on xenial help sign in
undo accidental commits
70e3a15Michael Terry
debian/control−1
@@ -20,7 +20,6 @@ Build-Depends: cmake,
20 libqt5xmlpatterns5-dev,
20 libqt5xmlpatterns5-dev,
21 libunity-api-dev (>= 7.80.6),
21 libunity-api-dev (>= 7.80.6),
22 libunity-mir-dev,
22 libunity-mir-dev,
23− libupstart-app-launch2-dev,
24 libusermetricsoutput1-dev,
23 libusermetricsoutput1-dev,
25 libxcb1-dev,
24 libxcb1-dev,
26 pkg-config,
25 pkg-config,
plugins/Unity/Launcher/CMakeLists.txt+2−6
@@ -2,7 +2,6 @@ include(FindPkgConfig)
2pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=3)
2pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=3)
3pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=1)
3pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=1)
4pkg_check_modules(GSETTINGS_QT REQUIRED gsettings-qt)
4pkg_check_modules(GSETTINGS_QT REQUIRED gsettings-qt)
5−pkg_check_modules(UPSTART_APP_LAUNCH REQUIRED upstart-app-launch-2)
6
5
7add_definitions(-DSM_BUSNAME=systemBus)
6add_definitions(-DSM_BUSNAME=systemBus)
8
7
@@ -10,7 +9,6 @@ include_directories(
10 ${CMAKE_CURRENT_SOURCE_DIR}
9 ${CMAKE_CURRENT_SOURCE_DIR}
11 ${CMAKE_SOURCE_DIR}/plugins/AccountsService
10 ${CMAKE_SOURCE_DIR}/plugins/AccountsService
12 ${GSETTINGS_QT_INCLUDE_DIRS}
11 ${GSETTINGS_QT_INCLUDE_DIRS}
13− ${UPSTART_APP_LAUNCH_INCLUDE_DIRS}
14)
12)
15
13
16set(QMLLAUNCHERPLUGIN_SRC
14set(QMLLAUNCHERPLUGIN_SRC
@@ -30,10 +28,8 @@ add_library(UnityLauncher-qml MODULE
30 ${QMLLAUNCHERPLUGIN_SRC}
28 ${QMLLAUNCHERPLUGIN_SRC}
31 )
29 )
32
30
33−target_link_libraries(UnityLauncher-qml
31+target_link_libraries(UnityLauncher-qml ${GSETTINGS_QT_LDFLAGS})
34− ${GSETTINGS_QT_LDFLAGS}
32+
35− ${UPSTART_APP_LAUNCH_LDFLAGS}
36−)
37qt5_use_modules(UnityLauncher-qml DBus Qml)
33qt5_use_modules(UnityLauncher-qml DBus Qml)
38
34
39add_unity8_plugin(Unity.Launcher 0.1 Unity/Launcher TARGETS UnityLauncher-qml)
35add_unity8_plugin(Unity.Launcher 0.1 Unity/Launcher TARGETS UnityLauncher-qml)
plugins/Unity/Launcher/launchermodel.cpp−26
@@ -22,7 +22,6 @@
22#include "backend/launcherbackend.h"
22#include "backend/launcherbackend.h"
23
23
24#include <unity/shell/application/ApplicationInfoInterface.h>
24#include <unity/shell/application/ApplicationInfoInterface.h>
25−#include <upstart-app-launch.h>
26
25
27using namespace unity::shell::application;
26using namespace unity::shell::application;
28
27
@@ -196,31 +195,6 @@ void LauncherModel::setUser(const QString &username)
196 m_backend->setUser(username);
195 m_backend->setUser(username);
197}
196}
198
197
199−QString LauncherModel::getUrlForAppId(const QString &appId)
200−{
201− // appId is either an appId or a legacy app name. Let's find out which
202− QString url;
203− gchar *package, *app, *version, *longAppId;
204−
205− // assume legacy app until proven otherwise
206− url = "application:///" + appId + ".desktop";
207−
208− if (upstart_app_launch_app_id_parse(appId.first().toLatin1().constData(),
209− &package, &app, &version)) {
210− // Turn it back into an appId to test if it's a click app or not
211− longAppId = upstart_app_launch_triplet_to_app_id(package, app, version);
212− if (longAppId != nullptr) { // it is a click app!
213− url = QString("appid://%1/%2/%3").args(package, app, version);
214− g_free(longAppId);
215− }
216− g_free(package);
217− g_free(app);
218− g_free(version);
219− }
220−
221− return url;
222−}
223−
224void LauncherModel::refreshStoredApplications()
198void LauncherModel::refreshStoredApplications()
225{
199{
226 // First remove any existing ones
200 // First remove any existing ones
plugins/Unity/Launcher/launchermodel.h−1
@@ -51,7 +51,6 @@ public:
51 Q_INVOKABLE void requestRemove(const QString &appId);
51 Q_INVOKABLE void requestRemove(const QString &appId);
52 Q_INVOKABLE void quickListActionInvoked(const QString &appId, int actionIndex);
52 Q_INVOKABLE void quickListActionInvoked(const QString &appId, int actionIndex);
53 Q_INVOKABLE void setUser(const QString &username);
53 Q_INVOKABLE void setUser(const QString &username);
54− Q_INVOKABLE QString getUrlForAppId(const QString &appId) const;
55
54
56 unity::shell::application::ApplicationManagerInterface* applicationManager() const;
55 unity::shell::application::ApplicationManagerInterface* applicationManager() const;
57 void setApplicationManager(unity::shell::application::ApplicationManagerInterface *appManager);
56 void setApplicationManager(unity::shell::application::ApplicationManagerInterface *appManager);
qml/GreeterShell.qml+1−1
@@ -201,7 +201,7 @@ BasicShell {
201 dragAreaWidth: shell.edgeSize
201 dragAreaWidth: shell.edgeSize
202 available: !edgeDemo.active
202 available: !edgeDemo.active
203 onLauncherApplicationSelected: {
203 onLauncherApplicationSelected: {
204− shell.activateApplication(LauncherModel.getUrlForAppId(appId))
204+ shell.activateApplication("application:///" + appId + ".desktop")
205 }
205 }
206 onShownChanged: {
206 onShownChanged: {
207 if (shown) {
207 if (shown) {
tests/mocks/Unity/Launcher/MockLauncherModel.cpp−5
@@ -183,11 +183,6 @@ void MockLauncherModel::setUser(const QString &username)
183 // TODO: implement this...
183 // TODO: implement this...
184}
184}
185
185
186−QString LauncherModel::getUrlForAppId(const QString &appId)
187−{
188− return "application:///" + appId + ".desktop";
189−}
190−
191void MockLauncherModel::setApplicationManager(unity::shell::application::ApplicationManagerInterface *applicationManager)
186void MockLauncherModel::setApplicationManager(unity::shell::application::ApplicationManagerInterface *applicationManager)
192{
187{
193 Q_UNUSED(applicationManager)
188 Q_UNUSED(applicationManager)
tests/mocks/Unity/Launcher/MockLauncherModel.h−1
@@ -44,7 +44,6 @@ public:
44 Q_INVOKABLE void requestRemove(const QString &appId);
44 Q_INVOKABLE void requestRemove(const QString &appId);
45 Q_INVOKABLE void quickListActionInvoked(const QString &appId, int actionIndex);
45 Q_INVOKABLE void quickListActionInvoked(const QString &appId, int actionIndex);
46 Q_INVOKABLE void setUser(const QString &username);
46 Q_INVOKABLE void setUser(const QString &username);
47− Q_INVOKABLE QString getUrlForAppId(const QString &appId) const;
48
47
49 unity::shell::application::ApplicationManagerInterface *applicationManager() const;
48 unity::shell::application::ApplicationManagerInterface *applicationManager() const;
50 void setApplicationManager(unity::shell::application::ApplicationManagerInterface *applicationManager);
49 void setApplicationManager(unity::shell::application::ApplicationManagerInterface *applicationManager);