pull/1/head
Darrell Anderson 11 years ago
parent 70932ba22c
commit a14f98704b

@ -204,17 +204,17 @@
* src/hardware.cpp: If the desktop session (if detected * src/hardware.cpp: If the desktop session (if detected
via ConsoleKit) get inactive call releasePolicyPowerIface() via ConsoleKit) get inactive call releasePolicyPowerIface()
and if the session is active again try to aquire the and if the session is active again try to acquire the
org.freedesktop.Policy.Power interface again. org.freedesktop.Policy.Power interface again.
This should happen: This should happen:
- the session get inactive: - the session get inactive:
- release org.freedesktop.Policy.Power: - release org.freedesktop.Policy.Power:
powersaved or if there is an other desktop session powersaved or if there is an other desktop session
an other KPowersave instance can aquire the name and an other KPowersave instance can acquire the name and
handle powermanagement. handle powermanagement.
- the session get active again: - the session get active again:
- the current active KPowersave instance aquire the - the current active KPowersave instance acquire the
interface/name from powersaved (if there is an other interface/name from powersaved (if there is an other
KPowersave instance holding the name it should release KPowersave instance holding the name it should release
the name ...) and handle powermanagement again. the name ...) and handle powermanagement again.
@ -230,7 +230,7 @@
2007-08-20 Danny Kukawka <danny.kukawka@web.de> 2007-08-20 Danny Kukawka <danny.kukawka@web.de>
* src/dbusHAL.[cpp,h]: Split up the code to aquire the * src/dbusHAL.[cpp,h]: Split up the code to acquire the
org.freedesktop.Policy.Power name service to a new own org.freedesktop.Policy.Power name service to a new own
function. Added new function to release the service function. Added new function to release the service
name again. Call now dbus_bus_release_name() if close() name again. Call now dbus_bus_release_name() if close()
@ -2011,7 +2011,7 @@
2006-11-19 Danny Kukawka <danny.kukawka@web.de> 2006-11-19 Danny Kukawka <danny.kukawka@web.de>
* TODO: removed done issues * TODO: removed done issues
* src/dbusHAL.[cpp,h]: Added code to claim/aquire the * src/dbusHAL.[cpp,h]: Added code to claim/acquire the
org.freedesktop.Policy.Power interface from D-Bus to stop org.freedesktop.Policy.Power interface from D-Bus to stop
the powersave daemon/client and to be allowed to handle the powersave daemon/client and to be allowed to handle
the powermanagement policy. the powermanagement policy.

@ -84,7 +84,7 @@ Mon Aug 20 18:10:39 CEST 2007 - dkukawka@suse.de
- added code to check if the current desktop session is avtive - added code to check if the current desktop session is avtive
and handle if the session get inactive (for more see Changelog and handle if the session get inactive (for more see Changelog
of the pacakge) of the pacakge)
- added code to release/aquire org.freedesktop.Policy.Power if - added code to release/acquire org.freedesktop.Policy.Power if
the session get inactive/active to allow powersaved or other the session get inactive/active to allow powersaved or other
active KPowersave instances to handle powermanagement active KPowersave instances to handle powermanagement
- fixed parameter types for call of SetPowerSave() on HAL - fixed parameter types for call of SetPowerSave() on HAL

