summaryrefslogtreecommitdiff
path: root/daemon/notificationmanager.cpp
diff options
context:
space:
mode:
authorTomasz Sterna <tomek@xiaoka.com>2015-05-18 09:35:38 +0200
committerTomasz Sterna <tomek@xiaoka.com>2015-05-18 09:39:42 +0200
commit7116e096e1288170da3820c77e41e377f9bd69be (patch)
treed6f826b7703a388018894033b95d61d745448588 /daemon/notificationmanager.cpp
parent37bc0ef733843f27eb6228f3ee149094e7f62383 (diff)
Save default settings to DConf if not present
Diffstat (limited to 'daemon/notificationmanager.cpp')
-rw-r--r--daemon/notificationmanager.cpp21
1 files changed, 7 insertions, 14 deletions
diff --git a/daemon/notificationmanager.cpp b/daemon/notificationmanager.cpp
index d983539..d357a3c 100644
--- a/daemon/notificationmanager.cpp
+++ b/daemon/notificationmanager.cpp
@@ -126,8 +126,7 @@ uint NotificationManager::Notify(const QString &app_name, uint replaces_id, cons
setDelayedReply(true);
if (app_name == "messageserver5") {
- QVariant notificationsEmails = settings->property("notificationsEmails");
- if (!notificationsEmails.isValid() || !notificationsEmails.toBool()) {
+ if (!settings->property("notificationsEmails").toBool()) {
qCDebug(l) << "Ignoring email notification because of setting!";
return 0;
}
@@ -149,14 +148,12 @@ uint NotificationManager::Notify(const QString &app_name, uint replaces_id, cons
QString category = hints.value("category", "").toString();
if (category == "x-nemo.call.missed") {
- QVariant notificationsMissedCall = settings->property("notificationsMissedCall");
- if (notificationsMissedCall.isValid() && !notificationsMissedCall.toBool()) {
+ if (!settings->property("notificationsMissedCall").toBool()) {
qCDebug(l) << "Ignoring MissedCall notification because of setting!";
return 0;
}
} else {
- QVariant notificationsCommhistoryd = settings->property("notificationsCommhistoryd");
- if (notificationsCommhistoryd.isValid() && !notificationsCommhistoryd.toBool()) {
+ if (!settings->property("notificationsCommhistoryd").toBool()) {
qCDebug(l) << "Ignoring commhistoryd notification because of setting!";
return 0;
}
@@ -166,8 +163,7 @@ uint NotificationManager::Notify(const QString &app_name, uint replaces_id, cons
);
}
} else if (app_name == "harbour-mitakuuluu2-server") {
- QVariant notificationsMitakuuluu = settings->property("notificationsMitakuuluu");
- if (notificationsMitakuuluu.isValid() && !notificationsMitakuuluu.toBool()) {
+ if (!settings->property("notificationsMitakuuluu").toBool()) {
qCDebug(l) << "Ignoring mitakuuluu notification because of setting!";
return 0;
}
@@ -176,8 +172,7 @@ uint NotificationManager::Notify(const QString &app_name, uint replaces_id, cons
hints.value("x-nemo-preview-summary", "default").toString()
);
} else if (app_name == "twitter-notifications-client") {
- QVariant notificationsTwitter = settings->property("notificationsTwitter");
- if (notificationsTwitter.isValid() && !notificationsTwitter.toBool()) {
+ if (!settings->property("notificationsTwitter").toBool()) {
qCDebug(l) << "Ignoring twitter notification because of setting!";
return 0;
}
@@ -195,14 +190,12 @@ uint NotificationManager::Notify(const QString &app_name, uint replaces_id, cons
qCDebug(l) << "MSG Prio:" << prio;
- QVariant notificationsAll = settings->property("notificationsAll");
- if ((!notificationsAll.isValid() || !notificationsAll.toBool()) && prio <= 10) {
+ if (!settings->property("notificationsAll").toBool() && prio <= 10) {
qCDebug(l) << "Ignoring notification because of setting! (all)";
return 0;
}
- QVariant notificationsOther = settings->property("notificationsOther");
- if (notificationsOther.isValid() && !notificationsOther.toBool() && prio < 90) {
+ if (!settings->property("notificationsOther").toBool() && prio < 90) {
qCDebug(l) << "Ignoring notification because of setting! (other)";
return 0;
}