[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdebase/workspace/plasma/generic/dataengines/powermanagement
From: Lukáš Tinkl <lukas () kde ! org>
Date: 2010-11-26 14:39:26
Message-ID: 20101126143926.06C6DAC8A2 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1201015 by lukas:
fix remaining time and profile changing signals, to match those in PowerDevil
(battery applet fixes coming up next)
M +0 -1 README.txt
M +8 -6 powermanagementengine.cpp
M +1 -1 powermanagementengine.h
--- trunk/KDE/kdebase/workspace/plasma/generic/dataengines/powermanagement/README.txt \
#1201014:1201015 @@ -1,6 +1,5 @@
TODO:
======
-- find a way to compute remaining minutes
- Sleepstates don't match what solidshell reports
- ac plug state does not get updated
- this engine probably shares some functionality with
--- trunk/KDE/kdebase/workspace/plasma/generic/dataengines/powermanagement/powermanagementengine.cpp \
#1201014:1201015 @@ -70,7 +70,7 @@
if (!QDBusConnection::sessionBus().connect("org.kde.Solid.PowerManagement",
"/org/kde/Solid/PowerManagement",
"org.kde.Solid.PowerManagement",
- "batteryRemainingTimeChanged", \
this, + "profileChanged", this,
SLOT(profileChanged(const \
QString&)))) { kDebug() << "error connecting to Profile changes via dbus";
}
@@ -78,13 +78,13 @@
"/org/kde/Solid/PowerManagement",
"org.kde.Solid.PowerManagement",
"batteryRemainingTimeChanged", \
this,
- \
SLOT(batteryRemainingTimeChanged(int)))) { + \
SLOT(batteryRemainingTimeChanged(qulonglong)))) { kDebug() << "error connecting to \
remaining time changes"; }
// Listen to profile changes
KDirWatch *profilesWatch = new KDirWatch(this);
- profilesWatch->addFile(KStandardDirs::locate("config", \
"powerdevilprofilesrc")); + \
profilesWatch->addFile(KStandardDirs::locate("config", \
"powerdevil2profilesrc"));
connect(profilesWatch,SIGNAL(dirty(QString)),this,SLOT(availableProfilesChanged()));
connect(profilesWatch,SIGNAL(created(QString)),this,SLOT(availableProfilesChanged()));
connect(profilesWatch,SIGNAL(deleted(QString)),this,SLOT(availableProfilesChanged()));
@@ -155,6 +155,7 @@
QDBusPendingReply< int > reply = \
QDBusConnection::sessionBus().asyncCall(msg); reply.waitForFinished();
if (reply.isValid()) {
+ //kDebug() << "Remaining time 1:" << reply.value();
setData("Battery", "Remaining msec", reply.value());
}
}
@@ -284,14 +285,15 @@
setData("PowerDevil", "Current profile", current);
}
-void PowermanagementEngine::batteryRemainingTimeChanged(int time)
+void PowermanagementEngine::batteryRemainingTimeChanged(qulonglong time)
{
- setData("Battery0", "Remaining msec", time);
+ //kDebug() << "Remaining time 2:" << time;
+ setData("Battery", "Remaining msec", time);
}
void PowermanagementEngine::availableProfilesChanged()
{
- KConfig *profilesConfig = new KConfig("powerdevilprofilesrc", \
KConfig::SimpleConfig); + KConfig *profilesConfig = new \
KConfig("powerdevil2profilesrc", KConfig::SimpleConfig);
setData("PowerDevil", "Available profiles", profilesConfig->groupList());
delete profilesConfig;
}
--- trunk/KDE/kdebase/workspace/plasma/generic/dataengines/powermanagement/powermanagementengine.h \
#1201014:1201015 @@ -54,7 +54,7 @@
void deviceRemoved(const QString& udi);
void deviceAdded(const QString& udi);
void profileChanged(const QString ¤t);
- void batteryRemainingTimeChanged(int time);
+ void batteryRemainingTimeChanged(qulonglong time);
void availableProfilesChanged();
void reloadPowerDevilData();
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic