on xenial help sign in
Compile fixes
de9fe6dMichael Terry
plugins/Unity/Launcher/CMakeLists.txt+4−1
@@ -1,4 +1,5 @@
1include(FindPkgConfig)
1include(FindPkgConfig)
2+pkg_check_modules(GLIB REQUIRED glib-2.0>=2.32)
2pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=3)
3pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=3)
3pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=1)
4pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=1)
4pkg_check_modules(GSETTINGS_QT REQUIRED gsettings-qt)
5pkg_check_modules(GSETTINGS_QT REQUIRED gsettings-qt)
@@ -9,6 +10,7 @@ add_definitions(-DSM_BUSNAME=systemBus)
9include_directories(
10include_directories(
10 ${CMAKE_CURRENT_SOURCE_DIR}
11 ${CMAKE_CURRENT_SOURCE_DIR}
11 ${CMAKE_SOURCE_DIR}/plugins/AccountsService
12 ${CMAKE_SOURCE_DIR}/plugins/AccountsService
13+ ${GLIB_INCLUDE_DIRS}
12 ${GSETTINGS_QT_INCLUDE_DIRS}
14 ${GSETTINGS_QT_INCLUDE_DIRS}
13 ${UPSTART_APP_LAUNCH_INCLUDE_DIRS}
15 ${UPSTART_APP_LAUNCH_INCLUDE_DIRS}
14)
16)
@@ -31,7 +33,8 @@ add_library(UnityLauncher-qml MODULE
31 )
33 )
32
34
33target_link_libraries(UnityLauncher-qml
35target_link_libraries(UnityLauncher-qml
36+ ${GLIB_LDFLAGS}
34− ${GSETTINGS_QT_LDFLAGS}
37+ ${GSETTINGS_QT_LDFLAGS}
35 ${UPSTART_APP_LAUNCH_LDFLAGS}
38 ${UPSTART_APP_LAUNCH_LDFLAGS}
36)
39)
37qt5_use_modules(UnityLauncher-qml DBus Qml)
40qt5_use_modules(UnityLauncher-qml DBus Qml)
plugins/Unity/Launcher/launchermodel.cpp+3−3
@@ -196,7 +196,7 @@ void LauncherModel::setUser(const QString &username)
196 m_backend->setUser(username);
196 m_backend->setUser(username);
197}
197}
198
198
199−QString LauncherModel::getUrlForAppId(const QString &appId)
199+QString LauncherModel::getUrlForAppId(const QString &appId) const
200{
200{
201 // appId is either an appId or a legacy app name. Let's find out which
201 // appId is either an appId or a legacy app name. Let's find out which
202 QString url;
202 QString url;
@@ -205,12 +205,12 @@ QString LauncherModel::getUrlForAppId(const QString &appId)
205 // assume legacy app until proven otherwise
205 // assume legacy app until proven otherwise
206 url = "application:///" + appId + ".desktop";
206 url = "application:///" + appId + ".desktop";
207
207
208− if (upstart_app_launch_app_id_parse(appId.first().toLatin1().constData(),
208+ if (upstart_app_launch_app_id_parse(appId.toLatin1().constData(),
209 &package, &app, &version)) {
209 &package, &app, &version)) {
210 // Turn it back into an appId to test if it's a click app or not
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);
211 longAppId = upstart_app_launch_triplet_to_app_id(package, app, version);
212 if (longAppId != nullptr) { // it is a click app!
212 if (longAppId != nullptr) { // it is a click app!
213− url = QString("appid://%1/%2/%3").args(package, app, version);
213+ url = QString("appid://%1/%2/%3").arg(package, app, version);
214 g_free(longAppId);
214 g_free(longAppId);
215 }
215 }
216 g_free(package);
216 g_free(package);
tests/mocks/Unity/Launcher/MockLauncherModel.cpp+1−1
@@ -183,7 +183,7 @@ 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)
186+QString MockLauncherModel::getUrlForAppId(const QString &appId) const
187{
187{
188 return "application:///" + appId + ".desktop";
188 return "application:///" + appId + ".desktop";
189}
189}
tests/plugins/Unity/Launcher/CMakeLists.txt+9−1
@@ -1,13 +1,17 @@
1+pkg_check_modules(GLIB REQUIRED glib-2.0>=2.32)
1pkg_check_modules(GSETTINGS_QT REQUIRED gsettings-qt)
2pkg_check_modules(GSETTINGS_QT REQUIRED gsettings-qt)
2pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=3)
3pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=3)
3pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=1)
4pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=1)
5+pkg_check_modules(UPSTART_APP_LAUNCH REQUIRED upstart-app-launch-2)
4
6
5include_directories(
7include_directories(
6 ${CMAKE_CURRENT_BINARY_DIR}
8 ${CMAKE_CURRENT_BINARY_DIR}
7 ${CMAKE_SOURCE_DIR}/plugins/AccountsService
9 ${CMAKE_SOURCE_DIR}/plugins/AccountsService
8 ${CMAKE_SOURCE_DIR}/plugins/Unity/Launcher
10 ${CMAKE_SOURCE_DIR}/plugins/Unity/Launcher
9 ${CMAKE_SOURCE_DIR}/plugins/Unity/Launcher/backend
11 ${CMAKE_SOURCE_DIR}/plugins/Unity/Launcher/backend
12+ ${GLIB_INCLUDE_DIRS}
10 ${GSETTINGS_QT_INCLUDE_DIRS}
13 ${GSETTINGS_QT_INCLUDE_DIRS}
14+ ${UPSTART_APP_LAUNCH_INCLUDE_DIRS}
11 )
15 )
12
16
13add_definitions(-DSM_BUSNAME=sessionBus)
17add_definitions(-DSM_BUSNAME=sessionBus)
@@ -49,7 +53,11 @@ add_executable(launchermodeltestExec
49 ${APPLICATION_API_INCLUDEDIR}/unity/shell/application/ApplicationManagerInterface.h
53 ${APPLICATION_API_INCLUDEDIR}/unity/shell/application/ApplicationManagerInterface.h
50 ${LAUNCHER_API_INCLUDEDIR}/unity/shell/application/ApplicationInfoInterface.h
54 ${LAUNCHER_API_INCLUDEDIR}/unity/shell/application/ApplicationInfoInterface.h
51 )
55 )
52−target_link_libraries(launchermodeltestExec ${GSETTINGS_QT_LDFLAGS} )
56+target_link_libraries(launchermodeltestExec
57+ ${GLIB_LDFLAGS}
58+ ${GSETTINGS_QT_LDFLAGS}
59+ ${UPSTART_APP_LAUNCH_LDFLAGS}
60+)
53qt5_use_modules(launchermodeltestExec Test Core DBus)
61qt5_use_modules(launchermodeltestExec Test Core DBus)
54
62
55# copy .desktop files into build directory for shadow builds
63# copy .desktop files into build directory for shadow builds