From f370629af093ae2d95cea3f77c7c29c0edadbd22 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 20 Sep 2016 14:27:21 +0300 Subject: [PATCH] Fixed support Qt 5.0. --HG-- branch : develop --- src/libs/vmisc/vabstractapplication.cpp | 36 ++++++++++++++----------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/src/libs/vmisc/vabstractapplication.cpp b/src/libs/vmisc/vabstractapplication.cpp index 0327fa6d6..b7984f8e7 100644 --- a/src/libs/vmisc/vabstractapplication.cpp +++ b/src/libs/vmisc/vabstractapplication.cpp @@ -62,13 +62,17 @@ VAbstractApplication::VAbstractApplication(int &argc, char **argv) doc(nullptr), openingPattern(false) { +#if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0) QString rules; +#endif // QT_VERSION >= QT_VERSION_CHECK(5, 2, 0) + #if QT_VERSION < QT_VERSION_CHECK(5, 3, 0) #if QT_VERSION < QT_VERSION_CHECK(5, 2, 0) // Qt < 5.2 didn't feature categorized logging // Do nothing #else + // In Qt 5.2 need manualy enable debug information for categories. This work // because Qt doesn't provide debug information for categories itself. And in this // case will show our messages. Another situation with Qt 5.3 that has many debug @@ -79,6 +83,23 @@ VAbstractApplication::VAbstractApplication(int &argc, char **argv) #endif // QT_VERSION < QT_VERSION_CHECK(5, 3, 0) +#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 1) +#if defined(V_NO_ASSERT) + // Ignore SSL-related warnings + // See issue #528: Error: QSslSocket: cannot resolve SSLv2_client_method. + rules += QLatin1String("qt.network.ssl.warning=false\n"); + // See issue #568: Certificate checking on Mac OS X. + rules += QLatin1String("qt.network.ssl.critical=false\n"); +#endif //defined(V_NO_ASSERT) +#endif // QT_VERSION >= QT_VERSION_CHECK(5, 4, 1) + +#if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0) + if (not rules.isEmpty()) + { + QLoggingCategory::setFilterRules(rules); + } +#endif // QT_VERSION >= QT_VERSION_CHECK(5, 2, 0) + #if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0) // Enable support for HiDPI bitmap resources setAttribute(Qt::AA_UseHighDpiPixmaps); @@ -91,21 +112,6 @@ VAbstractApplication::VAbstractApplication(int &argc, char **argv) // Connect this slot with VApplication::aboutToQuit. Settings()->sync(); }); - -#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 1) -#if defined(V_NO_ASSERT) - // Ignore SSL-related warnings - // See issue #528: Error: QSslSocket: cannot resolve SSLv2_client_method. - rules += QLatin1String("qt.network.ssl.warning=false\n"); - // See issue #568: Certificate checking on Mac OS X. - rules += QLatin1String("qt.network.ssl.critical=false\n"); -#endif //defined(V_NO_ASSERT) -#endif // QT_VERSION >= QT_VERSION_CHECK(5, 4, 1) - - if (not rules.isEmpty()) - { - QLoggingCategory::setFilterRules(rules); - } } //---------------------------------------------------------------------------------------------------------------------