From 47d8e30eb4f460c9d4a6571d83b47c15be36dbbe Mon Sep 17 00:00:00 2001 From: Patrick von Reth Date: Thu, 3 Sep 2015 14:48:55 +0200 Subject: [PATCH] Use if >= in version detection instead of a switch case. --- src/plugins/backends/snore/notifywidget.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/plugins/backends/snore/notifywidget.cpp b/src/plugins/backends/snore/notifywidget.cpp index 04f4462..c17c6a9 100644 --- a/src/plugins/backends/snore/notifywidget.cpp +++ b/src/plugins/backends/snore/notifywidget.cpp @@ -34,18 +34,14 @@ NotifyWidget::NotifyWidget(int pos, const SnoreNotifier *parent) : QString font = qApp->font().family(); #ifdef Q_OS_WIN - switch (QSysInfo::windowsVersion()) { - case QSysInfo::WV_WINDOWS8: + if(QSysInfo::windowsVersion() >= QSysInfo::WV_WINDOWS8 ) { font = QLatin1String("Segoe UI Symbol"); - break; -#if QT_VERSION >= QT_VERSION_CHECK(5,5,0) - case QSysInfo::WV_10_0: - font = QLatin1String("Segoe UI Emoji"); - break; -#endif - default: - qt_noop(); } +#if QT_VERSION >= QT_VERSION_CHECK(5,5,0) + if(QSysInfo::windowsVersion() >= QSysInfo::WV_WINDOWS10) { + font = QLatin1String("Segoe UI Emoji"); + } +#endif #endif rootContext()->setContextProperty(QLatin1String("snoreFont"), font); setSource(QUrl::fromEncoded("qrc:/notification.qml"));