summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Ancell <robert.ancell@canonical.com>2013-03-08 11:05:11 +1300
committerRobert Ancell <robert.ancell@canonical.com>2013-03-08 11:05:11 +1300
commit9f78fcc53b4b73fa78914e6ef9d8907a3e140941 (patch)
treef8a64a4f364759f84403cb233b7f9829c5b1e0c2
parent7331270816035ec48945c30219aeb915da707c24 (diff)
parent6a758c676e6f93cff312c41fb1283554f335bc6b (diff)
downloadlightdm-git-9f78fcc53b4b73fa78914e6ef9d8907a3e140941.tar.gz
QLightDM: Add a backgroundPath role to UsersModel1.5.1
-rw-r--r--NEWS1
-rw-r--r--liblightdm-qt/QLightDM/usersmodel.h3
-rw-r--r--liblightdm-qt/usersmodel.cpp3
3 files changed, 6 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index f6336055..fc55b9b4 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,7 @@ Overview of changes in lightdm 1.5.1
* QLightDM: Add Qt5 version of the library: liblightdm-qt5-2
* QLightDM: Add some missing role names in UsersModel
+ * QLightDM: Add a backgroundPath role to UsersModel
* QLightDM: Fix potential crash in QLightDM::UsersModel closedown.
* Improve guest session apparmor
* Run each test in its own /tmp dir so they can't interfere with eachother
diff --git a/liblightdm-qt/QLightDM/usersmodel.h b/liblightdm-qt/QLightDM/usersmodel.h
index e359eb80..659a8df6 100644
--- a/liblightdm-qt/QLightDM/usersmodel.h
+++ b/liblightdm-qt/QLightDM/usersmodel.h
@@ -33,7 +33,8 @@ public:
BackgroundRole,
SessionRole,
HasMessagesRole,
- ImagePathRole
+ ImagePathRole,
+ BackgroundPathRole
};
int rowCount(const QModelIndex &parent) const;
diff --git a/liblightdm-qt/usersmodel.cpp b/liblightdm-qt/usersmodel.cpp
index 91f67671..f45a79e2 100644
--- a/liblightdm-qt/usersmodel.cpp
+++ b/liblightdm-qt/usersmodel.cpp
@@ -185,6 +185,7 @@ UsersModel::UsersModel(QObject *parent) :
roles[RealNameRole] = "realName";
roles[LoggedInRole] = "loggedIn";
roles[BackgroundRole] = "background";
+ roles[BackgroundPathRole] = "backgroundPath";
roles[SessionRole] = "session";
roles[HasMessagesRole] = "hasMessages";
roles[ImagePathRole] = "imagePath";
@@ -233,6 +234,8 @@ QVariant UsersModel::data(const QModelIndex &index, int role) const
return d->users[row].isLoggedIn;
case UsersModel::BackgroundRole:
return QPixmap(d->users[row].background);
+ case UsersModel::BackgroundPathRole:
+ return d->users[row].background;
case UsersModel::HasMessagesRole:
return d->users[row].hasMessages;
case UsersModel::ImagePathRole: