on xenial help sign in
make closeAllApps as separate function.
b1c0402Ying-Chun Liu
qml/Shell.qml+9−7
@@ -282,13 +282,7 @@ FocusScope {
282 Connections {
282 Connections {
283 target: DBusUnitySessionService
283 target: DBusUnitySessionService
284
284
285− onLogoutRequested: {
285+ function closeAllApps() {
286− // TODO: Display a dialog to ask the user to confirm.
287− DBusUnitySessionService.Logout();
288− }
289−
290− onLogoutReady: {
291− // close all the apps.
292 while (true) {
286 while (true) {
293 var app = ApplicationManager.get(0);
287 var app = ApplicationManager.get(0);
294 if (app === null) {
288 if (app === null) {
@@ -296,7 +290,15 @@ FocusScope {
296 }
290 }
297 ApplicationManager.stopApplication(app.appId);
291 ApplicationManager.stopApplication(app.appId);
298 }
292 }
293+ }
299
294
295+ onLogoutRequested: {
296+ // TODO: Display a dialog to ask the user to confirm.
297+ DBusUnitySessionService.Logout();
298+ }
299+
300+ onLogoutReady: {
301+ closeAllApps();
300 Qt.quit();
302 Qt.quit();
301 }
303 }
302 }
304 }