summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/QtUI')
-rw-r--r--Swift/QtUI/WindowsNotifier.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/Swift/QtUI/WindowsNotifier.cpp b/Swift/QtUI/WindowsNotifier.cpp
index 49489a3..1789451 100644
--- a/Swift/QtUI/WindowsNotifier.cpp
+++ b/Swift/QtUI/WindowsNotifier.cpp
@@ -36,13 +36,15 @@ void WindowsNotifier::showMessage(Type type, const std::string& subject, const s
if (std::find(defaultTypes.begin(), defaultTypes.end(), type) == defaultTypes.end()) {
return;
}
lastCallback = callback;
int timeout = (type == IncomingMessage || type == SystemMessage) ? DEFAULT_MESSAGE_NOTIFICATION_TIMEOUT_SECONDS : DEFAULT_STATUS_NOTIFICATION_TIMEOUT_SECONDS;
tray->showMessage(P2QSTRING(subject), P2QSTRING(description), type == SystemMessage ? QSystemTrayIcon::Information : QSystemTrayIcon::NoIcon, timeout * 1000);
}
void WindowsNotifier::handleMessageClicked() {
- lastCallback();
+ if (lastCallback) {
+ lastCallback();
+ }
}
}