diff options
Diffstat (limited to 'ksmserver/server.cpp')
-rw-r--r-- | ksmserver/server.cpp | 65 |
1 files changed, 50 insertions, 15 deletions
diff --git a/ksmserver/server.cpp b/ksmserver/server.cpp index aee40fcaa..b41adc551 100644 --- a/ksmserver/server.cpp +++ b/ksmserver/server.cpp @@ -69,12 +69,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include <tdelocale.h> #include <tdeglobal.h> #include <tdeconfig.h> -#include <kstandarddirs.h> +#include <tdestandarddirs.h> #include <unistd.h> #include <tdeapplication.h> #include <kstaticdeleter.h> #include <tdetempfile.h> -#include <kprocess.h> +#include <tdeprocess.h> #include <dcopclient.h> #include <dcopref.h> @@ -514,8 +514,8 @@ static void sighandler(int sig) delete server; } - if (kapp) { - kapp->quit(); + if (tdeApp) { + tdeApp->quit(); } //::exit(0); } @@ -603,9 +603,9 @@ KSMServer::KSMServer( const TQString& windowManager, const TQString& windowManag hwDevices = TDEGlobal::hardwareDevices(); #endif - connect( &knotifyTimeoutTimer, TQT_SIGNAL( timeout()), TQT_SLOT( knotifyTimeout())); - connect( &startupSuspendTimeoutTimer, TQT_SIGNAL( timeout()), TQT_SLOT( startupSuspendTimeout())); - connect( &pendingShutdown, TQT_SIGNAL( timeout()), TQT_SLOT( pendingShutdownTimeout())); + connect( &knotifyTimeoutTimer, TQ_SIGNAL( timeout()), TQ_SLOT( knotifyTimeout())); + connect( &startupSuspendTimeoutTimer, TQ_SIGNAL( timeout()), TQ_SLOT( startupSuspendTimeout())); + connect( &pendingShutdown, TQ_SIGNAL( timeout()), TQ_SLOT( pendingShutdownTimeout())); only_local = _only_local; #ifdef HAVE__ICETRANSNOLISTEN @@ -676,7 +676,7 @@ KSMServer::KSMServer( const TQString& windowManager, const TQString& windowManag for ( int i = 0; i < numTransports; i++) { con = new KSMListener( listenObjs[i] ); listener.append( con ); - connect( con, TQT_SIGNAL( activated(int) ), this, TQT_SLOT( newConnection(int) ) ); + connect( con, TQ_SIGNAL( activated(int) ), this, TQ_SLOT( newConnection(int) ) ); } signal(SIGHUP, sighandler); @@ -684,11 +684,13 @@ KSMServer::KSMServer( const TQString& windowManager, const TQString& windowManag signal(SIGINT, sighandler); signal(SIGPIPE, SIG_IGN); - connect( ¬ificationTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( notificationTimeout() ) ); - connect( &protectionTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( protectionTimerTick() ) ); - connect( &restoreTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( tryRestoreNext() ) ); - connect( &shutdownTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( timeoutQuit() ) ); - connect( kapp, TQT_SIGNAL( shutDown() ), this, TQT_SLOT( cleanUp() ) ); + connect( ¬ificationTimer, TQ_SIGNAL( timeout() ), this, TQ_SLOT( notificationTimeout() ) ); + connect( &protectionTimer, TQ_SIGNAL( timeout() ), this, TQ_SLOT( protectionTimerTick() ) ); + connect( &restoreTimer, TQ_SIGNAL( timeout() ), this, TQ_SLOT( tryRestoreNext() ) ); + connect( &shutdownTimer, TQ_SIGNAL( timeout() ), this, TQ_SLOT( timeoutQuit() ) ); + connect( tdeApp, TQ_SIGNAL( shutDown() ), this, TQ_SLOT( cleanUp() ) ); + + reconfigure(); } KSMServer::~KSMServer() @@ -697,6 +699,16 @@ KSMServer::~KSMServer() cleanUp(); } +void KSMServer::reconfigure() +{ + // respect lock on resume & disable suspend/hibernate settings + // from power-manager + TDEConfig cfg("power-managerrc"); + m_disableSuspend = cfg.readBoolEntry("disableSuspend", false); + m_disableHibernate = cfg.readBoolEntry("disableHibernate", false); + m_lockOnResume = cfg.readBoolEntry("lockOnResume", true); +} + void KSMServer::cleanUp() { if (clean) return; @@ -742,7 +754,7 @@ void KSMServer::cleanUp() void* KSMServer::watchConnection( IceConn iceConn ) { KSMConnection* conn = new KSMConnection( iceConn ); - connect( conn, TQT_SIGNAL( activated(int) ), this, TQT_SLOT( processData(int) ) ); + connect( conn, TQ_SIGNAL( activated(int) ), this, TQ_SLOT( processData(int) ) ); return (void*) conn; } @@ -919,6 +931,29 @@ void KSMServer::storeSession() config->sync(); } +TQStringList KSMServer::suspendOptions() +{ + reconfigure(); + + TQStringList sopt; + +#ifdef WITH_TDEHWLIB + TDERootSystemDevice* rootDevice = hwDevices->rootSystemDevice(); + if (rootDevice->canFreeze() && !m_disableSuspend) + sopt << "freeze"; + + if (rootDevice->canSuspend() && !m_disableSuspend) + sopt << "suspend"; + + if (rootDevice->canHibernate() && !m_disableHibernate) + sopt << "hibernate"; + + if (rootDevice->canHybridSuspend() && !m_disableSuspend && !m_disableHibernate) + sopt << "hybridSuspend"; +#endif + + return sopt; +} TQStringList KSMServer::sessionList() { @@ -995,4 +1030,4 @@ bool KSMServer::defaultSession() const bool KSMServer::startupCompleted() { return m_startupCompleted; -} +}
\ No newline at end of file |