diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-07-25 15:47:23 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-07-25 15:47:23 -0500 |
commit | b004fbafa92b03e7c55d3115329256224279ef21 (patch) | |
tree | 09608883a0737f1dd593b660d9d296c163286ffb /ksmserver/shutdown.cpp | |
parent | eae7e0d365233b6c10662808e53deeed030077ae (diff) | |
download | tdebase-b004fbafa92b03e7c55d3115329256224279ef21.tar.gz tdebase-b004fbafa92b03e7c55d3115329256224279ef21.zip |
Fix ksmserver crash when logout dialog is disabled
Diffstat (limited to 'ksmserver/shutdown.cpp')
-rw-r--r-- | ksmserver/shutdown.cpp | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/ksmserver/shutdown.cpp b/ksmserver/shutdown.cpp index d09383fcd..9adad413a 100644 --- a/ksmserver/shutdown.cpp +++ b/ksmserver/shutdown.cpp @@ -570,10 +570,12 @@ void KSMServer::handleProtectionTimeout() SHUTDOWN_MARKER("handleProtectionTimeout"); notificationTimer.stop(); - static_cast<KSMShutdownIPDlg*>(shutdownNotifierIPDlg)->hideNotificationActionButtons(); - disconnect(shutdownNotifierIPDlg, SIGNAL(abortLogoutClicked()), this, SLOT(cancelShutdown())); - disconnect(shutdownNotifierIPDlg, SIGNAL(skipNotificationClicked()), this, SLOT(forceSkipSaveYourself())); - static_cast<KSMShutdownIPDlg*>(shutdownNotifierIPDlg)->setStatusMessage(i18n("Forcing interacting application termination").append("...")); + if (shutdownNotifierIPDlg) { + static_cast<KSMShutdownIPDlg*>(shutdownNotifierIPDlg)->hideNotificationActionButtons(); + disconnect(shutdownNotifierIPDlg, SIGNAL(abortLogoutClicked()), this, SLOT(cancelShutdown())); + disconnect(shutdownNotifierIPDlg, SIGNAL(skipNotificationClicked()), this, SLOT(forceSkipSaveYourself())); + static_cast<KSMShutdownIPDlg*>(shutdownNotifierIPDlg)->setStatusMessage(i18n("Forcing interacting application termination").append("...")); + } for ( KSMClient* c = clients.first(); c; c = clients.next() ) { if ( !c->saveYourselfDone && !c->waitForPhase2 ) { @@ -586,10 +588,12 @@ void KSMServer::handleProtectionTimeout() void KSMServer::notificationTimeout() { - // Display the buttons in the logout dialog - connect(shutdownNotifierIPDlg, SIGNAL(abortLogoutClicked()), this, SLOT(cancelShutdown())); - connect(shutdownNotifierIPDlg, SIGNAL(skipNotificationClicked()), this, SLOT(forceSkipSaveYourself())); - static_cast<KSMShutdownIPDlg*>(shutdownNotifierIPDlg)->showNotificationActionButtons(); + if (shutdownNotifierIPDlg) { + // Display the buttons in the logout dialog + connect(shutdownNotifierIPDlg, SIGNAL(abortLogoutClicked()), this, SLOT(cancelShutdown())); + connect(shutdownNotifierIPDlg, SIGNAL(skipNotificationClicked()), this, SLOT(forceSkipSaveYourself())); + static_cast<KSMShutdownIPDlg*>(shutdownNotifierIPDlg)->showNotificationActionButtons(); + } } void KSMServer::completeShutdownOrCheckpoint() @@ -638,9 +642,11 @@ void KSMServer::completeShutdownOrCheckpoint() } notificationTimer.stop(); - static_cast<KSMShutdownIPDlg*>(shutdownNotifierIPDlg)->hideNotificationActionButtons(); - disconnect(shutdownNotifierIPDlg, SIGNAL(abortLogoutClicked()), this, SLOT(cancelShutdown())); - disconnect(shutdownNotifierIPDlg, SIGNAL(skipNotificationClicked()), this, SLOT(forceSkipSaveYourself())); + if (shutdownNotifierIPDlg) { + static_cast<KSMShutdownIPDlg*>(shutdownNotifierIPDlg)->hideNotificationActionButtons(); + disconnect(shutdownNotifierIPDlg, SIGNAL(abortLogoutClicked()), this, SLOT(cancelShutdown())); + disconnect(shutdownNotifierIPDlg, SIGNAL(skipNotificationClicked()), this, SLOT(forceSkipSaveYourself())); + } // synchronize any folders that were requested for shutdown sync if (shutdownNotifierIPDlg) { |