-rw-r--r-- | core/launcher/desktop.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp index e58b08c..f90da1a 100644 --- a/core/launcher/desktop.cpp +++ b/core/launcher/desktop.cpp | |||
@@ -665,48 +665,54 @@ void Desktop::styleChange( QStyle &s ) | |||
665 | void DesktopApplication::shutdown() | 665 | void DesktopApplication::shutdown() |
666 | { | 666 | { |
667 | if ( type() != GuiServer ) | 667 | if ( type() != GuiServer ) |
668 | return; | 668 | return; |
669 | ShutdownImpl *sd = new ShutdownImpl( 0, 0, WDestructiveClose ); | 669 | ShutdownImpl *sd = new ShutdownImpl( 0, 0, WDestructiveClose ); |
670 | connect( sd, SIGNAL(shutdown(ShutdownImpl::Type)), | 670 | connect( sd, SIGNAL(shutdown(ShutdownImpl::Type)), |
671 | this, SLOT(shutdown(ShutdownImpl::Type)) ); | 671 | this, SLOT(shutdown(ShutdownImpl::Type)) ); |
672 | sd->showMaximized(); | 672 | sd->showMaximized(); |
673 | } | 673 | } |
674 | 674 | ||
675 | void DesktopApplication::shutdown( ShutdownImpl::Type t ) | 675 | void DesktopApplication::shutdown( ShutdownImpl::Type t ) |
676 | { | 676 | { |
677 | switch ( t ) { | 677 | switch ( t ) { |
678 | case ShutdownImpl::ShutdownSystem: | 678 | case ShutdownImpl::ShutdownSystem: |
679 | execlp("shutdown", "shutdown", "-h", "now", (void*)0); | 679 | execlp("shutdown", "shutdown", "-h", "now", (void*)0); |
680 | break; | 680 | break; |
681 | case ShutdownImpl::RebootSystem: | 681 | case ShutdownImpl::RebootSystem: |
682 | execlp("shutdown", "shutdown", "-r", "now", (void*)0); | 682 | execlp("shutdown", "shutdown", "-r", "now", (void*)0); |
683 | break; | 683 | break; |
684 | case ShutdownImpl::RestartDesktop: | 684 | case ShutdownImpl::RestartDesktop: |
685 | restart(); | 685 | restart(); |
686 | break; | 686 | break; |
687 | case ShutdownImpl::TerminateDesktop: | 687 | case ShutdownImpl::TerminateDesktop: |
688 | prepareForTermination(FALSE); | 688 | prepareForTermination(FALSE); |
689 | |||
690 | // This is a workaround for a Qt bug | ||
691 | // clipboard applet has to stop its poll timer, or Qt/E | ||
692 | // will hang on quit() right before it emits aboutToQuit() | ||
693 | emit aboutToQuit ( ); | ||
694 | |||
689 | quit(); | 695 | quit(); |
690 | break; | 696 | break; |
691 | } | 697 | } |
692 | } | 698 | } |
693 | 699 | ||
694 | void DesktopApplication::restart() | 700 | void DesktopApplication::restart() |
695 | { | 701 | { |
696 | prepareForTermination(TRUE); | 702 | prepareForTermination(TRUE); |
697 | 703 | ||
698 | #ifdef Q_WS_QWS | 704 | #ifdef Q_WS_QWS |
699 | for ( int fd = 3; fd < 100; fd++ ) | 705 | for ( int fd = 3; fd < 100; fd++ ) |
700 | close( fd ); | 706 | close( fd ); |
701 | #if defined(QT_DEMO_SINGLE_FLOPPY) | 707 | #if defined(QT_DEMO_SINGLE_FLOPPY) |
702 | execl( "/sbin/init", "qpe", 0 ); | 708 | execl( "/sbin/init", "qpe", 0 ); |
703 | #elif defined(QT_QWS_CASSIOPEIA) | 709 | #elif defined(QT_QWS_CASSIOPEIA) |
704 | execl( "/bin/sh", "sh", 0 ); | 710 | execl( "/bin/sh", "sh", 0 ); |
705 | #else | 711 | #else |
706 | execl( (qpeDir()+"/bin/qpe").latin1(), "qpe", 0 ); | 712 | execl( (qpeDir()+"/bin/qpe").latin1(), "qpe", 0 ); |
707 | #endif | 713 | #endif |
708 | exit(1); | 714 | exit(1); |
709 | #endif | 715 | #endif |
710 | } | 716 | } |
711 | 717 | ||
712 | void Desktop::startTransferServer() | 718 | void Desktop::startTransferServer() |