Use if >= in version detection instead of a switch case.

This commit is contained in:
Patrick von Reth 2015-09-03 14:48:55 +02:00
parent 270f70f872
commit 47d8e30eb4
1 changed files with 6 additions and 10 deletions

View File

@ -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"));