Merge lp:~ted/unity-mir/ubuntu-app-launch into lp:unity-mir

Proposed by Ted Gould
Status: Merged
Approved by: Gerry Boland
Approved revision: 226
Merged at revision: 227
Proposed branch: lp:~ted/unity-mir/ubuntu-app-launch
Merge into: lp:unity-mir
Diff against target: 202 lines (+35/-35)
4 files modified
debian/control (+2/-2)
src/modules/Unity/Application/CMakeLists.txt (+1/-1)
src/modules/Unity/Application/upstart/applicationcontroller.cpp (+30/-30)
tests/auto/modules/Unity/Application/CMakeLists.txt (+2/-2)
To merge this branch: bzr merge lp:~ted/unity-mir/ubuntu-app-launch
Reviewer Review Type Date Requested Status
Gerry Boland (community) Approve
Sebastien Bacher (community) the debian changes Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Review via email: mp+220905@code.launchpad.net

Commit message

UAL name chance got Ubuntu App Launch

Description of the change

Didn't change the interface from the module, just the change needed with the library change.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Gerry Boland (gerboland) wrote :

Please add Checklist, including listing dependant branches:
https://wiki.ubuntu.com/Process/Merges/Checklists/Unity-Mir

Commit message needs expanding. Name change of what exactly?

Note we use "upstart" in many more places in the code, including a specific "upstart" directory in src/modules/Unity/Application/, an upstart namespace and comments & tests referring to "upstart" - so please update those too.

Higher level question: why is this launch tool "ubuntu" specific?

review: Needs Fixing
lp:~ted/unity-mir/ubuntu-app-launch updated
226. By Ted Gould

Wrong type name

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Sebastien Bacher (seb128) wrote :

the packaging changes look fine to me, thanks

review: Approve (the debian changes)
Revision history for this message
Ted Gould (ted) wrote :

On Mon, 2014-05-26 at 09:52 +0000, Gerry Boland wrote:

> Please add Checklist, including listing dependant branches:
> https://wiki.ubuntu.com/Process/Merges/Checklists/Unity-Mir

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

https://code.launchpad.net/~ted/upstart-app-launch/rename/+merge/217819

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

Ensured that it builds and runs, expect to do more testing on the
landing PPA. Need to get all the packages working together to test.

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

Asked for a packaging review

> Commit message needs expanding. Name change of what exactly?

Updated.

> Note we use "upstart" in many more places in the code, including a specific "upstart" directory in src/modules/Unity/Application/, an upstart namespace and comments & tests referring to "upstart" - so please update those too.

Well, those comments are still correct, we *are* using Upstart in those
places. I looked at them and they still seemed correct. I can change
them to "init system" but "Ubuntu" is the wrong substitution.

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

LGTM, approved

 * Did you perform an exploratory manual test run of the code change and any related functionality?
N - waiting for the silo to build everything ok
 * Did CI run pass? If not, please explain why.
