-rw-r--r-- | core/launcher/serverapp.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/core/launcher/serverapp.cpp b/core/launcher/serverapp.cpp index 522ef07..28316a4 100644 --- a/core/launcher/serverapp.cpp +++ b/core/launcher/serverapp.cpp | |||
@@ -702,51 +702,70 @@ void ServerApplication::shutdown( ShutdownImpl::Type t ) | |||
702 | if ( execl( "/sbin/shutdown", "shutdown", opt, "now", ( void* ) 0) < 0 ) | 702 | if ( execl( "/sbin/shutdown", "shutdown", opt, "now", ( void* ) 0) < 0 ) |
703 | perror("shutdown"); | 703 | perror("shutdown"); |
704 | // ::syslog ( LOG_ERR, "Erroring execing shutdown\n" ); | 704 | // ::syslog ( LOG_ERR, "Erroring execing shutdown\n" ); |
705 | 705 | ||
706 | break; | 706 | break; |
707 | case ShutdownImpl::RestartDesktop: | 707 | case ShutdownImpl::RestartDesktop: |
708 | restart(); | 708 | restart(); |
709 | break; | 709 | break; |
710 | case ShutdownImpl::TerminateDesktop: | 710 | case ShutdownImpl::TerminateDesktop: |
711 | prepareForTermination( FALSE ); | 711 | prepareForTermination( FALSE ); |
712 | 712 | ||
713 | // This is a workaround for a Qt bug | 713 | // This is a workaround for a Qt bug |
714 | // clipboard applet has to stop its poll timer, or Qt/E | 714 | // clipboard applet has to stop its poll timer, or Qt/E |
715 | // will hang on quit() right before it emits aboutToQuit() | 715 | // will hang on quit() right before it emits aboutToQuit() |
716 | emit aboutToQuit ( ); | 716 | emit aboutToQuit ( ); |
717 | 717 | ||
718 | quit(); | 718 | quit(); |
719 | break; | 719 | break; |
720 | } | 720 | } |
721 | } | 721 | } |
722 | 722 | ||
723 | void ServerApplication::restart() | 723 | void ServerApplication::restart() |
724 | { | 724 | { |
725 | if ( allowRestart ) { | 725 | if ( allowRestart ) { |
726 | |||
727 | /* | ||
728 | * Applets and restart is a problem. Some applets delete | ||
729 | * their widgets even if ownership gets transfered to the | ||
730 | * parent (Systray ) but deleting the applet may be unsafe | ||
731 | * as well ( double deletion ). Some have topLevel widgets | ||
732 | * and when we dlclose and then delete the widget we will | ||
733 | * crash and an crash during restart is not nice | ||
734 | */ | ||
735 | #ifdef ALL_APPLETS_ON_THIS_WORLD_ARE_FIXED | ||
736 | /* same as above */ | ||
737 | emit aboutToQuit(); | ||
726 | prepareForTermination(TRUE); | 738 | prepareForTermination(TRUE); |
727 | doRestart = TRUE; | 739 | doRestart = TRUE; |
728 | quit(); | 740 | quit(); |
741 | #else | ||
742 | prepareForTermination( true ); | ||
743 | for ( int fd = 3; fd < 100; fd++ ) | ||
744 | close( fd ); | ||
745 | execl( ( qpeDir() + "/bin/qpe" ).latin1(), "qpe", 0 ); | ||
746 | exit( 1 ); | ||
747 | #endif | ||
729 | } | 748 | } |
730 | } | 749 | } |
731 | 750 | ||
732 | void ServerApplication::rereadVolumes() | 751 | void ServerApplication::rereadVolumes() |
733 | { | 752 | { |
734 | Config cfg( "qpe" ); | 753 | Config cfg( "qpe" ); |
735 | cfg. setGroup ( "Volume" ); | 754 | cfg. setGroup ( "Volume" ); |
736 | 755 | ||
737 | m_screentap_sound = cfg. readBoolEntry ( "TouchSound" ); | 756 | m_screentap_sound = cfg. readBoolEntry ( "TouchSound" ); |
738 | m_keyclick_sound = cfg. readBoolEntry ( "KeySound" ); | 757 | m_keyclick_sound = cfg. readBoolEntry ( "KeySound" ); |
739 | m_alarm_sound = cfg. readBoolEntry ( "AlarmSound" ); | 758 | m_alarm_sound = cfg. readBoolEntry ( "AlarmSound" ); |
740 | } | 759 | } |
741 | 760 | ||
742 | 761 | ||
743 | void ServerApplication::checkMemory() | 762 | void ServerApplication::checkMemory() |
744 | { | 763 | { |
745 | #if defined(QPE_HAVE_MEMALERTER) | 764 | #if defined(QPE_HAVE_MEMALERTER) |
746 | static bool ignoreNormal=TRUE; | 765 | static bool ignoreNormal=TRUE; |
747 | static bool existingMessage=FALSE; | 766 | static bool existingMessage=FALSE; |
748 | 767 | ||
749 | if(existingMessage) | 768 | if(existingMessage) |
750 | return; // don't show a second message while still on first | 769 | return; // don't show a second message while still on first |
751 | 770 | ||
752 | existingMessage = TRUE; | 771 | existingMessage = TRUE; |