summaryrefslogtreecommitdiff
authorpaule <paule>2007-01-31 05:11:56 (UTC)
committer paule <paule>2007-01-31 05:11:56 (UTC)
commit3a2db1ba1395a6d33de421ed5f3b04df53ced5bc (patch) (unidiff)
tree19af403919546824965303db78820a3f2a176bda
parentf4e6ede30d494ad91fdbd0fd72498ef3a44bf7ee (diff)
downloadopie-3a2db1ba1395a6d33de421ed5f3b04df53ced5bc.zip
opie-3a2db1ba1395a6d33de421ed5f3b04df53ced5bc.tar.gz
opie-3a2db1ba1395a6d33de421ed5f3b04df53ced5bc.tar.bz2
Specify correct parameters to needToAuthenticate() and login() so that appropriate setting is read when determining whether to authenticate or not. Fixes bug #1830.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/serverapp.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/launcher/serverapp.cpp b/core/launcher/serverapp.cpp
index 6fe0479..0e92040 100644
--- a/core/launcher/serverapp.cpp
+++ b/core/launcher/serverapp.cpp
@@ -517,148 +517,148 @@ bool ServerApplication::screenLocked()
517{ 517{
518 return loggedin == 0; 518 return loggedin == 0;
519} 519}
520 520
521void ServerApplication::login(bool at_poweron) 521void ServerApplication::login(bool at_poweron)
522{ 522{
523 if ( !loggedin ) { 523 if ( !loggedin ) {
524 Global::terminateBuiltin("calibrate"); // No tr 524 Global::terminateBuiltin("calibrate"); // No tr
525 int lockMode = at_poweron ? Opie::Security::IfPowerOn : Opie::Security::IfResume; 525 int lockMode = at_poweron ? Opie::Security::IfPowerOn : Opie::Security::IfResume;
526 Opie::Security::MultiauthPassword::authenticate(lockMode); 526 Opie::Security::MultiauthPassword::authenticate(lockMode);
527 loggedin=1; 527 loggedin=1;
528#ifndef QT_NO_COP 528#ifndef QT_NO_COP
529 QCopEnvelope e( "QPE/Desktop", "unlocked()" ); 529 QCopEnvelope e( "QPE/Desktop", "unlocked()" );
530#endif 530#endif
531 } 531 }
532} 532}
533 533
534#if defined(QPE_HAVE_TOGGLELIGHT) 534#if defined(QPE_HAVE_TOGGLELIGHT)
535#include <qtopia/config.h> 535#include <qtopia/config.h>
536 536
537#include <sys/ioctl.h> 537#include <sys/ioctl.h>
538#include <sys/types.h> 538#include <sys/types.h>
539#include <fcntl.h> 539#include <fcntl.h>
540#include <unistd.h> 540#include <unistd.h>
541#include <errno.h> 541#include <errno.h>
542#include <linux/ioctl.h> 542#include <linux/ioctl.h>
543#include <time.h> 543#include <time.h>
544#endif 544#endif
545 545
546namespace { 546namespace {
547 void execAutoStart(const QDateTime& suspendTime ) { 547 void execAutoStart(const QDateTime& suspendTime ) {
548 QString appName; 548 QString appName;
549 int delay; 549 int delay;
550 QDateTime now = QDateTime::currentDateTime(); 550 QDateTime now = QDateTime::currentDateTime();
551 551
552 Config cfg( "autostart" ); 552 Config cfg( "autostart" );
553 cfg.setGroup( "AutoStart" ); 553 cfg.setGroup( "AutoStart" );
554 appName = cfg.readEntry( "Apps", "" ); 554 appName = cfg.readEntry( "Apps", "" );
555 delay = cfg.readNumEntry( "Delay", 0 ); 555 delay = cfg.readNumEntry( "Delay", 0 );
556 556
557 // If the time between suspend and resume was longer then the 557 // If the time between suspend and resume was longer then the
558 // value saved as delay, start the app 558 // value saved as delay, start the app
559 if ( suspendTime.secsTo( now ) >= ( delay * 60 ) && !appName.isEmpty() ) { 559 if ( suspendTime.secsTo( now ) >= ( delay * 60 ) && !appName.isEmpty() ) {
560 QCopEnvelope e( "QPE/System", "execute(QString)" ); 560 QCopEnvelope e( "QPE/System", "execute(QString)" );
561 e << QString( appName ); 561 e << QString( appName );
562 } 562 }
563 } 563 }
564} 564}
565 565
566 566
567void ServerApplication::togglePower() 567void ServerApplication::togglePower()
568{ 568{
569 static bool excllock = false; 569 static bool excllock = false;
570 570
571 if ( excllock ) 571 if ( excllock )
572 return ; 572 return ;
573 573
574 excllock = true; 574 excllock = true;
575 575
576 bool wasloggedin = loggedin; 576 bool wasloggedin = loggedin;
577 loggedin = 0; 577 loggedin = 0;
578 m_suspendTime = QDateTime::currentDateTime(); 578 m_suspendTime = QDateTime::currentDateTime();
579 579
580#ifdef QWS 580#ifdef QWS
581 if ( Opie::Security::MultiauthPassword::needToAuthenticate ( true ) && qt_screen ) { 581 if ( Opie::Security::MultiauthPassword::needToAuthenticate ( false ) && qt_screen ) {
582 // Should use a big black window instead. 582 // Should use a big black window instead.
583 // But this would not show up fast enough 583 // But this would not show up fast enough
584 QGfx *g = qt_screen-> screenGfx ( ); 584 QGfx *g = qt_screen-> screenGfx ( );
585 g-> fillRect ( 0, 0, qt_screen-> width ( ), qt_screen-> height ( )); 585 g-> fillRect ( 0, 0, qt_screen-> width ( ), qt_screen-> height ( ));
586 delete g; 586 delete g;
587 } 587 }
588#endif 588#endif
589 589
590 ODevice::inst ( )-> suspend ( ); 590 ODevice::inst ( )-> suspend ( );
591 591
592 ServerApplication::switchLCD ( true ); // force LCD on without slow qcop call 592 ServerApplication::switchLCD ( true ); // force LCD on without slow qcop call
593 QWSServer::screenSaverActivate ( false ); 593 QWSServer::screenSaverActivate ( false );
594 594
595 { 595 {
596 QCopEnvelope( "QPE/Card", "mtabChanged()" ); // might have changed while asleep 596 QCopEnvelope( "QPE/Card", "mtabChanged()" ); // might have changed while asleep
597 } 597 }
598 598
599 if ( wasloggedin ) 599 if ( wasloggedin )
600 login ( true ); 600 login ( false );
601 601
602 execAutoStart(m_suspendTime); 602 execAutoStart(m_suspendTime);
603 //qcopBridge->closeOpenConnections(); 603 //qcopBridge->closeOpenConnections();
604 604
605 excllock = false; 605 excllock = false;
606} 606}
607 607
608void ServerApplication::toggleLight() 608void ServerApplication::toggleLight()
609{ 609{
610#ifndef QT_NO_COP 610#ifndef QT_NO_COP
611 QCopEnvelope e("QPE/System", "setBacklight(int)"); 611 QCopEnvelope e("QPE/System", "setBacklight(int)");
612 e << -2; // toggle 612 e << -2; // toggle
613#endif 613#endif
614} 614}
615 615
616 616
617/* 617/*
618 * We still listen to key events but handle them in 618 * We still listen to key events but handle them in
619 * a special class 619 * a special class
620 */ 620 */
621 621
622bool ServerApplication::eventFilter( QObject *o, QEvent *e) { 622bool ServerApplication::eventFilter( QObject *o, QEvent *e) {
623 if ( e->type() != QEvent::KeyPress && 623 if ( e->type() != QEvent::KeyPress &&
624 e->type() != QEvent::KeyRelease ) 624 e->type() != QEvent::KeyRelease )
625 return QPEApplication::eventFilter( o, e ); 625 return QPEApplication::eventFilter( o, e );
626 626
627 QKeyEvent *ke = static_cast<QKeyEvent*>( e ); 627 QKeyEvent *ke = static_cast<QKeyEvent*>( e );
628 if ( kf->checkButtonAction( true, ke->key(), 628 if ( kf->checkButtonAction( true, ke->key(),
629 e->type() == QEvent::KeyPress, 629 e->type() == QEvent::KeyPress,
630 ke-> isAutoRepeat() )) 630 ke-> isAutoRepeat() ))
631 return true; 631 return true;
632 632
633 return QPEApplication::eventFilter( o, e ); 633 return QPEApplication::eventFilter( o, e );
634 634
635} 635}
636 636
637#ifdef Q_WS_QWS 637#ifdef Q_WS_QWS
638bool ServerApplication::qwsEventFilter( QWSEvent *e ) 638bool ServerApplication::qwsEventFilter( QWSEvent *e )
639{ 639{
640 checkMemory(); 640 checkMemory();
641 641
642 if ( e->type == QWSEvent::Mouse ) { 642 if ( e->type == QWSEvent::Mouse ) {
643 QWSMouseEvent *me = (QWSMouseEvent *)e; 643 QWSMouseEvent *me = (QWSMouseEvent *)e;
644 static bool up = TRUE; 644 static bool up = TRUE;
645 if ( me->simpleData.state&LeftButton ) { 645 if ( me->simpleData.state&LeftButton ) {
646 if ( up ) { 646 if ( up ) {
647 up = FALSE; 647 up = FALSE;
648 screenClick(TRUE); 648 screenClick(TRUE);
649 } 649 }
650 } else if ( !up ) { 650 } else if ( !up ) {
651 up = TRUE; 651 up = TRUE;
652 screenClick(FALSE); 652 screenClick(FALSE);
653 } 653 }
654 } else 654 } else
655 if ( e->type == QWSEvent::Key ) { 655 if ( e->type == QWSEvent::Key ) {
656 QWSKeyEvent * ke = static_cast<QWSKeyEvent*>( e ); 656 QWSKeyEvent * ke = static_cast<QWSKeyEvent*>( e );
657 if ( kf->checkButtonAction( false, 657 if ( kf->checkButtonAction( false,
658 ke-> simpleData.keycode, 658 ke-> simpleData.keycode,
659 ke-> simpleData.is_press, 659 ke-> simpleData.is_press,
660 ke-> simpleData.is_auto_repeat ) ) 660 ke-> simpleData.is_auto_repeat ) )
661 return true; 661 return true;
662 } 662 }
663 663
664 return QPEApplication::qwsEventFilter( e ); 664 return QPEApplication::qwsEventFilter( e );