@ -42,7 +42,7 @@ dbusInterface::dbusInterface(){
kdDebugFuncIn(trace); kdDebugFuncIn(trace);
dbus_is_connected = false; dbus_is_connected = false;
aquiredPolicyPower = false; acquiredPolicyPower = false;
// add pointer to this for filter_function() // add pointer to this for filter_function()
myInstance=this; myInstance=this;
@ -79,11 +79,11 @@ bool dbusInterface::isConnectedToDBUS() {
* This function return information if the org.freedesktop.Policy.Power * This function return information if the org.freedesktop.Policy.Power
* interface was claimed. * interface was claimed.
* \return boolean with the status of claim the interface * \return boolean with the status of claim the interface
* \retval true if aquired * \retval true if acquired
* \retval false if not * \retval false if not
*/ */
bool dbusInterface::aquiredPolicyPowerInterface() { bool dbusInterface::acquiredPolicyPowerInterface() {
return aquiredPolicyPower; return acquiredPolicyPower;
} }
/*! /*!
@ -145,7 +145,7 @@ bool dbusInterface::initDBUS(){
return false; return false;
} }
aquirePolicyPowerIface(); acquirePolicyPowerIface();
dbus_connection_set_exit_on_disconnect( dbus_connection, false ); dbus_connection_set_exit_on_disconnect( dbus_connection, false );
@ -175,12 +175,12 @@ bool dbusInterface::initDBUS(){
} }
/*! /*!
* This function aquire the org.freedesktop.Policy.Power interface * This function acquire the org.freedesktop.Policy.Power interface
* \return boolean with the result of the operation * \return boolean with the result of the operation
* \retval true if successful aquired the interface * \retval true if successful acquired the interface
* \retval false if unsuccessful * \retval false if unsuccessful
*/ */
bool dbusInterface::aquirePolicyPowerIface(){ bool dbusInterface::acquirePolicyPowerIface(){
kdDebugFuncIn(trace); kdDebugFuncIn(trace);
if (dbus_connection == NULL) { if (dbus_connection == NULL) {
@ -192,26 +192,26 @@ bool dbusInterface::aquirePolicyPowerIface(){
DBUS_NAME_FLAG_REPLACE_EXISTING, NULL)) { DBUS_NAME_FLAG_REPLACE_EXISTING, NULL)) {
case DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER: case DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER:
kdDebug() << "Acquired org.freedesktop.Policy.Power interface" << endl; kdDebug() << "Acquired org.freedesktop.Policy.Power interface" << endl;
aquiredPolicyPower = true; acquiredPolicyPower = true;
break; break;
case DBUS_REQUEST_NAME_REPLY_IN_QUEUE: case DBUS_REQUEST_NAME_REPLY_IN_QUEUE:
kdWarning() << "Queued to aquire org.freedesktop.Policy.Power interface" << endl; kdWarning() << "Queued to acquire org.freedesktop.Policy.Power interface" << endl;
aquiredPolicyPower = false; acquiredPolicyPower = false;
break; break;
default: default:
kdWarning() << "Unknown error while aquire org.freedesktop.Policy.Power interface" << endl; kdWarning() << "Unknown error while acquire org.freedesktop.Policy.Power interface" << endl;
aquiredPolicyPower = false; acquiredPolicyPower = false;
break; break;
} }
kdDebugFuncOut(trace); kdDebugFuncOut(trace);
return aquiredPolicyPower; return acquiredPolicyPower;
} }
/*! /*!
* This function release the org.freedesktop.Policy.Power interface * This function release the org.freedesktop.Policy.Power interface
* \return boolean with the result of the operation * \return boolean with the result of the operation
* \retval true if successful aquired the interface * \retval true if successful acquired the interface
* \retval false if unsuccessful * \retval false if unsuccessful
*/ */
bool dbusInterface::releasePolicyPowerIface(){ bool dbusInterface::releasePolicyPowerIface(){
@ -238,7 +238,7 @@ bool dbusInterface::releasePolicyPowerIface(){
case DBUS_RELEASE_NAME_REPLY_RELEASED: case DBUS_RELEASE_NAME_REPLY_RELEASED:
kdDebug() << "Released org.freedesktop.Policy.Power interface" << endl; kdDebug() << "Released org.freedesktop.Policy.Power interface" << endl;
retval = true; retval = true;
aquiredPolicyPower = false; acquiredPolicyPower = false;
break; break;
case DBUS_RELEASE_NAME_REPLY_NOT_OWNER: case DBUS_RELEASE_NAME_REPLY_NOT_OWNER:
kdWarning() << "Couldn't release org.freedesktop.Policy.Power, not the owner" << endl; kdWarning() << "Couldn't release org.freedesktop.Policy.Power, not the owner" << endl;
@ -502,9 +502,9 @@ void dbusInterface::emitMsgReceived( msg_type type, TQString message, TQString s
if (type == POLICY_POWER_OWNER_CHANGED) { if (type == POLICY_POWER_OWNER_CHANGED) {
if (message.startsWith("NOW_OWNER")) if (message.startsWith("NOW_OWNER"))
aquiredPolicyPower = true; acquiredPolicyPower = true;
else else
aquiredPolicyPower = false; acquiredPolicyPower = false;
} }
emit msgReceived_withStringString( type, message, string ); emit msgReceived_withStringString( type, message, string );

@ -89,10 +89,10 @@ private:
/*! /*!
* This boolean represent information if KPowersave could claim the * This boolean represent information if KPowersave could claim the
* org.freedesktop.Policy.Power interface from the D-Bus * org.freedesktop.Policy.Power interface from the D-Bus
* \li true: if aquired * \li true: if acquired
* \li false: if not * \li false: if not
*/ */
bool aquiredPolicyPower; bool acquiredPolicyPower;
/* D-Bus helper functions */ /* D-Bus helper functions */
//! to initialise the connection to D-Bus //! to initialise the connection to D-Bus
@ -114,8 +114,8 @@ public:
//! to close the connection to D-Bus and HAL //! to close the connection to D-Bus and HAL
bool close(); bool close();
//! to aquire the org.freedesktop.Policy.Power interface //! to acquire the org.freedesktop.Policy.Power interface
bool aquirePolicyPowerIface(); bool acquirePolicyPowerIface();
//! to release the org.freedesktop.Policy.Power interface //! to release the org.freedesktop.Policy.Power interface
bool releasePolicyPowerIface(); bool releasePolicyPowerIface();
//! to check if the org.freedesktop.Policy.Power interface has an owner //! to check if the org.freedesktop.Policy.Power interface has an owner
@ -125,7 +125,7 @@ public:
//! to get information if KPowersave is connected to D-Bus //! to get information if KPowersave is connected to D-Bus
bool isConnectedToDBUS(); bool isConnectedToDBUS();
//! to get info about claim org.freedesktop.Policy.Power interface //! to get info about claim org.freedesktop.Policy.Power interface
bool aquiredPolicyPowerInterface(); bool acquiredPolicyPowerInterface();
//! return the current DBus connection //! return the current DBus connection
DBusConnection *get_DBUS_connection(); DBusConnection *get_DBUS_connection();

@ -1264,11 +1264,11 @@ void HardwareInfo::emitS2diskButtonPressed() {
*/ */
void HardwareInfo::emitSessionActiveState() { void HardwareInfo::emitSessionActiveState() {
if (sessionIsActive) { if (sessionIsActive) {
if (!dbus_HAL->aquiredPolicyPowerInterface()) { if (!dbus_HAL->acquiredPolicyPowerInterface()) {
dbus_HAL->aquirePolicyPowerIface(); dbus_HAL->acquirePolicyPowerIface();
} }
} else { } else {
if (dbus_HAL->aquiredPolicyPowerInterface()) { if (dbus_HAL->acquiredPolicyPowerInterface()) {
dbus_HAL->releasePolicyPowerIface(); dbus_HAL->releasePolicyPowerIface();
} }
} }

Loading…
Cancel
Save