Merge lp:~mterry/unity8/display-real-name into lp:unity8

Proposed by Michael Terry
Status: Merged
Approved by: Michael Zanetti
Approved revision: 2150
Merged at revision: 2174
Proposed branch: lp:~mterry/unity8/display-real-name
Merge into: lp:unity8
Diff against target: 160 lines (+30/-25)
10 files modified
CMakeLists.txt (+3/-0)
plugins/IntegratedLightDM/liblightdm/CMakeLists.txt (+3/-0)
plugins/IntegratedLightDM/liblightdm/UsersModelPrivate.cpp (+24/-8)
plugins/Powerd/CMakeLists.txt (+0/-2)
plugins/Unity/Indicators/CMakeLists.txt (+0/-4)
plugins/Unity/Session/CMakeLists.txt (+0/-2)
plugins/Utils/CMakeLists.txt (+0/-2)
tests/mocks/Utils/CMakeLists.txt (+0/-2)
tests/mocks/indicator-service/CMakeLists.txt (+0/-1)
tests/plugins/Unity/Indicators/CMakeLists.txt (+0/-4)
To merge this branch: bzr merge lp:~mterry/unity8/display-real-name
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Unity8 CI Bot continuous-integration Needs Fixing
Michael Zanetti (community) Approve
Review via email: mp+284635@code.launchpad.net

Commit message

Display the current user's real name on the tablet lockscreen.

Description of the change

This was happening because the only thing we ever checked for a real name was the ancient ~/.unity8-greeter-demo file. I've fixed this to check the passwd entry if no demo file exists (the 99.99% case).

- I've done a bit of CMakeLists.txt cleanup, unifying the check for glib/gio/qmenumodel.

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

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

 * Did you make sure that your branch does not contain spurious tags?
 Yes

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

 * If you changed the UI, has there been a design review?
 NA

To post a comment you must log in.
lp:~mterry/unity8/display-real-name updated
2147. By Michael Terry

Drop hack, not needed yet

2148. By Michael Terry

Drop unneeded header

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:2146
http://jenkins.qa.ubuntu.com/job/unity8-ci/7186/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/6285
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-xenial-touch/601/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/1891
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity8-qmluitest-xenial-amd64/594
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1786
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1786
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-amd64-ci/593
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-i386-ci/592
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-touch/4833
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/6296
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/6296/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/27209
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-xenial-touch/316/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/599
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/599/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/27208

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/7186/rebuild

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

FAILED: Continuous integration, rev:2146
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/237/
Executed test runs:

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

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

FAILED: Continuous integration, rev:2148
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/238/
Executed test runs:

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

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

FAILED: Continuous integration, rev:2148
http://jenkins.qa.ubuntu.com/job/unity8-ci/7187/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/6286
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-xenial-touch/602/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/1892
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity8-qmluitest-xenial-amd64/595
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1787
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1787
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-amd64-ci/594
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-i386-ci/593
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-touch/4834
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/6297
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/6297/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/27215
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-xenial-touch/317/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/600
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/600/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/27214

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/7187/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote :

<mzanetti> Saviq, do we still want that greeter_demo_mode file? IMO we could just drop it by now
<Saviq> mzanetti, right, probably
<Saviq> we probably even forgot we had it and hence the whole problem ;)
 could've just populated it instead :D

Mike, wdyt?

review: Needs Information
Revision history for this message
Michael Terry (mterry) wrote :

If we remove the demo mode, we have no way to demonstrate what a multi-user greeter looks like.

Maybe that's OK these days, because at this point in our demos, if we show it, users expect it to really work?

But without a working split greeter, we can't replicate the look of multi-users. Are we fine with that?

Revision history for this message
Michael Zanetti (mzanetti) wrote :

some inline comments on the username code.

CMakeLists changes look ok, compiles fine.

review: Needs Fixing
lp:~mterry/unity8/display-real-name updated
2149. By Michael Terry

Use clear

Revision history for this message
Michael Terry (mterry) wrote :

Addressed your comments.

lp:~mterry/unity8/display-real-name updated
2150. By Michael Terry

Use utf8 encoding

Revision history for this message
Michael Zanetti (mzanetti) wrote :

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

yes

 * Did CI run pass? If not, please explain why.

hmm. unrelated failure.

 * Did you make sure that the branch does not contain spurious tags?

yep

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

