[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:16:19
Message-ID: 20101111171619.164DBAC8A1 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1195639 by dafre:
BUG: 256593
Use DBus for notifying the daemon: KDirWatch just doesn't cut it.
M +1 -0 daemon/org.kde.Solid.PowerManagement.xml
M +1 -8 daemon/powerdevilcore.cpp
M +1 -0 daemon/powerdevilcore.h
M +4 -0 kcmodule/profiles/EditPage.cpp
--- trunk/KDE/kdebase/workspace/powerdevil/daemon/org.kde.Solid.PowerManagement.xml \
#1195638:1195639 @@ -3,6 +3,7 @@
<interface name="org.kde.Solid.PowerManagement">
<method name="refreshStatus" />
+ <method name="reloadCurrentProfile" />
<method name="loadProfile">
<arg type="s" direction="in" />
</method>
--- trunk/KDE/kdebase/workspace/powerdevil/daemon/powerdevilcore.cpp \
#1195638:1195639 @@ -37,7 +37,6 @@
#include <KAction>
#include <KActionCollection>
#include <KDebug>
-#include <KDirWatch>
#include <KIdleTime>
#include <KLocalizedString>
#include <KMessageBox>
@@ -141,13 +140,6 @@
connect(KIdleTime::instance(), SIGNAL(resumingFromIdle()),
this, SLOT(onResumingFromIdle()));
- // Listen to profile changes
- KDirWatch *profilesWatch = new KDirWatch(this);
- profilesWatch->addFile(KStandardDirs::locate("config", \
"powerdevil2profilesrc"));
- connect(profilesWatch, SIGNAL(dirty(QString)), this, \
SLOT(reloadCurrentProfile()));
- connect(profilesWatch, SIGNAL(created(QString)), this, \
SLOT(reloadCurrentProfile()));
- connect(profilesWatch, SIGNAL(deleted(QString)), this, \
SLOT(reloadCurrentProfile()));
-
// Set up the policy agent
PowerDevil::PolicyAgent::instance()->init();
@@ -258,6 +250,7 @@
/* The configuration could have changed if this function was called, \
so
* let's resync it.
*/
+ kDebug() << "Request to reload current profile";
PowerDevilSettings::self()->readConfig();
m_profilesConfig->reparseConfiguration();
loadProfile(m_currentProfile);
--- trunk/KDE/kdebase/workspace/powerdevil/daemon/powerdevilcore.h \
#1195638:1195639 @@ -28,6 +28,7 @@
#include <KComponentData>
+class KDirWatch;
class QTimer;
class KNotification;
namespace Solid {
--- trunk/KDE/kdebase/workspace/powerdevil/kcmodule/profiles/EditPage.cpp \
#1195638:1195639 @@ -170,6 +170,10 @@
void EditPage::save()
{
saveProfile();
+ // 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::loadProfile()
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic