--===============0038085380== Content-Type: multipart/signed; boundary="nextPart1954867.SUWSW2gqL3"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit --nextPart1954867.SUWSW2gqL3 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I would wait for Kevin's input/ok for this one. Ok for me, but please wait= =20 until Kevin says ok as well. On Wednesday 24 March 2010 16:24:46 Holger Macht wrote: > On So 07. M=E4r - 23:57:52, Holger Macht wrote: > > Current powerdevil and solid implementation has the concept of schemes, > > not to be confused with profiles, which is currently hard coded to > > "powersave" and "performance". The only thing this is doing is to map > > powersave/performance to the SetPowerSave HAL method which either > > enabled or disables certain system level power management > > functionality. I have no idea why this was implemented in this way and > > lacks any basis for me. The SetPowerSave HAL method is not intended, and > > will never be used for any kind of scheme methodology. Even more recent > > system application like DeviceKit-power/upower lack things of this > > kind. With this patch I propose to remove the "scheme"-stuff and > > implement the pure SetPowerSave method to be just a toggle, on or > > off. This will result in a more comprehensible implementation. >=20 > How about this one? Ok to commit? >=20 > Thanks, > Holger >=20 > PS: Thanks for committing the other patches. >=20 > PSS: Meanwhile I have a KDE SVN account. >=20 > > Regards, > >=20 > > Holger > >=20 > > Index: KDE/kdebase/workspace/powerdevil/daemon/PowerDevilDaemon.cpp > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > --- KDE.orig/kdebase/workspace/powerdevil/daemon/PowerDevilDaemon.cpp > > +++ KDE/kdebase/workspace/powerdevil/daemon/PowerDevilDaemon.cpp > > @@ -361,7 +361,7 @@ void PowerDevilDaemon::applyProfile() > >=20 > > Solid::Control::PowerManager::setBrightness(settings->readEntry("b= ri > > ghtness").toInt()); d->brightness =3D > > settings->readEntry("brightness").toInt(); > >=20 > > - =20 > > Solid::Control::PowerManager::setScheme(settings->readEntry("scheme")); > > + =20 > > Solid::Control::PowerManager::setPowerSave(settings->readEntry("setPower > > Save", true)); > >=20 > > // Compositing!! > >=20 > > @@ -1169,18 +1169,13 @@ QVariantMap PowerDevilDaemon::getSupport > >=20 > > return retlist; > > =20 > > } > >=20 > > -QStringList PowerDevilDaemon::getSupportedSchemes() > > -{ > > - return Solid::Control::PowerManager::supportedSchemes(); > > -} > > - > > -void PowerDevilDaemon::setPowersavingScheme(const QString &scheme) > > +void PowerDevilDaemon::setPowerSave(bool powersave) > >=20 > > { > > =20 > > if (!checkIfCurrentSessionActive()) { > > =20 > > return; > > =20 > > } > >=20 > > - Solid::Control::PowerManager::setScheme(scheme); > > + Solid::Control::PowerManager::setPowerSave(powersave); > >=20 > > } > > =20 > > void PowerDevilDaemon::suspend(int method) > >=20 > > Index: KDE/kdebase/workspace/powerdevil/daemon/PowerDevilDaemon.h > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > --- KDE.orig/kdebase/workspace/powerdevil/daemon/PowerDevilDaemon.h > > +++ KDE/kdebase/workspace/powerdevil/daemon/PowerDevilDaemon.h > >=20 > > @@ -46,7 +46,7 @@ public Q_SLOTS: > > void streamData(); > > =20 > > void suspend(int method); > >=20 > > - void setPowersavingScheme(const QString &scheme); > > + void setPowerSave(bool powersave); > >=20 > > void setBrightness(int value); > > void turnOffScreen(); > >=20 > > @@ -54,7 +54,6 @@ public Q_SLOTS: > > deleteLater(); > > =20 > > } > >=20 > > - QStringList getSupportedSchemes(); > >=20 > > QVariantMap getSupportedSuspendMethods(); > > =20 > > SuspensionLockHandler *lockHandler(); > >=20 > > Index: KDE/kdebase/workspace/powerdevil/daemon/org.kde.PowerDevil.xml > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > --- KDE.orig/kdebase/workspace/powerdevil/daemon/org.kde.PowerDevil.xml > > +++ KDE/kdebase/workspace/powerdevil/daemon/org.kde.PowerDevil.xml > > @@ -19,8 +19,8 @@ > >=20 > > > > =20 > > > > =20 > > > >=20 > > - > > - > > + > > + > >=20 > > > > > > =20 > > > >=20 > > @@ -31,9 +31,6 @@ > >=20 > > > > > value=3D"QVariantMap" /> > > =20 > > > >=20 > > - > > - > > - > >=20 > > > > =20 > > > >=20 > > Index: KDE/kdebase/workspace/powerdevil/default.powerdevilprofiles > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > --- KDE.orig/kdebase/workspace/powerdevil/default.powerdevilprofiles > > +++ KDE/kdebase/workspace/powerdevil/default.powerdevilprofiles > > @@ -16,7 +16,7 @@ idleTime=3D10 > >=20 > > lidAction=3D2 > > name=3DAggressive Powersave > > powerButtonAction=3D2 > >=20 > > -scheme=3Dpowersaving > > +setPowerSave=3Dtrue > >=20 > > scriptpath=3D > > sleepButtonAction=3D2 > > turnOffIdle=3Dtrue > >=20 > > @@ -40,7 +40,7 @@ idleTime=3D99 > >=20 > > lidAction=3D16 > > name=3DPerformance > > powerButtonAction=3D32 > >=20 > > -scheme=3Dperformance > > +setPowerSave=3Dfalse > >=20 > > scriptpath=3D > > sleepButtonAction=3D2 > > turnOffIdle=3Dfalse > >=20 > > @@ -64,7 +64,7 @@ idleTime=3D15 > >=20 > > lidAction=3D2 > > name=3DPowersave > > powerButtonAction=3D32 > >=20 > > -scheme=3Dpowersaving > > +setPowerSave=3Dtrue > >=20 > > scriptpath=3D > > sleepButtonAction=3D2 > > turnOffIdle=3Dtrue > >=20 > > @@ -87,7 +87,7 @@ idleAction=3D0 > >=20 > > idleTime=3D50 > > lidAction=3D0 > > powerButtonAction=3D0 > >=20 > > -scheme=3Dpowersaving > > +setPowerSave=3Dtrue > >=20 > > scriptpath=3D > > sleepButtonAction=3D0 > > turnOffIdle=3Dfalse > >=20 > > @@ -111,7 +111,7 @@ idleTime=3D5 > >=20 > > lidAction=3D2 > > name=3DXtreme Powersave > > powerButtonAction=3D2 > >=20 > > -scheme=3Dpowersaving > > +setPowerSave=3Dtrue > >=20 > > scriptpath=3D > > sleepButtonAction=3D2 > > turnOffIdle=3Dtrue > >=20 > > Index: KDE/kdebase/workspace/powerdevil/kcmodule/capabilitiesPage.ui > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > --- KDE.orig/kdebase/workspace/powerdevil/kcmodule/capabilitiesPage.ui > > +++ KDE/kdebase/workspace/powerdevil/kcmodule/capabilitiesPage.ui > > @@ -65,34 +65,20 @@ > >=20 > > > > =20 > > > > > >=20 > > - > > - > > - Scheme support > > - > > - > > - > > - > > - > > - > > - > > - > > - > > - > > - > >=20 > > > > =20 > > > > =20 > > Qt::Horizontal > > =20 > > > > =20 > > > > =20 > > > >=20 > > - > > + > >=20 > > > > =20 > > > > =20 > > Supported suspend methods > > =20 > > > > =20 > > > > =20 > > > >=20 > > - > > + > >=20 > > > > =20 > > > > =20 > > > >=20 > > @@ -105,28 +91,14 @@ > >=20 > > > > =20 > > > > =20 > > > >=20 > > - > > - > > - > > - Supported schemes > > - > > - > > - > > - > > - > > - > > - > > - > > - > > - > > - > > + > >=20 > > > > =20 > > > > =20 > > Qt::Horizontal > > =20 > > > > =20 > > > > =20 > > > >=20 > > - > > + > >=20 > > > > =20 > > > > =20 > > Support for DPMS > >=20 > > @@ -139,14 +111,14 @@ > >=20 > > > > =20 > > > > =20 > > > >=20 > > - > > + > >=20 > > > > =20 > > > > =20 > > > > =20 > > > > =20 > > > > =20 > > > >=20 > > - > > + > >=20 > > > > =20 > > > > =20 > > Checks if ConsoleKit is active on your system > >=20 > > @@ -159,28 +131,28 @@ > >=20 > > > > =20 > > > > =20 > > > >=20 > > - > > + > >=20 > > > > =20 > > > > =20 > > > > =20 > > > > =20 > > > > =20 > > > >=20 > > - > > + > >=20 > > > > =20 > > > > =20 > > Qt::Horizontal > > =20 > > > > =20 > > > > =20 > > > >=20 > > - > > + > >=20 > > > > =20 > > > > =20 > > Status > > =20 > > > > =20 > > > > =20 > > > >=20 > > - > > + > >=20 > > > > =20 > > > > =20 > > > >=20 > > Index: KDE/kdebase/workspace/powerdevil/kcmodule/EditPage.cpp > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > --- KDE.orig/kdebase/workspace/powerdevil/kcmodule/EditPage.cpp > > +++ KDE/kdebase/workspace/powerdevil/kcmodule/EditPage.cpp > > @@ -143,8 +143,6 @@ void EditPage::fillUi() > >=20 > > powerButtonCombo->addItem(KIcon("system-suspend"), > > i18n("Standby"), (int) Standby); > > =20 > > } > >=20 > > - =20 > > schemeCombo->addItems(Solid::Control::PowerManager::supportedSchemes()); > > - > >=20 > > reloadAvailableProfiles(); > > =20 > > tabWidget->setTabIcon(0, > > KIcon("preferences-system-session-services")); > >=20 > > @@ -180,7 +178,7 @@ void EditPage::fillUi() > >=20 > > connect(dimDisplayOnIdle, SIGNAL(stateChanged(int)), > > SLOT(enableBoxes())); > >=20 > > - connect(schemeCombo, SIGNAL(currentIndexChanged(int)), > > SLOT(setProfileChanged())); + connect(SetPowerSaveCheckBox, > > SIGNAL(stateChanged(int)), SLOT(setProfileChanged())); > >=20 > > connect(scriptRequester, SIGNAL(textChanged(const QString&)), > > SLOT(setProfileChanged())); > > =20 > > #ifdef HAVE_DPMS > >=20 > > @@ -273,7 +271,8 @@ void EditPage::loadProfile() > >=20 > > dimOnIdleTime->setValue(group->readEntry("dimOnIdleTime").toInt()); > > idleTime->setValue(group->readEntry("idleTime").toInt()); > > idleCombo->setCurrentIndex(idleCombo->findData(group->readEntry("i= dl > > eAction").toInt())); > >=20 > > - =20 > > schemeCombo->setCurrentIndex(schemeCombo->findText(group->readEntry("sch > > eme"))); + =20 > > SetPowerSaveCheckBox->setChecked(group->readEntry("setPowerSave", > > true)); + > >=20 > > scriptRequester->setUrl(KUrl::fromPath(group->readEntry("scriptpat= h" > > ))); > > =20 > > laptopClosedCombo->setCurrentIndex(laptopClosedCombo->findData(gro= up > > ->readEntry("lidAction").toInt())); > >=20 > > @@ -325,7 +324,7 @@ void EditPage::saveProfile(const QString > >=20 > > group->writeEntry("lidAction", > > laptopClosedCombo->itemData(laptopClosedCombo->currentIndex()).toIn > > t()); group->writeEntry("sleepButtonAction", > > sleepButtonCombo->itemData(sleepButtonCombo->currentIndex()).toInt( > > )); group->writeEntry("powerButtonAction", > > powerButtonCombo->itemData(powerButtonCombo->currentIndex()).toInt( > > )); > >=20 > > - group->writeEntry("scheme", schemeCombo->currentText()); > > + group->writeEntry("setPowerSave", > > SetPowerSaveCheckBox->isChecked()); > >=20 > > group->writeEntry("scriptpath", scriptRequester->url().path()); > > group->writeEntry("disableCompositing", > > disableCompositing->isChecked()); > >=20 > > Index: KDE/kdebase/workspace/powerdevil/kcmodule/profileEditPage.ui > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > --- KDE.orig/kdebase/workspace/powerdevil/kcmodule/profileEditPage.ui > > +++ KDE/kdebase/workspace/powerdevil/kcmodule/profileEditPage.ui > > @@ -471,20 +471,29 @@ > >=20 > > > > =20 > > QFormLayout::ExpandingFieldsGrow > > =20 > > > >=20 > > - > > - > > + > > + > > + > > + true > > + > > + > > + Qt::LeftToRight > > + > >=20 > > > >=20 > > - System powersaving scheme: > > + Enable system power saving > >=20 > > > >=20 > > - > > - schemeCombo > > + > > + true > > + > > + > > + false > >=20 > > > > =20 > > > > =20 > > > >=20 > > - > > - > > + > > + > >=20 > > > >=20 > > - > vsizetype=3D"Fixed"> + > hsizetype=3D"MinimumExpanding" vsizetype=3D"Preferred"> > >=20 > > 0 > > 0 > > =20 > > > >=20 > > @@ -497,7 +506,7 @@ > >=20 > > > > =20 > > > > =20 > > > >=20 > > - > > + > >=20 > > > > =20 > > > > =20 > > When loading profile execute: > >=20 > > @@ -507,27 +516,7 @@ > >=20 > > > > =20 > > > > =20 > > > >=20 > > - > > - > > - > > - > vsizetype=3D"Preferred"> - 0 > > - 0 > > - > > - > > - > > - > > - 250 > > - 16777215 > > - > > - > > - > > - > >=20 > > > >=20 > > - schemeCombo > > - label_20 > > - label_19 > > - scriptRequester > >=20 > > > > =20 > > > > =20 > > > >=20 > > Index: KDE/kdebase/workspace/libs/solid/control/ifaces/powermanager.h > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > --- KDE.orig/kdebase/workspace/libs/solid/control/ifaces/powermanager.h > > +++ KDE/kdebase/workspace/libs/solid/control/ifaces/powermanager.h > > @@ -58,39 +58,6 @@ namespace Ifaces > >=20 > > */ > > =20 > > virtual ~PowerManager(); > >=20 > > - > > - /** > > - * Retrieves the list of power management schemes available on > > this system. - * > > - * @return the available power management schemes > > - */ > > - virtual QStringList supportedSchemes() const =3D 0; > > - > > - /** > > - * Retrieves a localized description corresponding to the given > > scheme. - * > > - * @param schemeName the name of the scheme we request the > > description for - * @return the associated description > > - */ > > - virtual QString schemeDescription(const QString &schemeName) > > const =3D 0; - > > - /** > > - * Retrieves the name of the current power management scheme > > used - * by the system. > > - * > > - * @return the current scheme > > - */ > > - virtual QString scheme() const =3D 0; > > - > > - /** > > - * Changes the current power management scheme. > > - * > > - * @param name the name of the new scheme > > - * @return true if the scheme change succeeded, false otherwise > > - */ > > - virtual bool setScheme(const QString &name) =3D 0; > > - > > - > >=20 > > /** > > =20 > > * Retrieves the current state of the system battery. > > * > >=20 > > @@ -158,6 +125,15 @@ namespace Ifaces > >=20 > > virtual Solid::Control::PowerManager::CpuFreqPolicy > > cpuFreqPolicy() const =3D 0; > > =20 > > /** > >=20 > > + * Changes the current power management policy of the system. > > + * > > + * @param powersave if powersaving should be anabled > > + * @return true if the policy change succeeded, false otherwise > > + * @see Solid::Control::PowerManager::setPowerSave > > + */ > > + virtual bool setPowerSave(bool powersave) =3D 0; > > + > > + /** > >=20 > > * Changes the current CPU frequency policy of the system. > > * > > * @param newPolicy the new policy > >=20 > > @@ -209,13 +185,6 @@ namespace Ifaces > >=20 > > Q_SIGNALS: > > /** > >=20 > > - * This signal is emitted when the power management scheme has > > changed. - * > > - * @param newScheme the new scheme name > > - */ > > - void schemeChanged(QString newScheme); > > - > > - /** > >=20 > > * This signal is emitted when the AC adapter is plugged or > > unplugged. * > > * @param newState the new state of the AC adapter, it's one of > > the > >=20 > > Index: KDE/kdebase/workspace/libs/solid/control/powermanager.cpp > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > --- KDE.orig/kdebase/workspace/libs/solid/control/powermanager.cpp > > +++ KDE/kdebase/workspace/libs/solid/control/powermanager.cpp > > @@ -34,8 +34,6 @@ Solid::Control::PowerManagerPrivate::Pow > >=20 > > loadBackend("Power Management", "SolidPowerManager", > > "Solid::Control::Ifaces::PowerManager"); > > =20 > > if (managerBackend()!=3D0) { > >=20 > > - connect(managerBackend(), SIGNAL(schemeChanged(QString)), > > - this, SIGNAL(schemeChanged(QString))); > >=20 > > connect(managerBackend(), SIGNAL(acAdapterStateChanged(int)), > > =20 > > this, SIGNAL(acAdapterStateChanged(int))); > > =20 > > connect(managerBackend(), SIGNAL(batteryStateChanged(int)), > >=20 > > @@ -53,27 +51,10 @@ Solid::Control::PowerManagerPrivate::~Po > >=20 > > { > > } > >=20 > > -QStringList Solid::Control::PowerManager::supportedSchemes() > > +bool Solid::Control::PowerManager::setPowerSave(bool powersave) > >=20 > > { > > =20 > > return_SOLID_CALL(Ifaces::PowerManager *, > > globalPowerManager->managerBackend(), > >=20 > > - QStringList(), supportedSchemes()); > > -} > > - > > -QString Solid::Control::PowerManager::schemeDescription(const QString > > &schemeName) -{ > > - return_SOLID_CALL(Ifaces::PowerManager *, > > globalPowerManager->managerBackend(), - QString(), > > schemeDescription(schemeName)); -} > > - > > -QString Solid::Control::PowerManager::scheme() > > -{ > > - return_SOLID_CALL(Ifaces::PowerManager *, > > globalPowerManager->managerBackend(), QString(), scheme()); -} > > - > > -bool Solid::Control::PowerManager::setScheme(const QString &name) > > -{ > > - return_SOLID_CALL(Ifaces::PowerManager *, > > globalPowerManager->managerBackend(), - false, > > setScheme(name)); > > + false, setPowerSave(powersave)); > >=20 > > } > > =20 > > Solid::Control::PowerManager::BatteryState > > Solid::Control::PowerManager::batteryState() > >=20 > > Index: KDE/kdebase/workspace/libs/solid/control/powermanager.h > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > --- KDE.orig/kdebase/workspace/libs/solid/control/powermanager.h > > +++ KDE/kdebase/workspace/libs/solid/control/powermanager.h > > @@ -119,37 +119,13 @@ namespace Control > >=20 > > typedef QHash > > BrightnessControlsList; > >=20 > > - > > - /** > > - * Retrieves the list of power management schemes available on > > this system. - * > > - * @return the available power management schemes > > - */ > > - SOLIDCONTROL_EXPORT QStringList supportedSchemes(); > > - > > - /** > > - * Retrieves a localized description corresponding to the given > > scheme. - * > > - * @param schemeName the name of the scheme we request the > > description for - * @return the associated description > > - */ > > - SOLIDCONTROL_EXPORT QString schemeDescription(const QString > > &schemeName); - > >=20 > > /** > >=20 > > - * Retrieves the name of the current power management scheme > > used - * by the system. > > + * Changes the current power management policy of the system > >=20 > > * > >=20 > > - * @return the current scheme > > - */ > > - SOLIDCONTROL_EXPORT QString scheme(); > > - > > - /** > > - * Changes the current power management scheme. > > - * > > - * @param name the name of the new scheme > > - * @return true if the scheme change succeeded, false otherwise > > + * @param true if powersaving should be enabled > > + * @return true if the policy change succeeded, false otherwise > >=20 > > */ > >=20 > > - SOLIDCONTROL_EXPORT bool setScheme(const QString &name); > > + SOLIDCONTROL_EXPORT bool setPowerSave(bool powersave); > >=20 > > /** > >=20 > > @@ -273,13 +249,6 @@ namespace Control > >=20 > > Q_OBJECT > > =20 > > Q_SIGNALS: > > /** > >=20 > > - * This signal is emitted when the power management scheme > > has changed. - * > > - * @param newScheme the new scheme name > > - */ > > - void schemeChanged(QString newScheme); > > - > > - /** > >=20 > > * This signal is emitted when the AC adapter is plugged or > > unplugged. * > > * @param newState the new state of the AC adapter, it's o= ne > > of the > >=20 > > Index: KDE/kdebase/workspace/powerdevil/kcmodule/CapabilitiesPage.cpp > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > --- KDE.orig/kdebase/workspace/powerdevil/kcmodule/CapabilitiesPage.cpp > > +++ KDE/kdebase/workspace/powerdevil/kcmodule/CapabilitiesPage.cpp > > @@ -132,26 +132,6 @@ void CapabilitiesPage::fillCapabilities( > >=20 > > supportedMethods->setText(sMethods); > >=20 > > - if (!Solid::Control::PowerManager::supportedSchemes().isEmpty()) { > > - isSchemeSupported->setPixmap(KIcon("dialog-ok-apply").pixmap(1= 6, > > 16)); - } else { > > - isSchemeSupported->setPixmap(KIcon("dialog-cancel").pixmap(16, > > 16)); - } > > - > > - QString schemes; > > - > > - foreach(const QString &scheme, > > Solid::Control::PowerManager::supportedSchemes()) { - =20 > > schemes.append(scheme + QString(", ")); > > - } > > - > > - if (!schemes.isEmpty()) { > > - schemes.remove(schemes.length() - 2, 2); > > - } else { > > - schemes =3D i18nc("None", "No methods found"); > > - } > > - > > - supportedSchemes->setText(schemes); > > - > >=20 > > bool dpms =3D false; > > =20 > > #ifdef HAVE_DPMS > >=20 > > Index: KDE/kdebase/workspace/solid/hal/halpower.cpp > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > --- KDE.orig/kdebase/workspace/solid/hal/halpower.cpp > > +++ KDE/kdebase/workspace/solid/hal/halpower.cpp > > @@ -72,52 +72,8 @@ HalPower::~HalPower() > >=20 > > qDeleteAll(m_buttons); > > =20 > > } > >=20 > > -QStringList HalPower::supportedSchemes() const > > +bool HalPower::setPowerSave(bool powersave) > >=20 > > { > >=20 > > - return QStringList() << "performance" << "powersaving"; > > -} > > - > > -QString HalPower::schemeDescription(const QString &schemeName) const > > -{ > > - if (schemeName=3D=3D"performance") > > - { > > - return "Use all the performances of the system"; > > - } > > - else if (schemeName=3D=3D"powersaving") > > - { > > - return "Try to keep as much power as possible to improve batte= ry > > life"; - } > > - else > > - { > > - return QString(); > > - } > > - > > - return QString(); > > -} > > - > > -QString HalPower::scheme() const > > -{ > > - // FIXME: We miss an accessor in HAL to make scheme management > > useful - return QString(); > > -} > > - > > -bool HalPower::setScheme(const QString &name) > > -{ > > - bool powersave; > > - > > - if (name=3D=3D"powersaving") > > - { > > - powersave =3D true; > > - } > > - else if (name=3D=3D"performance") > > - { > > - powersave =3D false; > > - } > > - else > > - { > > - return false; > > - } > > - > >=20 > > QDBusReply reply =3D m_halPowerManagement.call("SetPowerSave", > > powersave); > > =20 > > if (reply.isValid()) > >=20 > > Index: KDE/kdebase/workspace/solid/hal/halpower.h > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > --- KDE.orig/kdebase/workspace/solid/hal/halpower.h > > +++ KDE/kdebase/workspace/solid/hal/halpower.h > >=20 > > @@ -40,10 +40,7 @@ public: > > HalPower(QObject *parent, const QVariantList &args); > > virtual ~HalPower(); > >=20 > > - virtual QStringList supportedSchemes() const; > > - virtual QString schemeDescription(const QString &schemeName) const; > > - virtual QString scheme() const; > > - virtual bool setScheme(const QString &name); > > + virtual bool setPowerSave(bool powersave); > >=20 > > virtual Solid::Control::PowerManager::BatteryState batteryState() > > const; virtual int batteryChargePercent() const; > >=20 > > Index: KDE/kdebase/workspace/solid/solidshell/solid-powermanagement.cpp > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > --- KDE.orig/kdebase/workspace/solid/solidshell/solid-powermanagement.c= pp > > +++ KDE/kdebase/workspace/solid/solidshell/solid-powermanagement.cpp > > @@ -196,19 +196,15 @@ int main(int argc, char **argv) > >=20 > > cout << endl << i18n("Syntax:") << endl << endl; > >=20 > > - cout << " solid-powermanagement query (suspend|scheme|cpufreq)" > > << endl; + cout << " solid-powermanagement query > > (suspend|cpufreq)" << endl; > >=20 > > cout << i18n(" # List a particular set of information > > regarding power management.\n" > > =20 > > " # - If the 'suspend' option is > > specified, give the list of suspend\n" " = =20 > > # methods supported by the system\n" > >=20 > > - " # - If the 'scheme' option is > > specified, give the list of\n" - " # > > power management schemes supported by this system\n" > >=20 > > " # - If the 'cpufreq' option is > > specified, give the list of\n" " # > > supported CPU frequency policies\n") << endl; > >=20 > > - cout << " solid-powermanagement set (scheme|cpufreq) 'value'" << > > endl; + cout << " solid-powermanagement set (cpufreq) 'value'" << > > endl; > >=20 > > cout << i18n(" # Set power management options of the > > system.\n" > >=20 > > - " # - If the 'scheme' option is > > specified, the power management\n" - " # > > scheme set corresponds to 'value'\n" > >=20 > > " # - If the 'cpufreq' option is > > specified, the CPU frequency policy\n" " = =20 > > # set corresponds to 'value'\n") << endl; > >=20 > > @@ -257,10 +253,6 @@ bool SolidPowermanagement::doIt() > >=20 > > { > > =20 > > return shell.powerQuerySuspendMethods(); > > =20 > > } > >=20 > > - else if (type =3D=3D "scheme") > > - { > > - return shell.powerQuerySchemes(); > > - } > >=20 > > else if (type =3D=3D "cpufreq") > > { > > =20 > > return shell.powerQueryCpuPolicies(); > >=20 > > @@ -276,11 +268,7 @@ bool SolidPowermanagement::doIt() > >=20 > > QString type(args->arg(1)); > > QString value(args->arg(2)); > >=20 > > - if (type =3D=3D "scheme") > > - { > > - return shell.powerChangeScheme(value); > > - } > > - else if (type =3D=3D "cpufreq") > > + if (type =3D=3D "cpufreq") > >=20 > > { > > =20 > > return shell.powerChangeCpuPolicy(value); > > =20 > > } > >=20 > > @@ -380,41 +368,6 @@ bool SolidPowermanagement::powerSuspend( > >=20 > > } > > =20 > > } > >=20 > > -bool SolidPowermanagement::powerQuerySchemes() > > -{ > > - QString current =3D Solid::Control::PowerManager::scheme(); > > - QStringList schemes =3D > > Solid::Control::PowerManager::supportedSchemes(); - > > - foreach (const QString& scheme, schemes) > > - { > > - cout << scheme << " (" << > > Solid::Control::PowerManager::schemeDescription(scheme) << ")"; - > > - if (scheme=3D=3Dcurrent) > > - { > > - cout << " [*]" << endl; > > - } > > - else > > - { > > - cout << endl; > > - } > > - } > > - > > - return true; > > -} > > - > > -bool SolidPowermanagement::powerChangeScheme(const QString &schemeName) > > -{ > > - QStringList supported =3D > > Solid::Control::PowerManager::supportedSchemes(); - > > - if (!supported.contains(schemeName)) > > - { > > - cerr << i18n("Unsupported scheme: %1" , schemeName) << endl; > > - return false; > > - } > > - > > - return Solid::Control::PowerManager::setScheme(schemeName); > > -} > > - > >=20 > > bool SolidPowermanagement::powerQueryCpuPolicies() > > { > > =20 > > Solid::Control::PowerManager::CpuFreqPolicy current =3D > > Solid::Control::PowerManager::cpuFreqPolicy(); > >=20 > > Index: KDE/kdebase/workspace/solid/solidshell/solid-powermanagement.h > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > --- KDE.orig/kdebase/workspace/solid/solidshell/solid-powermanagement.h > > +++ KDE/kdebase/workspace/solid/solidshell/solid-powermanagement.h > >=20 > > @@ -45,9 +45,6 @@ public: > > bool powerQuerySuspendMethods(); > > bool powerSuspend(const QString &method); > >=20 > > - bool powerQuerySchemes(); > > - bool powerChangeScheme(const QString &schemeName); > > - > >=20 > > bool powerQueryCpuPolicies(); > > bool powerChangeCpuPolicy(const QString &policyName); > > >>=20 > > >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to > > >> unsubscribe << > >>=20 > >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to > >> unsubscribe << =2D-=20 =2D------------------ Dario Freddi KDE Developer GPG Key Signature: 511A9A3B --nextPart1954867.SUWSW2gqL3 Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iEYEABECAAYFAkuqLw8ACgkQaqeZcVEamjvOPwCePvGy9XV7SFADAbd0lFBkS7Ki BKAAnicKOgpu+QRe3QXV/V4++nAGIfPC =wL5m -----END PGP SIGNATURE----- --nextPart1954867.SUWSW2gqL3-- --===============0038085380== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe << --===============0038085380==--