From 39c3a25e62c3a87aa92a61443a11eddaf8252369 Mon Sep 17 00:00:00 2001 From: Sergio Martins Date: Sun, 24 Nov 2013 19:08:21 +0000 Subject: [PATCH] Allow to disable/enable systray unread count through D-Bus. I'm working on a couple of scripts that disable distractions while I'm focusing. This is not for a bug-fix, but it's dead simple and it's more of an hacker's option than end-user stuff, so I'm putting this in 4.11. --- kmkernel.cpp | 7 +++++++ kmkernel.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/kmkernel.cpp b/kmkernel.cpp index 849acb6e1..37efdcdff 100644 --- a/kmkernel.cpp +++ b/kmkernel.cpp @@ -537,6 +537,13 @@ void KMKernel::checkMail () //might create a new reader but won't show!! } } +void KMKernel::setSystrayUnreadCountEnabled(bool enabled) +{ + GlobalSettings::self()->systemTrayShowUnreadItem()->setValue(enabled); + mSystemTray->setShowUnread(enabled); + GlobalSettings::self()->writeConfig(); +} + QStringList KMKernel::accounts() { QStringList accountLst; diff --git a/kmkernel.h b/kmkernel.h index 6d359e172..6425c7759 100644 --- a/kmkernel.h +++ b/kmkernel.h @@ -120,6 +120,8 @@ public Q_SLOTS: Q_SCRIPTABLE void checkMail(); Q_SCRIPTABLE void openReader() { openReader( false ); } + Q_SCRIPTABLE void setSystrayUnreadCountEnabled(bool enabled); + /** * Pauses all background jobs and does not * allow new background jobs to be started.