Merge lp:~mterry/lightdm/enums into lp:lightdm

Proposed by Michael Terry
Status: Merged
Approved by: Robert Ancell
Approved revision: 1630
Merged at revision: 1635
Proposed branch: lp:~mterry/lightdm/enums
Merge into: lp:lightdm
Diff against target: 40 lines (+8/-0)
3 files modified
liblightdm-qt/QLightDM/greeter.h (+2/-0)
liblightdm-qt/QLightDM/sessionsmodel.h (+3/-0)
liblightdm-qt/QLightDM/usersmodel.h (+3/-0)
To merge this branch: bzr merge lp:~mterry/lightdm/enums
Reviewer Review Type Date Requested Status
David Edmundson Approve
Robert Ancell Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+156695@code.launchpad.net

Commit message

Register enums with QObject meta type system

Description of the change

Register enums with the QObject meta type system. This way they can be accessed from Qml.

To post a comment you must log in.
Revision history for this message
David Edmundson (david.edmundson) wrote :

+ Q_ENUMS(PromptType MessageType);

makes absolute sense.

I don't understand why you would do it for the model roles, Models are accessed through roleNames anyway.

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

I figured (A) it didn't hurt and (B) we don't know how downstream users were going to use the classes. For example, I could imagine someone taking one of these models and exposing a function that takes a role enum. In which case, we'd be doing them a favor if we exposed the enum. Doesn't seem likely, but then I thought of (A). :)

But I'm not doing something that needs it right now. If you think it doesn't make sense, I can drop those bits.

Revision history for this message
David Edmundson (david.edmundson) wrote :

You're right that it doesn't hurt.
I don't mind either way.

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

FAILED: Continuous integration, rev:1630
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~mterry/lightdm/enums/+merge/156695/+edit-commit-message

http://jenkins.qa.ubuntu.com/job/lightdm-ci/2/
Executed test runs:
    FAILURE: http://jenkins.qa.ubuntu.com/job/lightdm-quantal-amd64-ci/2/console

Click here to trigger a rebuild:
http://s-jenkins:8080/job/lightdm-ci/2/rebuild

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

PASSED: Continuous integration, rev:1630
http://jenkins.qa.ubuntu.com/job/lightdm-ci/8/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/lightdm-raring-amd64-ci/2

Click here to trigger a rebuild:
http://s-jenkins:8080/job/lightdm-ci/8/rebuild

review: Approve (continuous-integration)
Revision history for this message
Robert Ancell (robert-ancell) :
review: Approve
Revision history for this message
David Edmundson (david.edmundson) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'liblightdm-qt/QLightDM/greeter.h'
2--- liblightdm-qt/QLightDM/greeter.h 2013-01-31 20:56:09 +0000
3+++ liblightdm-qt/QLightDM/greeter.h 2013-04-02 21:10:29 +0000
4@@ -36,6 +36,8 @@
5
6 Q_PROPERTY(QString hostname READ hostname CONSTANT);
7
8+ Q_ENUMS(PromptType MessageType);
9+
10 public:
11 enum PromptType {
12 PromptTypeQuestion,
13
14=== modified file 'liblightdm-qt/QLightDM/sessionsmodel.h'
15--- liblightdm-qt/QLightDM/sessionsmodel.h 2013-01-31 20:56:09 +0000
16+++ liblightdm-qt/QLightDM/sessionsmodel.h 2013-04-02 21:10:29 +0000
17@@ -19,6 +19,9 @@
18 class Q_DECL_EXPORT SessionsModel : public QAbstractListModel
19 {
20 Q_OBJECT
21+
22+ Q_ENUMS(SessionModelRoles SessionType);
23+
24 public:
25 enum SessionModelRoles {
26 //name is exposed as Qt::DisplayRole
27
28=== modified file 'liblightdm-qt/QLightDM/usersmodel.h'
29--- liblightdm-qt/QLightDM/usersmodel.h 2013-03-08 22:00:21 +0000
30+++ liblightdm-qt/QLightDM/usersmodel.h 2013-04-02 21:10:29 +0000
31@@ -23,6 +23,9 @@
32 class Q_DECL_EXPORT UsersModel : public QAbstractListModel
33 {
34 Q_OBJECT
35+
36+ Q_ENUMS(UserModelRoles);
37+
38 public:
39 explicit UsersModel(QObject *parent = 0);
40 ~UsersModel();

Subscribers

People subscribed via source and target branches