Show notification only on Debug level or above #4745

This commit is contained in:
Jerry (Xinyu Hou) 2015-06-18 13:50:38 -07:00
parent ebb7edfb0f
commit f3472c84e2
1 changed files with 19 additions and 17 deletions

View File

@ -467,24 +467,26 @@ void MainWindow::checkFingerprint(const QString& line)
void MainWindow::checkTransmission(const QString& line) void MainWindow::checkTransmission(const QString& line)
{ {
if (line.contains("Transmission")) { if (appConfig().logLevel() >= 2) {
if (line.contains("Started")) { if (line.contains("Transmission")) {
setSynergyState(synergyTransfering); if (line.contains("Started")) {
} setSynergyState(synergyTransfering);
else if (line.contains("Failed") || }
line.contains("Complete") || else if (line.contains("Failed") ||
line.contains("Interrupted")) { line.contains("Complete") ||
setSynergyState(synergyConnected); line.contains("Interrupted")) {
} setSynergyState(synergyConnected);
}
// NOTIFY: Title: Detail // NOTIFY: Title: Detail
int p1 = line.indexOf(':'); int p1 = line.indexOf(':');
if (p1 > 0) { if (p1 > 0) {
int p2 = line.indexOf(':', p1 + 1); int p2 = line.indexOf(':', p1 + 1);
if (p2 > 0) { if (p2 > 0) {
QString title = line.mid(p1 + 2, p2 - p1 - 2); QString title = line.mid(p1 + 2, p2 - p1 - 2);
QString detail = line.mid(p2 + 2); QString detail = line.mid(p2 + 2);
m_pTrayIcon->showMessage(title, detail); m_pTrayIcon->showMessage(title, detail);
}
} }
} }
} }