summaryrefslogtreecommitdiff
path: root/core/launcher/desktop.cpp
Unidiff
Diffstat (limited to 'core/launcher/desktop.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/desktop.cpp41
1 files changed, 25 insertions, 16 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp
index cf33011..43006f1 100644
--- a/core/launcher/desktop.cpp
+++ b/core/launcher/desktop.cpp
@@ -37,2 +37,3 @@
37#include <qpe/power.h> 37#include <qpe/power.h>
38#include <qpe/timeconversion.h>
38#include <qpe/qcopenvelope_qws.h> 39#include <qpe/qcopenvelope_qws.h>
@@ -58,3 +59,3 @@ public:
58 QCopKeyRegister() : keyCode(0) { } 59 QCopKeyRegister() : keyCode(0) { }
59 QCopKeyRegister(int k, const QString &c, const QString &m) 60 QCopKeyRegister(int k, const QString &c, const QString &m)
60 : keyCode(k), channel(c), message(m) { } 61 : keyCode(k), channel(c), message(m) { }
@@ -170,6 +171,6 @@ void DesktopApplication::receive( const QCString &msg, const QByteArray &data )
170 stream >> m; 171 stream >> m;
171 172
172 qWarning("KeyRegisterRecieved: %i, %s, %s", k, (const char*)c, (const char *)m); 173 qWarning("KeyRegisterRecieved: %i, %s, %s", k, (const char*)c, (const char *)m);
173 keyRegisterList.append(QCopKeyRegister(k,c,m)); 174 keyRegisterList.append(QCopKeyRegister(k,c,m));
174 } 175 }
175 else if (msg == "suspend()"){ 176 else if (msg == "suspend()"){
@@ -177,3 +178,3 @@ void DesktopApplication::receive( const QCString &msg, const QByteArray &data )
177 } 178 }
178 179
179} 180}
@@ -279,3 +280,3 @@ bool DesktopApplication::qwsEventFilter( QWSEvent *e )
279 } 280 }
280 281
281 return QPEApplication::qwsEventFilter( e ); 282 return QPEApplication::qwsEventFilter( e );
@@ -549,10 +550,17 @@ void Desktop::raiseEmail()
549// autoStarts apps on resume and start 550// autoStarts apps on resume and start
550void Desktop::execAutoStart() 551void Desktop::execAutoStart() {
551{ 552 QString appName;
552 QString appName; 553 int delay;
553 Config cfg( "autostart" ); 554 QDateTime now = QDateTime::currentDateTime();
554 cfg.setGroup( "AutoStart" ); 555 Config cfg( "autostart" );
555 appName = cfg.readEntry("Apps", ""); 556 cfg.setGroup( "AutoStart" );
556 QCopEnvelope e("QPE/System", "execute(QString)"); 557 appName = cfg.readEntry("Apps", "");
557 e << QString(appName); 558 delay = (cfg.readEntry("Delay", "0" )).toInt();
559 // If the time between suspend and resume was longer then the
560 // value saved as delay, start the app
561 if ( suspendTime.secsTo(now) >= (delay*60) ) {
562 QCopEnvelope e("QPE/System", "execute(QString)");
563 e << QString(appName);
564 } else {
565 }
558} 566}
@@ -595,2 +603,3 @@ void Desktop::togglePower()
595 loggedin=0; 603 loggedin=0;
604 suspendTime = QDateTime::currentDateTime();
596 darkScreen(); 605 darkScreen();
@@ -598,6 +607,6 @@ void Desktop::togglePower()
598 blankScreen(); 607 blankScreen();
599 608
600 system("apm --suspend"); 609 system("apm --suspend");
601 610
602 611
603 612