aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qmlprofiler/qmlprofilerapplication.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2021-02-17 13:53:22 +0100
committerUlf Hermann <ulf.hermann@qt.io>2021-02-19 00:15:12 +0100
commit6e5eee54f9bcc00092381b1957e91eb03bf1fe33 (patch)
tree7684a90a317575ccf0bae9de89eeed27e68f5d02 /tools/qmlprofiler/qmlprofilerapplication.cpp
parent76d1bf1e876ca7c949feae5e6dc5a3928daa581f (diff)
QML profiler: Fix nonsensical condition
Failure to connect within 5s is a warning now, and not affected by the verbosity setting. Change-Id: Ia0bace7bfbb1c7aa09642b7036344d0929f9b2b8 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tools/qmlprofiler/qmlprofilerapplication.cpp')
-rw-r--r--tools/qmlprofiler/qmlprofilerapplication.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/tools/qmlprofiler/qmlprofilerapplication.cpp b/tools/qmlprofiler/qmlprofilerapplication.cpp
index d91ef191e5..4d97efafb4 100644
--- a/tools/qmlprofiler/qmlprofilerapplication.cpp
+++ b/tools/qmlprofiler/qmlprofilerapplication.cpp
@@ -491,14 +491,13 @@ void QmlProfilerApplication::tryToConnect()
Q_ASSERT(!m_connection->isConnected());
++ m_connectionAttempts;
- if (!m_verbose && !(m_connectionAttempts % 5)) {// print every 5 seconds
- if (m_verbose) {
- if (m_socketFile.isEmpty())
- logError(QString::fromLatin1("Could not connect to %1:%2 for %3 seconds ...")
- .arg(m_hostName).arg(m_port).arg(m_connectionAttempts));
- else
- logError(QString::fromLatin1("No connection received on %1 for %2 seconds ...")
- .arg(m_socketFile).arg(m_connectionAttempts));
+ if (!(m_connectionAttempts % 5)) {// print every 5 seconds
+ if (m_socketFile.isEmpty()) {
+ logWarning(QString::fromLatin1("Could not connect to %1:%2 for %3 seconds ...")
+ .arg(m_hostName).arg(m_port).arg(m_connectionAttempts));
+ } else {
+ logWarning(QString::fromLatin1("No connection received on %1 for %2 seconds ...")
+ .arg(m_socketFile).arg(m_connectionAttempts));
}
}
@@ -604,6 +603,11 @@ void QmlProfilerApplication::logError(const QString &error)
std::cerr << "Error: " << qPrintable(error) << std::endl;
}
+void QmlProfilerApplication::logWarning(const QString &warning)
+{
+ std::cerr << "Warning: " << qPrintable(warning) << std::endl;
+}
+
void QmlProfilerApplication::logStatus(const QString &status)
{
if (!m_verbose)