on xenial help sign in
Update top level plugin files
commit0fbfccd7e8f13cbdbc1932c9718b7d094f46fb8a authorJosh Arenson <joshua.arenson@canonical.com> dateThu 10 Sep 2015, 21:21 (11 years ago) parentfad5a9a
8 files changed+49−43
plugins/LightDM/CMakeLists.txt+7−20 plugins/LightDM/DBusGreeter.cpp+5−4 plugins/LightDM/DBusGreeterList.cpp+2−2 plugins/LightDM/Greeter.cpp+7−6 plugins/LightDM/plugin.cpp+11−3 plugins/LightDM/plugin.h+14−5 plugins/LightDM/qmldir−3 plugins/LightDM/qmldir.in+3
plugins/LightDM/CMakeLists.txt+7−20
@@ -1,21 +1,21 @@
11pkg_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)
42
5−add_subdirectory(liblightdm)
3+find_package(Qt5Core REQUIRED)
4+find_package(Qt5Quick REQUIRED)
65
76include_directories(
87 ${CMAKE_CURRENT_SOURCE_DIR}
98 ${CMAKE_CURRENT_BINARY_DIR}
109 ${CMAKE_SOURCE_DIR}/plugins/Utils
1110 ${CMAKE_SOURCE_DIR}/tests/mocks/LightDM
12− #${LIBLIGHTDM_INCLUDE_DIRS}
11+ ${CMAKE_BINARY_DIR}/tests/mocks/LightDM
12+ ${LIBLIGHTDM_INCLUDE_DIRS}
1313 ${libunity8-private_SOURCE_DIR}
1414 ${LIBUSERMETRICSOUTPUT_INCLUDE_DIRS}
1515)
1616
1717set(QMLPLUGIN_SRC
18− ../Utils/unitysortfilterproxymodelqml.cpp # FIXME evaluate a more generic approach for using other plugins
18+ ../Utils/unitysortfilterproxymodelqml.cpp
1919 DBusGreeter.cpp
2020 DBusGreeterList.cpp
2121 Greeter.cpp
@@ -23,18 +23,5 @@ set(QMLPLUGIN_SRC
2323 UsersModel.cpp
2424 )
2525
26−add_library(IntegratedLightDM-qml MODULE
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)
39−
40−add_unity8_plugin(IntegratedLightDM 0.1 IntegratedLightDM TARGETS IntegratedLightDM-qml)
26+add_subdirectory(FullLightDM)
27+add_subdirectory(IntegratedLightDM)
plugins/LightDM/DBusGreeter.cpp+5−4
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2014 Canonical, Ltd.
2+ * Copyright (C) 2014, 2015 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -24,7 +24,8 @@ DBusGreeter::DBusGreeter(Greeter *greeter, const QString &path)
2424 : UnityDBusObject(path, "com.canonical.UnityGreeter", true, greeter),
2525 m_greeter(greeter)
2626{
27− connect(m_greeter, SIGNAL(isActiveChanged()), this, SLOT(isActiveChangedHandler()));
27+ connect(m_greeter, &Greeter::isActiveChanged,
28+ this, &DBusGreeter::isActiveChangedHandler);
2829}
2930
3031bool DBusGreeter::isActive() const
@@ -34,12 +35,12 @@ bool DBusGreeter::isActive() const
3435
3536void DBusGreeter::ShowGreeter()
3637{
37− return Q_EMIT m_greeter->showGreeter();
38+ Q_EMIT m_greeter->showGreeter();
3839}
3940
4041void DBusGreeter::HideGreeter()
4142{
42− return Q_EMIT m_greeter->hideGreeter();
43+ Q_EMIT m_greeter->hideGreeter();
4344}
4445
4546void DBusGreeter::isActiveChangedHandler()
plugins/LightDM/DBusGreeterList.cpp+2−2
@@ -24,8 +24,8 @@ DBusGreeterList::DBusGreeterList(Greeter *greeter, const QString &path)
2424 : UnityDBusObject(path, "com.canonical.UnityGreeter", true, greeter),
2525 m_greeter(greeter)
2626{
27− connect(m_greeter, SIGNAL(authenticationUserChanged(const QString &)), this, SLOT(authenticationUserChangedHandler(const QString &)));
28− connect(m_greeter, SIGNAL(promptlessChanged()), this, SLOT(promptlessChangedHandler()));
27+ connect(m_greeter, &Greeter::authenticationUserChanged, this, &DBusGreeterList::authenticationUserChangedHandler);
28+ connect(m_greeter, &Greeter::promptlessChanged, this, &DBusGreeterList::promptlessChangedHandler);
2929}
3030
3131QString DBusGreeterList::GetActiveEntry() const
plugins/LightDM/Greeter.cpp+7−6
@@ -19,6 +19,7 @@
1919#include "Greeter.h"
2020#include "GreeterPrivate.h"
2121#include <libintl.h>
22+#include <QDebug>
2223
2324GreeterPrivate::GreeterPrivate(Greeter* parent)
2425 : m_greeter(new QLightDM::Greeter(parent)),
@@ -35,12 +36,12 @@ Greeter::Greeter(QObject* parent)
3536{
3637 Q_D(Greeter);
3738
38− connect(d->m_greeter, SIGNAL(showMessage(QString, QLightDM::Greeter::MessageType)),
39− this, SLOT(showMessageFilter(QString, QLightDM::Greeter::MessageType)));
40− connect(d->m_greeter, SIGNAL(showPrompt(QString, QLightDM::Greeter::PromptType)),
41− this, SLOT(showPromptFilter(QString, QLightDM::Greeter::PromptType)));
42− connect(d->m_greeter, SIGNAL(authenticationComplete()),
43− this, SLOT(authenticationCompleteFilter()));
39+ connect(d->m_greeter, &QLightDM::Greeter::showMessage,
40+ this, &Greeter::showMessageFilter);
41+ connect(d->m_greeter, &QLightDM::Greeter::showPrompt,
42+ this, &Greeter::showPromptFilter);
43+ connect(d->m_greeter, &QLightDM::Greeter::authenticationComplete,
44+ this, &Greeter::authenticationCompleteFilter);
4445
4546 d->m_greeter->connectSync();
4647}
plugins/LightDM/plugin.cpp+11−3
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2012,2013, 2015 Canonical, Ltd.
2+ * Copyright (C) 2012,2013,2015 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * 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
5454 return UserMetricsOutput::UserMetrics::getInstance();
5555}
5656
57−void IntegratedLightDMPlugin::registerTypes(const char *uri)
57+void PLUGIN_CLASSNAME::registerTypes(const char *uri)
5858{
5959 qmlRegisterType<QAbstractItemModel>();
6060 qmlRegisterType<UserMetricsOutput::ColorTheme>();
6161
62− Q_ASSERT(uri == QLatin1String("IntegratedLightDM"));
62+ Q_ASSERT(uri == QLatin1String("PLUGIN_CLASSNAME"));
6363 qRegisterMetaType<QLightDM::Greeter::MessageType>("QLightDM::Greeter::MessageType");
6464 qRegisterMetaType<QLightDM::Greeter::PromptType>("QLightDM::Greeter::PromptType");
65+
66+#if defined INTEGRATED_LIGHTDM
6567 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+
6674 qmlRegisterSingletonType<UsersModel>(uri, 0, 1, "Users", users_provider);
6775 qmlRegisterUncreatableType<QLightDM::UsersModel>(uri, 0, 1, "UserRoles", "Type is not instantiable");
6876 qmlRegisterSingletonType<UserMetricsOutput::UserMetrics>(uri, 0, 1, "Infographic", infographic_provider);
plugins/LightDM/plugin.h+14−5
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2012,2013, 2015 Canonical, Ltd.
2+ * Copyright (C) 2012,2013,2015 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -15,13 +15,22 @@
1515 *
1616 */
1717
18−#ifndef INTEGRATED_LIGHTDM_PLUGIN_H
19−#define INTEFRATED_LIGHTDM_PLUGIN_H
18+#ifndef LIGHTDM_PLUGIN_H
19+#define LIGHTDM_PLUGIN_H
2020
2121#include <QtQml/QQmlEngine>
2222#include <QtQml/QQmlExtensionPlugin>
2323
24−class IntegratedLightDMPlugin : public QQmlExtensionPlugin
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+
33+class PLUGIN_CLASSNAME : public QQmlExtensionPlugin
2534{
2635 Q_OBJECT
2736 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
@@ -30,4 +39,4 @@ public:
3039 void registerTypes(const char *uri) override;
3140};
3241
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