summaryrefslogtreecommitdiff
authorharlekin <harlekin>2002-08-27 21:11:47 (UTC)
committer harlekin <harlekin>2002-08-27 21:11:47 (UTC)
commita6432554a1e64d54c53c1400aa1dfa11ae83f11a (patch) (unidiff)
treebaae8b562962d952904e07a5b2317041a9e37ede
parent86352e32f449ecf00de254674b7dcac72bc34a14 (diff)
downloadopie-a6432554a1e64d54c53c1400aa1dfa11ae83f11a.zip
opie-a6432554a1e64d54c53c1400aa1dfa11ae83f11a.tar.gz
opie-a6432554a1e64d54c53c1400aa1dfa11ae83f11a.tar.bz2
small fix for autostart
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/desktop.cpp35
1 files changed, 17 insertions, 18 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp
index 552c7c3..fb10602 100644
--- a/core/launcher/desktop.cpp
+++ b/core/launcher/desktop.cpp
@@ -199,11 +199,11 @@ bool DesktopApplication::qwsEventFilter( QWSEvent *e )
199 app that registers key/message to be sent back to the app, when it doesn't have focus, 199 app that registers key/message to be sent back to the app, when it doesn't have focus,
200 when user presses key, unless keyboard has been requested from app. 200 when user presses key, unless keyboard has been requested from app.
201 will not send multiple repeats if user holds key 201 will not send multiple repeats if user holds key
202 i.e. one shot 202 i.e. one shot
203 203
204 */ 204 */
205 if (!keyRegisterList.isEmpty()) { 205 if (!keyRegisterList.isEmpty()) {
206 KeyRegisterList::Iterator it; 206 KeyRegisterList::Iterator it;
207 for( it = keyRegisterList.begin(); it != keyRegisterList.end(); ++it ) { 207 for( it = keyRegisterList.begin(); it != keyRegisterList.end(); ++it ) {
208 if ((*it).getKeyCode() == ke->simpleData.keycode && !autoRepeat && !keyboardGrabbed() && press) { 208 if ((*it).getKeyCode() == ke->simpleData.keycode && !autoRepeat && !keyboardGrabbed() && press) {
209 if(press) qDebug("press"); else qDebug("release"); 209 if(press) qDebug("press"); else qDebug("release");
@@ -249,9 +249,9 @@ bool DesktopApplication::qwsEventFilter( QWSEvent *e )
249 if ( ke->simpleData.keycode == Key_F34 ) { 249 if ( ke->simpleData.keycode == Key_F34 ) {
250 if ( press ) emit power(); 250 if ( press ) emit power();
251 return TRUE; 251 return TRUE;
252 } 252 }
253// This was used for the iPAQ PowerButton 253// This was used for the iPAQ PowerButton
254// See main.cpp for new KeyboardFilter 254// See main.cpp for new KeyboardFilter
255// 255//
256// if ( ke->simpleData.keycode == Key_SysReq ) { 256// if ( ke->simpleData.keycode == Key_SysReq ) {
257// if ( press ) emit power(); 257// if ( press ) emit power();
@@ -558,17 +558,16 @@ void Desktop::execAutoStart() {
558 int delay; 558 int delay;
559 QDateTime now = QDateTime::currentDateTime(); 559 QDateTime now = QDateTime::currentDateTime();
560 Config cfg( "autostart" ); 560 Config cfg( "autostart" );
561 cfg.setGroup( "AutoStart" ); 561 cfg.setGroup( "AutoStart" );
562 appName = cfg.readEntry("Apps", ""); 562 appName = cfg.readEntry( "Apps", "" );
563 delay = (cfg.readEntry("Delay", "0" )).toInt(); 563 delay = ( cfg.readEntry( "Delay", "0" ) ).toInt();
564 // If the time between suspend and resume was longer then the 564 // If the time between suspend and resume was longer then the
565 // value saved as delay, start the app 565 // value saved as delay, start the app
566 if ( suspendTime.secsTo(now) >= (delay*60) ) { 566 if ( suspendTime.secsTo( now ) >= ( delay * 60 ) && !appName.isEmpty() ) {
567 QCopEnvelope e("QPE/System", "execute(QString)"); 567 QCopEnvelope e( "QPE/System", "execute(QString)" );
568 e << QString(appName); 568 e << QString( appName );
569 } //else { 569 }
570 //}
571} 570}
572 571
573#if defined(QPE_HAVE_TOGGLELIGHT) 572#if defined(QPE_HAVE_TOGGLELIGHT)
574#include <qpe/config.h> 573#include <qpe/config.h>
@@ -606,12 +605,12 @@ void Desktop::togglePower()
606{ 605{
607 extern void qpe_setBacklight ( int ); // We need to toggle the LCD fast - no time to send a QCop 606 extern void qpe_setBacklight ( int ); // We need to toggle the LCD fast - no time to send a QCop
608 607
609 static bool excllock = false; 608 static bool excllock = false;
610 609
611 if ( excllock ) 610 if ( excllock )
612 return; 611 return;
613 612
614 excllock = true; 613 excllock = true;
615 614
616 bool wasloggedin = loggedin; 615 bool wasloggedin = loggedin;
617 loggedin=0; 616 loggedin=0;
@@ -637,11 +636,11 @@ void Desktop::togglePower()
637 636
638 execAutoStart(); 637 execAutoStart();
639 //qcopBridge->closeOpenConnections(); 638 //qcopBridge->closeOpenConnections();
640 //qDebug("called togglePower()!!!!!!"); 639 //qDebug("called togglePower()!!!!!!");
641 640
642 qApp-> processEvents ( ); 641 qApp-> processEvents ( );
643 642
644 excllock = false; 643 excllock = false;
645} 644}
646 645
647void Desktop::toggleLight() 646void Desktop::toggleLight()
@@ -699,14 +698,14 @@ void DesktopApplication::shutdown( ShutdownImpl::Type t )
699 restart(); 698 restart();
700 break; 699 break;
701 case ShutdownImpl::TerminateDesktop: 700 case ShutdownImpl::TerminateDesktop:
702 prepareForTermination(FALSE); 701 prepareForTermination(FALSE);
703 702
704 // This is a workaround for a Qt bug 703 // This is a workaround for a Qt bug
705 // clipboard applet has to stop its poll timer, or Qt/E 704 // clipboard applet has to stop its poll timer, or Qt/E
706 // will hang on quit() right before it emits aboutToQuit() 705 // will hang on quit() right before it emits aboutToQuit()
707 emit aboutToQuit ( ); 706 emit aboutToQuit ( );
708 707
709 quit(); 708 quit();
710 break; 709 break;
711 } 710 }
712} 711}
@@ -797,9 +796,9 @@ bool Desktop::eventFilter( QObject *, QEvent *ev )
797 if ( ev-> type ( ) == QEvent::KeyPress ) { 796 if ( ev-> type ( ) == QEvent::KeyPress ) {
798 QKeyEvent *ke = (QKeyEvent *) ev; 797 QKeyEvent *ke = (QKeyEvent *) ev;
799 if ( ke-> key ( ) == Qt::Key_F11 ) { // menu key 798 if ( ke-> key ( ) == Qt::Key_F11 ) { // menu key
800 QWidget *active = qApp-> activeWindow ( ); 799 QWidget *active = qApp-> activeWindow ( );
801 800
802 if ( active && active-> isPopup ( )) 801 if ( active && active-> isPopup ( ))
803 active->close(); 802 active->close();
804 803
805 raiseMenu ( ); 804 raiseMenu ( );