-rw-r--r-- | core/launcher/desktop.cpp | 13 |
1 files changed, 11 insertions, 2 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 | |||
@@ -35,6 +35,7 @@ | |||
35 | #include <qpe/password.h> | 35 | #include <qpe/password.h> |
36 | #include <qpe/config.h> | 36 | #include <qpe/config.h> |
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> |
39 | #include <qpe/global.h> | 40 | #include <qpe/global.h> |
40 | #ifdef QT_QWS_CUSTOM | 41 | #ifdef QT_QWS_CUSTOM |
@@ -547,14 +548,21 @@ void Desktop::raiseEmail() | |||
547 | } | 548 | } |
548 | 549 | ||
549 | // autoStarts apps on resume and start | 550 | // autoStarts apps on resume and start |
550 | void Desktop::execAutoStart() | 551 | void Desktop::execAutoStart() { |
551 | { | ||
552 | QString appName; | 552 | QString appName; |
553 | int delay; | ||
554 | QDateTime now = QDateTime::currentDateTime(); | ||
553 | Config cfg( "autostart" ); | 555 | Config cfg( "autostart" ); |
554 | cfg.setGroup( "AutoStart" ); | 556 | cfg.setGroup( "AutoStart" ); |
555 | appName = cfg.readEntry("Apps", ""); | 557 | appName = cfg.readEntry("Apps", ""); |
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) ) { | ||
556 | QCopEnvelope e("QPE/System", "execute(QString)"); | 562 | QCopEnvelope e("QPE/System", "execute(QString)"); |
557 | e << QString(appName); | 563 | e << QString(appName); |
564 | } else { | ||
565 | } | ||
558 | } | 566 | } |
559 | 567 | ||
560 | #if defined(QPE_HAVE_TOGGLELIGHT) | 568 | #if defined(QPE_HAVE_TOGGLELIGHT) |
@@ -593,6 +601,7 @@ void Desktop::togglePower() | |||
593 | { | 601 | { |
594 | bool wasloggedin = loggedin; | 602 | bool wasloggedin = loggedin; |
595 | loggedin=0; | 603 | loggedin=0; |
604 | suspendTime = QDateTime::currentDateTime(); | ||
596 | darkScreen(); | 605 | darkScreen(); |
597 | if ( wasloggedin ) | 606 | if ( wasloggedin ) |
598 | blankScreen(); | 607 | blankScreen(); |