open the application when clicking on the title entry in the quicklist
commit0312969c570d7ed5452d35b7f013f3a1877237a9
authorMichael Zanetti <michael.zanetti@canonical.com>
dateTue 2 Sep 2014, 13:11 (12 years ago)
parent62c84f8
plugins/Unity/Launcher/CMakeLists.txt+1−1
@@ -30,6 +30,6 @@ add_library(UnityLauncher-qml MODULE
3030
3131target_link_libraries(UnityLauncher-qml ${GSETTINGS_QT_LDFLAGS})
3232
33−qt5_use_modules(UnityLauncher-qml DBus Qml)
33+qt5_use_modules(UnityLauncher-qml DBus Qml Gui)
3434
3535add_unity8_plugin(Unity.Launcher 0.1 Unity/Launcher TARGETS UnityLauncher-qml)
plugins/Unity/Launcher/launcheritem.cpp+1
@@ -36,6 +36,7 @@ LauncherItem::LauncherItem(const QString &appId, const QString &name, const QStr
3636 m_quickList(new QuickListModel(this))
3737{
3838 QuickListEntry nameAction;
39+ nameAction.setActionId("launch_item");
3940 nameAction.setText(m_name);
4041 m_quickList->appendAction(nameAction);
4142 QuickListEntry pinningAction;
plugins/Unity/Launcher/launchermodel.cpp+3
@@ -23,6 +23,7 @@
2323
2424#include <unity/shell/application/ApplicationInfoInterface.h>
2525
26+#include <QDesktopServices>
2627#include <QDebug>
2728
2829using namespace unity::shell::application;
@@ -191,6 +192,8 @@ void LauncherModel::quickListActionInvoked(const QString &appId, int actionIndex
191192 } else {
192193 pin(appId);
193194 }
195+ } else if (actionId == "launch_item") {
196+ QDesktopServices::openUrl(getUrlForAppId(appId));
194197
195198 // Nope, we don't know this action, let the backend forward it to the application
196199 } else {
qml/Shell.qml+2
@@ -146,6 +146,7 @@ Item {
146146 lockscreen.show();
147147 }
148148 greeter.hide();
149+ launcher.hide();
149150 }
150151
151152 onFocusedApplicationIdChanged: {
@@ -164,6 +165,7 @@ Item {
164165 // for an emergency call or accepted an incoming call.
165166 setFakeActiveForApp(appId)
166167 }
168+ launcher.hide();
167169 }
168170 }
169171
tests/plugins/Unity/Launcher/CMakeLists.txt+1−1
@@ -50,7 +50,7 @@ add_executable(launchermodeltestExec
5050 ${LAUNCHER_API_INCLUDEDIR}/unity/shell/application/ApplicationInfoInterface.h
5151 )
5252target_link_libraries(launchermodeltestExec ${GSETTINGS_QT_LDFLAGS})
53−qt5_use_modules(launchermodeltestExec Test Core DBus)
53+qt5_use_modules(launchermodeltestExec Test Core DBus Gui)
5454
5555# copy .desktop files into build directory for shadow builds
5656file(GLOB DESKTOP_FILES *.desktop)