From f3472c84e2cce05ca15de2e7a30f7812e19eda82 Mon Sep 17 00:00:00 2001 From: "Jerry (Xinyu Hou)" Date: Thu, 18 Jun 2015 13:50:38 -0700 Subject: [PATCH] Show notification only on Debug level or above #4745 --- src/gui/src/MainWindow.cpp | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/src/gui/src/MainWindow.cpp b/src/gui/src/MainWindow.cpp index f1b1055f..1ecfde01 100644 --- a/src/gui/src/MainWindow.cpp +++ b/src/gui/src/MainWindow.cpp @@ -467,24 +467,26 @@ void MainWindow::checkFingerprint(const QString& line) void MainWindow::checkTransmission(const QString& line) { - if (line.contains("Transmission")) { - if (line.contains("Started")) { - setSynergyState(synergyTransfering); - } - else if (line.contains("Failed") || - line.contains("Complete") || - line.contains("Interrupted")) { - setSynergyState(synergyConnected); - } + if (appConfig().logLevel() >= 2) { + if (line.contains("Transmission")) { + if (line.contains("Started")) { + setSynergyState(synergyTransfering); + } + else if (line.contains("Failed") || + line.contains("Complete") || + line.contains("Interrupted")) { + setSynergyState(synergyConnected); + } - // NOTIFY: Title: Detail - int p1 = line.indexOf(':'); - if (p1 > 0) { - int p2 = line.indexOf(':', p1 + 1); - if (p2 > 0) { - QString title = line.mid(p1 + 2, p2 - p1 - 2); - QString detail = line.mid(p2 + 2); - m_pTrayIcon->showMessage(title, detail); + // NOTIFY: Title: Detail + int p1 = line.indexOf(':'); + if (p1 > 0) { + int p2 = line.indexOf(':', p1 + 1); + if (p2 > 0) { + QString title = line.mid(p1 + 2, p2 - p1 - 2); + QString detail = line.mid(p2 + 2); + m_pTrayIcon->showMessage(title, detail); + } } } }