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

Proposed by Benjamin Zeller
Status: Work in progress
Proposed branch: lp:~zeller-benjamin/messaging-app/applauncherd
Merge into: lp:messaging-app
Diff against target: 198 lines (+47/-14)
7 files modified
CMakeLists.txt (+6/-0)
debian/control (+3/-0)
src/CMakeLists.txt (+7/-0)
src/main.cpp (+14/-5)
src/messaging-app.desktop.in.in (+1/-1)
src/messagingapplication.cpp (+14/-5)
src/messagingapplication.h (+2/-3)
To merge this branch: bzr merge lp:~zeller-benjamin/messaging-app/applauncherd
Reviewer Review Type Date Requested Status
Ubuntu Phablet Team Pending
Review via email: mp+287959@code.launchpad.net

Commit message

Prepare messaging-app for mapplauncherd

Description of the change

Prepare messaging-app for mapplauncherd

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

Prepare messaging-app for mapplauncherd

525. By Benjamin Zeller

Merge trunk

Unmerged revisions

525. By Benjamin Zeller

Merge trunk

524. By Benjamin Zeller

Prepare messaging-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 2016-01-19 17:44:27 +0000
3+++ CMakeLists.txt 2016-03-14 10:25:25 +0000
4@@ -2,6 +2,8 @@
5 cmake_minimum_required(VERSION 2.8)
6 set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
7
8+option(MAPPLAUNCHERD_ENABLED "Build with mapplauncherd support" ON)
9+
10 # Standard install paths
11 include(GNUInstallDirs)
12
13@@ -46,6 +48,10 @@
14 find_package(PkgConfig REQUIRED)
15 pkg_check_modules(NOTIFY REQUIRED libnotify)
16
17+if (MAPPLAUNCHERD_ENABLED)
18+ pkg_check_modules(MAPPLAUNCH REQUIRED qdeclarative5-boostable)
19+endif()
20+
21 #find unity8 qml libraries
22 set(UNITY8_QML_PATH /usr/lib/${CMAKE_C_LIBRARY_ARCHITECTURE}/unity8/qml/)
23 find_path(LIB_UNITY_QML_EXISTS NAMES libUnity-qml.so
24
25=== modified file 'debian/control'
26--- debian/control 2016-01-28 12:42:01 +0000
27+++ debian/control 2016-03-14 10:25:25 +0000
28@@ -33,6 +33,7 @@
29 qml-module-qtmultimedia,
30 qtpim5-dev,
31 xvfb,
32+ libmdeclarativecache5-dev (>= 1.1.13),
33 Standards-Version: 3.9.4
34 Homepage: https://launchpad.net/messaging-app
35 # If you aren't a member of ~phablet-team but need to upload packaging changes,
36@@ -55,6 +56,8 @@
37 qtdeclarative5-gsettings1.0,
38 qml-module-qt-labs-settings,
39 ttf-ancient-fonts-symbola,
40+ libmdeclarativecache5-0,
41+ mapplauncherd-booster-ubuntu-components,
42 Recommends: unity8 (>= 7.81.0~),
43 Description: messaging application for Ubuntu
44 An application to send and receive messages.
45
46=== modified file 'src/CMakeLists.txt'
47--- src/CMakeLists.txt 2015-11-26 20:32:50 +0000
48+++ src/CMakeLists.txt 2016-03-14 10:25:25 +0000
49@@ -20,6 +20,13 @@
50 )
51 qt5_use_modules(${MESSAGING_APP} Core DBus Gui Multimedia Qml Quick Sql Versit)
52
53+if (MAPPLAUNCHERD_ENABLED)
54+ set(MAPPLAUNCHERD_COMMAND_PREFIX "/usr/bin/invoker --type=ubuntu-components ")
55+ add_definitions(-DMAPPLAUNCHERD_ENABLED)
56+ target_link_libraries (${MESSAGING_APP} ${MAPPLAUNCH_LDFLAGS})
57+ target_compile_options(${MESSAGING_APP} PRIVATE ${MAPPLAUNCH_CFLAGS})
58+endif()
59+
60 include_directories(
61 ${CMAKE_CURRENT_BINARY_DIR}
62 ${CMAKE_CURRENT_SOURCE_DIR}
63
64=== modified file 'src/main.cpp'
65--- src/main.cpp 2014-08-26 19:07:12 +0000
66+++ src/main.cpp 2016-03-14 10:25:25 +0000
67@@ -24,6 +24,8 @@
68 #include <QString>
69 #include <QTemporaryFile>
70 #include <QTextStream>
71+#include <QGuiApplication>
72+#include <QScopedPointer>
73
74 // libc
75 #include <cerrno>
76@@ -34,23 +36,30 @@
77 #include "messagingapplication.h"
78 #include "config.h"
79
80+#ifdef MAPPLAUNCHERD_ENABLED
81+#include <mdeclarativecache5/MDeclarativeCache>
82+#endif
83+
84 // WORKAROUND: to make easy to debug apps
85 #include <QtQml/QQmlDebuggingEnabler>
86 static QQmlDebuggingEnabler debuggingEnabler(false);
87
88 // Temporarily disable the telepathy folks backend
89 // as it doesn’t play well with QtFolks.
90-int main(int argc, char** argv)
91+int Q_DECL_EXPORT main(int argc, char** argv)
92 {
93 QGuiApplication::setApplicationName("Messaging App");
94 QGuiApplication::setOrganizationName("com.ubuntu.messaging-app");
95-
96- MessagingApplication application(argc, argv);
97+ #ifdef MAPPLAUNCHERD_ENABLED
98+ QScopedPointer<QGuiApplication> app(MDeclarativeCache::qApplication(argc, argv));
99+ #else
100+ QScopedPointer<QGuiApplication> app(new QGuiApplication(argc,argv));
101+ #endif
102+ MessagingApplication application;
103
104 if (!application.setup()) {
105 return 0;
106 }
107
108- return application.exec();
109+ return app->exec();
110 }
111-
112
113=== modified file 'src/messaging-app.desktop.in.in'
114--- src/messaging-app.desktop.in.in 2016-02-10 16:50:36 +0000
115+++ src/messaging-app.desktop.in.in 2016-03-14 10:25:25 +0000
116@@ -4,7 +4,7 @@
117 _GenericName=Messaging App
118 _Comment=Messaging application
119 _Keywords=Messages;SMS;MMS;Text Messages;Text
120-Exec=messaging-app %u
121+Exec=@MAPPLAUNCHERD_COMMAND_PREFIX@messaging-app %u
122 Terminal=false
123 Icon=@CMAKE_INSTALL_PREFIX@/@MESSAGING_APP_DIR@/assets/messaging-app.png
124 MimeType=x-scheme-handler/contact;x-scheme-handler/call
125
126=== modified file 'src/messagingapplication.cpp'
127--- src/messagingapplication.cpp 2016-02-10 17:01:02 +0000
128+++ src/messagingapplication.cpp 2016-03-14 10:25:25 +0000
129@@ -42,6 +42,11 @@
130 #include <QMimeDatabase>
131 #include <QStandardPaths>
132 #include <QVersitReader>
133+#include <QGuiApplication>
134+
135+#ifdef MAPPLAUNCHERD_ENABLED
136+#include <mdeclarativecache5/MDeclarativeCache>
137+#endif
138
139 using namespace QtVersit;
140 #define Pair QPair<QString,QString>
141@@ -84,10 +89,10 @@
142 return new StickersHistoryModel();
143 }
144
145-MessagingApplication::MessagingApplication(int &argc, char **argv)
146- : QGuiApplication(argc, argv), m_view(0), m_applicationIsReady(false)
147+MessagingApplication::MessagingApplication()
148+ : QObject(0), m_view(0), m_applicationIsReady(false)
149 {
150- setApplicationName("MessagingApp");
151+ qApp->setApplicationName("MessagingApp");
152 }
153
154 bool MessagingApplication::fullscreen() const
155@@ -105,7 +110,7 @@
156 validSchemes << "message";
157 }
158
159- QStringList arguments = this->arguments();
160+ QStringList arguments = qApp->arguments();
161
162 if (arguments.contains("--help")) {
163 printUsage(arguments);
164@@ -157,7 +162,11 @@
165 }
166 }
167
168- m_view = new QQuickView();
169+ #ifdef MAPPLAUNCHERD_ENABLED
170+ m_view = MDeclarativeCache::qQuickView();
171+ #else
172+ m_view = new QQuickView();
173+ #endif
174 QObject::connect(m_view, SIGNAL(statusChanged(QQuickView::Status)), this, SLOT(onViewStatusChanged(QQuickView::Status)));
175 QObject::connect(m_view->engine(), SIGNAL(quit()), SLOT(quit()));
176 m_view->setResizeMode(QQuickView::SizeRootObjectToView);
177
178=== modified file 'src/messagingapplication.h'
179--- src/messagingapplication.h 2015-11-24 18:09:55 +0000
180+++ src/messagingapplication.h 2016-03-14 10:25:25 +0000
181@@ -21,15 +21,14 @@
182
183 #include <QObject>
184 #include <QQuickView>
185-#include <QGuiApplication>
186
187-class MessagingApplication : public QGuiApplication
188+class MessagingApplication : public QObject
189 {
190 Q_OBJECT
191 Q_PROPERTY(bool fullscreen READ fullscreen WRITE setFullscreen NOTIFY fullscreenChanged)
192
193 public:
194- MessagingApplication(int &argc, char **argv);
195+ MessagingApplication();
196 virtual ~MessagingApplication();
197
198 bool fullscreen() const;

Subscribers

People subscribed via source and target branches