Changeset View
Changeset View
Standalone View
Standalone View
ksmserver/logout.cpp
Show First 20 Lines • Show All 89 Lines • ▼ Show 20 Line(s) | 88 | { | |||
---|---|---|---|---|---|
90 | if (sdtype == KWorkSpace::ShutdownTypeLogout) | 90 | if (sdtype == KWorkSpace::ShutdownTypeLogout) | ||
91 | sdtype = KWorkSpace::ShutdownTypeNone; | 91 | sdtype = KWorkSpace::ShutdownTypeNone; | ||
92 | 92 | | |||
93 | shutdown( (KWorkSpace::ShutdownConfirm)confirm, | 93 | shutdown( (KWorkSpace::ShutdownConfirm)confirm, | ||
94 | (KWorkSpace::ShutdownType)sdtype, | 94 | (KWorkSpace::ShutdownType)sdtype, | ||
95 | (KWorkSpace::ShutdownMode)sdmode ); | 95 | (KWorkSpace::ShutdownMode)sdmode ); | ||
96 | } | 96 | } | ||
97 | 97 | | |||
98 | bool KSMServer::closeSession() | ||||
99 | { | ||||
100 | Q_ASSERT(calledFromDBus()); | ||||
101 | performLogout(); | ||||
102 | setDelayedReply(true); | ||||
103 | m_performLogoutCall = message(); | ||||
104 | return false; | ||||
105 | } | ||||
106 | | ||||
98 | bool KSMServer::canShutdown() | 107 | bool KSMServer::canShutdown() | ||
99 | { | 108 | { | ||
100 | KSharedConfig::Ptr config = KSharedConfig::openConfig(); | 109 | KSharedConfig::Ptr config = KSharedConfig::openConfig(); | ||
101 | config->reparseConfiguration(); // config may have changed in the KControl module | 110 | config->reparseConfiguration(); // config may have changed in the KControl module | ||
102 | KConfigGroup cg( config, "General"); | 111 | KConfigGroup cg( config, "General"); | ||
103 | 112 | | |||
104 | return cg.readEntry( "offerShutdown", true ) && KDisplayManager().canShutdown(); | 113 | return cg.readEntry( "offerShutdown", true ) && KDisplayManager().canShutdown(); | ||
105 | } | 114 | } | ||
▲ Show 20 Lines • Show All 291 Lines • ▼ Show 20 Line(s) | 405 | if( c->saveYourselfDone ) { | |||
397 | // Discard also saved state. | 406 | // Discard also saved state. | ||
398 | QStringList discard = c->discardCommand(); | 407 | QStringList discard = c->discardCommand(); | ||
399 | if( !discard.isEmpty()) | 408 | if( !discard.isEmpty()) | ||
400 | executeCommand( discard ); | 409 | executeCommand( discard ); | ||
401 | } | 410 | } | ||
402 | } | 411 | } | ||
403 | } | 412 | } | ||
404 | state = Idle; | 413 | state = Idle; | ||
414 | if (m_performLogoutCall.type() == QDBusMessage::MethodCallMessage) { | ||||
415 | auto reply = m_performLogoutCall.createReply(false); | ||||
416 | QDBusConnection::sessionBus().send(reply); | ||||
417 | m_performLogoutCall = QDBusMessage(); | ||||
418 | } | ||||
405 | emit logoutCancelled(); | 419 | emit logoutCancelled(); | ||
406 | } | 420 | } | ||
407 | 421 | | |||
408 | void KSMServer::startProtection() | 422 | void KSMServer::startProtection() | ||
409 | { | 423 | { | ||
410 | KSharedConfig::Ptr config = KSharedConfig::openConfig(); | 424 | KSharedConfig::Ptr config = KSharedConfig::openConfig(); | ||
411 | config->reparseConfiguration(); // config may have changed in the KControl module | 425 | config->reparseConfiguration(); // config may have changed in the KControl module | ||
412 | KConfigGroup cg( config, "General" ); | 426 | KConfigGroup cg( config, "General" ); | ||
▲ Show 20 Lines • Show All 162 Lines • ▼ Show 20 Line(s) | 588 | if( state == KillingWM ) { | |||
575 | if( clients.isEmpty()) | 589 | if( clients.isEmpty()) | ||
576 | killingCompleted(); | 590 | killingCompleted(); | ||
577 | } | 591 | } | ||
578 | } | 592 | } | ||
579 | 593 | | |||
580 | // shutdown is fully complete | 594 | // shutdown is fully complete | ||
581 | void KSMServer::killingCompleted() | 595 | void KSMServer::killingCompleted() | ||
582 | { | 596 | { | ||
597 | if (m_performLogoutCall.type() == QDBusMessage::MethodCallMessage) { | ||||
598 | auto reply = m_performLogoutCall.createReply(true); | ||||
599 | QDBusConnection::sessionBus().send(reply); | ||||
600 | m_performLogoutCall = QDBusMessage(); | ||||
601 | } | ||||
583 | qApp->quit(); | 602 | qApp->quit(); | ||
584 | } | 603 | } | ||
585 | 604 | | |||
586 | void KSMServer::timeoutQuit() | 605 | void KSMServer::timeoutQuit() | ||
587 | { | 606 | { | ||
588 | foreach( KSMClient* c, clients ) { | 607 | foreach( KSMClient* c, clients ) { | ||
589 | qCWarning(KSMSERVER) << "SmsDie timeout, client " << c->program() << "(" << c->clientId() << ")" ; | 608 | qCWarning(KSMSERVER) << "SmsDie timeout, client " << c->program() << "(" << c->clientId() << ")" ; | ||
590 | } | 609 | } | ||
▲ Show 20 Lines • Show All 109 Lines • Show Last 20 Lines |