on xenial help sign in
Compile fixes
commitde9fe6dd211a6fcb9d86fc3013cde147fe1df850 authorMichael Terry <michael.terry@canonical.com> dateThu 29 May 2014, 15:14 (12 years ago) parent13d4102
4 files changed+17−6
plugins/Unity/Launcher/CMakeLists.txt+4−1 plugins/Unity/Launcher/launchermodel.cpp+3−3 tests/mocks/Unity/Launcher/MockLauncherModel.cpp+1−1 tests/plugins/Unity/Launcher/CMakeLists.txt+9−1
plugins/Unity/Launcher/CMakeLists.txt+4−1
@@ -1,4 +1,5 @@
11include(FindPkgConfig)
2+pkg_check_modules(GLIB REQUIRED glib-2.0>=2.32)
23pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=3)
34pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=1)
45pkg_check_modules(GSETTINGS_QT REQUIRED gsettings-qt)
@@ -9,6 +10,7 @@ add_definitions(-DSM_BUSNAME=systemBus)
910include_directories(
1011 ${CMAKE_CURRENT_SOURCE_DIR}
1112 ${CMAKE_SOURCE_DIR}/plugins/AccountsService
13+ ${GLIB_INCLUDE_DIRS}
1214 ${GSETTINGS_QT_INCLUDE_DIRS}
1315 ${UPSTART_APP_LAUNCH_INCLUDE_DIRS}
1416)
@@ -31,7 +33,8 @@ add_library(UnityLauncher-qml MODULE
3133 )
3234
3335target_link_libraries(UnityLauncher-qml
34− ${GSETTINGS_QT_LDFLAGS}
36+ ${GLIB_LDFLAGS}
37+ ${GSETTINGS_QT_LDFLAGS}
3538 ${UPSTART_APP_LAUNCH_LDFLAGS}
3639)
3740qt5_use_modules(UnityLauncher-qml DBus Qml)
plugins/Unity/Launcher/launchermodel.cpp+3−3
@@ -196,7 +196,7 @@ void LauncherModel::setUser(const QString &username)
196196 m_backend->setUser(username);
197197}
198198
199−QString LauncherModel::getUrlForAppId(const QString &appId)
199+QString LauncherModel::getUrlForAppId(const QString &appId) const
200200{
201201 // appId is either an appId or a legacy app name. Let's find out which
202202 QString url;
@@ -205,12 +205,12 @@ QString LauncherModel::getUrlForAppId(const QString &appId)
205205 // assume legacy app until proven otherwise
206206 url = "application:///" + appId + ".desktop";
207207
208− if (upstart_app_launch_app_id_parse(appId.first().toLatin1().constData(),
208+ if (upstart_app_launch_app_id_parse(appId.toLatin1().constData(),
209209 &package, &app, &version)) {
210210 // Turn it back into an appId to test if it's a click app or not
211211 longAppId = upstart_app_launch_triplet_to_app_id(package, app, version);
212212 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);
214214 g_free(longAppId);
215215 }
216216 g_free(package);
tests/mocks/Unity/Launcher/MockLauncherModel.cpp+1−1
@@ -183,7 +183,7 @@ void MockLauncherModel::setUser(const QString &username)
183183 // TODO: implement this...
184184}
185185
186−QString LauncherModel::getUrlForAppId(const QString &appId)
186+QString MockLauncherModel::getUrlForAppId(const QString &appId) const
187187{
188188 return "application:///" + appId + ".desktop";
189189}
tests/plugins/Unity/Launcher/CMakeLists.txt+9−1
@@ -1,13 +1,17 @@
1+pkg_check_modules(GLIB REQUIRED glib-2.0>=2.32)
12pkg_check_modules(GSETTINGS_QT REQUIRED gsettings-qt)
23pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=3)
34pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=1)
5+pkg_check_modules(UPSTART_APP_LAUNCH REQUIRED upstart-app-launch-2)
46
57include_directories(
68 ${CMAKE_CURRENT_BINARY_DIR}
79 ${CMAKE_SOURCE_DIR}/plugins/AccountsService
810 ${CMAKE_SOURCE_DIR}/plugins/Unity/Launcher
911 ${CMAKE_SOURCE_DIR}/plugins/Unity/Launcher/backend
12+ ${GLIB_INCLUDE_DIRS}
1013 ${GSETTINGS_QT_INCLUDE_DIRS}
14+ ${UPSTART_APP_LAUNCH_INCLUDE_DIRS}
1115 )
1216
1317add_definitions(-DSM_BUSNAME=sessionBus)
@@ -49,7 +53,11 @@ add_executable(launchermodeltestExec
4953 ${APPLICATION_API_INCLUDEDIR}/unity/shell/application/ApplicationManagerInterface.h
5054 ${LAUNCHER_API_INCLUDEDIR}/unity/shell/application/ApplicationInfoInterface.h
5155 )
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+)
5361qt5_use_modules(launchermodeltestExec Test Core DBus)
5462
5563# copy .desktop files into build directory for shadow builds