From e56e39cfdcdb666368b0f4c70a8cdea0fa47802f Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Mon, 18 Jul 2016 05:37:14 +0000 Subject: [PATCH] fix some compiler warnings Signed-off-by: Ivailo Monev --- src/gui/dialogs/qwizard.cpp | 17 ++++++++++------- src/gui/image/qnativeimage.cpp | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/gui/dialogs/qwizard.cpp b/src/gui/dialogs/qwizard.cpp index ff13aaa28..ab50dace4 100644 --- a/src/gui/dialogs/qwizard.cpp +++ b/src/gui/dialogs/qwizard.cpp @@ -510,13 +510,15 @@ void QWizardPagePrivate::_q_updateCachedCompleteState() class QWizardAntiFlickerWidget : public QWidget { - QWizard *wizard; QWizardPrivate *wizardPrivate; public: QWizardAntiFlickerWidget(QWizard *wizard, QWizardPrivate *wizardPrivate) : QWidget(wizard) - , wizard(wizard) - , wizardPrivate(wizardPrivate) {} +#if !defined(QT_NO_STYLE_WINDOWSVISTA) + , wizardPrivate(wizardPrivate) +#endif + {} + #if !defined(QT_NO_STYLE_WINDOWSVISTA) protected: void paintEvent(QPaintEvent *); @@ -677,11 +679,8 @@ public: int maximumHeight; }; -static QString buttonDefaultText(int wstyle, int which, const QWizardPrivate *wizardPrivate) +static QString buttonDefaultText(int wstyle, int which, const QWizardPrivate *wizard) { -#if defined(QT_NO_STYLE_WINDOWSVISTA) - Q_UNUSED(wizardPrivate); -#endif const bool macStyle = (wstyle == QWizard::MacStyle); switch (which) { case QWizard::BackButton: @@ -690,7 +689,11 @@ static QString buttonDefaultText(int wstyle, int which, const QWizardPrivate *wi if (macStyle) return QWizard::tr("Continue"); else +#if defined(QT_NO_STYLE_WINDOWSVISTA) + return wizard->isVistaThemeEnabled() +#else return wizardPrivate->isVistaThemeEnabled() +#endif ? QWizard::tr("&Next") : QWizard::tr("&Next >"); case QWizard::CommitButton: return QWizard::tr("Commit"); diff --git a/src/gui/image/qnativeimage.cpp b/src/gui/image/qnativeimage.cpp index e7ae87cb5..c12d5c183 100644 --- a/src/gui/image/qnativeimage.cpp +++ b/src/gui/image/qnativeimage.cpp @@ -158,7 +158,7 @@ QNativeImage::QNativeImage(int width, int height, QImage::Format format,bool /* int dd = info.depth(); Visual *vis = (Visual*) info.visual(); - if (!X11->use_mitshm || format != QImage::Format_RGB16 && X11->bppForDepth.value(dd) != 32) { + if (!X11->use_mitshm || (format != QImage::Format_RGB16 && X11->bppForDepth.value(dd) != 32)) { image = QImage(width, height, format); // follow good coding practice and set xshminfo attributes, though values not used in this case xshminfo.readOnly = true; -- 2.11.0