diff options
author | David Edmundson <david@davidedmundson.co.uk> | 2011-11-16 00:17:04 +0000 |
---|---|---|
committer | David Edmundson <david@davidedmundson.co.uk> | 2011-11-16 00:17:04 +0000 |
commit | f61e53663f98fce199502a98d14785c21a76bd69 (patch) | |
tree | 829ee9ea1a46dfd91ee30002478df15bc74a810e /liblightdm-qt | |
parent | 3e8c3c0fff6e5c5fd64f67e6b52a7c3956994684 (diff) | |
download | lightdm-f61e53663f98fce199502a98d14785c21a76bd69.tar.gz |
Change singleton classes to be normal QObjects which don't leak.
Diffstat (limited to 'liblightdm-qt')
-rw-r--r-- | liblightdm-qt/QLightDM/session.h | 2 | ||||
-rw-r--r-- | liblightdm-qt/QLightDM/user.h | 3 | ||||
-rw-r--r-- | liblightdm-qt/session.cpp | 11 | ||||
-rw-r--r-- | liblightdm-qt/user.cpp | 11 |
4 files changed, 1 insertions, 26 deletions
diff --git a/liblightdm-qt/QLightDM/session.h b/liblightdm-qt/QLightDM/session.h index e3343274..f859e4ce 100644 --- a/liblightdm-qt/QLightDM/session.h +++ b/liblightdm-qt/QLightDM/session.h @@ -35,8 +35,6 @@ namespace QLightDM { SessionsModelPrivate *d; void buildList(); //maybe make this a public slot, which apps can call only if they give a care about the session. }; - - SessionsModel *sessions(); }; #endif // QLIGHTDM_SESSION_H diff --git a/liblightdm-qt/QLightDM/user.h b/liblightdm-qt/QLightDM/user.h index 136e2c1f..ea33a2c3 100644 --- a/liblightdm-qt/QLightDM/user.h +++ b/liblightdm-qt/QLightDM/user.h @@ -45,7 +45,6 @@ private: QList<UserItem> getUsers() const; }; -UsersModel *users(); -} +}; #endif // QLIGHTDM_USER_H diff --git a/liblightdm-qt/session.cpp b/liblightdm-qt/session.cpp index b2274ec8..5b9b1d82 100644 --- a/liblightdm-qt/session.cpp +++ b/liblightdm-qt/session.cpp @@ -29,22 +29,11 @@ public: class SessionItem { public: - //FIXME can I make these consts, if I set them in a lovely constructor? QString id; QString name; QString comment; }; -static SessionsModel *session_model = NULL; - -SessionsModel *QLightDM::sessions() -{ - if (!session_model) - session_model = new SessionsModel (); - - return session_model; -} - SessionsModel::SessionsModel(QObject *parent) : QAbstractListModel(parent), d(new SessionsModelPrivate()) diff --git a/liblightdm-qt/user.cpp b/liblightdm-qt/user.cpp index fb1643b4..0bb407df 100644 --- a/liblightdm-qt/user.cpp +++ b/liblightdm-qt/user.cpp @@ -25,17 +25,6 @@ using namespace QLightDM; -static UsersModel *user_model = NULL; - -UsersModel *QLightDM::users() -{ - if (!user_model) - user_model = new UsersModel (); - - return user_model; -} - - class UserItem { public: |