Merge lp:~zeller-benjamin/dialer-app/applauncherd into lp:dialer-app

Proposed by Benjamin Zeller
Status: Work in progress
Proposed branch: lp:~zeller-benjamin/dialer-app/applauncherd
Merge into: lp:dialer-app
Diff against target: 206 lines (+55/-17)
7 files modified
CMakeLists.txt (+8/-0)
debian/control (+3/-0)
src/CMakeLists.txt (+9/-0)
src/dialer-app.desktop.in.in (+1/-1)
src/dialerapplication.cpp (+15/-7)
src/dialerapplication.h (+5/-4)
src/main.cpp (+14/-5)
To merge this branch: bzr merge lp:~zeller-benjamin/dialer-app/applauncherd
Reviewer Review Type Date Requested Status
Ubuntu Phablet Team Pending
Review via email: mp+287948@code.launchpad.net

Commit message

Prepare dialer-app for mapplauncherd

Description of the change

Prepare dialer-app for mapplauncherd

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

Prepare dialer-app for mapplauncherd

515. By Benjamin Zeller

Make the mapplauncherd optional for development

516. By Benjamin Zeller

remove debug output

Unmerged revisions

516. By Benjamin Zeller

remove debug output

515. By Benjamin Zeller

Make the mapplauncherd optional for development

514. By Benjamin Zeller

