diff options
author | Ulf Hermann <[email protected]> | 2021-02-17 13:53:22 +0100 |
---|---|---|
committer | Ulf Hermann <[email protected]> | 2021-02-19 00:15:12 +0100 |
commit | 6e5eee54f9bcc00092381b1957e91eb03bf1fe33 (patch) | |
tree | 7684a90a317575ccf0bae9de89eeed27e68f5d02 | |
parent | 76d1bf1e876ca7c949feae5e6dc5a3928daa581f (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 <[email protected]>
-rw-r--r-- | tools/qmlprofiler/qmlprofilerapplication.cpp | 20 | ||||
-rw-r--r-- | tools/qmlprofiler/qmlprofilerapplication.h | 1 |
2 files changed, 13 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) diff --git a/tools/qmlprofiler/qmlprofilerapplication.h b/tools/qmlprofiler/qmlprofilerapplication.h index 73b2b231cd..e069659af3 100644 --- a/tools/qmlprofiler/qmlprofilerapplication.h +++ b/tools/qmlprofiler/qmlprofilerapplication.h @@ -78,6 +78,7 @@ private: void prompt(const QString &line = QString(), bool ready = true); void logError(const QString &error); + void logWarning(const QString &warning); void logStatus(const QString &status); quint64 parseFeatures(const QStringList &featureList, const QString &values, bool exclude); |