on xenial help sign in
Update top level plugin files
0fbfccdJosh Arenson
plugins/LightDM/CMakeLists.txt+7−20
@@ -1,21 +1,21 @@
1pkg_check_modules(LIBUSERMETRICSOUTPUT REQUIRED libusermetricsoutput-1)
1pkg_check_modules(LIBUSERMETRICSOUTPUT REQUIRED libusermetricsoutput-1)
2−# TODO: Once we split out a separate greeter process, uncomment these lines
3−#pkg_check_modules(LIBLIGHTDM REQUIRED liblightdm-qt5-2)
4
2
5−add_subdirectory(liblightdm)
3+find_package(Qt5Core REQUIRED)
4+find_package(Qt5Quick REQUIRED)
6
5
7include_directories(
6include_directories(
8 ${CMAKE_CURRENT_SOURCE_DIR}
7 ${CMAKE_CURRENT_SOURCE_DIR}
9 ${CMAKE_CURRENT_BINARY_DIR}
8 ${CMAKE_CURRENT_BINARY_DIR}
10 ${CMAKE_SOURCE_DIR}/plugins/Utils
9 ${CMAKE_SOURCE_DIR}/plugins/Utils
11 ${CMAKE_SOURCE_DIR}/tests/mocks/LightDM
10 ${CMAKE_SOURCE_DIR}/tests/mocks/LightDM
11+ ${CMAKE_BINARY_DIR}/tests/mocks/LightDM
12− #${LIBLIGHTDM_INCLUDE_DIRS}
12+ ${LIBLIGHTDM_INCLUDE_DIRS}
13 ${libunity8-private_SOURCE_DIR}
13 ${libunity8-private_SOURCE_DIR}
14 ${LIBUSERMETRICSOUTPUT_INCLUDE_DIRS}
14 ${LIBUSERMETRICSOUTPUT_INCLUDE_DIRS}
15)
15)
16
16
17set(QMLPLUGIN_SRC
17set(QMLPLUGIN_SRC
18− ../Utils/unitysortfilterproxymodelqml.cpp # FIXME evaluate a more generic approach for using other plugins
18+ ../Utils/unitysortfilterproxymodelqml.cpp
19 DBusGreeter.cpp
19 DBusGreeter.cpp
20 DBusGreeterList.cpp
20 DBusGreeterList.cpp
21 Greeter.cpp
21 Greeter.cpp
@@ -23,18 +23,5 @@ set(QMLPLUGIN_SRC
23 UsersModel.cpp
23 UsersModel.cpp
24 )
24 )
25
25
26−add_library(IntegratedLightDM-qml MODULE
26+add_subdirectory(FullLightDM)
27− ${QMLPLUGIN_SRC}
28− )
29−
30−target_link_libraries(IntegratedLightDM-qml
31− integratedLightDM
32− unity8-private
33−# TODO: Once we split out a separate greeter process, uncomment these lines
34−# ${LIBLIGHTDM_LDFLAGS}
35− ${LIBUSERMETRICSOUTPUT_LDFLAGS}
36− )
37−
38−qt5_use_modules(IntegratedLightDM-qml DBus Gui Qml)
27+add_subdirectory(IntegratedLightDM)
39−
40−add_unity8_plugin(IntegratedLightDM 0.1 IntegratedLightDM TARGETS IntegratedLightDM-qml)
plugins/LightDM/DBusGreeter.cpp+5−4
@@ -1,5 +1,5 @@
1/*
1/*
2− * Copyright (C) 2014 Canonical, Ltd.
2+ * Copyright (C) 2014, 2015 Canonical, Ltd.
3 *
3 *
4 * This program is free software; you can redistribute it and/or modify
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
5 * it under the terms of the GNU General Public License as published by
@@ -24,7 +24,8 @@ DBusGreeter::DBusGreeter(Greeter *greeter, const QString &path)
24 : UnityDBusObject(path, "com.canonical.UnityGreeter", true, greeter),
24 : UnityDBusObject(path, "com.canonical.UnityGreeter", true, greeter),
25 m_greeter(greeter)
25 m_greeter(greeter)
26{
26{
27− connect(m_greeter, SIGNAL(isActiveChanged()), this, SLOT(isActiveChangedHandler()));
27+ connect(m_greeter, &Greeter::isActiveChanged,
28+ this, &DBusGreeter::isActiveChangedHandler);
28}
29}
29
30
30bool DBusGreeter::isActive() const
31bool DBusGreeter::isActive() const
@@ -34,12 +35,12 @@ bool DBusGreeter::isActive() const
34
35
35void DBusGreeter::ShowGreeter()
36void DBusGreeter::ShowGreeter()
36{
37{
37− return Q_EMIT m_greeter->showGreeter();
38+ Q_EMIT m_greeter->showGreeter();
38}
39}
39
40
40void DBusGreeter::HideGreeter()
41void DBusGreeter::HideGreeter()
41{
42{
42− return Q_EMIT m_greeter->hideGreeter();
43+ Q_EMIT m_greeter->hideGreeter();
43}
44}
44
45
45void DBusGreeter::isActiveChangedHandler()
46void DBusGreeter::isActiveChangedHandler()
plugins/LightDM/DBusGreeterList.cpp+2−2
@@ -24,8 +24,8 @@ DBusGreeterList::DBusGreeterList(Greeter *greeter, const QString &path)
24 : UnityDBusObject(path, "com.canonical.UnityGreeter", true, greeter),
24 : UnityDBusObject(path, "com.canonical.UnityGreeter", true, greeter),
25 m_greeter(greeter)
25 m_greeter(greeter)
26{
26{
27− connect(m_greeter, SIGNAL(authenticationUserChanged(const QString &)), this, SLOT(authenticationUserChangedHandler(const QString &)));
27+ connect(m_greeter, &Greeter::authenticationUserChanged, this, &DBusGreeterList::authenticationUserChangedHandler);
28− connect(m_greeter, SIGNAL(promptlessChanged()), this, SLOT(promptlessChangedHandler()));
28+ connect(m_greeter, &Greeter::promptlessChanged, this, &DBusGreeterList::promptlessChangedHandler);
29}
29}
30
30
31QString DBusGreeterList::GetActiveEntry() const
31QString DBusGreeterList::GetActiveEntry() const
plugins/LightDM/Greeter.cpp+7−6
@@ -19,6 +19,7 @@
19#include "Greeter.h"
19#include "Greeter.h"
20#include "GreeterPrivate.h"
20#include "GreeterPrivate.h"
21#include <libintl.h>
21#include <libintl.h>
22+#include <QDebug>
22
23
23GreeterPrivate::GreeterPrivate(Greeter* parent)
24GreeterPrivate::GreeterPrivate(Greeter* parent)
24 : m_greeter(new QLightDM::Greeter(parent)),
25 : m_greeter(new QLightDM::Greeter(parent)),
@@ -35,12 +36,12 @@ Greeter::Greeter(QObject* parent)
35{
36{
36 Q_D(Greeter);
37 Q_D(Greeter);
37
38
38− connect(d->m_greeter, SIGNAL(showMessage(QString, QLightDM::Greeter::MessageType)),
39+ connect(d->m_greeter, &QLightDM::Greeter::showMessage,
39− this, SLOT(showMessageFilter(QString, QLightDM::Greeter::MessageType)));
40+ this, &Greeter::showMessageFilter);
40− connect(d->m_greeter, SIGNAL(showPrompt(QString, QLightDM::Greeter::PromptType)),
41+ connect(d->m_greeter, &QLightDM::Greeter::showPrompt,
41− this, SLOT(showPromptFilter(QString, QLightDM::Greeter::PromptType)));
42+ this, &Greeter::showPromptFilter);
42− connect(d->m_greeter, SIGNAL(authenticationComplete()),
43+ connect(d->m_greeter, &QLightDM::Greeter::authenticationComplete,
43− this, SLOT(authenticationCompleteFilter()));
44+ this, &Greeter::authenticationCompleteFilter);
44
45
45 d->m_greeter->connectSync();
46 d->m_greeter->connectSync();
46}
47}
plugins/LightDM/plugin.cpp+11−3
@@ -1,5 +1,5 @@
1/*
1/*
2− * Copyright (C) 2012,2013, 2015 Canonical, Ltd.
2+ * Copyright (C) 2012,2013,2015 Canonical, Ltd.
3 *
3 *
4 * This program is free software; you can redistribute it and/or modify
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
5 * it under the terms of the GNU General Public License as published by
@@ -54,15 +54,23 @@ static QObject *infographic_provider(QQmlEngine *engine, QJSEngine *scriptEngine
54 return UserMetricsOutput::UserMetrics::getInstance();
54 return UserMetricsOutput::UserMetrics::getInstance();
55}
55}
56
56
57−void IntegratedLightDMPlugin::registerTypes(const char *uri)
57+void PLUGIN_CLASSNAME::registerTypes(const char *uri)
58{
58{
59 qmlRegisterType<QAbstractItemModel>();
59 qmlRegisterType<QAbstractItemModel>();
60 qmlRegisterType<UserMetricsOutput::ColorTheme>();
60 qmlRegisterType<UserMetricsOutput::ColorTheme>();
61
61
62− Q_ASSERT(uri == QLatin1String("IntegratedLightDM"));
62+ Q_ASSERT(uri == QLatin1String("PLUGIN_CLASSNAME"));
63 qRegisterMetaType<QLightDM::Greeter::MessageType>("QLightDM::Greeter::MessageType");
63 qRegisterMetaType<QLightDM::Greeter::MessageType>("QLightDM::Greeter::MessageType");
64 qRegisterMetaType<QLightDM::Greeter::PromptType>("QLightDM::Greeter::PromptType");
64 qRegisterMetaType<QLightDM::Greeter::PromptType>("QLightDM::Greeter::PromptType");
65+
66+#if defined INTEGRATED_LIGHTDM
65 qmlRegisterSingletonType<Greeter>(uri, 0, 1, "Greeter", greeter_provider);
67 qmlRegisterSingletonType<Greeter>(uri, 0, 1, "Greeter", greeter_provider);
68+#elif defined FULL_LIGHTDM
69+ qmlRegisterSingletonType<QLightDM::Greeter>(uri, 0, 1, "Greeter", greeter_provider);
70+#else
71+ #error No library defined in LightDM plugin
72+#endif
73+
66 qmlRegisterSingletonType<UsersModel>(uri, 0, 1, "Users", users_provider);
74 qmlRegisterSingletonType<UsersModel>(uri, 0, 1, "Users", users_provider);
67 qmlRegisterUncreatableType<QLightDM::UsersModel>(uri, 0, 1, "UserRoles", "Type is not instantiable");
75 qmlRegisterUncreatableType<QLightDM::UsersModel>(uri, 0, 1, "UserRoles", "Type is not instantiable");
68 qmlRegisterSingletonType<UserMetricsOutput::UserMetrics>(uri, 0, 1, "Infographic", infographic_provider);
76 qmlRegisterSingletonType<UserMetricsOutput::UserMetrics>(uri, 0, 1, "Infographic", infographic_provider);
plugins/LightDM/plugin.h+14−5
@@ -1,5 +1,5 @@
1/*
1/*
2− * Copyright (C) 2012,2013, 2015 Canonical, Ltd.
2+ * Copyright (C) 2012,2013,2015 Canonical, Ltd.
3 *
3 *
4 * This program is free software; you can redistribute it and/or modify
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
5 * it under the terms of the GNU General Public License as published by
@@ -15,13 +15,22 @@
15 *
15 *
16 */
16 */
17
17
18−#ifndef INTEGRATED_LIGHTDM_PLUGIN_H
18+#ifndef LIGHTDM_PLUGIN_H
19−#define INTEFRATED_LIGHTDM_PLUGIN_H
19+#define LIGHTDM_PLUGIN_H
20
20
21#include <QtQml/QQmlEngine>
21#include <QtQml/QQmlEngine>
22#include <QtQml/QQmlExtensionPlugin>
22#include <QtQml/QQmlExtensionPlugin>
23
23
24+#if defined INTEGRATED_LIGHTDM
25+ #define PLUGIN_CLASSNAME FullLightDMPlugin
26+#elif defined FULL_LIGHTDM
27+ #define PLUGIN_CLASSNAME IntegratedLightDMPlugin
28+#else
29+ #error No library defined in LightDM plugin
30+#endif
31+
32+
24−class IntegratedLightDMPlugin : public QQmlExtensionPlugin
33+class PLUGIN_CLASSNAME : public QQmlExtensionPlugin
25{
34{
26 Q_OBJECT
35 Q_OBJECT
27 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
36 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
@@ -30,4 +39,4 @@ public:
30 void registerTypes(const char *uri) override;
39 void registerTypes(const char *uri) override;
31};
40};
32
41
33−#endif /* INTEGRATED_LIGHTDM_PLUGIN_H */
42+#endif /* LIGHTDM_PLUGIN_H */
plugins/LightDM/qmldirdeleted−3
@@ -1,3 +0,0 @@
1−module IntegratedLightDM
2−plugin IntegratedLightDM-qml
3−typeinfo IntegratedLightDM.qmltypes
plugins/LightDM/qmldir.innew file+3
@@ -0,0 +1,3 @@
1+module LightDM.@PLUGIN_CLASSNAME@
2+plugin @PLUGIN_CLASSNAME@-qml
3+typeinfo @PLUGIN_CLASSNAME@.qmltypes