author | kergoth <kergoth> | 2003-03-14 20:40:06 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2003-03-14 20:40:06 (UTC) |
commit | 2c53d85583ebece42b3b4c155540cd6a01542731 (patch) (unidiff) | |
tree | e30be18a7d98d9ebee5ac4a30bbe703b3a34cc28 /core/launcher/desktop.cpp | |
parent | 2d20b81186bd9a4795af736710d0cb205ead9a77 (diff) | |
download | opie-2c53d85583ebece42b3b4c155540cd6a01542731.zip opie-2c53d85583ebece42b3b4c155540cd6a01542731.tar.gz opie-2c53d85583ebece42b3b4c155540cd6a01542731.tar.bz2 |
Simplification.
-rw-r--r-- | core/launcher/desktop.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp index 5ecc8bf..ba4fd66 100644 --- a/core/launcher/desktop.cpp +++ b/core/launcher/desktop.cpp | |||
@@ -719,61 +719,61 @@ void Desktop::toggleCapsLockState() | |||
719 | 719 | ||
720 | void Desktop::styleChange( QStyle &s ) | 720 | void Desktop::styleChange( QStyle &s ) |
721 | { | 721 | { |
722 | QWidget::styleChange( s ); | 722 | QWidget::styleChange( s ); |
723 | int displayw = qApp->desktop() ->width(); | 723 | int displayw = qApp->desktop() ->width(); |
724 | int displayh = qApp->desktop() ->height(); | 724 | int displayh = qApp->desktop() ->height(); |
725 | 725 | ||
726 | QSize sz = tb->sizeHint(); | 726 | QSize sz = tb->sizeHint(); |
727 | 727 | ||
728 | tb->setGeometry( 0, displayh - sz.height(), displayw, sz.height() ); | 728 | tb->setGeometry( 0, displayh - sz.height(), displayw, sz.height() ); |
729 | } | 729 | } |
730 | 730 | ||
731 | void DesktopApplication::shutdown() | 731 | void DesktopApplication::shutdown() |
732 | { | 732 | { |
733 | if ( type() != GuiServer ) | 733 | if ( type() != GuiServer ) |
734 | return ; | 734 | return ; |
735 | ShutdownImpl *sd = new ShutdownImpl( 0, 0, WDestructiveClose ); | 735 | ShutdownImpl *sd = new ShutdownImpl( 0, 0, WDestructiveClose ); |
736 | connect( sd, SIGNAL( shutdown( ShutdownImpl::Type ) ), | 736 | connect( sd, SIGNAL( shutdown( ShutdownImpl::Type ) ), |
737 | this, SLOT( shutdown( ShutdownImpl::Type ) ) ); | 737 | this, SLOT( shutdown( ShutdownImpl::Type ) ) ); |
738 | sd->showMaximized(); | 738 | sd->showMaximized(); |
739 | } | 739 | } |
740 | 740 | ||
741 | void DesktopApplication::shutdown( ShutdownImpl::Type t ) | 741 | void DesktopApplication::shutdown( ShutdownImpl::Type t ) |
742 | { | 742 | { |
743 | char *path[] = { "/sbin", "/usr/sbin", 0 }; | ||
744 | char *opt = 0; | 743 | char *opt = 0; |
745 | 744 | ||
746 | switch ( t ) { | 745 | switch ( t ) { |
747 | case ShutdownImpl::ShutdownSystem: | 746 | case ShutdownImpl::ShutdownSystem: |
748 | opt = "-h"; | 747 | opt = "-h"; |
749 | // fall through | 748 | // fall through |
750 | case ShutdownImpl::RebootSystem: | 749 | case ShutdownImpl::RebootSystem: |
751 | if ( opt == 0 ) | 750 | if ( opt == 0 ) |
752 | opt = "-r"; | 751 | opt = "-r"; |
753 | 752 | ||
754 | if ( execle( "shutdown", "shutdown", opt, "now", ( void* ) 0, path ) < 0 ) | 753 | if ( execl( "/sbin/shutdown", "shutdown", opt, "now", ( void* ) 0) < 0 ) |
755 | ::syslog ( LOG_ERR, "Erroring execing shutdown\n" ); | 754 | perror("shutdown"); |
755 | // ::syslog ( LOG_ERR, "Erroring execing shutdown\n" ); | ||
756 | 756 | ||
757 | break; | 757 | break; |
758 | case ShutdownImpl::RestartDesktop: | 758 | case ShutdownImpl::RestartDesktop: |
759 | restart(); | 759 | restart(); |
760 | break; | 760 | break; |
761 | case ShutdownImpl::TerminateDesktop: | 761 | case ShutdownImpl::TerminateDesktop: |
762 | prepareForTermination( FALSE ); | 762 | prepareForTermination( FALSE ); |
763 | 763 | ||
764 | // This is a workaround for a Qt bug | 764 | // This is a workaround for a Qt bug |
765 | // clipboard applet has to stop its poll timer, or Qt/E | 765 | // clipboard applet has to stop its poll timer, or Qt/E |
766 | // will hang on quit() right before it emits aboutToQuit() | 766 | // will hang on quit() right before it emits aboutToQuit() |
767 | emit aboutToQuit ( ); | 767 | emit aboutToQuit ( ); |
768 | 768 | ||
769 | quit(); | 769 | quit(); |
770 | break; | 770 | break; |
771 | } | 771 | } |
772 | } | 772 | } |
773 | 773 | ||
774 | void DesktopApplication::restart() | 774 | void DesktopApplication::restart() |
775 | { | 775 | { |
776 | prepareForTermination( TRUE ); | 776 | prepareForTermination( TRUE ); |
777 | 777 | ||
778 | #ifdef Q_WS_QWS | 778 | #ifdef Q_WS_QWS |
779 | 779 | ||