]> rtime.felk.cvut.cz Git - sojka/lightdm.git/commitdiff
Fix Qt headers.
authorDavid Edmundson <david@davidedmundson.co.uk>
Thu, 10 Nov 2011 01:59:37 +0000 (01:59 +0000)
committerDavid Edmundson <david@davidedmundson.co.uk>
Thu, 10 Nov 2011 01:59:37 +0000 (01:59 +0000)
Fix moc loading to match other other code
Create system class rather than using namespace methods.

14 files changed:
greeters/qt/loginprompt.cpp
liblightdm-qt/Makefile.am
liblightdm-qt/QLightDM/Greeter
liblightdm-qt/QLightDM/Language
liblightdm-qt/QLightDM/Power
liblightdm-qt/QLightDM/Session
liblightdm-qt/QLightDM/System
liblightdm-qt/QLightDM/User
liblightdm-qt/greeter.cpp
liblightdm-qt/language.cpp
liblightdm-qt/power.cpp
liblightdm-qt/session.cpp
liblightdm-qt/system.cpp
liblightdm-qt/user.cpp

index fe7a49316df831a8ebaae5b4bc09d9281377b036..258f7b3e639f3f285fb7fff11ca1028b07ed56ce 100644 (file)
@@ -28,7 +28,7 @@ LoginPrompt::LoginPrompt(QLightDM::Greeter *greeter, QWidget *parent) :
     ui->setupUi(this);
     ui->feedbackLabel->setText(QString());
     
-    ui->hostnameLabel->setText(QLightDM::hostname());
+    ui->hostnameLabel->setText(QLightDM::System::hostname());
     
     ui->userListView->setModel(QLightDM::users());
 
index dbd8c3a59d000627329634c5c01ede2fe1d2346e..dc4a405a96c1e59bc5c02871b56237dc7f566559 100644 (file)
@@ -1,16 +1,10 @@
 lib_LTLIBRARIES = liblightdm-qt-1.la
 
-# Generate metadata for QObjects
-MOC_FILES = \
-       greeter_moc.cpp \
-       session_moc.cpp \
-       user_moc.cpp 
-
-greeter_moc.cpp: QLightDM/Greeter
+greeter_moc.cpp: QLightDM/greeter.h
        $(MOC) $< -o $@
-session_moc.cpp: QLightDM/Session
+session_moc.cpp: QLightDM/session.h
        $(MOC) $< -o $@
-user_moc.cpp: QLightDM/User
+user_moc.cpp: QLightDM/user.h
        $(MOC) $< -o $@
 
 liblightdm_qt_1_la_LIBADD = $(LIBLIGHTDM_QT_LIBS)
@@ -23,7 +17,14 @@ liblightdm_qt_1include_HEADERS = \
        QLightDM/Power \
        QLightDM/Session \
        QLightDM/System \
-       QLightDM/User
+       QLightDM/User \
+       QLightDM/greeter.h \
+       QLightDM/language.h \
+       QLightDM/power.h \
+       QLightDM/session.h \
+       QLightDM/system.h \
+       QLightDM/user.h
+
 liblightdm_qt_1includedir=$(includedir)/lightdm-qt-1/QLightDM
 
 liblightdm_qt_1_la_SOURCES = \
@@ -33,14 +34,13 @@ liblightdm_qt_1_la_SOURCES = \
        session.cpp \
        system.cpp \
        user.cpp \
-       $(MOC_FILES) \
        $(liblightdm_qt_1include_HEADERS)
 
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = liblightdm-qt-1.pc
 
 CLEANFILES = \
-       $(MOC_FILES)
+       *_moc.cpp
 
 DISTCLEANFILES = \
        Makefile.in \
