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

List:       kde-commits
Subject:    KDE/kdebase/workspace/powerdevil
From:       Dario Freddi <drf () kde ! org>
Date:       2010-11-11 17:30:37
Message-ID: 20101111173037.D7F2BAC89E () svn ! kde ! org
[Download RAW message or body]

SVN commit 1195645 by dafre:

BUG: 256592

Add a signal to DBus Daemon interface for notifying when config gets reparsed. \
General uses this for reloading its own list as well.

 M  +2 -0      daemon/org.kde.Solid.PowerManagement.xml  
 M  +8 -1      daemon/powerdevilcore.cpp  
 M  +1 -0      daemon/powerdevilcore.h  
 M  +5 -0      kcmodule/global/GeneralPage.cpp  
 M  +10 -0     kcmodule/profiles/EditPage.cpp  


--- trunk/KDE/kdebase/workspace/powerdevil/daemon/org.kde.Solid.PowerManagement.xml \
#1195644:1195645 @@ -40,6 +40,8 @@
     <signal name="profileChanged">
       <arg type="s" direction="out" />
     </signal>
+    <signal name="configurationReloaded">
+    </signal>
     <signal name="batteryRemainingTimeChanged">
       <arg type="t" direction="out" />
     </signal>
--- trunk/KDE/kdebase/workspace/powerdevil/daemon/powerdevilcore.cpp #1195644:1195645
@@ -253,6 +253,10 @@
     kDebug() << "Request to reload current profile";
     PowerDevilSettings::self()->readConfig();
     m_profilesConfig->reparseConfiguration();
+
+    // Config reloaded
+    emit configurationReloaded();
+
     loadProfile(m_currentProfile);
 }
 
@@ -319,8 +323,11 @@
         }        
     }
 
-    // And set the current profile
+    // Set the current profile. Notify if different.
+    if (m_currentProfile != name) {
     m_currentProfile = name;
+        emit profileChanged(m_currentProfile);
+    }
 
     // If the lid is closed, retrigger the lid close signal
     if (m_backend->isLidClosed()) {
--- trunk/KDE/kdebase/workspace/powerdevil/daemon/powerdevilcore.h #1195644:1195645
@@ -85,6 +85,7 @@
 
 Q_SIGNALS:
     void profileChanged(const QString &newProfile);
+    void configurationReloaded();
     void brightnessChanged(int percent);
     void batteryRemainingTimeChanged(qulonglong time);
     void resumingFromSuspend();
--- trunk/KDE/kdebase/workspace/powerdevil/kcmodule/global/GeneralPage.cpp \
#1195644:1195645 @@ -59,6 +59,11 @@
     setupUi(this);
 
     fillUi();
+
+    // Connect to daemon's signal
+    QDBusConnection::sessionBus().connect("org.kde.Solid.PowerManagement", \
"/org/kde/Solid/PowerManagement", +                                          \
"org.kde.Solid.PowerManagement", "configurationReloaded", +                           \
this, SLOT(reloadAvailableProfiles()));  }
 
 GeneralPage::~GeneralPage()
--- trunk/KDE/kdebase/workspace/powerdevil/kcmodule/profiles/EditPage.cpp \
#1195644:1195645 @@ -276,6 +276,11 @@
     m_profilesConfig->sync();
 
     reloadAvailableProfiles();
+
+    // Notify the daemon
+    QDBusMessage call = \
QDBusMessage::createMethodCall("org.kde.Solid.PowerManagement", \
"/org/kde/Solid/PowerManagement", +                                                   \
"org.kde.Solid.PowerManagement", "reloadCurrentProfile"); +    \
QDBusConnection::sessionBus().asyncCall(call);  }
 
 void EditPage::createProfile(const QString &name, const QString &icon)
@@ -289,6 +294,11 @@
     group.sync();
 
     reloadAvailableProfiles();
+
+    // Notify the daemon
+    QDBusMessage call = \
QDBusMessage::createMethodCall("org.kde.Solid.PowerManagement", \
"/org/kde/Solid/PowerManagement", +                                                   \
"org.kde.Solid.PowerManagement", "reloadCurrentProfile"); +    \
QDBusConnection::sessionBus().asyncCall(call);  }
 
 void EditPage::createProfile()


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

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