summaryrefslogtreecommitdiff
path: root/core/launcher/serverapp.cpp
authorschurig <schurig>2004-09-10 08:04:41 (UTC)
committer schurig <schurig>2004-09-10 08:04:41 (UTC)
commit1ce7786a16ee7b9679391090eeedc4cbcaab81ca (patch) (unidiff)
tree93e562be7ff03ade88d3cc9838c8420a02a5ff8d /core/launcher/serverapp.cpp
parent0209835eb255beb66cf021c02e659ed8ab02dcd1 (diff)
downloadopie-1ce7786a16ee7b9679391090eeedc4cbcaab81ca.zip
opie-1ce7786a16ee7b9679391090eeedc4cbcaab81ca.tar.gz
opie-1ce7786a16ee7b9679391090eeedc4cbcaab81ca.tar.bz2
whitespace changes
Diffstat (limited to 'core/launcher/serverapp.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/serverapp.cpp106
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
@@ -59,24 +59,30 @@ static int loggedin=0;
59 59
60QCopKeyRegister::QCopKeyRegister() 60QCopKeyRegister::QCopKeyRegister()
61 : m_keyCode( 0 ) { 61 : m_keyCode( 0 )
62{
62} 63}
63 64
64QCopKeyRegister::QCopKeyRegister( int k, const QCString& c, const QCString& m ) 65QCopKeyRegister::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
68int QCopKeyRegister::keyCode()const { 70int QCopKeyRegister::keyCode() const
71{
69 return m_keyCode; 72 return m_keyCode;
70} 73}
71 74
72QCString QCopKeyRegister::channel()const { 75QCString QCopKeyRegister::channel() const
76{
73 return m_channel; 77 return m_channel;
74} 78}
75 79
76QCString QCopKeyRegister::message()const { 80QCString QCopKeyRegister::message() const
81{
77 return m_message; 82 return m_message;
78} 83}
79 84
80bool QCopKeyRegister::send() { 85bool QCopKeyRegister::send()
86{
81 if (m_channel.isNull() ) 87 if (m_channel.isNull() )
82 return false; 88 return false;
@@ -158,13 +164,16 @@ void KeyFilter::timerEvent(QTimerEvent* e)
158} 164}
159 165
160void KeyFilter::registerKey( const QCopKeyRegister& key ) { 166void KeyFilter::registerKey( const QCopKeyRegister& key )
167{
161 m_keys.insert( key.keyCode(), key ); 168 m_keys.insert( key.keyCode(), key );
162} 169}
163 170
164void KeyFilter::unregisterKey( const QCopKeyRegister& key ) { 171void KeyFilter::unregisterKey( const QCopKeyRegister& key )
172{
165 m_keys.remove( key.keyCode() ); 173 m_keys.remove( key.keyCode() );
166} 174}
167 175
168bool KeyFilter::keyRegistered( int key ) { 176bool KeyFilter::keyRegistered( int key )
177{
169 /* 178 /*
170 * Check if we've a key registered 179 * Check if we've a key registered
@@ -174,5 +183,4 @@ bool KeyFilter::keyRegistered( int key ) {
174 else 183 else
175 return true; 184 return true;
176
177} 185}
178 186
@@ -196,6 +204,5 @@ bool KeyFilter::checkButtonAction(bool db, int keycode, int press, int autoRepe
196 if (keycode != 0 &&press && !autoRepeat && keyRegistered(keycode) ) 204 if (keycode != 0 &&press && !autoRepeat && keyRegistered(keycode) )
197 return true; 205 return true;
198 }else { 206 } else {
199
200 207
201 // First check to see if DeviceButtonManager knows something about this button: 208 // First check to see if DeviceButtonManager knows something about this button:
@@ -267,5 +274,6 @@ bool ServerApplication::allowRestart = TRUE;
267bool ServerApplication::ms_is_starting = TRUE; 274bool ServerApplication::ms_is_starting = TRUE;
268 275
269void ServerApplication::switchLCD( bool on ) { 276void ServerApplication::switchLCD( bool on )
277{
270 if ( !qApp ) 278 if ( !qApp )
271 return; 279 return;
@@ -279,5 +287,5 @@ void ServerApplication::switchLCD( bool on ) {
279 dapp-> m_screensaver-> setDisplayState ( true ); 287 dapp-> m_screensaver-> setDisplayState ( true );
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 );
283 291
@@ -360,5 +368,4 @@ ServerApplication::~ServerApplication()
360 ungrabKeyboard(); 368 ungrabKeyboard();
361 369
362
363 delete pa; 370 delete pa;
364 delete m_ps; 371 delete m_ps;
@@ -366,5 +373,6 @@ ServerApplication::~ServerApplication()
366} 373}
367 374
368void ServerApplication::apmTimeout() { 375void ServerApplication::apmTimeout()
376{
369 serverApp-> checkMemory( ); // in case no events are generated 377 serverApp-> checkMemory( ); // in case no events are generated
370 *m_ps_last = *m_ps; 378 *m_ps_last = *m_ps;
@@ -409,5 +417,6 @@ void ServerApplication::apmTimeout() {
409 417
410void ServerApplication::systemMessage( const QCString& msg, 418void 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 );
413 422
@@ -522,18 +531,18 @@ namespace {
522 void execAutoStart(const QDateTime& suspendTime ) { 531 void execAutoStart(const QDateTime& suspendTime ) {
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 }
539} 548}
@@ -554,5 +563,4 @@ void ServerApplication::togglePower()
554 563
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 ) {
558 // Should use a big black window instead. 566 // Should use a big black window instead.
@@ -617,16 +625,17 @@ bool ServerApplication::qwsEventFilter( QWSEvent *e )
617 625
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 );
632 if ( kf->checkButtonAction( false, 641 if ( kf->checkButtonAction( false,
@@ -651,6 +660,7 @@ void ServerApplication::showSafeMode()
651 "Plugins are not loaded in Safe Mode. " 660 "Plugins are not loaded in Safe Mode. "
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 }
656#endif 666#endif
@@ -666,5 +676,5 @@ void ServerApplication::clearSafeMode()
666 QString mode = cfg.readEntry( "Mode", "Normal" ); 676 QString mode = cfg.readEntry( "Mode", "Normal" );
667 if ( mode == "MaybeSafe" ) { 677 if ( mode == "MaybeSafe" ) {
668 cfg.writeEntry( "Mode", "Normal" ); 678 cfg.writeEntry( "Mode", "Normal" );
669 } 679 }
670#endif 680#endif
@@ -675,5 +685,5 @@ void ServerApplication::shutdown()
675{ 685{
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 );
679 connect( sd, SIGNAL(shutdown(ShutdownImpl::Type)), 689 connect( sd, SIGNAL(shutdown(ShutdownImpl::Type)),
@@ -730,7 +740,7 @@ void ServerApplication::restart()
730 /* same as above */ 740 /* same as above */
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
736 prepareForTermination( true ); 746 prepareForTermination( true );