[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [muon] kded: Add an API for using different tray icons and context menu action icons.
From:       Jonathan Thomas <echidnaman () kubuntu ! org>
Date:       2013-06-05 13:09:08
Message-ID: 20130605130908.C069CA605A () git ! kde ! org
[Download RAW message or body]

Git commit c2c074e88602d712efa9ebcbcb9bd9be898f7737 by Jonathan Thomas.
Committed on 05/06/2013 at 15:07.
Pushed by jmthomas into branch 'master'.

Add an API for using different tray icons and context menu action icons.
Tray icons can be Plasma theme svgs that can't be used as the icons for context menu \
actions. This fixes a missing icon for the software update notification's context \
menu.

BUG:320750
FIXED-IN:2.1

M  +1    -1    kded/UpdateEvent/UpdateEvent.cpp
M  +5    -2    kded/event.cpp
M  +2    -1    kded/event.h

http://commits.kde.org/muon/c2c074e88602d712efa9ebcbcb9bd9be898f7737

diff --git a/kded/UpdateEvent/UpdateEvent.cpp b/kded/UpdateEvent/UpdateEvent.cpp
index 4d88ad5..c1a9f35 100644
--- a/kded/UpdateEvent/UpdateEvent.cpp
+++ b/kded/UpdateEvent/UpdateEvent.cpp
@@ -97,7 +97,7 @@ void UpdateEvent::show(int updates, int securityUpdates)
                      "Never show again");
 
     if (!m_active) {
-        Event::show(icon, text, actions, tTipIcon);
+        Event::show(icon, text, actions, tTipIcon, "system-software-update");
     } else {
         Event::update(icon, text, tTipIcon);
     }
diff --git a/kded/event.cpp b/kded/event.cpp
index dd38841..b29aeea 100644
--- a/kded/event.cpp
+++ b/kded/event.cpp
@@ -85,12 +85,15 @@ bool Event::isHidden() const
     return m_hidden;
 }
 
-void Event::show(const QString &icon, const QString &text, const QStringList \
&actions, const QString &tTipIcon) +void Event::show(const QString &icon, const \
QString &text, const QStringList &actions, +                 const QString &tTipIcon, \
const QString &actionIcon)  {
     if (m_active || m_hidden) {
         return;
     }
 
+    QString aIcon = actionIcon.isEmpty() ? icon : actionIcon;
+
     if (m_useKNotify) {
         KNotification::NotificationFlag flag;
 
@@ -143,7 +146,7 @@ void Event::show(const QString &icon, const QString &text, const \
                QStringList &ac
         contextMenu->addTitle(KIcon("applications-system"), i18n("System \
Notification"));  
         QAction *runAction = contextMenu->addAction(actions.at(0));
-        runAction->setIcon(KIcon(icon));
+        runAction->setIcon(KIcon(aIcon));
         connect(runAction, SIGNAL(triggered()), this, SLOT(run()));
         contextMenu->addAction(runAction);
 
diff --git a/kded/event.h b/kded/event.h
index 8d6f566..5d89fbf 100644
--- a/kded/event.h
+++ b/kded/event.h
@@ -45,7 +45,8 @@ public:
 
 public slots:
     bool isHidden() const;
-    void show(const QString &icon, const QString &text, const QStringList &actions, \
const QString &tTipIcon = QString()); +    void show(const QString &icon, const \
QString &text, const QStringList &actions, +              const QString &tTipIcon = \
QString(), const QString &actionIcon = QString());  void ignore();
     void update(const QString &icon, const QString &text, const QString &tTipIcon = \
QString());  void run();


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic