remove useless qt_version defines

This commit is contained in:
Chocobozzz 2015-06-03 23:13:06 +02:00
parent 5aec1c0e24
commit 5d343cbe7f
5 changed files with 1 additions and 22 deletions

View File

@ -17,13 +17,7 @@ if(WIN32)
endif(WIN32)
# Activate fast QString concatenation
if (QT_VERSION_MINOR GREATER 5)
if (QT_VERSION_MINOR GREATER 7)
add_definitions(-DQT_USE_QSTRINGBUILDER)
else(QT_VERSION_MINOR GREATER 7)
add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
endif(QT_VERSION_MINOR GREATER 7)
endif(QT_VERSION_MINOR GREATER 5)
add_definitions(-DQT_USE_QSTRINGBUILDER)
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
add_definitions(-DBOOST_BIND_NO_PLACEHOLDERS)

View File

@ -693,16 +693,12 @@ bool IsLaptop() {
}
QString SystemLanguageName() {
#if QT_VERSION >= 0x040800
QString system_language = QLocale::system().uiLanguages().empty()
? QLocale::system().name()
: QLocale::system().uiLanguages().first();
// uiLanguages returns strings with "-" as separators for language/region;
// however QTranslator needs "_" separators
system_language.replace("-", "_");
#else
QString system_language = QLocale::system().name();
#endif
return system_language;
}

View File

@ -28,14 +28,7 @@
// some functions in their includes files, which aren't compatible with
// QStringBuilder, we undef it here
#include <QtGlobal>
#if QT_VERSION >= 0x040600
#if QT_VERSION >= 0x040800
#undef QT_USE_QSTRINGBUILDER
#else
#undef QT_USE_FAST_CONCATENATION
#undef QT_USE_FAST_OPERATOR_PLUS
#endif // QT_VERSION >= 0x040800
#endif // QT_VERSION >= 0x040600
#include "lastfmservice.h"

View File

@ -70,12 +70,10 @@ BehaviourSettingsPage::BehaviourSettingsPage(SettingsDialog* dialog)
.replace("_TW", "_Hant_TW");
QString language_name =
QLocale::languageToString(QLocale(lookup_code).language());
#if QT_VERSION >= 0x040800
QString native_name = QLocale(lookup_code).nativeLanguageName();
if (!native_name.isEmpty()) {
language_name = native_name;
}
#endif
QString name = QString("%1 (%2)").arg(language_name, code);
language_map_[name] = code;

View File

@ -33,11 +33,9 @@ QIcon IconLoader::Load(const QString& name) {
if (name.isEmpty()) return ret;
#if QT_VERSION >= 0x040600
// Try to load it from the theme initially
ret = QIcon::fromTheme(name);
if (!ret.isNull()) return ret;
#endif
// Otherwise use our fallback theme
const QString path(":/icons/%1x%2/%3.png");