Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: kde-plasma/user-manager/files/, kde-plasma/user-manager/
Date: Wed, 16 May 2018 16:13:04
Message-Id: 1526487171.5b9b31ac57650d34987d52a2d5768f80aea92eaf.asturm@gentoo
1 commit: 5b9b31ac57650d34987d52a2d5768f80aea92eaf
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Wed May 16 16:11:34 2018 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Wed May 16 16:12:51 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5b9b31ac
7
8 kde-plasma/user-manager: Fix user account list
9
10 See also: https://bugs.kde.org/show_bug.cgi?id=336994
11
12 Package-Manager: Portage-2.3.36, Repoman-2.3.9
13
14 ...user-manager-5.12.5-fix-addAccountToCache.patch | 104 +++++++++++++++++++++
15 .../user-manager/user-manager-5.12.5-r1.ebuild | 29 ++++++
16 2 files changed, 133 insertions(+)
17
18 diff --git a/kde-plasma/user-manager/files/user-manager-5.12.5-fix-addAccountToCache.patch b/kde-plasma/user-manager/files/user-manager-5.12.5-fix-addAccountToCache.patch
19 new file mode 100644
20 index 00000000000..bc823adf8c9
21 --- /dev/null
22 +++ b/kde-plasma/user-manager/files/user-manager-5.12.5-fix-addAccountToCache.patch
23 @@ -0,0 +1,104 @@
24 +From ff88e24e4380a341f70f9b005acbce2ae9afa60a Mon Sep 17 00:00:00 2001
25 +From: Valeriy Malov <jazzvoid@×××××.com>
26 +Date: Sat, 12 May 2018 18:13:25 +0300
27 +Subject: Split replaceAccount from addAccountToCache
28 +
29 +Summary:
30 +We were accidentally overwriting first account in the model with
31 +currently logged in user after polling AccountsService
32 +
33 +BUG: 336994
34 +
35 +Test Plan: check if kcmshell5 user_manager lists mutliple users on cold boot
36 +
37 +Reviewers: #plasma, davidedmundson
38 +
39 +Reviewed By: #plasma, davidedmundson
40 +
41 +Subscribers: davidedmundson, ngraham, rdieter, plasma-devel
42 +
43 +Tags: #plasma
44 +
45 +Differential Revision: https://phabricator.kde.org/D12837
46 +---
47 + src/lib/accountmodel.cpp | 26 ++++++++++++++++----------
48 + src/lib/accountmodel.h | 1 +
49 + 2 files changed, 17 insertions(+), 10 deletions(-)
50 +
51 +diff --git a/src/lib/accountmodel.cpp b/src/lib/accountmodel.cpp
52 +index 8ebc4ff..8258810 100644
53 +--- a/src/lib/accountmodel.cpp
54 ++++ b/src/lib/accountmodel.cpp
55 +@@ -93,8 +93,8 @@ AccountModel::AccountModel(QObject* parent)
56 + addAccount(path.path());
57 + }
58 +
59 +- //Adding fake "new user" directly into cache
60 +- addAccountToCache("new-user", 0);
61 ++ // Adding fake "new user" directly into cache
62 ++ addAccountToCache("new-user", nullptr);
63 +
64 + m_kEmailSettings.setProfile(m_kEmailSettings.defaultProfileName());
65 +
66 +@@ -368,11 +368,7 @@ void AccountModel::addAccount(const QString& path)
67 + void AccountModel::addAccountToCache(const QString& path, Account* acc, int pos)
68 + {
69 + if (pos > -1) {
70 +- if (m_userPath.count() > 0) {
71 +- m_userPath.replace(pos, path);
72 +- } else {
73 +- m_userPath.insert(pos, path);
74 +- }
75 ++ m_userPath.insert(pos, path);
76 + } else {
77 + m_userPath.append(path);
78 + }
79 +@@ -381,6 +377,16 @@ void AccountModel::addAccountToCache(const QString& path, Account* acc, int pos)
80 + m_loggedAccounts[path] = false;
81 + }
82 +
83 ++void AccountModel::replaceAccount(const QString &path, OrgFreedesktopAccountsUserInterface *acc, int pos)
84 ++{
85 ++ if (pos >= m_userPath.size() || pos < 0) {
86 ++ return;
87 ++ }
88 ++ m_userPath.replace(pos, path);
89 ++
90 ++ m_users.insert(path, acc);
91 ++ m_loggedAccounts[path] = false;
92 ++}
93 +
94 + void AccountModel::removeAccount(const QString& path)
95 + {
96 +@@ -429,13 +435,13 @@ void AccountModel::UserAdded(const QDBusObjectPath& dbusPath)
97 + }
98 + connect(acc, SIGNAL(Changed()), SLOT(Changed()));
99 +
100 +- //First, we modify "new-user" to become the new created user
101 ++ // First, we modify "new-user" to become the new created user
102 + int row = rowCount();
103 +- addAccountToCache(path, acc, row - 1);
104 ++ replaceAccount(path, acc, row - 1);
105 + QModelIndex changedIndex = index(row - 1, 0);
106 + emit dataChanged(changedIndex, changedIndex);
107 +
108 +- //Then we add new-user again.
109 ++ // Then we add new-user again.
110 + beginInsertRows(QModelIndex(), row, row);
111 + addAccountToCache("new-user", 0);
112 + endInsertRows();
113 +diff --git a/src/lib/accountmodel.h b/src/lib/accountmodel.h
114 +index b666239..f515613 100644
115 +--- a/src/lib/accountmodel.h
116 ++++ b/src/lib/accountmodel.h
117 +@@ -79,6 +79,7 @@ class AccountModel : public QAbstractListModel
118 + const QString accountPathForUid(uint uid) const;
119 + void addAccount(const QString &path);
120 + void addAccountToCache(const QString &path, OrgFreedesktopAccountsUserInterface *acc, int pos = -1);
121 ++ void replaceAccount(const QString &path, OrgFreedesktopAccountsUserInterface *acc, int pos);
122 + void removeAccount(const QString &path);
123 + bool checkForErrors(QDBusPendingReply <void> reply) const;
124 + QString cryptPassword(const QString &password) const;
125 +--
126 +cgit v0.11.2
127 +
128
129 diff --git a/kde-plasma/user-manager/user-manager-5.12.5-r1.ebuild b/kde-plasma/user-manager/user-manager-5.12.5-r1.ebuild
130 new file mode 100644
131 index 00000000000..7be2c877f07
132 --- /dev/null
133 +++ b/kde-plasma/user-manager/user-manager-5.12.5-r1.ebuild
134 @@ -0,0 +1,29 @@
135 +# Copyright 1999-2018 Gentoo Foundation
136 +# Distributed under the terms of the GNU General Public License v2
137 +
138 +EAPI=6
139 +
140 +inherit kde5
141 +
142 +DESCRIPTION="Simple system settings module to manage the users of your system"
143 +KEYWORDS="~amd64 ~arm ~x86"
144 +IUSE=""
145 +
146 +DEPEND="
147 + $(add_frameworks_dep kauth)
148 + $(add_frameworks_dep kcmutils)
149 + $(add_frameworks_dep kconfig)
150 + $(add_frameworks_dep kconfigwidgets)
151 + $(add_frameworks_dep kcoreaddons)
152 + $(add_frameworks_dep ki18n)
153 + $(add_frameworks_dep kiconthemes)
154 + $(add_frameworks_dep kio)
155 + $(add_frameworks_dep kwidgetsaddons)
156 + $(add_qt_dep qtdbus)
157 + $(add_qt_dep qtgui)
158 + $(add_qt_dep qtwidgets)
159 + >=dev-libs/libpwquality-1.3.0
160 +"
161 +RDEPEND="${DEPEND}"
162 +
163 +PATCHES=( "${FILESDIR}/${P}-fix-addAccountToCache.patch" )