mirror of
https://github.com/abraunegg/onedrive
synced 2024-05-18 05:36:41 +02:00
Fix: Initialization and Error Handling for Libnotify (#2659)
* fix libnotify * Add notification error handling
This commit is contained in:
parent
fda043061a
commit
3d249b8d10
|
@ -99,8 +99,13 @@ class LogBuffer {
|
||||||
shared void notify(string message) {
|
shared void notify(string message) {
|
||||||
// Use dnotify's functionality for GUI notifications, if GUI notifications is enabled
|
// Use dnotify's functionality for GUI notifications, if GUI notifications is enabled
|
||||||
version(Notifications) {
|
version(Notifications) {
|
||||||
auto n = new Notification("Log Notification", message, "IGNORED");
|
try {
|
||||||
n.show();
|
auto n = new Notification("Log Notification", message, "IGNORED");
|
||||||
|
n.show();
|
||||||
|
} catch (NotificationError e) {
|
||||||
|
sendGUINotification = false;
|
||||||
|
addLogEntry("Unable to send notification; disabled in the following: " ~ e.message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -79,11 +79,11 @@ void init(in char[] name) {
|
||||||
alias notify_is_initted is_initted;
|
alias notify_is_initted is_initted;
|
||||||
alias notify_uninit uninit;
|
alias notify_uninit uninit;
|
||||||
|
|
||||||
static this() {
|
shared static this() {
|
||||||
init(__FILE__);
|
init(__FILE__);
|
||||||
}
|
}
|
||||||
|
|
||||||
static ~this() {
|
shared static ~this() {
|
||||||
uninit();
|
uninit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue