Merge lp:~zeller-benjamin/ubuntu-system-settings/applauncherd into lp:ubuntu-system-settings

Proposed by Benjamin Zeller
Status: Work in progress
Proposed branch: lp:~zeller-benjamin/ubuntu-system-settings/applauncherd
Merge into: lp:ubuntu-system-settings
Diff against target: 158 lines (+50/-19)
5 files modified
CMakeLists.txt (+7/-0)
debian/control (+3/-0)
src/CMakeLists.txt (+7/-0)
src/main.cpp (+32/-18)
ubuntu-system-settings.desktop.in.in (+1/-1)
To merge this branch: bzr merge lp:~zeller-benjamin/ubuntu-system-settings/applauncherd
Reviewer Review Type Date Requested Status
Ubuntu Touch System Settings Pending
Review via email: mp+287968@code.launchpad.net

Commit message

Prepare ubuntu-system-settings app for mapplauncherd

Description of the change

Prepare ubuntu-system-settings app for mapplauncherd

To post a comment you must log in.
1602. By Benjamin Zeller

Prepare ubuntu-system-settings app for mapplauncherd

1603. By Benjamin Zeller

Fix build error

Unmerged revisions

1603. By Benjamin Zeller

Fix build error

1602. By Benjamin Zeller

Prepare ubuntu-system-settings app for mapplauncherd

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2015-11-05 21:25:13 +0000
+++ CMakeLists.txt 2016-03-04 07:19:42 +0000
@@ -1,6 +1,8 @@
1project(ubuntu-system-settings C CXX)1project(ubuntu-system-settings C CXX)
2cmake_minimum_required(VERSION 2.8.10)2cmake_minimum_required(VERSION 2.8.10)
33
4option(MAPPLAUNCHERD_ENABLED "Build with mapplauncherd support" ON)
5
4if(${PROJECT_BINARY_DIR} STREQUAL ${PROJECT_SOURCE_DIR})6if(${PROJECT_BINARY_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
5 message(FATAL_ERROR "In-tree build attempt detected, aborting. Set your build dir outside your source dir, delete CMakeCache.txt from source root and try again.")7 message(FATAL_ERROR "In-tree build attempt detected, aborting. Set your build dir outside your source dir, delete CMakeCache.txt from source root and try again.")
6endif()8endif()
@@ -47,6 +49,11 @@
47pkg_search_module(POLKIT_AGENT polkit-agent-1)49pkg_search_module(POLKIT_AGENT polkit-agent-1)
48pkg_search_module(CLICK REQUIRED click-0.4)50pkg_search_module(CLICK REQUIRED click-0.4)
4951
52if (MAPPLAUNCHERD_ENABLED)
53 set(MAPPLAUNCHERD_COMMAND_PREFIX "/usr/bin/invoker --type=ubuntu-components ")
54 pkg_check_modules(MAPPLAUNCH REQUIRED qdeclarative5-boostable)
55endif()
56
50find_program(XGETTEXT_BIN xgettext)57find_program(XGETTEXT_BIN xgettext)
51find_program(MSGFMT_BIN msgfmt)58find_program(MSGFMT_BIN msgfmt)
52find_program(INTLTOOL_MERGE intltool-merge)59find_program(INTLTOOL_MERGE intltool-merge)
5360
=== modified file 'debian/control'
--- debian/control 2016-02-03 20:58:04 +0000
+++ debian/control 2016-03-04 07:19:42 +0000
@@ -49,6 +49,7 @@
49 python3-dbus,49 python3-dbus,
50 python3-xdg,50 python3-xdg,
51 gir1.2-glib-2.0,51 gir1.2-glib-2.0,
52 libmdeclarativecache5-dev (>= 1.1.13),
52Standards-Version: 3.9.653Standards-Version: 3.9.6
53Homepage: https://launchpad.net/ubuntu-system-settings54Homepage: https://launchpad.net/ubuntu-system-settings
54# If you aren't a member of ~system-settings-touch but need to upload packaging55# If you aren't a member of ~system-settings-touch but need to upload packaging
@@ -95,6 +96,8 @@
95 python3-dbus,96 python3-dbus,
96 python3-xdg,97 python3-xdg,
97 gir1.2-glib-2.0,98 gir1.2-glib-2.0,
99 libmdeclarativecache5-0,
100 mapplauncherd-booster-ubuntu-components,
98 qml-module-ubuntu-connectivity101 qml-module-ubuntu-connectivity
99Recommends: ubuntu-system-settings-online-accounts,102Recommends: ubuntu-system-settings-online-accounts,
100 ubuntu-touch-sounds,103 ubuntu-touch-sounds,
101104
=== modified file 'src/CMakeLists.txt'
--- src/CMakeLists.txt 2016-02-10 15:52:50 +0000
+++ src/CMakeLists.txt 2016-03-04 07:19:42 +0000
@@ -32,6 +32,13 @@
3232
33add_executable(system-settings ${USS_SOURCES} ${QML_SOURCES} ${system-settings-resources})33add_executable(system-settings ${USS_SOURCES} ${QML_SOURCES} ${system-settings-resources})
34qt5_use_modules(system-settings Core Gui Quick Qml)34qt5_use_modules(system-settings Core Gui Quick Qml)
35
36if (MAPPLAUNCHERD_ENABLED)
37 add_definitions(-DMAPPLAUNCHERD_ENABLED)
38 target_link_libraries (system-settings ${MAPPLAUNCH_LDFLAGS})
39 target_compile_options(system-settings PRIVATE ${MAPPLAUNCH_CFLAGS})
40endif()
41
35target_link_libraries(system-settings SystemSettings ${GLIB_LDFLAGS})42target_link_libraries(system-settings SystemSettings ${GLIB_LDFLAGS})
36install(TARGETS system-settings RUNTIME DESTINATION bin)43install(TARGETS system-settings RUNTIME DESTINATION bin)
3744
3845
=== modified file 'src/main.cpp'
--- src/main.cpp 2016-02-08 14:26:43 +0000
+++ src/main.cpp 2016-03-04 07:19:42 +0000
@@ -30,20 +30,29 @@
30#include <QQuickView>30#include <QQuickView>
31#include <QtQml>31#include <QtQml>
32#include <QtQml/QQmlDebuggingEnabler>32#include <QtQml/QQmlDebuggingEnabler>
33#include <QScopedPointer>
33static QQmlDebuggingEnabler debuggingEnabler(false);34static QQmlDebuggingEnabler debuggingEnabler(false);
3435
36#ifdef MAPPLAUNCHERD_ENABLED
37#include <mdeclarativecache5/MDeclarativeCache>
38#endif
39
35using namespace SystemSettings;40using namespace SystemSettings;
3641
37int main(int argc, char **argv)42int Q_DECL_EXPORT main(int argc, char **argv)
38{43{
39 QGuiApplication app(argc, argv);44 #ifdef MAPPLAUNCHERD_ENABLED
45 QScopedPointer<QGuiApplication> app(MDeclarativeCache::qApplication(argc, argv));
46 #else
47 QScopedPointer<QGuiApplication> app(new QGuiApplication(argc,argv));
48 #endif
4049
41 /* The testability driver is only loaded by QApplication but not by50 /* The testability driver is only loaded by QApplication but not by
42 * QGuiApplication. However, QApplication depends on QWidget which would51 * QGuiApplication. However, QApplication depends on QWidget which would
43 * add some unneeded overhead => Let's load the testability driver on our52 * add some unneeded overhead => Let's load the testability driver on our
44 * own.53 * own.
45 */54 */
46 if (app.arguments().contains(QStringLiteral("-testability"))) {55 if (app->arguments().contains(QStringLiteral("-testability"))) {
47 QLibrary testLib(QStringLiteral("qttestability"));56 QLibrary testLib(QStringLiteral("qttestability"));
48 if (testLib.load()) {57 if (testLib.load()) {
49 typedef void (*TasInitialize)(void);58 typedef void (*TasInitialize)(void);
@@ -78,24 +87,29 @@
78 */87 */
79 QString defaultPlugin;88 QString defaultPlugin;
80 QVariantMap pluginOptions;89 QVariantMap pluginOptions;
81 parsePluginOptions(app.arguments(), defaultPlugin, pluginOptions);90 parsePluginOptions(app->arguments(), defaultPlugin, pluginOptions);
8291
83 QQuickView view;92 #ifdef MAPPLAUNCHERD_ENABLED
93 QScopedPointer<QQuickView> view(MDeclarativeCache::qQuickView());
94 #else
95 QScopedPointer<QQuickView> view(new QQuickView);
96 #endif
84 Utilities utils;97 Utilities utils;
85 QObject::connect(view.engine(), SIGNAL(quit()), &app, SLOT(quit()),98 QObject::connect(view->engine(), SIGNAL(quit()), app.data(), SLOT(quit()),
86 Qt::QueuedConnection);99 Qt::QueuedConnection);
87 qmlRegisterType<QAbstractItemModel>();100 qmlRegisterType<QAbstractItemModel>();
88 qmlRegisterType<SystemSettings::PluginManager>("SystemSettings", 1, 0, "PluginManager");101 qmlRegisterType<SystemSettings::PluginManager>("SystemSettings", 1, 0, "PluginManager");
89 view.engine()->rootContext()->setContextProperty("Utilities", &utils);102
90 view.setResizeMode(QQuickView::SizeRootObjectToView);103 view->engine()->rootContext()->setContextProperty("Utilities", &utils);
91 view.engine()->addImportPath(PLUGIN_PRIVATE_MODULE_DIR);104 view->setResizeMode(QQuickView::SizeRootObjectToView);
92 view.engine()->addImportPath(PLUGIN_QML_DIR);105 view->engine()->addImportPath(PLUGIN_PRIVATE_MODULE_DIR);
93 view.rootContext()->setContextProperty("defaultPlugin", defaultPlugin);106 view->engine()->addImportPath(PLUGIN_QML_DIR);
94 view.rootContext()->setContextProperty("i18nDirectory", I18N_DIRECTORY);107 view->rootContext()->setContextProperty("defaultPlugin", defaultPlugin);
95 view.rootContext()->setContextProperty("pluginOptions", pluginOptions);108 view->rootContext()->setContextProperty("i18nDirectory", I18N_DIRECTORY);
96 view.rootContext()->setContextProperty("view", &view);109 view->rootContext()->setContextProperty("pluginOptions", pluginOptions);
97 view.setSource(QUrl("qrc:/qml/MainWindow.qml"));110 view->rootContext()->setContextProperty("view", view.data());
98 view.show();111 view->setSource(QUrl("qrc:/qml/MainWindow.qml"));
99112 view->show();
100 return app.exec();113
114 return app->exec();
101}115}
102116
=== modified file 'ubuntu-system-settings.desktop.in.in'
--- ubuntu-system-settings.desktop.in.in 2014-10-01 14:10:47 +0000
+++ ubuntu-system-settings.desktop.in.in 2016-03-04 07:19:42 +0000
@@ -3,7 +3,7 @@
3_Categories=System;3_Categories=System;
4_Keywords=Preferences;Settings;4_Keywords=Preferences;Settings;
5Icon=@SETTINGS_SHARE_DIR@/system-settings.png5Icon=@SETTINGS_SHARE_DIR@/system-settings.png
6Exec=system-settings %u6Exec=@MAPPLAUNCHERD_COMMAND_PREFIX@system-settings %u
7Terminal=false7Terminal=false
8Type=Application8Type=Application
9StartupNotify=true9StartupNotify=true

Subscribers

People subscribed via source and target branches