-rw-r--r-- | core/launcher/serverapp.cpp | 106 |
1 files changed, 58 insertions, 48 deletions
diff --git a/core/launcher/serverapp.cpp b/core/launcher/serverapp.cpp index f1bce40..a2302d8 100644 --- a/core/launcher/serverapp.cpp +++ b/core/launcher/serverapp.cpp | |||
@@ -60,3 +60,4 @@ static int loggedin=0; | |||
60 | QCopKeyRegister::QCopKeyRegister() | 60 | QCopKeyRegister::QCopKeyRegister() |
61 | : m_keyCode( 0 ) { | 61 | : m_keyCode( 0 ) |
62 | { | ||
62 | } | 63 | } |
@@ -64,6 +65,8 @@ QCopKeyRegister::QCopKeyRegister() | |||
64 | QCopKeyRegister::QCopKeyRegister( int k, const QCString& c, const QCString& m ) | 65 | QCopKeyRegister::QCopKeyRegister( int k, const QCString& c, const QCString& m ) |
65 | :m_keyCode( k ), m_channel( c ), m_message( m ) { | 66 | :m_keyCode( k ), m_channel( c ), m_message( m ) |
67 | { | ||
66 | } | 68 | } |
67 | 69 | ||
68 | int QCopKeyRegister::keyCode()const { | 70 | int QCopKeyRegister::keyCode() const |
71 | { | ||
69 | return m_keyCode; | 72 | return m_keyCode; |
@@ -71,3 +74,4 @@ int QCopKeyRegister::keyCode()const { | |||
71 | 74 | ||
72 | QCString QCopKeyRegister::channel()const { | 75 | QCString QCopKeyRegister::channel() const |
76 | { | ||
73 | return m_channel; | 77 | return m_channel; |
@@ -75,3 +79,4 @@ QCString QCopKeyRegister::channel()const { | |||
75 | 79 | ||
76 | QCString QCopKeyRegister::message()const { | 80 | QCString QCopKeyRegister::message() const |
81 | { | ||
77 | return m_message; | 82 | return m_message; |
@@ -79,3 +84,4 @@ QCString QCopKeyRegister::message()const { | |||
79 | 84 | ||
80 | bool QCopKeyRegister::send() { | 85 | bool QCopKeyRegister::send() |
86 | { | ||
81 | if (m_channel.isNull() ) | 87 | if (m_channel.isNull() ) |
@@ -159,3 +165,4 @@ void KeyFilter::timerEvent(QTimerEvent* e) | |||
159 | 165 | ||
160 | void KeyFilter::registerKey( const QCopKeyRegister& key ) { | 166 | void KeyFilter::registerKey( const QCopKeyRegister& key ) |
167 | { | ||
161 | m_keys.insert( key.keyCode(), key ); | 168 | m_keys.insert( key.keyCode(), key ); |
@@ -163,3 +170,4 @@ void KeyFilter::registerKey( const QCopKeyRegister& key ) { | |||
163 | 170 | ||
164 | void KeyFilter::unregisterKey( const QCopKeyRegister& key ) { | 171 | void KeyFilter::unregisterKey( const QCopKeyRegister& key ) |
172 | { | ||
165 | m_keys.remove( key.keyCode() ); | 173 | m_keys.remove( key.keyCode() ); |
@@ -167,3 +175,4 @@ void KeyFilter::unregisterKey( const QCopKeyRegister& key ) { | |||
167 | 175 | ||
168 | bool KeyFilter::keyRegistered( int key ) { | 176 | bool KeyFilter::keyRegistered( int key ) |
177 | { | ||
169 | /* | 178 | /* |
@@ -175,3 +184,2 @@ bool KeyFilter::keyRegistered( int key ) { | |||
175 | return true; | 184 | return true; |
176 | |||
177 | } | 185 | } |
@@ -197,4 +205,3 @@ bool KeyFilter::checkButtonAction(bool db, int keycode, int press, int autoRepe | |||
197 | return true; | 205 | return true; |
198 | }else { | 206 | } else { |
199 | |||
200 | 207 | ||
@@ -268,3 +275,4 @@ bool ServerApplication::ms_is_starting = TRUE; | |||
268 | 275 | ||
269 | void ServerApplication::switchLCD( bool on ) { | 276 | void ServerApplication::switchLCD( bool on ) |
277 | { | ||
270 | if ( !qApp ) | 278 | if ( !qApp ) |
@@ -280,3 +288,3 @@ void ServerApplication::switchLCD( bool on ) { | |||
280 | dapp-> m_screensaver-> setBacklight ( -3 ); | 288 | dapp-> m_screensaver-> setBacklight ( -3 ); |
281 | }else | 289 | } else |
282 | dapp-> m_screensaver-> setDisplayState ( false ); | 290 | dapp-> m_screensaver-> setDisplayState ( false ); |
@@ -361,3 +369,2 @@ ServerApplication::~ServerApplication() | |||
361 | 369 | ||
362 | |||
363 | delete pa; | 370 | delete pa; |
@@ -367,3 +374,4 @@ ServerApplication::~ServerApplication() | |||
367 | 374 | ||
368 | void ServerApplication::apmTimeout() { | 375 | void ServerApplication::apmTimeout() |
376 | { | ||
369 | serverApp-> checkMemory( ); // in case no events are generated | 377 | serverApp-> checkMemory( ); // in case no events are generated |
@@ -410,3 +418,4 @@ void ServerApplication::apmTimeout() { | |||
410 | void ServerApplication::systemMessage( const QCString& msg, | 418 | void ServerApplication::systemMessage( const QCString& msg, |
411 | const QByteArray& data ) { | 419 | const QByteArray& data ) |
420 | { | ||
412 | QDataStream stream ( data, IO_ReadOnly ); | 421 | QDataStream stream ( data, IO_ReadOnly ); |
@@ -523,16 +532,16 @@ namespace { | |||
523 | QString appName; | 532 | QString appName; |
524 | int delay; | 533 | int delay; |
525 | QDateTime now = QDateTime::currentDateTime(); | 534 | QDateTime now = QDateTime::currentDateTime(); |
526 | 535 | ||
527 | Config cfg( "autostart" ); | 536 | Config cfg( "autostart" ); |
528 | cfg.setGroup( "AutoStart" ); | 537 | cfg.setGroup( "AutoStart" ); |
529 | appName = cfg.readEntry( "Apps", "" ); | 538 | appName = cfg.readEntry( "Apps", "" ); |
530 | delay = cfg.readNumEntry( "Delay", 0 ); | 539 | delay = cfg.readNumEntry( "Delay", 0 ); |
531 | 540 | ||
532 | // If the time between suspend and resume was longer then the | 541 | // If the time between suspend and resume was longer then the |
533 | // value saved as delay, start the app | 542 | // value saved as delay, start the app |
534 | if ( suspendTime.secsTo( now ) >= ( delay * 60 ) && !appName.isEmpty() ) { | 543 | if ( suspendTime.secsTo( now ) >= ( delay * 60 ) && !appName.isEmpty() ) { |
535 | QCopEnvelope e( "QPE/System", "execute(QString)" ); | 544 | QCopEnvelope e( "QPE/System", "execute(QString)" ); |
536 | e << QString( appName ); | 545 | e << QString( appName ); |
537 | } | 546 | } |
538 | } | 547 | } |
@@ -555,3 +564,2 @@ void ServerApplication::togglePower() | |||
555 | #ifdef QWS | 564 | #ifdef QWS |
556 | |||
557 | if ( Opie::Security::MultiauthPassword::needToAuthenticate ( true ) && qt_screen ) { | 565 | if ( Opie::Security::MultiauthPassword::needToAuthenticate ( true ) && qt_screen ) { |
@@ -618,14 +626,15 @@ bool ServerApplication::qwsEventFilter( QWSEvent *e ) | |||
618 | if ( e->type == QWSEvent::Mouse ) { | 626 | if ( e->type == QWSEvent::Mouse ) { |
619 | QWSMouseEvent *me = (QWSMouseEvent *)e; | 627 | QWSMouseEvent *me = (QWSMouseEvent *)e; |
620 | static bool up = TRUE; | 628 | static bool up = TRUE; |
621 | if ( me->simpleData.state&LeftButton ) { | 629 | if ( me->simpleData.state&LeftButton ) { |
622 | if ( up ) { | 630 | if ( up ) { |
623 | up = FALSE; | 631 | up = FALSE; |
624 | screenClick(TRUE); | 632 | screenClick(TRUE); |
633 | } | ||
634 | } else if ( !up ) { | ||
635 | up = TRUE; | ||
636 | screenClick(FALSE); | ||
625 | } | 637 | } |
626 | } else if ( !up ) { | 638 | } else |
627 | up = TRUE; | 639 | if ( e->type == QWSEvent::Key ) { |
628 | screenClick(FALSE); | ||
629 | } | ||
630 | }else if ( e->type == QWSEvent::Key ) { | ||
631 | QWSKeyEvent * ke = static_cast<QWSKeyEvent*>( e ); | 640 | QWSKeyEvent * ke = static_cast<QWSKeyEvent*>( e ); |
@@ -652,4 +661,5 @@ void ServerApplication::showSafeMode() | |||
652 | "You can use the Plugin Manager to " | 661 | "You can use the Plugin Manager to " |
653 | "disable plugins that cause system error."), tr("OK"), tr("Plugin Manager..."), 0) == 1 ) { | 662 | "disable plugins that cause system error."), tr("OK"), tr("Plugin Manager..."), 0) == 1 ) |
654 | Global::execute( "pluginmanager" ); | 663 | { |
664 | Global::execute( "pluginmanager" ); | ||
655 | } | 665 | } |
@@ -667,3 +677,3 @@ void ServerApplication::clearSafeMode() | |||
667 | if ( mode == "MaybeSafe" ) { | 677 | if ( mode == "MaybeSafe" ) { |
668 | cfg.writeEntry( "Mode", "Normal" ); | 678 | cfg.writeEntry( "Mode", "Normal" ); |
669 | } | 679 | } |
@@ -676,3 +686,3 @@ void ServerApplication::shutdown() | |||
676 | if ( type() != GuiServer ) | 686 | if ( type() != GuiServer ) |
677 | return; | 687 | return; |
678 | ShutdownImpl *sd = new ShutdownImpl( 0, 0, WDestructiveClose ); | 688 | ShutdownImpl *sd = new ShutdownImpl( 0, 0, WDestructiveClose ); |
@@ -731,5 +741,5 @@ void ServerApplication::restart() | |||
731 | emit aboutToQuit(); | 741 | emit aboutToQuit(); |
732 | prepareForTermination(TRUE); | 742 | prepareForTermination(TRUE); |
733 | doRestart = TRUE; | 743 | doRestart = TRUE; |
734 | quit(); | 744 | quit(); |
735 | #else | 745 | #else |