fix compile warnings
This commit is contained in:
parent
290a6e2870
commit
551fcc23c2
@ -286,14 +286,14 @@ void CMakeSetupDialog::doConfigure()
|
|||||||
QDir dir(bindir);
|
QDir dir(bindir);
|
||||||
if(!dir.exists())
|
if(!dir.exists())
|
||||||
{
|
{
|
||||||
QString message = tr("Build directory does not exist, "
|
QString msg = tr("Build directory does not exist, "
|
||||||
"should I create it?")
|
"should I create it?")
|
||||||
+ "\n\n"
|
+ "\n\n"
|
||||||
+ tr("Directory: ");
|
+ tr("Directory: ");
|
||||||
message += bindir;
|
msg += bindir;
|
||||||
QString title = tr("Create Directory");
|
QString title = tr("Create Directory");
|
||||||
QMessageBox::StandardButton btn;
|
QMessageBox::StandardButton btn;
|
||||||
btn = QMessageBox::information(this, title, message,
|
btn = QMessageBox::information(this, title, msg,
|
||||||
QMessageBox::Yes | QMessageBox::No);
|
QMessageBox::Yes | QMessageBox::No);
|
||||||
if(btn == QMessageBox::No)
|
if(btn == QMessageBox::No)
|
||||||
{
|
{
|
||||||
@ -380,11 +380,11 @@ void CMakeSetupDialog::closeEvent(QCloseEvent* e)
|
|||||||
// prompt for close if there are unsaved changes, and we're not busy
|
// prompt for close if there are unsaved changes, and we're not busy
|
||||||
if(this->CacheModified)
|
if(this->CacheModified)
|
||||||
{
|
{
|
||||||
QString message = tr("You have changed options but not rebuilt, "
|
QString msg = tr("You have changed options but not rebuilt, "
|
||||||
"are you sure you want to exit?");
|
"are you sure you want to exit?");
|
||||||
QString title = tr("Confirm Exit");
|
QString title = tr("Confirm Exit");
|
||||||
QMessageBox::StandardButton btn;
|
QMessageBox::StandardButton btn;
|
||||||
btn = QMessageBox::critical(this, title, message,
|
btn = QMessageBox::critical(this, title, msg,
|
||||||
QMessageBox::Yes | QMessageBox::No);
|
QMessageBox::Yes | QMessageBox::No);
|
||||||
if(btn == QMessageBox::No)
|
if(btn == QMessageBox::No)
|
||||||
{
|
{
|
||||||
@ -395,12 +395,12 @@ void CMakeSetupDialog::closeEvent(QCloseEvent* e)
|
|||||||
// don't close if we're busy, unless the user really wants to
|
// don't close if we're busy, unless the user really wants to
|
||||||
if(this->CurrentState == Configuring)
|
if(this->CurrentState == Configuring)
|
||||||
{
|
{
|
||||||
QString message = "You are in the middle of a Configure.\n"
|
QString msg = "You are in the middle of a Configure.\n"
|
||||||
"If you Exit now the configure information will be lost.\n"
|
"If you Exit now the configure information will be lost.\n"
|
||||||
"Are you sure you want to Exit?";
|
"Are you sure you want to Exit?";
|
||||||
QString title = tr("Confirm Exit");
|
QString title = tr("Confirm Exit");
|
||||||
QMessageBox::StandardButton btn;
|
QMessageBox::StandardButton btn;
|
||||||
btn = QMessageBox::critical(this, title, message,
|
btn = QMessageBox::critical(this, title, msg,
|
||||||
QMessageBox::Yes | QMessageBox::No);
|
QMessageBox::Yes | QMessageBox::No);
|
||||||
if(btn == QMessageBox::No)
|
if(btn == QMessageBox::No)
|
||||||
{
|
{
|
||||||
@ -540,16 +540,16 @@ void CMakeSetupDialog::showProgress(const QString& /*msg*/, float percent)
|
|||||||
this->ProgressBar->setValue(qRound(percent * 100));
|
this->ProgressBar->setValue(qRound(percent * 100));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMakeSetupDialog::error(const QString& message)
|
void CMakeSetupDialog::error(const QString& msg)
|
||||||
{
|
{
|
||||||
this->Output->setCurrentCharFormat(this->ErrorFormat);
|
this->Output->setCurrentCharFormat(this->ErrorFormat);
|
||||||
this->Output->append(message);
|
this->Output->append(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMakeSetupDialog::message(const QString& message)
|
void CMakeSetupDialog::message(const QString& msg)
|
||||||
{
|
{
|
||||||
this->Output->setCurrentCharFormat(this->MessageFormat);
|
this->Output->setCurrentCharFormat(this->MessageFormat);
|
||||||
this->Output->append(message);
|
this->Output->append(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMakeSetupDialog::setEnabledState(bool enabled)
|
void CMakeSetupDialog::setEnabledState(bool enabled)
|
||||||
@ -677,9 +677,9 @@ void CMakeSetupDialog::doReloadCache()
|
|||||||
void CMakeSetupDialog::doDeleteCache()
|
void CMakeSetupDialog::doDeleteCache()
|
||||||
{
|
{
|
||||||
QString title = tr("Delete Cache");
|
QString title = tr("Delete Cache");
|
||||||
QString message = "Are you sure you want to delete the cache?";
|
QString msg = "Are you sure you want to delete the cache?";
|
||||||
QMessageBox::StandardButton btn;
|
QMessageBox::StandardButton btn;
|
||||||
btn = QMessageBox::information(this, title, message,
|
btn = QMessageBox::information(this, title, msg,
|
||||||
QMessageBox::Yes | QMessageBox::No);
|
QMessageBox::Yes | QMessageBox::No);
|
||||||
if(btn == QMessageBox::No)
|
if(btn == QMessageBox::No)
|
||||||
{
|
{
|
||||||
|
@ -250,18 +250,18 @@ void QCMakeCacheModel::setProperties(const QCMakePropertyList& props)
|
|||||||
QCMakePropertyList newP2 = newProps2.toList();
|
QCMakePropertyList newP2 = newProps2.toList();
|
||||||
qSort(newP);
|
qSort(newP);
|
||||||
qSort(newP2);
|
qSort(newP2);
|
||||||
int rowCount = 0;
|
int row_count = 0;
|
||||||
foreach(QCMakeProperty p, newP)
|
foreach(QCMakeProperty p, newP)
|
||||||
{
|
{
|
||||||
this->insertRow(rowCount);
|
this->insertRow(row_count);
|
||||||
this->setPropertyData(this->index(rowCount, 0), p, true);
|
this->setPropertyData(this->index(row_count, 0), p, true);
|
||||||
rowCount++;
|
row_count++;
|
||||||
}
|
}
|
||||||
foreach(QCMakeProperty p, newP2)
|
foreach(QCMakeProperty p, newP2)
|
||||||
{
|
{
|
||||||
this->insertRow(rowCount);
|
this->insertRow(row_count);
|
||||||
this->setPropertyData(this->index(rowCount, 0), p, false);
|
this->setPropertyData(this->index(row_count, 0), p, false);
|
||||||
rowCount++;
|
row_count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(this->View == GroupView)
|
else if(this->View == GroupView)
|
||||||
@ -275,7 +275,7 @@ void QCMakeCacheModel::setProperties(const QCMakePropertyList& props)
|
|||||||
|
|
||||||
foreach(QString key, newPropsTree.keys())
|
foreach(QString key, newPropsTree.keys())
|
||||||
{
|
{
|
||||||
QCMakePropertyList props = newPropsTree[key];
|
QCMakePropertyList props2 = newPropsTree[key];
|
||||||
|
|
||||||
QList<QStandardItem*> parentItems;
|
QList<QStandardItem*> parentItems;
|
||||||
parentItems.append(
|
parentItems.append(
|
||||||
@ -286,8 +286,10 @@ void QCMakeCacheModel::setProperties(const QCMakePropertyList& props)
|
|||||||
parentItems[1]->setData(QBrush(QColor(255,100,100)), Qt::BackgroundColorRole);
|
parentItems[1]->setData(QBrush(QColor(255,100,100)), Qt::BackgroundColorRole);
|
||||||
root->appendRow(parentItems);
|
root->appendRow(parentItems);
|
||||||
|
|
||||||
foreach(QCMakeProperty prop, props)
|
int num = props2.size();
|
||||||
|
for(int i=0; i<num; i++)
|
||||||
{
|
{
|
||||||
|
QCMakeProperty prop = props2[i];
|
||||||
QList<QStandardItem*> items;
|
QList<QStandardItem*> items;
|
||||||
items.append(new QStandardItem());
|
items.append(new QStandardItem());
|
||||||
items.append(new QStandardItem());
|
items.append(new QStandardItem());
|
||||||
@ -298,14 +300,16 @@ void QCMakeCacheModel::setProperties(const QCMakePropertyList& props)
|
|||||||
|
|
||||||
foreach(QString key, newPropsTree2.keys())
|
foreach(QString key, newPropsTree2.keys())
|
||||||
{
|
{
|
||||||
QCMakePropertyList props = newPropsTree2[key];
|
QCMakePropertyList props2 = newPropsTree2[key];
|
||||||
|
|
||||||
QStandardItem* parentItem =
|
QStandardItem* parentItem =
|
||||||
new QStandardItem(key.isEmpty() ? tr("Ungrouped Entries") : key);
|
new QStandardItem(key.isEmpty() ? tr("Ungrouped Entries") : key);
|
||||||
root->appendRow(parentItem);
|
root->appendRow(parentItem);
|
||||||
|
|
||||||
foreach(QCMakeProperty prop, props)
|
int num = props2.size();
|
||||||
|
for(int i=0; i<num; i++)
|
||||||
{
|
{
|
||||||
|
QCMakeProperty prop = props2[i];
|
||||||
QList<QStandardItem*> items;
|
QList<QStandardItem*> items;
|
||||||
items.append(new QStandardItem());
|
items.append(new QStandardItem());
|
||||||
items.append(new QStandardItem());
|
items.append(new QStandardItem());
|
||||||
@ -644,17 +648,17 @@ bool QCMakeCacheModelDelegate::editorEvent(QEvent* e, QAbstractItemModel* model,
|
|||||||
|
|
||||||
// Issue 205903 fixed in Qt 4.5.0.
|
// Issue 205903 fixed in Qt 4.5.0.
|
||||||
// Can remove this function and FileDialogFlag when minimum Qt version is 4.5
|
// Can remove this function and FileDialogFlag when minimum Qt version is 4.5
|
||||||
bool QCMakeCacheModelDelegate::eventFilter(QObject* object, QEvent* event)
|
bool QCMakeCacheModelDelegate::eventFilter(QObject* object, QEvent* evt)
|
||||||
{
|
{
|
||||||
// workaround for what looks like a bug in Qt on Mac OS X
|
// workaround for what looks like a bug in Qt on Mac OS X
|
||||||
// where it doesn't create a QWidget wrapper for the native file dialog
|
// where it doesn't create a QWidget wrapper for the native file dialog
|
||||||
// so the Qt library ends up assuming the focus was lost to something else
|
// so the Qt library ends up assuming the focus was lost to something else
|
||||||
|
|
||||||
if(event->type() == QEvent::FocusOut && this->FileDialogFlag)
|
if(evt->type() == QEvent::FocusOut && this->FileDialogFlag)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return QItemDelegate::eventFilter(object, event);
|
return QItemDelegate::eventFilter(object, evt);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QCMakeCacheModelDelegate::setModelData(QWidget* editor,
|
void QCMakeCacheModelDelegate::setModelData(QWidget* editor,
|
||||||
@ -699,18 +703,18 @@ void QCMakeCacheModelDelegate::recordChange(QAbstractItemModel* model, const QMo
|
|||||||
QCMakeCacheModel* cache_model = qobject_cast<QCMakeCacheModel*>(mymodel);
|
QCMakeCacheModel* cache_model = qobject_cast<QCMakeCacheModel*>(mymodel);
|
||||||
if(cache_model && idx.isValid())
|
if(cache_model && idx.isValid())
|
||||||
{
|
{
|
||||||
QCMakeProperty property;
|
QCMakeProperty prop;
|
||||||
idx = idx.sibling(idx.row(), 0);
|
idx = idx.sibling(idx.row(), 0);
|
||||||
cache_model->getPropertyData(idx, property);
|
cache_model->getPropertyData(idx, prop);
|
||||||
|
|
||||||
// clean out an old one
|
// clean out an old one
|
||||||
QSet<QCMakeProperty>::iterator iter = mChanges.find(property);
|
QSet<QCMakeProperty>::iterator iter = mChanges.find(prop);
|
||||||
if(iter != mChanges.end())
|
if(iter != mChanges.end())
|
||||||
{
|
{
|
||||||
mChanges.erase(iter);
|
mChanges.erase(iter);
|
||||||
}
|
}
|
||||||
// now add the new item
|
// now add the new item
|
||||||
mChanges.insert(property);
|
mChanges.insert(prop);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ public:
|
|||||||
// get whether to show advanced entries
|
// get whether to show advanced entries
|
||||||
bool showAdvanced() const;
|
bool showAdvanced() const;
|
||||||
|
|
||||||
QSize sizeHint(int) { return QSize(200,200); }
|
QSize sizeHint() const { return QSize(200,200); }
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
// set whether to show advanced entries
|
// set whether to show advanced entries
|
||||||
|
Loading…
x
Reference in New Issue
Block a user