-rw-r--r-- | core/launcher/serverapp.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/core/launcher/serverapp.cpp b/core/launcher/serverapp.cpp index cf543ce..807942d 100644 --- a/core/launcher/serverapp.cpp +++ b/core/launcher/serverapp.cpp | |||
@@ -684,48 +684,50 @@ void ServerApplication::showSafeMode() | |||
684 | 684 | ||
685 | void ServerApplication::clearSafeMode() | 685 | void ServerApplication::clearSafeMode() |
686 | { | 686 | { |
687 | #if 0 | 687 | #if 0 |
688 | // If we've been running OK for a while then we won't bother going into | 688 | // If we've been running OK for a while then we won't bother going into |
689 | // safe mode immediately on the next crash. | 689 | // safe mode immediately on the next crash. |
690 | Config cfg( "PluginLoader" ); | 690 | Config cfg( "PluginLoader" ); |
691 | cfg.setGroup( "Global" ); | 691 | cfg.setGroup( "Global" ); |
692 | QString mode = cfg.readEntry( "Mode", "Normal" ); | 692 | QString mode = cfg.readEntry( "Mode", "Normal" ); |
693 | if ( mode == "MaybeSafe" ) { | 693 | if ( mode == "MaybeSafe" ) { |
694 | cfg.writeEntry( "Mode", "Normal" ); | 694 | cfg.writeEntry( "Mode", "Normal" ); |
695 | } | 695 | } |
696 | #endif | 696 | #endif |
697 | } | 697 | } |
698 | 698 | ||
699 | 699 | ||
700 | void ServerApplication::shutdown() | 700 | void ServerApplication::shutdown() |
701 | { | 701 | { |
702 | if ( type() != GuiServer ) | 702 | if ( type() != GuiServer ) |
703 | return; | 703 | return; |
704 | ShutdownImpl *sd = new ShutdownImpl( 0, 0, WDestructiveClose ); | 704 | ShutdownImpl *sd = new ShutdownImpl( 0, 0, WDestructiveClose ); |
705 | connect( sd, SIGNAL(shutdown(ShutdownImpl::Type)), | 705 | connect( sd, SIGNAL(shutdown(ShutdownImpl::Type)), |
706 | this, SLOT(shutdown(ShutdownImpl::Type)) ); | 706 | this, SLOT(shutdown(ShutdownImpl::Type)) ); |
707 | QPEApplication::showWidget( sd ); | 707 | QPEApplication::showWidget( sd ); |
708 | sd->move(0,0); | ||
709 | |||
708 | } | 710 | } |
709 | 711 | ||
710 | void ServerApplication::shutdown( ShutdownImpl::Type t ) | 712 | void ServerApplication::shutdown( ShutdownImpl::Type t ) |
711 | { | 713 | { |
712 | char *opt = 0; | 714 | char *opt = 0; |
713 | 715 | ||
714 | switch ( t ) { | 716 | switch ( t ) { |
715 | case ShutdownImpl::ShutdownSystem: | 717 | case ShutdownImpl::ShutdownSystem: |
716 | opt = "-h"; | 718 | opt = "-h"; |
717 | // fall through | 719 | // fall through |
718 | case ShutdownImpl::RebootSystem: | 720 | case ShutdownImpl::RebootSystem: |
719 | if ( opt == 0 ) | 721 | if ( opt == 0 ) |
720 | opt = "-r"; | 722 | opt = "-r"; |
721 | 723 | ||
722 | if ( execl( "/sbin/shutdown", "shutdown", opt, "now", ( void* ) 0) < 0 ) | 724 | if ( execl( "/sbin/shutdown", "shutdown", opt, "now", ( void* ) 0) < 0 ) |
723 | perror("shutdown"); | 725 | perror("shutdown"); |
724 | // ::syslog ( LOG_ERR, "Erroring execing shutdown\n" ); | 726 | // ::syslog ( LOG_ERR, "Erroring execing shutdown\n" ); |
725 | 727 | ||
726 | break; | 728 | break; |
727 | case ShutdownImpl::RestartDesktop: | 729 | case ShutdownImpl::RestartDesktop: |
728 | restart(); | 730 | restart(); |
729 | break; | 731 | break; |
730 | case ShutdownImpl::TerminateDesktop: | 732 | case ShutdownImpl::TerminateDesktop: |
731 | prepareForTermination( FALSE ); | 733 | prepareForTermination( FALSE ); |