Fix GCC 6 valid warnings about misleading indendations

It's currently producing a lot of false positives, but a few are
actually valid.

See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69029,
 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69122 and some others.

Change-Id: I24a735698d3c4a719fc9ffff1425f29d7b5a3458
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
bb10
Thiago Macieira 2016-01-03 13:00:13 -02:00
parent f576f438bf
commit 157445e64a
6 changed files with 40 additions and 40 deletions

View File

@ -122,13 +122,13 @@ void Uic::writeCopyrightHeader(DomUI *ui)
if (comment.size())
out << "/*\n" << comment << "\n*/\n\n";
out << "/********************************************************************************\n";
out << "** Form generated from reading UI file '" << QFileInfo(opt.inputFile).fileName() << "'\n";
out << "**\n";
out << "** Created by: Qt User Interface Compiler version " << QLatin1String(QT_VERSION_STR) << "\n";
out << "**\n";
out << "** WARNING! All changes made in this file will be lost when recompiling UI file!\n";
out << "********************************************************************************/\n\n";
out << "/********************************************************************************\n";
out << "** Form generated from reading UI file '" << QFileInfo(opt.inputFile).fileName() << "'\n";
out << "**\n";
out << "** Created by: Qt User Interface Compiler version " << QLatin1String(QT_VERSION_STR) << "\n";
out << "**\n";
out << "** WARNING! All changes made in this file will be lost when recompiling UI file!\n";
out << "********************************************************************************/\n\n";
}
// Check the version with a stream reader at the <ui> element.

View File

@ -3400,27 +3400,27 @@ void QFileDialogPrivate::_q_deleteCurrent()
if (!index.isValid())
continue;
QString fileName = index.data(QFileSystemModel::FileNameRole).toString();
QString filePath = index.data(QFileSystemModel::FilePathRole).toString();
bool isDir = model->isDir(index);
QString fileName = index.data(QFileSystemModel::FileNameRole).toString();
QString filePath = index.data(QFileSystemModel::FilePathRole).toString();
bool isDir = model->isDir(index);
QFile::Permissions p(index.parent().data(QFileSystemModel::FilePermissions).toInt());
QFile::Permissions p(index.parent().data(QFileSystemModel::FilePermissions).toInt());
#ifndef QT_NO_MESSAGEBOX
Q_Q(QFileDialog);
if (!(p & QFile::WriteUser) && (QMessageBox::warning(q_func(), QFileDialog::tr("Delete"),
QFileDialog::tr("'%1' is write protected.\nDo you want to delete it anyway?")
.arg(fileName),
QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::No))
return;
else if (QMessageBox::warning(q_func(), QFileDialog::tr("Delete"),
QFileDialog::tr("Are you sure you want to delete '%1'?")
.arg(fileName),
QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::No)
return;
Q_Q(QFileDialog);
if (!(p & QFile::WriteUser) && (QMessageBox::warning(q_func(), QFileDialog::tr("Delete"),
QFileDialog::tr("'%1' is write protected.\nDo you want to delete it anyway?")
.arg(fileName),
QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::No))
return;
else if (QMessageBox::warning(q_func(), QFileDialog::tr("Delete"),
QFileDialog::tr("Are you sure you want to delete '%1'?")
.arg(fileName),
QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::No)
return;
#else
if (!(p & QFile::WriteUser))
return;
if (!(p & QFile::WriteUser))
return;
#endif // QT_NO_MESSAGEBOX
// the event loop has run, we can NOT reuse index because the model might have removed it.

View File

@ -1173,8 +1173,8 @@ void QGraphicsViewPrivate::updateInputMethodSensitivity()
if (!proxy) {
q->setInputMethodHints(focusItem->inputMethodHints());
} else if (QWidget *widget = proxy->widget()) {
if (QWidget *fw = widget->focusWidget())
widget = fw;
if (QWidget *fw = widget->focusWidget())
widget = fw;
q->setInputMethodHints(widget->inputMethodHints());
} else {
q->setInputMethodHints(0);

View File

@ -1311,8 +1311,8 @@ void QComboBoxPrivate::_q_emitCurrentIndexChanged(const QModelIndex &index)
if (!lineEdit)
emit q->currentTextChanged(text);
#ifndef QT_NO_ACCESSIBILITY
QAccessibleValueChangeEvent event(q, text);
QAccessible::updateAccessibility(&event);
QAccessibleValueChangeEvent event(q, text);
QAccessible::updateAccessibility(&event);
#endif
}
@ -2830,8 +2830,8 @@ void QComboBox::clear()
Q_D(QComboBox);
d->model->removeRows(0, d->model->rowCount(d->root), d->root);
#ifndef QT_NO_ACCESSIBILITY
QAccessibleValueChangeEvent event(this, QString());
QAccessible::updateAccessibility(&event);
QAccessibleValueChangeEvent event(this, QString());
QAccessible::updateAccessibility(&event);
#endif
}
@ -2844,8 +2844,8 @@ void QComboBox::clearEditText()
if (d->lineEdit)
d->lineEdit->clear();
#ifndef QT_NO_ACCESSIBILITY
QAccessibleValueChangeEvent event(this, QString());
QAccessible::updateAccessibility(&event);
QAccessibleValueChangeEvent event(this, QString());
QAccessible::updateAccessibility(&event);
#endif
}
@ -2858,8 +2858,8 @@ void QComboBox::setEditText(const QString &text)
if (d->lineEdit)
d->lineEdit->setText(text);
#ifndef QT_NO_ACCESSIBILITY
QAccessibleValueChangeEvent event(this, text);
QAccessible::updateAccessibility(&event);
QAccessibleValueChangeEvent event(this, text);
QAccessible::updateAccessibility(&event);
#endif
}
@ -3004,8 +3004,8 @@ bool QComboBox::event(QEvent *event)
case QEvent::HoverEnter:
case QEvent::HoverLeave:
case QEvent::HoverMove:
if (const QHoverEvent *he = static_cast<const QHoverEvent *>(event))
d->updateHoverControl(he->pos());
if (const QHoverEvent *he = static_cast<const QHoverEvent *>(event))
d->updateHoverControl(he->pos());
break;
case QEvent::ShortcutOverride:
if (d->lineEdit)

View File

@ -479,8 +479,8 @@ bool QScrollBar::event(QEvent *event)
case QEvent::HoverEnter:
case QEvent::HoverLeave:
case QEvent::HoverMove:
if (const QHoverEvent *he = static_cast<const QHoverEvent *>(event))
d_func()->updateHoverControl(he->pos());
if (const QHoverEvent *he = static_cast<const QHoverEvent *>(event))
d_func()->updateHoverControl(he->pos());
break;
case QEvent::StyleChange:
d_func()->setTransient(style()->styleHint(QStyle::SH_ScrollBar_Transient, 0, this));

View File

@ -961,8 +961,8 @@ bool QToolButton::event(QEvent *event)
case QEvent::HoverEnter:
case QEvent::HoverLeave:
case QEvent::HoverMove:
if (const QHoverEvent *he = static_cast<const QHoverEvent *>(event))
d_func()->updateHoverControl(he->pos());
if (const QHoverEvent *he = static_cast<const QHoverEvent *>(event))
d_func()->updateHoverControl(he->pos());
break;
default:
break;