From 0cdd058eb4fa84facb5b2ec419bca912fc351923 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 3 Aug 2016 14:54:18 +0300 Subject: [PATCH] Fixed issue #538. QSslSocket error messages during startup in newest development build. --HG-- branch : develop --- src/app/tape/mapplication.cpp | 17 +++++++++++------ src/app/valentina/core/vapplication.cpp | 9 +++++++-- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/app/tape/mapplication.cpp b/src/app/tape/mapplication.cpp index 6628d1d08..897668a0f 100644 --- a/src/app/tape/mapplication.cpp +++ b/src/app/tape/mapplication.cpp @@ -84,13 +84,18 @@ inline void noisyFailureMsgHandler(QtMsgType type, const QMessageLogContext &con type = QtWarningMsg; } -#if !defined(V_NO_ASSERT) +#if defined(V_NO_ASSERT) // I have decided to hide this annoing message for release builds. + if ((type == QtWarningMsg) && msg.contains(QStringLiteral("QSslSocket: cannot resolve"))) + { + type = QtDebugMsg; + } + if ((type == QtWarningMsg) && msg.contains(QStringLiteral("setGeometry: Unable to set geometry"))) { type = QtDebugMsg; } -#endif //!defined(V_NO_ASSERT) +#endif //defined(V_NO_ASSERT) #if defined(Q_OS_MAC) # if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0) && QT_VERSION < QT_VERSION_CHECK(5, 7, 0) @@ -169,20 +174,20 @@ inline void noisyFailureMsgHandler(QtMsgType type, const QMessageLogContext &con switch (type) { case QtWarningMsg: - messageBox.setWindowTitle(QApplication::translate("mNoisyHandler", "Warning.")); + messageBox.setWindowTitle(QApplication::translate("mNoisyHandler", "Warning")); messageBox.setIcon(QMessageBox::Warning); break; case QtCriticalMsg: - messageBox.setWindowTitle(QApplication::translate("mNoisyHandler", "Critical error.")); + messageBox.setWindowTitle(QApplication::translate("mNoisyHandler", "Critical error")); messageBox.setIcon(QMessageBox::Critical); break; case QtFatalMsg: - messageBox.setWindowTitle(QApplication::translate("mNoisyHandler", "Fatal error.")); + messageBox.setWindowTitle(QApplication::translate("mNoisyHandler", "Fatal error")); messageBox.setIcon(QMessageBox::Critical); break; #if QT_VERSION > QT_VERSION_CHECK(5, 4, 2) case QtInfoMsg: - messageBox.setWindowTitle(QApplication::translate("mNoisyHandler", "Information.")); + messageBox.setWindowTitle(QApplication::translate("mNoisyHandler", "Information")); messageBox.setIcon(QMessageBox::Information); break; #endif diff --git a/src/app/valentina/core/vapplication.cpp b/src/app/valentina/core/vapplication.cpp index a263c0b5f..c5b5bc638 100644 --- a/src/app/valentina/core/vapplication.cpp +++ b/src/app/valentina/core/vapplication.cpp @@ -80,13 +80,18 @@ inline void noisyFailureMsgHandler(QtMsgType type, const QMessageLogContext &con type = QtWarningMsg; } -#if !defined(V_NO_ASSERT) +#if defined(V_NO_ASSERT) // I have decided to hide this annoing message for release builds. + if ((type == QtWarningMsg) && msg.contains(QStringLiteral("QSslSocket: cannot resolve"))) + { + type = QtDebugMsg; + } + if ((type == QtWarningMsg) && msg.contains(QStringLiteral("setGeometry: Unable to set geometry"))) { type = QtDebugMsg; } -#endif //!defined(V_NO_ASSERT) +#endif //defined(V_NO_ASSERT) #if defined(Q_OS_MAC) # if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0) && QT_VERSION < QT_VERSION_CHECK(5, 7, 0)