index 5e892fd80eec6bee97b1cd4396ec04b49f16b2cc..bcfa4a967b9ee9faa4bcee194f8f4e79cd20dcc1 100644 (file)
@@ -1,89 +1 @@
-/*
- * Copyright (C) 2010-2011 David Edmundson.
- * Copyright (C) 2010-2011 Robert Ancell
- * Author: David Edmundson <kde@davidedmundson.co.uk>
- *
- * This library is free software; you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License as published by the Free
- * Software Foundation; either version 3 of the License, or (at your option) any
- * later version. See http://www.gnu.org/copyleft/lgpl.html the full text of the
- * license.
- */
-
-#ifndef QLIGHTDM_GREETER_H
-#define QLIGHTDM_GREETER_H
-
-#include <QtCore/QObject>
-#include <QtCore/QVariant>
-#include "QLightDM/User"
-#include "QLightDM/Language"
-
-class GreeterPrivate;
-
-namespace QLightDM
-{
-  typedef enum
-  {
-    PROMPT_TYPE_QUESTION,
-    PROMPT_TYPE_SECRET
-  } PromptType;
-
-  typedef enum
-  {
-    MESSAGE_TYPE_INFO,
-    MESSAGE_TYPE_ERROR
-  } MessageType;
-
-  class Q_DECL_EXPORT Greeter : public QObject
-  {
-    Q_OBJECT
-    public:
-        explicit Greeter(QObject* parent=0);
-        virtual ~Greeter();
-
-        QString timedLoginUser() const;
-        int timedLoginDelay() const;
-
-        QString getHint(QString name) const;
-        QString defaultSessionHint() const;
-        bool hideUsersHint() const;
-        bool hasGuestAccountHint() const;
-        QString selectUserHint() const;
-        bool selectGuestHint() const;
-        QString autologinUserHint() const;
-        bool autologinGuestHint() const;
-        int autologinTimeoutHint() const;
-
-        bool inAuthentication() const;
-        bool isAuthenticated() const;
-        QString authenticationUser() const;
-
-    public slots:
-        bool connectSync();
-        void authenticate(const QString &username=QString());
-        void authenticateAsGuest();
-        void respond(const QString &response);
-        void cancelAuthentication();
-        void setLanguage (QString language);
-        bool startSessionSync(const QString &session=QString());
-
-    signals:
-        void showMessage(QString text, QLightDM::MessageType type);
-        void showPrompt(QString text, QLightDM::PromptType type);
-        void authenticationComplete();
-        void autologinTimerExpired();
-
-    private slots:
-        void onRead(int fd);
-
-    private:
-        GreeterPrivate *d;
-        void writeInt(int value);
-        void writeString(QString value);
-        void writeHeader(int id, int length);
-        void flush();
-        char *readMessage(int *length, bool block);
-    };
-};
-
-#endif // QLIGHTDM_GREETER_H
+#include "QLightDM/greeter.h"
\ No newline at end of file
index 5ba16c8ba2f85f44d6c0c5baf9dd198f514de0ec..68d5513f15567cfe7c059180091cb8a28096e2e1 100644 (file)
@@ -1,36 +1 @@
-/*
- * Copyright (C) 2010-2011 David Edmundson.
- * Author: David Edmundson <kde@davidedmundson.co.uk>
- *
- * This library is free software; you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License as published by the Free
- * Software Foundation; either version 3 of the License, or (at your option) any
- * later version. See http://www.gnu.org/copyleft/lgpl.html the full text of the
- * license.
- */
-
-#ifndef QLIGHTDM_LANGUAGE_H
-#define QLIGHTDM_LANGUAGE_H
-
-#include <QString>
-
-class LanguagePrivate;
-
-namespace QLightDM {
-    class Language
-    {
-    public:
-        Language(QString &code, QString &name, QString &territory);
-        ~Language();
-        Language(const Language& other);
-        Language &operator=(const Language& other);
-
-        QString code() const;
-        QString name() const;
-        QString territory() const;
-    private:
-        LanguagePrivate* d;
-    };
-};
-
-#endif // QLIGHTDM_LANGUAGE_H
+#include "QLightDM/language.h"
\ No newline at end of file
index e3a0a12b4bb4f516d9fe0864c4215a19e3f3d3ae..446eb11fe6752766123312c148afaf177ebd72c2 100644 (file)
@@ -1,28 +1 @@
-/*
- * Copyright (C) 2010-2011 David Edmundson.
- * Copyright (C) 2010-2011 Robert Ancell
- * Author: David Edmundson <kde@davidedmundson.co.uk>
- *
- * This library is free software; you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License as published by the Free
- * Software Foundation; either version 3 of the License, or (at your option) any
- * later version. See http://www.gnu.org/copyleft/lgpl.html the full text of the
- * license.
- */
-
-#ifndef QLIGHTDM_POWER_H
-#define QLIGHTDM_POWER_H
-
-namespace QLightDM
-{
-    bool canSuspend();
-    bool canHibernate();
-    bool canShutdown();
-    bool canRestart();
-    void suspend();
-    void hibernate();
-    void shutdown();
-    void restart();
-};
-
-#endif // QLIGHTDM_POWER_H
+#include "QLightDM/power.h"
\ No newline at end of file
index 83310bbc07a43b14d9c68eefc1ec2f969e7cea4e..9566e0b883ac4e5bcc98f60f38ce3b168ef9dc37 100644 (file)
@@ -1,39 +1 @@
-/*
- * Copyright (C) 2010-2011 David Edmundson.
- * Author: David Edmundson <kde@davidedmundson.co.uk>
- *
- * This library is free software; you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License as published by the Free
- * Software Foundation; either version 3 of the License, or (at your option) any
- * later version. See http://www.gnu.org/copyleft/lgpl.html the full text of the
- * license.
- */
-
-#ifndef QLIGHTDM_SESSION_H
-#define QLIGHTDM_SESSION_H
-
-#include <QtCore/QAbstractListModel>
-
-class SessionsModelPrivate;
-
-namespace QLightDM {
-    class Q_DECL_EXPORT SessionsModel : public QAbstractListModel
-    {
-        Q_OBJECT
-    public:
-        explicit SessionsModel(QObject *parent = 0);
-        virtual ~SessionsModel();
-
-        enum SessionModelRoles {IdRole = Qt::UserRole};
-        int rowCount(const QModelIndex &parent) const;
-        QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const;
-
-    private:
-        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
+#include "QLightDM/session.h"
\ No newline at end of file
index 7958be09db0e6b79197b2e03e8649c0943665805..3f9275fc3c12f91d1e2a18170a6d4fb3d3a5cb36 100644 (file)
@@ -1,21 +1 @@
-/*
- * Copyright (C) 2010-2011 David Edmundson.
- * Copyright (C) 2010-2011 Robert Ancell
- * Author: David Edmundson <kde@davidedmundson.co.uk>
- *
- * This library is free software; you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License as published by the Free
- * Software Foundation; either version 3 of the License, or (at your option) any
- * later version. See http://www.gnu.org/copyleft/lgpl.html the full text of the
- * license.
- */
-
-#ifndef QLIGHTDM_SYSTEM_H
-#define QLIGHTDM_SYSTEM_H
-
-namespace QLightDM
-{
-    QString hostname();
-};
-
-#endif // QLIGHTDM_SYSTEM_H
+#include "QLightDM/system.h"
\ No newline at end of file
index 08841fc16ea649e8c4cf1babda5164aec2173b80..968058f5ed38f4e7918ac16e75f11cd17e6e7d0a 100644 (file)
@@ -1,92 +1 @@
-/*
- * Copyright (C) 2010-2011 David Edmundson.
- * Author: David Edmundson <kde@davidedmundson.co.uk>
- *
- * This library is free software; you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License as published by the Free
- * Software Foundation; either version 3 of the License, or (at your option) any
- * later version. See http://www.gnu.org/copyleft/lgpl.html the full text of the
- * license.
- */
-
-#ifndef QLIGHTDM_USER_H
-#define QLIGHTDM_USER_H
-
-#include <QtCore/QString>
-#include <QtCore/QSharedDataPointer>
-#include <QAbstractListModel>
-
-class UserPrivate;
-class UsersModelPrivate;
-
-namespace QLightDM
-{
-    //public facing User class
-    /** Class storing user information.
-      This is an implicitly shared class. */
-
-    class Q_DECL_EXPORT User
-    {
-    public:
-        explicit User();
-        User(const QString &name, const QString &realName, const QString &homeDirectory, const QString &image, bool isLoggedIn);
-        User(const User& other);
-        ~User();
-        User &operator=(const User& other);
-
-        bool update(const QString &realName, const QString &homeDirectory, const QString &image, bool isLoggedIn);
-
-        /** The name to display (the real name if available, otherwise use the username */
-        QString displayName() const;
-
-        /** The username of the user*/
-        QString name() const;
-        /** The user's real name, use this for displaying*/
-        QString realName() const;
-
-        /** Returns the home directory of this user*/
-        QString homeDirectory() const;
-
-        /** Returns the path to an avatar of this user*/
-        QString image() const;
-
-        /** Returns true if this user is already logged in on another session*/
-        bool isLoggedIn() const;
-
-    //    LdmUser &operator=(const LdmUser user);
-    private:
-        QSharedDataPointer<UserPrivate> d;
-    };
-
-    class Q_DECL_EXPORT UsersModel : public QAbstractListModel
-    {
-        Q_OBJECT
-    public:
-        explicit UsersModel(QObject *parent = 0);
-        ~UsersModel();
-
-        enum UserModelRoles {NameRole = Qt::UserRole,
-                             RealNameRole,
-                             LoggedInRole};
-
-        int rowCount(const QModelIndex &parent) const;
-        QVariant data(const QModelIndex &index, int role) const;
-
-    signals:
-
-    public slots:
-
-    private slots:
-        /** Updates the model with new changes in the password file*/
-        void loadUsers();
-
-    private:
-        /** Returns a list of all users in the password file*/
-        QList<User> getUsers();
-        UsersModelPrivate *d;
-    };
-
-    UsersModel *users();
-}
-
-#endif // QLIGHTDM_USER_H
+#include "QLightDM/user.h"
\ No newline at end of file
index bc8ec28a8074715606b72cc99358c5b46345be97..9c062336b6e311105b06b288e567a71e838bc71d 100644 (file)
  * license.
  */
 
-#include "config.h"
 
-#include "QLightDM/Greeter"
+#include "QLightDM/greeter.h"
+
+#include "config.h"
 
-#include <security/pam_appl.h>
 #include <QtCore/QDebug>
 #include <QtCore/QDir>
 #include <QtCore/QVariant>
@@ -27,6 +27,9 @@
 #include <QtDBus/QDBusInterface>
 #include <QtDBus/QDBusReply>
 
+#include <security/pam_appl.h>
+
+
 /* Messages from the greeter to the server */
 typedef enum
 {
@@ -489,3 +492,5 @@ int Greeter::autologinTimeoutHint() const
 {
     return d->hints.value ("autologin-timeout", "0").toInt ();
 }
+
+#include "greeter_moc.cpp"
\ No newline at end of file
index 8c087a80adcd1785771a51cda9deb2b7525c0543..c8668c9da1191c8c9f4ba9dedba8ff6888867a79 100644 (file)
@@ -9,7 +9,7 @@
  * license.
  */
 
-#include "QLightDM/Language"
+#include "QLightDM/language.h"
 
 using namespace QLightDM;
 
index 8656c24792bbdeaf5291e873fab0f8fc698ffa89..2f75fbb349c028c619eef908514c2a82d9020899 100644 (file)
  * license.
  */
 
-#include "config.h"
 
-#include "QLightDM/Power"
+#include "QLightDM/power.h"
 
 #include <QtCore/QVariant>
 #include <QtDBus/QDBusInterface>
 #include <QtDBus/QDBusReply>
 
+#include "config.h"
+
 using namespace QLightDM;
 
 static QDBusInterface* powerManagementInterface = NULL;
index 7134d93728512abb846a801d4a244f6130b1000d..b2274ec87abd31ce12439b2a1995e52c1b12aa54 100644 (file)
@@ -9,7 +9,7 @@
  * license.
  */
 
-#include "QLightDM/Session"
+#include "QLightDM/session.h"
 
 #include <QtCore/QList>
 #include <QtCore/QDir>
@@ -111,3 +111,5 @@ void SessionsModel::buildList()
     d->items.append(items);
     endInsertRows();
 }
+
+#include "session_moc.cpp"
index 8c11e6eb474d6860b3e18c9da85a5bd5bd517afe..2461aaadaf8f50de2e38e0c2372df5e15ab98d48 100644 (file)
  * license.
  */
 
+#include "QLightDM/system.h"
+
 #include <QtNetwork/QHostInfo>
 
-#include "QLightDM/System"
+using namespace QLightDM;
 
-QString QLightDM::hostname()
+QString System::hostname()
 {
     return QHostInfo::localHostName();
 }
index 1f5cd5f4ac47e9e1ad90038885a2bf1ed17c639a..aa7d67e9855a3423b34e63189e423fd6613b5bf4 100644 (file)
@@ -9,10 +9,11 @@
  * license.
  */
 
-#include "QLightDM/User"
+#include "QLightDM/user.h"
 
 #include <pwd.h>
 #include <errno.h>
+
 #include <QtCore/QSharedData>
 #include <QtCore/QString>
 #include <QtCore/QFileSystemWatcher>
@@ -20,7 +21,6 @@
 #include <QtCore/QDir>
 #include <QtCore/QSettings>
 #include <QtCore/QDebug>
-
 #include <QtGui/QPixmap>
 
 using namespace QLightDM;
@@ -301,3 +301,5 @@ void UsersModel::loadUsers()
         endInsertRows();
     }
 }
+
+#include "user_moc.cpp"
\ No newline at end of file