Merge lp:~aacid/unity8/handle_termination_signals into lp:unity8

Proposed by Albert Astals Cid
Status: Merged
Approved by: Gerry Boland
Approved revision: 2377
Merged at revision: 2433
Proposed branch: lp:~aacid/unity8/handle_termination_signals
Merge into: lp:unity8
Diff against target: 111 lines (+17/-3)
7 files modified
src/CMakeLists.txt (+1/-0)
src/Dash/CMakeLists.txt (+1/-0)
src/Dash/main.cpp (+6/-0)
src/UnixSignalHandler.cpp (+1/-1)
src/main.cpp (+6/-0)
tools/CMakeLists.txt (+1/-1)
tools/scopetool.cpp (+1/-1)
To merge this branch: bzr merge lp:~aacid/unity8/handle_termination_signals
Reviewer Review Type Date Requested Status
Unity8 CI Bot continuous-integration Approve
Daniel d'Andrada (community) Needs Information
Gerry Boland (community) Approve
Review via email: mp+293737@code.launchpad.net

Commit message

Make unity8 and unity8-dash handle termination signals

This way the app gracefully exists, making things like "flush qml debugging when app finishes" work

Description of the change

 * Are there any related MPs required for this MP to build/function as expected?
No

 * Did you perform an exploratory manual test run of your code change and any related functionality?
Yes

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A

 * If you changed the UI, has there been a design review?
N/A

To post a comment you must log in.
Revision history for this message
Gerry Boland (gerboland) wrote :