FAILED: Continuous integration, rev:2149
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/276/
Executed test runs:

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

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

FAILED: Continuous integration, rev:2150
http://jenkins.qa.ubuntu.com/job/unity8-ci/7218/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/6335
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-xenial-touch/633/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/1923
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity8-qmluitest-xenial-amd64/626
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1818
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1818
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-amd64-ci/625
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-i386-ci/624
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-touch/4865
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/6346
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/6346/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/27324
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-xenial-touch/334/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/631
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/631/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/27322

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/7218/rebuild

review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2015-12-16 13:58:39 +0000
3+++ CMakeLists.txt 2016-02-04 14:10:58 +0000
4@@ -58,6 +58,9 @@
5 find_package(Qt5Sql 5.4 REQUIRED)
6
7 pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=12)
8+pkg_check_modules(GIO REQUIRED gio-2.0>=2.32)
9+pkg_check_modules(GLIB REQUIRED glib-2.0>=2.32)
10+pkg_check_modules(QMENUMODEL REQUIRED qmenumodel)
11
12 # Standard install paths
13 include(GNUInstallDirs)
14
15=== modified file 'plugins/IntegratedLightDM/liblightdm/CMakeLists.txt'
16--- plugins/IntegratedLightDM/liblightdm/CMakeLists.txt 2015-09-21 12:14:55 +0000
17+++ plugins/IntegratedLightDM/liblightdm/CMakeLists.txt 2016-02-04 14:10:58 +0000
18@@ -13,14 +13,17 @@
19
20 include_directories(
21 ${CMAKE_CURRENT_BINARY_DIR}
22+ ${GLIB_INCLUDE_DIRS}
23 ${LIBUSERMETRICSOUTPUT_INCLUDE_DIRS}
24 )
25
26 target_link_libraries(integratedLightDM
27+ ${GLIB_LIBRARIES}
28 ${LIBUSERMETRICSOUTPUT_LDFLAGS}
29 -lpam
30 )
31 target_link_libraries(MockLightDM-demo-shared
32+ ${GLIB_LIBRARIES}
33 ${LIBUSERMETRICSOUTPUT_LDFLAGS}
34 -lpam
35 )
36
37=== modified file 'plugins/IntegratedLightDM/liblightdm/UsersModelPrivate.cpp'
38--- plugins/IntegratedLightDM/liblightdm/UsersModelPrivate.cpp 2015-11-05 03:51:47 +0000
39+++ plugins/IntegratedLightDM/liblightdm/UsersModelPrivate.cpp 2016-02-04 14:10:58 +0000
40@@ -18,6 +18,7 @@
41
42 #include "UsersModelPrivate.h"
43
44+#include <glib.h>
45 #include <QDir>
46 #include <QSettings>
47 #include <QStringList>
48@@ -28,14 +29,29 @@
49 UsersModelPrivate::UsersModelPrivate(UsersModel* parent)
50 : q_ptr(parent)
51 {
52- QSettings settings(QDir::homePath() + "/.unity8-greeter-demo", QSettings::NativeFormat);
53- QStringList users = settings.value(QStringLiteral("users"), QStringList() << qgetenv("USER")).toStringList();
54-
55- entries.reserve(users.count());
56- Q_FOREACH(const QString &user, users)
57- {
58- QString name = settings.value(user + "/name", user).toString();
59- entries.append({user, name, 0, 0, false, false, 0, 0});
60+ QFileInfo demoFile(QDir::homePath() + "/.unity8-greeter-demo");
61+ QString currentUser = g_get_user_name();
62+
63+ if (demoFile.exists()) {
64+ QSettings settings(demoFile.filePath(), QSettings::NativeFormat);
65+ QStringList users = settings.value(QStringLiteral("users"), QStringList() << currentUser).toStringList();
66+
67+ entries.reserve(users.count());
68+ Q_FOREACH(const QString &user, users)
69+ {
70+ QString name = settings.value(user + "/name", user).toString();
71+ entries.append({user, name, 0, 0, false, false, 0, 0});
72+ }
73+ } else {
74+ // If we were using the actual liblightdm, we could just ask it
75+ // for the user's real name. But we aren't. We *should* ask
76+ // AccountsService for the real name, like liblightdm does internally,
77+ // but this is close enough since AS and passwd are always in sync.
78+ QString realName = QString::fromUtf8(g_get_real_name()); // gets name from passwd entry
79+ if (realName == QStringLiteral("Unknown")) { // glib doesn't translate this string
80+ realName.clear();
81+ }
82+ entries.append({currentUser, realName, 0, 0, false, false, 0, 0});
83 }
84 }
85
86
87=== modified file 'plugins/Powerd/CMakeLists.txt'
88--- plugins/Powerd/CMakeLists.txt 2015-02-03 12:17:50 +0000
89+++ plugins/Powerd/CMakeLists.txt 2016-02-04 14:10:58 +0000
90@@ -1,5 +1,3 @@
91-pkg_search_module(GIO REQUIRED gio-2.0)
92-
93 include_directories(
94 ${GIO_INCLUDE_DIRS}
95 )
96
97=== modified file 'plugins/Unity/Indicators/CMakeLists.txt'
98--- plugins/Unity/Indicators/CMakeLists.txt 2015-11-16 14:02:01 +0000
99+++ plugins/Unity/Indicators/CMakeLists.txt 2016-02-04 14:10:58 +0000
100@@ -1,9 +1,5 @@
101 project(IndicatorsQml)
102
103-pkg_check_modules(GLIB REQUIRED glib-2.0>=2.32)
104-pkg_check_modules(GIO REQUIRED gio-2.0>=2.32)
105-pkg_check_modules(QMENUMODEL REQUIRED qmenumodel)
106-
107 find_package(Qt5Core REQUIRED)
108 find_package(Qt5Quick REQUIRED)
109
110
111=== modified file 'plugins/Unity/Session/CMakeLists.txt'
112--- plugins/Unity/Session/CMakeLists.txt 2015-06-18 16:06:44 +0000
113+++ plugins/Unity/Session/CMakeLists.txt 2016-02-04 14:10:58 +0000
114@@ -1,5 +1,3 @@
115-pkg_search_module(GIO REQUIRED gio-2.0)
116-
117 include_directories(
118 ${CMAKE_CURRENT_SOURCE_DIR}
119 ${CMAKE_CURRENT_BINARY_DIR}
120
121=== modified file 'plugins/Utils/CMakeLists.txt'
122--- plugins/Utils/CMakeLists.txt 2016-01-29 11:52:14 +0000
123+++ plugins/Utils/CMakeLists.txt 2016-02-04 14:10:58 +0000
124@@ -1,5 +1,3 @@
125-pkg_search_module(GIO REQUIRED gio-2.0)
126-
127 include_directories(
128 ${CMAKE_CURRENT_SOURCE_DIR}
129 ${CMAKE_CURRENT_BINARY_DIR}
130
131=== modified file 'tests/mocks/Utils/CMakeLists.txt'
132--- tests/mocks/Utils/CMakeLists.txt 2016-01-13 17:52:51 +0000
133+++ tests/mocks/Utils/CMakeLists.txt 2016-02-04 14:10:58 +0000
134@@ -1,5 +1,3 @@
135-pkg_search_module(GIO REQUIRED gio-2.0)
136-
137 include_directories(
138 ${CMAKE_CURRENT_SOURCE_DIR}
139 ${CMAKE_CURRENT_BINARY_DIR}
140
141=== modified file 'tests/mocks/indicator-service/CMakeLists.txt'
142--- tests/mocks/indicator-service/CMakeLists.txt 2015-04-07 11:48:34 +0000
143+++ tests/mocks/indicator-service/CMakeLists.txt 2016-02-04 14:10:58 +0000
144@@ -1,5 +1,4 @@
145 project(mock-indicator-service)
146-pkg_search_module(GIO REQUIRED gio-2.0)
147
148 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
149
150
151=== modified file 'tests/plugins/Unity/Indicators/CMakeLists.txt'
152--- tests/plugins/Unity/Indicators/CMakeLists.txt 2015-11-16 14:02:01 +0000
153+++ tests/plugins/Unity/Indicators/CMakeLists.txt 2016-02-04 14:10:58 +0000
154@@ -1,7 +1,3 @@
155-pkg_check_modules(GLIB REQUIRED glib-2.0>=2.32)
156-pkg_check_modules(GIO REQUIRED gio-2.0>=2.32)
157-pkg_check_modules(QMENUMODEL REQUIRED qmenumodel)
158-
159 set(INDICATORS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../../plugins/Unity/Indicators)
160 set(TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../..)
161

Subscribers

People subscribed via source and target branches