Merge lp:~mardy/ubuntu-system-settings-online-accounts/lp1380914-rtm into lp:ubuntu-system-settings-online-accounts/rtm-14.09

Proposed by Alberto Mardegan
Status: Merged
Approved by: David Barth
Approved revision: 204
Merged at revision: 204
Proposed branch: lp:~mardy/ubuntu-system-settings-online-accounts/lp1380914-rtm
Merge into: lp:ubuntu-system-settings-online-accounts/rtm-14.09
Diff against target: 95 lines (+24/-5)
5 files modified
online-accounts-service/request-manager.cpp (+1/-3)
online-accounts-service/request.cpp (+14/-0)
online-accounts-service/request.h (+1/-0)
online-accounts-ui/signonui-request.cpp (+3/-1)
tests/online-accounts-service/tst_service.pro (+5/-1)
To merge this branch: bzr merge lp:~mardy/ubuntu-system-settings-online-accounts/lp1380914-rtm
Reviewer Review Type Date Requested Status
David Barth (community) Approve
Review via email: mp+246573@code.launchpad.net

Commit message

Use trusted prompts for SignOnUi

Description of the change

Use trusted prompts for SignOnUi

To post a comment you must log in.
Revision history for this message
David Barth (dbarth) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'online-accounts-service/request-manager.cpp'
2--- online-accounts-service/request-manager.cpp 2014-08-19 09:34:33 +0000
3+++ online-accounts-service/request-manager.cpp 2015-01-15 14:04:34 +0000
4@@ -117,9 +117,7 @@
5 return; // Nothing to do
6 }
7
8- pid_t clientPid = (request->interface() == OAU_INTERFACE) ?
9- request->parameters().value(OAU_KEY_PID, 0).toUInt() : 0;
10- UiProxy *proxy = new UiProxy(clientPid, this);
11+ UiProxy *proxy = new UiProxy(request->clientPid(), this);
12 if (Q_UNLIKELY(!proxy->init())) {
13 qWarning() << "UiProxy initialization failed!";
14 runQueue(queue);
15
16=== modified file 'online-accounts-service/request.cpp'
17--- online-accounts-service/request.cpp 2014-11-28 10:23:47 +0000
18+++ online-accounts-service/request.cpp 2015-01-15 14:04:34 +0000
19@@ -22,6 +22,8 @@
20 #include "globals.h"
21 #include "request.h"
22
23+#include <SignOn/uisessiondata_priv.h>
24+
25 using namespace OnlineAccountsUi;
26
27 static bool mapIsSuperset(const QVariantMap &test, const QVariantMap &set)
28@@ -149,6 +151,18 @@
29 return d->windowId();
30 }
31
32+pid_t Request::clientPid() const
33+{
34+ Q_D(const Request);
35+ if (interface() == OAU_INTERFACE) {
36+ return d->m_parameters.value(OAU_KEY_PID, 0).toUInt();
37+ } else if (interface() == SIGNONUI_INTERFACE) {
38+ return d->m_parameters.value(SSOUI_KEY_PID, 0).toUInt();
39+ }
40+
41+ return 0;
42+}
43+
44 void Request::setInProgress(bool inProgress)
45 {
46 Q_D(Request);
47
48=== modified file 'online-accounts-service/request.h'
49--- online-accounts-service/request.h 2014-11-28 10:23:47 +0000
50+++ online-accounts-service/request.h 2015-01-15 14:04:34 +0000
51@@ -43,6 +43,7 @@
52 static Request *find(const QVariantMap &match);
53
54 quint64 windowId() const;
55+ pid_t clientPid() const;
56 void setInProgress(bool inProgress);
57 bool isInProgress() const;
58 const QVariantMap &parameters() const;
59
60=== modified file 'online-accounts-ui/signonui-request.cpp'
61--- online-accounts-ui/signonui-request.cpp 2014-10-10 12:29:38 +0000
62+++ online-accounts-ui/signonui-request.cpp 2015-01-15 14:04:34 +0000
63@@ -275,7 +275,9 @@
64 * Then, if this is called again with the same QWindow, it means that the
65 * snap decision was accepted, and we show the window.
66 */
67- if (window == d->m_window) {
68+ if (window == d->m_window ||
69+ /* If we are part of a prompt session, just show the window */
70+ !qgetenv("MIR_SOCKET").isEmpty()) {
71 OnlineAccountsUi::Request::setWindow(window);
72 d->m_window = 0;
73 } else {
74
75=== modified file 'tests/online-accounts-service/tst_service.pro'
76--- tests/online-accounts-service/tst_service.pro 2014-08-08 11:37:56 +0000
77+++ tests/online-accounts-service/tst_service.pro 2015-01-15 14:04:34 +0000
78@@ -3,13 +3,17 @@
79 TARGET = tst_service
80
81 CONFIG += \
82- debug
83+ debug \
84+ link_pkgconfig
85
86 QT += \
87 core \
88 dbus \
89 testlib
90
91+PKGCONFIG += \
92+ signon-plugins-common
93+
94 DEFINES += \
95 NO_REQUEST_FACTORY
96

Subscribers

People subscribed via source and target branches