Nitpick:
+ UnixSignalHandler signal_handler([]{
we prefer camelCase, no?

Rest looks fine

review: Needs Fixing
2377. By Albert Astals Cid

I'm a cAmeL

Revision history for this message
Albert Astals Cid (aacid) wrote :

> Nitpick:
> + UnixSignalHandler signal_handler([]{
> we prefer camelCase, no?

Changed

Revision history for this message
Gerry Boland (gerboland) wrote :

LGTM

review: Approve
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2376
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1120/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/676
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/676
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=phone-armhf,release=vivid+overlay,testname=autopilot.sh/676
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/1504
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1468
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1468
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1468
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1468/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1468
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1468/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1468
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1468/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1468
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1468/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1468
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1468/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1468
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1468/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1120/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

What about CamelCase in the filename as well? as nearly all files in src follow that convention?

review: Needs Information
Revision history for this message
Albert Astals Cid (aacid) wrote :

I'm just moving it, i'd prefer not to rename it too, but can do if you really want it.

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

On 05/05/2016 12:24, Albert Astals Cid wrote:
> I'm just moving it, i'd prefer not to rename it too, but can do if you really want it.
move and rename are pretty much the same thing (in bzr you do both with
"bzr mv"). bzr history will follow just fine.

Revision history for this message
Albert Astals Cid (aacid) wrote :

> move and rename are pretty much the same thing (in bzr you do both with
> "bzr mv"). bzr history will follow just fine.

I know, are you asking me to rename it?

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

On 09/05/2016 07:13, Albert Astals Cid wrote:
>> move and rename are pretty much the same thing (in bzr you do both with
>> "bzr mv"). bzr history will follow just fine.
> I know, are you asking me to rename it?
Yes

2378. By Albert Astals Cid

Critical rename bugfix

2379. By Albert Astals Cid

Merge

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2376
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1164/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/714
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/714
    FAILURE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=phone-armhf,release=vivid+overlay,testname=autopilot.sh/714/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/1557
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1517
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1517
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1517
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1517/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1517
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1517/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1517
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1517/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1517
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1517/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1517
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1517/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1517
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1517/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1164/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:2376
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1208/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/749
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/749
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/1622
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1577
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1577
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1570
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1570/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1570
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1570/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1570
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1570/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1570
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1570/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1570
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1570/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1570
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1570/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1208/rebuild

review: Approve (continuous-integration)
2380. By Albert Astals Cid

Merge

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:2380
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1254/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/790
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/790
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/1690
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1640
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1640
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1633
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1633/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1633
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1633/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1633
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1633/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1633
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1633/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1633
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1633/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1633
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1633/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1254/rebuild

review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/CMakeLists.txt'
2--- src/CMakeLists.txt 2016-02-17 15:54:34 +0000
3+++ src/CMakeLists.txt 2016-05-19 07:31:43 +0000
4@@ -24,6 +24,7 @@
5 ShellApplication.cpp
6 ShellView.cpp
7 UnityCommandLineParser.cpp
8+ UnixSignalHandler.cpp
9 ${QML_FILES} # This is to make qml and image files appear in the IDE's project tree
10 )
11
12
13=== modified file 'src/Dash/CMakeLists.txt'
14--- src/Dash/CMakeLists.txt 2016-02-17 15:54:34 +0000
15+++ src/Dash/CMakeLists.txt 2016-05-19 07:31:43 +0000
16@@ -1,6 +1,7 @@
17 set(DASH_SRCS
18 main.cpp
19 ../CachingNetworkManagerFactory.cpp
20+ ../UnixSignalHandler.cpp
21 )
22
23 if (ENABLE_TOUCH_EMULATION)
24
25=== modified file 'src/Dash/main.cpp'
26--- src/Dash/main.cpp 2016-04-08 09:31:05 +0000
27+++ src/Dash/main.cpp 2016-05-19 07:31:43 +0000
28@@ -32,6 +32,7 @@
29 #include "../MouseTouchAdaptor.h"
30 #endif
31 #include "../CachingNetworkManagerFactory.h"
32+#include "../UnixSignalHandler.h"
33
34 int main(int argc, const char *argv[])
35 {
36@@ -116,6 +117,11 @@
37 view->setSource(source);
38 view->show();
39
40+ UnixSignalHandler signalHandler([]{
41+ QGuiApplication::exit(0);
42+ });
43+ signalHandler.setupUnixSignalHandlers();
44+
45 int result = application->exec();
46
47 delete view;
48
49=== renamed file 'tools/unix-signal-handler.cpp' => 'src/UnixSignalHandler.cpp'
50--- tools/unix-signal-handler.cpp 2015-07-01 10:48:40 +0000
51+++ src/UnixSignalHandler.cpp 2016-05-19 07:31:43 +0000
52@@ -16,7 +16,7 @@
53 * Author: Marcus Tomlinson <marcus.tomlinson@canonical.com>
54 */
55
56-#include "unix-signal-handler.h"
57+#include "UnixSignalHandler.h"
58
59 #include <QDebug>
60
61
62=== renamed file 'tools/unix-signal-handler.h' => 'src/UnixSignalHandler.h'
63=== modified file 'src/main.cpp'
64--- src/main.cpp 2016-04-08 09:31:05 +0000
65+++ src/main.cpp 2016-05-19 07:31:43 +0000
66@@ -17,6 +17,7 @@
67 // local
68 #include "ShellApplication.h"
69 #include "qmldebuggerutils.h"
70+#include "UnixSignalHandler.h"
71
72 int main(int argc, const char *argv[])
73 {
74@@ -32,6 +33,11 @@
75
76 ShellApplication *application = new ShellApplication(argc, (char**)argv, isMirServer);
77
78+ UnixSignalHandler signalHandler([]{
79+ QGuiApplication::exit(0);
80+ });
81+ signalHandler.setupUnixSignalHandlers();
82+
83 int result = application->exec();
84
85 application->destroyResources();
86
87=== modified file 'tools/CMakeLists.txt'
88--- tools/CMakeLists.txt 2015-07-01 10:48:40 +0000
89+++ tools/CMakeLists.txt 2016-05-19 07:31:43 +0000
90@@ -1,7 +1,7 @@
91 add_executable(${SCOPE_TOOL}
92 scopetool.cpp
93 registry-tracker.cpp
94- unix-signal-handler.cpp
95+ ../src/UnixSignalHandler.cpp
96 )
97
98 qt5_use_modules(${SCOPE_TOOL} Qml Quick)
99
100=== modified file 'tools/scopetool.cpp'
101--- tools/scopetool.cpp 2015-09-22 10:44:21 +0000
102+++ tools/scopetool.cpp 2016-05-19 07:31:43 +0000
103@@ -32,7 +32,7 @@
104 // local
105 #include <paths.h>
106 #include "registry-tracker.h"
107-#include "unix-signal-handler.h"
108+#include "../src/UnixSignalHandler.h"
109
110
111 int main(int argc, char *argv[])

Subscribers

People subscribed via source and target branches