Merge lp:~kdub/content-hub/mir-deprecations into lp:content-hub

Proposed by Kevin DuBois
Status: Merged
Approved by: Ken VanDine
Approved revision: 326
Merged at revision: 336
Proposed branch: lp:~kdub/content-hub/mir-deprecations
Merge into: lp:content-hub
Diff against target: 95 lines (+12/-25)
4 files modified
debian/control (+1/-1)
examples/pasteboard/copy.cpp (+3/-3)
examples/pasteboard/paste.cpp (+3/-3)
src/com/ubuntu/content/detail/mir-helper.cpp (+5/-18)
To merge this branch: bzr merge lp:~kdub/content-hub/mir-deprecations
Reviewer Review Type Date Requested Status
Ken VanDine Approve
Review via email: mp+317770@code.launchpad.net

Commit message

mir-helper: transition deprecated functions from mir 0.26 to the non-deprecated alternatives.

Description of the change

mir-helper: transition deprecated functions from mir 0.26 to the non-deprecated alternatives.

To post a comment you must log in.
Revision history for this message
Alberto Mardegan (mardy) wrote :

Thanks Kevin! For the record, I applied the same changes to Online Accounts (minus cosmetic changes):

https://code.launchpad.net/~mardy/ubuntu-system-settings-online-accounts/mir-deprecations/+merge/317949

321. By Kevin DuBois

merge in mir

322. By Kevin DuBois

fix changelog

Revision history for this message
Kevin DuBois (kdub) wrote :

> Thanks Kevin! For the record, I applied the same changes to Online Accounts
> (minus cosmetic changes):
>
> https://code.launchpad.net/~mardy/ubuntu-system-settings-online-accounts/mir-
> deprecations/+merge/317949

Cool, could you suggest a way to test the change? I don't think its covered in the unit tests.

Revision history for this message
Ken VanDine (ken-vandine) wrote :

Please remove the changelog entry. Otherwise it looks good. You can run through the manual test plan at https://wiki.ubuntu.com/Process/Merges/TestPlan/content-hub

review: Needs Fixing
Revision history for this message
Ken VanDine (ken-vandine) wrote :

Also please update the build depends version

review: Needs Fixing
323. By Kevin DuBois

merge in lp:content-hub

324. By Kevin DuBois

remove changelog addition

325. By Kevin DuBois

make mir build-depends on 0.26.0

326. By Kevin DuBois

correct control entry

Revision history for this message
Kevin DuBois (kdub) wrote :

> Please remove the changelog entry. Otherwise it looks good. You can run
> through the manual test plan at
> https://wiki.ubuntu.com/Process/Merges/TestPlan/content-hub

There's a fair amount in the test plan that I don't quite understand, but can test best I can...
eg, not sure what "peers" are in this context.

Revision history for this message
Ken VanDine (ken-vandine) wrote :

Thanks, looks great!

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 2017-03-15 12:54:42 +0000
3+++ debian/control 2017-04-03 16:55:51 +0000
4@@ -12,7 +12,7 @@
5 libapparmor-dev,
6 libglib2.0-dev,
7 libgsettings-qt-dev,
8- libmirclient-dev [!powerpc !ppc64 !ppc64el],
9+ libmirclient-dev (>= 0.26.0) [!powerpc !ppc64 !ppc64el],
10 liblibertine-dev,
11 libnih-dbus-dev,
12 libnotify-dev,
13
14=== modified file 'examples/pasteboard/copy.cpp'
15--- examples/pasteboard/copy.cpp 2016-08-23 20:17:57 +0000
16+++ examples/pasteboard/copy.cpp 2017-04-03 16:55:51 +0000
17@@ -43,9 +43,9 @@
18
19 /* Won't work unless you disable the surface Id verification with CONTENT_HUB_TESTING=1 env var
20 To get the surface Id of a MirSurface in a real GUI app you should to it like the following:
21- MirPersistentId* mirPermaId = mir_surface_request_persistent_id_sync(mirSurface);
22- QString surfaceId = mir_persistent_id_as_string(mirPermaId);
23- mir_persistent_id_release(mirPermaId);
24+ MirWindowId* mirWindowId = mir_window_request_window_id_sync(mirWindow);
25+ QString windowId = mir_window_id_as_string(mirWindowId);
26+ mir_window_id_release(mirWindowId);
27 */
28 QString surfaceId("some-bogus-fake-surface-id");
29
30
31=== modified file 'examples/pasteboard/paste.cpp'
32--- examples/pasteboard/paste.cpp 2016-08-23 20:17:57 +0000
33+++ examples/pasteboard/paste.cpp 2017-04-03 16:55:51 +0000
34@@ -38,9 +38,9 @@
35
36 /* Won't work unless you disable the surface Id verification with CONTENT_HUB_TESTING=1 env var
37 To get the surface Id of a MirSurface in a real GUI app you should to it like the following:
38- MirPersistentId* mirPermaId = mir_surface_request_persistent_id_sync(mirSurface);
39- QString surfaceId = mir_persistent_id_as_string(mirPermaId);
40- mir_persistent_id_release(mirPermaId);
41+ MirWindowId* mirWindowId = mir_window_request_window_id_sync(mirWindow);
42+ QString windowId = mir_window_id_as_string(mirPermaId);
43+ mir_window_id_release(mirWindowId);
44 */
45 QString surfaceId("some-bogus-fake-surface-id");
46
47
48=== modified file 'src/com/ubuntu/content/detail/mir-helper.cpp'
49--- src/com/ubuntu/content/detail/mir-helper.cpp 2016-11-10 21:10:51 +0000
50+++ src/com/ubuntu/content/detail/mir-helper.cpp 2017-04-03 16:55:51 +0000
51@@ -35,7 +35,6 @@
52
53 MirPromptSession *m_mirSession;
54 pid_t m_initiatorPid;
55- QList<int> m_fds;
56 mutable PromptSession *q_ptr;
57 };
58
59@@ -88,16 +87,6 @@
60 delete d_ptr;
61 }
62
63-static void client_fd_callback(MirPromptSession *, size_t count,
64- int const *fds, void *context)
65-{
66- TRACE() << Q_FUNC_INFO;
67- PromptSessionPrivate *priv = (PromptSessionPrivate *)context;
68- for (size_t i = 0; i < count; i++) {
69- priv->m_fds.append(fds[i]);
70- }
71-}
72-
73 MirPromptSession* PromptSession::get()
74 {
75 TRACE() << Q_FUNC_INFO;
76@@ -119,14 +108,12 @@
77 TRACE() << Q_FUNC_INFO;
78 Q_D(PromptSession);
79
80- d->m_fds.clear();
81- mir_wait_for(mir_prompt_session_new_fds_for_prompt_providers(
82- d->m_mirSession, 1, client_fd_callback, d));
83- if (!d->m_fds.isEmpty()) {
84- return QString("%1").arg(d->m_fds[0]);
85- } else {
86+ int fd = -1;
87+ auto num_fds = mir_prompt_session_new_fds_for_prompt_providers_sync(d->m_mirSession, 1, &fd);
88+ if (fd >= 0 && num_fds == 1)
89+ return QString("%1").arg(fd);
90+ else
91 return QString();
92- }
93 }
94
95 MirHelperPrivate::MirHelperPrivate(MirHelper *helper):

Subscribers

People subscribed via source and target branches