Cleaner code

This commit is contained in:
apa420 2018-10-06 18:20:07 +02:00
parent aac2afedf5
commit dbd730487b
3 changed files with 14 additions and 16 deletions

View file

@ -180,13 +180,13 @@ void NotificationController::getFakeTwitchChannelLiveStatus(
getApp()->notifications->playSound();
}
if (getSettings()->notificationFlashTaskbar) {
int flashDuration = 2500;
if (getSettings()->longAlerts) {
QApplication::alert(
getApp()->windows->getMainWindow().window(), 0);
} else {
QApplication::alert(
getApp()->windows->getMainWindow().window(), 2500);
flashDuration = 0;
}
QApplication::alert(
getApp()->windows->getMainWindow().window(),
flashDuration);
}
}
return Success;

View file

@ -408,14 +408,13 @@ void TwitchChannel::setLive(bool newLiveStatus)
getApp()->notifications->playSound();
}
if (getSettings()->notificationFlashTaskbar) {
int flashDuration = 2500;
if (getSettings()->longAlerts) {
QApplication::alert(
getApp()->windows->getMainWindow().window(), 0);
} else {
flashDuration = 0;
}
QApplication::alert(
getApp()->windows->getMainWindow().window(),
2500);
}
flashDuration);
}
}
auto live = makeSystemMessage(this->getName() + " is live");

View file

@ -788,13 +788,12 @@ void TwitchMessageBuilder::parseHighlights(bool isPastMsg)
}
if (doAlert) {
int flashDuration = 2500;
if (getSettings()->longAlerts) {
QApplication::alert(
getApp()->windows->getMainWindow().window(), 0);
} else {
QApplication::alert(
getApp()->windows->getMainWindow().window(), 2500);
flashDuration = 0;
}
QApplication::alert(getApp()->windows->getMainWindow().window(),
flashDuration);
}
}
}