summaryrefslogtreecommitdiff
path: root/core/launcher/desktop.cpp
Side-by-side diff
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 @@
#include <qpe/power.h>
+#include <qpe/timeconversion.h>
#include <qpe/qcopenvelope_qws.h>
@@ -58,3 +59,3 @@ public:
QCopKeyRegister() : keyCode(0) { }
- QCopKeyRegister(int k, const QString &c, const QString &m)
+ QCopKeyRegister(int k, const QString &c, const QString &m)
: keyCode(k), channel(c), message(m) { }
@@ -170,6 +171,6 @@ void DesktopApplication::receive( const QCString &msg, const QByteArray &data )
stream >> m;
-
+
qWarning("KeyRegisterRecieved: %i, %s, %s", k, (const char*)c, (const char *)m);
keyRegisterList.append(QCopKeyRegister(k,c,m));
- }
+ }
else if (msg == "suspend()"){
@@ -177,3 +178,3 @@ void DesktopApplication::receive( const QCString &msg, const QByteArray &data )
}
-
+
}
@@ -279,3 +280,3 @@ bool DesktopApplication::qwsEventFilter( QWSEvent *e )
}
-
+
return QPEApplication::qwsEventFilter( e );
@@ -549,10 +550,17 @@ void Desktop::raiseEmail()
// autoStarts apps on resume and start
-void Desktop::execAutoStart()
-{
- QString appName;
- Config cfg( "autostart" );
- cfg.setGroup( "AutoStart" );
- appName = cfg.readEntry("Apps", "");
- QCopEnvelope e("QPE/System", "execute(QString)");
- e << QString(appName);
+void Desktop::execAutoStart() {
+ QString appName;
+ int delay;
+ QDateTime now = QDateTime::currentDateTime();
+ Config cfg( "autostart" );
+ cfg.setGroup( "AutoStart" );
+ appName = cfg.readEntry("Apps", "");
+ delay = (cfg.readEntry("Delay", "0" )).toInt();
+ // If the time between suspend and resume was longer then the
+ // value saved as delay, start the app
+ if ( suspendTime.secsTo(now) >= (delay*60) ) {
+ QCopEnvelope e("QPE/System", "execute(QString)");
+ e << QString(appName);
+ } else {
+ }
}
@@ -595,2 +603,3 @@ void Desktop::togglePower()
loggedin=0;
+ suspendTime = QDateTime::currentDateTime();
darkScreen();
@@ -598,6 +607,6 @@ void Desktop::togglePower()
blankScreen();
-
+
system("apm --suspend");
-
-
+
+