N - package name change

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/control'
2--- debian/control 2014-04-30 15:56:45 +0000
3+++ debian/control 2014-05-26 10:35:25 +0000
4@@ -13,7 +13,7 @@
5 libmirclient-dev (>= 0.1.8),
6 libprocess-cpp-dev,
7 libunity-api-dev (>= 7.80.6),
8- libupstart-app-launch2-dev,
9+ libubuntu-app-launch2-dev,
10 qt5-default,
11 qtbase5-dev,
12 qtdeclarative5-dev,
13@@ -49,7 +49,7 @@
14 Depends: ${misc:Depends},
15 ${shlibs:Depends},
16 libunity-mir1 (= ${binary:Version}),
17- libupstart-app-launch2-dev,
18+ libubuntu-app-launch2-dev,
19 libmirserver-dev (>= 0.1.8),
20 libmirclient-dev (>= 0.1.8),
21 libplatform-api1-dev,
22
23=== modified file 'src/modules/Unity/Application/CMakeLists.txt'
24--- src/modules/Unity/Application/CMakeLists.txt 2014-03-28 16:41:02 +0000
25+++ src/modules/Unity/Application/CMakeLists.txt 2014-05-26 10:35:25 +0000
26@@ -1,6 +1,6 @@
27 pkg_check_modules(GLIB glib-2.0 REQUIRED)
28 pkg_check_modules(PROCESS_CPP process-cpp REQUIRED)
29-pkg_check_modules(UPSTART_APP_LAUNCH upstart-app-launch-2 REQUIRED)
30+pkg_check_modules(UPSTART_APP_LAUNCH ubuntu-app-launch-2 REQUIRED)
31
32 add_definitions(-DQT_PLUGIN)
33
34
35=== modified file 'src/modules/Unity/Application/upstart/applicationcontroller.cpp'
36--- src/modules/Unity/Application/upstart/applicationcontroller.cpp 2014-05-15 14:29:26 +0000
37+++ src/modules/Unity/Application/upstart/applicationcontroller.cpp 2014-05-26 10:35:25 +0000
38@@ -25,7 +25,7 @@
39
40 // upstart
41 extern "C" {
42- #include "upstart-app-launch.h"
43+ #include "ubuntu-app-launch.h"
44 }
45
46 namespace unitymir
47@@ -35,12 +35,12 @@
48
49 struct ApplicationController::Private
50 {
51- upstart_app_launch_app_observer_t preStartCallback = nullptr;
52- upstart_app_launch_app_observer_t startedCallback = nullptr;
53- upstart_app_launch_app_observer_t stopCallback = nullptr;
54- upstart_app_launch_app_observer_t focusCallback = nullptr;
55- upstart_app_launch_app_observer_t resumeCallback = nullptr;
56- upstart_app_launch_app_failed_observer_t failureCallback = nullptr;
57+ UbuntuAppLaunchAppObserver preStartCallback = nullptr;
58+ UbuntuAppLaunchAppObserver startedCallback = nullptr;
59+ UbuntuAppLaunchAppObserver stopCallback = nullptr;
60+ UbuntuAppLaunchAppObserver focusCallback = nullptr;
61+ UbuntuAppLaunchAppObserver resumeCallback = nullptr;
62+ UbuntuAppLaunchAppFailedObserver failureCallback = nullptr;
63 };
64
65 namespace {
66@@ -51,7 +51,7 @@
67 */
68 QString toShortAppIdIfPossible(const QString &appId) {
69 gchar *package, *application;
70- if (upstart_app_launch_app_id_parse(appId.toLatin1().constData(), &package, &application, nullptr)) {
71+ if (ubuntu_app_launch_app_id_parse(appId.toLatin1().constData(), &package, &application, nullptr)) {
72 // is long appId, so assemble its short appId
73 QString shortAppId = QString("%1_%2").arg(package).arg(application);
74 g_free(package);
75@@ -69,7 +69,7 @@
76 * entered, it is returned unchanged. Anything else is also returned unchanged.
77 */
78 QString toLongAppIdIfPossible(const QString &shortAppId) {
79- if (upstart_app_launch_app_id_parse(shortAppId.toLatin1().constData(), nullptr, nullptr, nullptr)) {
80+ if (ubuntu_app_launch_app_id_parse(shortAppId.toLatin1().constData(), nullptr, nullptr, nullptr)) {
81 // then we got a long appId after all, just return it
82 return shortAppId;
83 } else {
84@@ -83,7 +83,7 @@
85 // ask upstart for the long appId corresponding to this short appId
86 QStringList parts = shortAppId.split("_");
87 gchar *longAppId;
88- longAppId = upstart_app_launch_triplet_to_app_id(parts.first().toLatin1().constData(),
89+ longAppId = ubuntu_app_launch_triplet_to_app_id(parts.first().toLatin1().constData(),
90 parts.last().toLatin1().constData(),
91 nullptr);
92 if (longAppId == nullptr) {
93@@ -128,39 +128,39 @@
94 Q_EMIT(thiz->applicationResumeRequest(toShortAppIdIfPossible(appId)));
95 };
96
97- impl->failureCallback = [](const gchar * appId, upstart_app_launch_app_failed_t failureType, gpointer userData) {
98+ impl->failureCallback = [](const gchar * appId, UbuntuAppLaunchAppFailed failureType, gpointer userData) {
99 ApplicationController::Error error;
100 switch(failureType)
101 {
102- case UPSTART_APP_LAUNCH_APP_FAILED_CRASH: error = ApplicationController::Error::APPLICATION_CRASHED;
103- case UPSTART_APP_LAUNCH_APP_FAILED_START_FAILURE: error = ApplicationController::Error::APPLICATION_FAILED_TO_START;
104+ case UBUNTU_APP_LAUNCH_APP_FAILED_CRASH: error = ApplicationController::Error::APPLICATION_CRASHED;
105+ case UBUNTU_APP_LAUNCH_APP_FAILED_START_FAILURE: error = ApplicationController::Error::APPLICATION_FAILED_TO_START;
106 }
107
108 auto thiz = static_cast<ApplicationController*>(userData);
109 Q_EMIT(thiz->applicationError(toShortAppIdIfPossible(appId), error));
110 };
111
112- upstart_app_launch_observer_add_app_starting(impl->preStartCallback, this);
113- upstart_app_launch_observer_add_app_started(impl->startedCallback, this);
114- upstart_app_launch_observer_add_app_stop(impl->stopCallback, this);
115- upstart_app_launch_observer_add_app_focus(impl->focusCallback, this);
116- upstart_app_launch_observer_add_app_resume(impl->resumeCallback, this);
117- upstart_app_launch_observer_add_app_failed(impl->failureCallback, this);
118+ ubuntu_app_launch_observer_add_app_starting(impl->preStartCallback, this);
119+ ubuntu_app_launch_observer_add_app_started(impl->startedCallback, this);
120+ ubuntu_app_launch_observer_add_app_stop(impl->stopCallback, this);
121+ ubuntu_app_launch_observer_add_app_focus(impl->focusCallback, this);
122+ ubuntu_app_launch_observer_add_app_resume(impl->resumeCallback, this);
123+ ubuntu_app_launch_observer_add_app_failed(impl->failureCallback, this);
124 }
125
126 ApplicationController::~ApplicationController()
127 {
128- upstart_app_launch_observer_delete_app_starting(impl->preStartCallback, this);
129- upstart_app_launch_observer_delete_app_started(impl->startedCallback, this);
130- upstart_app_launch_observer_delete_app_stop(impl->stopCallback, this);
131- upstart_app_launch_observer_delete_app_focus(impl->focusCallback, this);
132- upstart_app_launch_observer_delete_app_resume(impl->resumeCallback, this);
133- upstart_app_launch_observer_delete_app_failed(impl->failureCallback, this);
134+ ubuntu_app_launch_observer_delete_app_starting(impl->preStartCallback, this);
135+ ubuntu_app_launch_observer_delete_app_started(impl->startedCallback, this);
136+ ubuntu_app_launch_observer_delete_app_stop(impl->stopCallback, this);
137+ ubuntu_app_launch_observer_delete_app_focus(impl->focusCallback, this);
138+ ubuntu_app_launch_observer_delete_app_resume(impl->resumeCallback, this);
139+ ubuntu_app_launch_observer_delete_app_failed(impl->failureCallback, this);
140 }
141
142 pid_t ApplicationController::primaryPidForAppId(const QString& appId)
143 {
144- GPid pid = upstart_app_launch_get_primary_pid(toLongAppIdIfPossible(appId).toLatin1().constData());
145+ GPid pid = ubuntu_app_launch_get_primary_pid(toLongAppIdIfPossible(appId).toLatin1().constData());
146 DLOG_IF(!pid, "ApplicationController::stopApplication appId='%s' FAILED", qPrintable(appId));
147
148 return pid;
149@@ -168,19 +168,19 @@
150
151 bool ApplicationController::appIdHasProcessId(pid_t pid, const QString& appId)
152 {
153- return upstart_app_launch_pid_in_app_id(pid, toLongAppIdIfPossible(appId).toLatin1().constData());
154+ return ubuntu_app_launch_pid_in_app_id(pid, toLongAppIdIfPossible(appId).toLatin1().constData());
155 }
156
157 bool ApplicationController::stopApplicationWithAppId(const QString& appId)
158 {
159- auto result = upstart_app_launch_stop_application(toLongAppIdIfPossible(appId).toLatin1().constData());
160+ auto result = ubuntu_app_launch_stop_application(toLongAppIdIfPossible(appId).toLatin1().constData());
161 DLOG_IF(!result, "ApplicationController::stopApplicationWithAppId appId='%s' FAILED", qPrintable(appId));
162 return result;
163 }
164
165 bool ApplicationController::startApplicationWithAppIdAndArgs(const QString& appId, const QStringList& arguments)
166 {
167- // Convert arguments QStringList into format suitable for upstart-app-launch
168+ // Convert arguments QStringList into format suitable for ubuntu-app-launch
169 // The last item should be null, which is done by g_new0, we just don't fill it.
170 auto upstartArgs = g_new0(gchar *, arguments.length() + 1);
171
172@@ -188,7 +188,7 @@
173 upstartArgs[i] = g_strdup(arguments.at(i).toUtf8().data());
174 }
175
176- auto result = upstart_app_launch_start_application(
177+ auto result = ubuntu_app_launch_start_application(
178 toLongAppIdIfPossible(appId).toLatin1().constData(),
179 static_cast<const gchar * const *>(upstartArgs));
180
181
182=== modified file 'tests/auto/modules/Unity/Application/CMakeLists.txt'
183--- tests/auto/modules/Unity/Application/CMakeLists.txt 2014-02-21 21:41:21 +0000
184+++ tests/auto/modules/Unity/Application/CMakeLists.txt 2014-05-26 10:35:25 +0000
185@@ -5,7 +5,7 @@
186 ${CMAKE_SOURCE_DIR}/src/unity-mir
187
188 ${MIRSERVER_INCLUDE_DIRS}
189- ${UPSTART_APP_LAUNCH_INCLUDE_DIRS})
190+ ${UBUNTU_APP_LAUNCH_INCLUDE_DIRS})
191
192 add_executable(
193 unity-mir-test-app
194@@ -20,7 +20,7 @@
195 unityapplicationplugin
196
197 ${MIRSERVER_LDFLAGS}
198- ${UPSTART_APP_LAUNCH_LDFLAGS})
199+ ${UBUNTU_APP_LAUNCH_LDFLAGS})
200
201 install(
202 TARGETS unity-mir-test-app

Subscribers

People subscribed via source and target branches