Prepare dialer-app for mapplauncherd

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2014-08-15 09:08:45 +0000
3+++ CMakeLists.txt 2016-03-03 15:57:20 +0000
4@@ -1,5 +1,8 @@
5 project(dialer-app)
6 cmake_minimum_required(VERSION 2.8)
7+
8+option(MAPPLAUNCHERD_ENABLED "Build with mapplauncherd support" ON)
9+
10 set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
11 set(DESKTOP_FILE dialer-app.desktop)
12
13@@ -47,6 +50,11 @@
14 find_package(Qt5Test)
15
16 find_package(PkgConfig REQUIRED)
17+
18+if (MAPPLAUNCHERD_ENABLED)
19+ pkg_check_modules(MAPPLAUNCH REQUIRED qdeclarative5-boostable)
20+endif()
21+
22 #pkg_check_modules(TP_QT5 REQUIRED TelepathyQt5)
23 #pkg_check_modules(TPL_QT5 REQUIRED TelepathyLoggerQt5)
24 #pkg_check_modules(QTGLIB REQUIRED QtGLib-2.0)
25
26=== modified file 'debian/control'
27--- debian/control 2015-08-07 21:33:33 +0000
28+++ debian/control 2016-03-03 15:57:20 +0000
29@@ -21,6 +21,7 @@
30 qtdeclarative5-ubuntu-history0.1,
31 qtdeclarative5-ubuntu-ui-toolkit-plugin,
32 xvfb,
33+ libmdeclarativecache5-dev (>= 1.1.13),
34 Standards-Version: 3.9.4
35 Homepage: https://launchpad.net/dialer-app
36 # If you aren't a member of ~phablet-team but need to upload packaging changes,
37@@ -40,6 +41,8 @@
38 qtdeclarative5-ubuntu-ui-toolkit-plugin | qt-components-ubuntu,
39 qtdeclarative5-ubuntu-addressbook0.1,
40 qtdeclarative5-qtcontacts-plugin,
41+ libmdeclarativecache5-0,
42+ mapplauncherd-booster-ubuntu-components,
43 Recommends: unity8 (>= 7.81.0~),
44 Description: Dialer application for Ubuntu
45 An application to make phone calls
46
47=== modified file 'src/CMakeLists.txt'
48--- src/CMakeLists.txt 2014-06-16 17:28:15 +0000
49+++ src/CMakeLists.txt 2016-03-03 15:57:20 +0000
50@@ -12,8 +12,17 @@
51 add_executable(${DIALER_APP}
52 ${dialer_app_SRCS}
53 )
54+
55+
56 qt5_use_modules(${DIALER_APP} Core DBus Gui Qml Quick)
57
58+if (MAPPLAUNCHERD_ENABLED)
59+ set(MAPPLAUNCHERD_COMMAND_PREFIX "/usr/bin/invoker --type=ubuntu-components ")
60+ add_definitions(-DMAPPLAUNCHERD_ENABLED)
61+ target_link_libraries(${DIALER_APP} ${MAPPLAUNCH_LDFLAGS})
62+ target_compile_options(${DIALER_APP} PRIVATE ${MAPPLAUNCH_CFLAGS})
63+endif()
64+
65 include_directories(
66 ${CMAKE_CURRENT_BINARY_DIR}
67 ${CMAKE_CURRENT_SOURCE_DIR}
68
69=== modified file 'src/dialer-app.desktop.in.in'
70--- src/dialer-app.desktop.in.in 2015-04-29 12:54:24 +0000
71+++ src/dialer-app.desktop.in.in 2016-03-03 15:57:20 +0000
72@@ -4,7 +4,7 @@
73 _GenericName=Phone App
74 _Comment=Phone application
75 _Keywords=Phone;Dialer;Dial;Call;Keypad
76-Exec=dialer-app %u
77+Exec=@MAPPLAUNCHERD_COMMAND_PREFIX@dialer-app %u
78 Terminal=false
79 Icon=@CMAKE_INSTALL_PREFIX@/@DIALER_APP_DIR@/assets/dialer-app.png
80 MimeType=x-scheme-handler/contact;x-scheme-handler/call
81
82=== modified file 'src/dialerapplication.cpp'
83--- src/dialerapplication.cpp 2015-11-11 15:16:52 +0000
84+++ src/dialerapplication.cpp 2016-03-03 15:57:20 +0000
85@@ -34,6 +34,11 @@
86 #include "config.h"
87 #include <QQmlEngine>
88 #include <QDir>
89+#include <QGuiApplication>
90+
91+#ifdef MAPPLAUNCHERD_ENABLED
92+#include <mdeclarativecache5/MDeclarativeCache>
93+#endif
94
95 static void printUsage(const QStringList& arguments)
96 {
97@@ -59,11 +64,11 @@
98 }
99
100
101-DialerApplication::DialerApplication(int &argc, char **argv)
102- : QGuiApplication(argc, argv), m_view(0), m_applicationIsReady(false), m_fullScreen(false)
103+DialerApplication::DialerApplication()
104+ : QObject(0), m_view(0), m_applicationIsReady(false), m_fullScreen(false)
105 {
106- setApplicationName("DialerApp");
107- setOrganizationName("com.ubuntu.dialer-app");
108+ qApp->setApplicationName("DialerApp");
109+ qApp->setOrganizationName("com.ubuntu.dialer-app");
110 }
111
112 bool DialerApplication::setup()
113@@ -74,7 +79,7 @@
114 mValidSchemes << "tel" << "dialer";
115 }
116
117- QStringList arguments = this->arguments();
118+ QStringList arguments = qApp->arguments();
119
120 if (arguments.contains("--help")) {
121 printUsage(arguments);
122@@ -125,10 +130,13 @@
123 m_arg = arguments.at(1);
124 }
125 }
126-
127+#ifdef MAPPLAUNCHERD_ENABLED
128+ m_view = MDeclarativeCache::qQuickView();
129+#else
130 m_view = new QQuickView();
131+#endif
132 QObject::connect(m_view, SIGNAL(statusChanged(QQuickView::Status)), this, SLOT(onViewStatusChanged(QQuickView::Status)));
133- QObject::connect(m_view->engine(), SIGNAL(quit()), SLOT(quit()));
134+ QObject::connect(m_view->engine(), SIGNAL(quit()), qApp, SLOT(quit()));
135 m_view->setResizeMode(QQuickView::SizeRootObjectToView);
136 m_view->setTitle("Dialer");
137 m_view->rootContext()->setContextProperty("application", this);
138
139=== modified file 'src/dialerapplication.h'
140--- src/dialerapplication.h 2015-10-19 17:24:34 +0000
141+++ src/dialerapplication.h 2016-03-03 15:57:20 +0000
142@@ -21,15 +21,16 @@
143
144 #include <QObject>
145 #include <QQuickView>
146-#include <QGuiApplication>
147-
148-class DialerApplication : public QGuiApplication
149+
150+class QGuiApplication;
151+
152+class DialerApplication : public QObject
153 {
154 Q_OBJECT
155 Q_PROPERTY(bool fullScreen READ fullScreen WRITE setFullScreen NOTIFY fullScreenChanged)
156
157 public:
158- DialerApplication(int &argc, char **argv);
159+ DialerApplication();
160 virtual ~DialerApplication();
161
162 bool setup();
163
164=== modified file 'src/main.cpp'
165--- src/main.cpp 2014-09-03 14:44:09 +0000
166+++ src/main.cpp 2016-03-03 15:57:20 +0000
167@@ -25,6 +25,7 @@
168 #include <QTemporaryFile>
169 #include <QTextStream>
170 #include <QQmlDebuggingEnabler>
171+#include <QGuiApplication>
172
173 // libc
174 #include <cerrno>
175@@ -35,18 +36,26 @@
176 #include "dialerapplication.h"
177 #include "config.h"
178
179+#ifdef MAPPLAUNCHERD_ENABLED
180+#include <mdeclarativecache5/MDeclarativeCache>
181+#endif
182+
183 // make it possible to do QML profiling
184 static QQmlDebuggingEnabler debuggingEnabler(false);
185
186-int main(int argc, char** argv)
187+int Q_DECL_EXPORT main(int argc, char** argv)
188 {
189- QGuiApplication::setApplicationName("Dialer App");
190- DialerApplication application(argc, argv);
191+#ifdef MAPPLAUNCHERD_ENABLED
192+ QScopedPointer<QGuiApplication> app(MDeclarativeCache::qApplication(argc, argv));
193+#else
194+ QScopedPointer<QGuiApplication> app(new QGuiApplication(argc,argv));
195+#endif
196+ app->setApplicationName("Dialer App");
197
198+ DialerApplication application;
199 if (!application.setup()) {
200 return 0;
201 }
202
203- return application.exec();
204+ return app->exec();
205 }
206-

Subscribers

People subscribed via source and target branches