Commit 551fcc23 authored by Clinton Stimpson's avatar Clinton Stimpson

fix compile warnings

parent 290a6e28
......@@ -286,14 +286,14 @@ void CMakeSetupDialog::doConfigure()
QDir dir(bindir);
if(!dir.exists())
{
QString message = tr("Build directory does not exist, "
QString msg = tr("Build directory does not exist, "
"should I create it?")
+ "\n\n"
+ tr("Directory: ");
message += bindir;
msg += bindir;
QString title = tr("Create Directory");
QMessageBox::StandardButton btn;
btn = QMessageBox::information(this, title, message,
btn = QMessageBox::information(this, title, msg,
QMessageBox::Yes | 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
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?");
QString title = tr("Confirm Exit");
QMessageBox::StandardButton btn;
btn = QMessageBox::critical(this, title, message,
btn = QMessageBox::critical(this, title, msg,
QMessageBox::Yes | 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
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"
"Are you sure you want to Exit?";
QString title = tr("Confirm Exit");
QMessageBox::StandardButton btn;
btn = QMessageBox::critical(this, title, message,
btn = QMessageBox::critical(this, title, msg,
QMessageBox::Yes | QMessageBox::No);
if(btn == QMessageBox::No)
{
......@@ -540,16 +540,16 @@ void CMakeSetupDialog::showProgress(const QString& /*msg*/, float percent)
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->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->append(message);
this->Output->append(msg);
}
void CMakeSetupDialog::setEnabledState(bool enabled)
......@@ -677,9 +677,9 @@ void CMakeSetupDialog::doReloadCache()
void CMakeSetupDialog::doDeleteCache()
{
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;
btn = QMessageBox::information(this, title, message,
btn = QMessageBox::information(this, title, msg,
QMessageBox::Yes | QMessageBox::No);
if(btn == QMessageBox::No)
{
......
......@@ -250,18 +250,18 @@ void QCMakeCacheModel::setProperties(const QCMakePropertyList& props)
QCMakePropertyList newP2 = newProps2.toList();
qSort(newP);
qSort(newP2);
int rowCount = 0;
int row_count = 0;
foreach(QCMakeProperty p, newP)
{
this->insertRow(rowCount);
this->setPropertyData(this->index(rowCount, 0), p, true);
rowCount++;
this->insertRow(row_count);
this->setPropertyData(this->index(row_count, 0), p, true);
row_count++;
}
foreach(QCMakeProperty p, newP2)
{
this->insertRow(rowCount);
this->setPropertyData(this->index(rowCount, 0), p, false);
rowCount++;
this->insertRow(row_count);
this->setPropertyData(this->index(row_count, 0), p, false);
row_count++;
}
}
else if(this->View == GroupView)
......@@ -275,7 +275,7 @@ void QCMakeCacheModel::setProperties(const QCMakePropertyList& props)
foreach(QString key, newPropsTree.keys())
{
QCMakePropertyList props = newPropsTree[key];
QCMakePropertyList props2 = newPropsTree[key];
QList<QStandardItem*> parentItems;
parentItems.append(
......@@ -286,8 +286,10 @@ void QCMakeCacheModel::setProperties(const QCMakePropertyList& props)
parentItems[1]->setData(QBrush(QColor(255,100,100)), Qt::BackgroundColorRole);
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;
items.append(new QStandardItem());
items.append(new QStandardItem());
......@@ -298,14 +300,16 @@ void QCMakeCacheModel::setProperties(const QCMakePropertyList& props)
foreach(QString key, newPropsTree2.keys())
{
QCMakePropertyList props = newPropsTree2[key];
QCMakePropertyList props2 = newPropsTree2[key];
QStandardItem* parentItem =
new QStandardItem(key.isEmpty() ? tr("Ungrouped Entries") : key);
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;
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.
// 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
// 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
if(event->type() == QEvent::FocusOut && this->FileDialogFlag)
if(evt->type() == QEvent::FocusOut && this->FileDialogFlag)
{
return false;
}
return QItemDelegate::eventFilter(object, event);
return QItemDelegate::eventFilter(object, evt);
}
void QCMakeCacheModelDelegate::setModelData(QWidget* editor,
......@@ -699,18 +703,18 @@ void QCMakeCacheModelDelegate::recordChange(QAbstractItemModel* model, const QMo
QCMakeCacheModel* cache_model = qobject_cast<QCMakeCacheModel*>(mymodel);
if(cache_model && idx.isValid())
{
QCMakeProperty property;
QCMakeProperty prop;
idx = idx.sibling(idx.row(), 0);
cache_model->getPropertyData(idx, property);
cache_model->getPropertyData(idx, prop);
// clean out an old one
QSet<QCMakeProperty>::iterator iter = mChanges.find(property);
QSet<QCMakeProperty>::iterator iter = mChanges.find(prop);
if(iter != mChanges.end())
{
mChanges.erase(iter);
}
// now add the new item
mChanges.insert(property);
mChanges.insert(prop);
}
}
......@@ -42,7 +42,7 @@ public:
// get whether to show advanced entries
bool showAdvanced() const;
QSize sizeHint(int) { return QSize(200,200); }
QSize sizeHint() const { return QSize(200,200); }
public slots:
// set whether to show advanced entries
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment