From ecacdf3fbd80627a6da3e44a077ef3e308688c10 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Mon, 19 Dec 2016 15:03:45 -0500 Subject: Update the applauncher panel plugin to be able to auto-complete paths to .desktop files. --- .../lumina-desktop/panel-plugins/applauncher/AppLaunchButton.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src-qt5/core/lumina-desktop') diff --git a/src-qt5/core/lumina-desktop/panel-plugins/applauncher/AppLaunchButton.cpp b/src-qt5/core/lumina-desktop/panel-plugins/applauncher/AppLaunchButton.cpp index 05b7981f..1fd819b5 100644 --- a/src-qt5/core/lumina-desktop/panel-plugins/applauncher/AppLaunchButton.cpp +++ b/src-qt5/core/lumina-desktop/panel-plugins/applauncher/AppLaunchButton.cpp @@ -8,13 +8,18 @@ #include "../../LSession.h" #include +#include #include AppLaunchButtonPlugin::AppLaunchButtonPlugin(QWidget *parent, QString id, bool horizontal) : LPPlugin(parent, id, horizontal){ button = new QToolButton(this); button->setAutoRaise(true); button->setToolButtonStyle(Qt::ToolButtonIconOnly); - appfile = id.section("---",0,0).section("::",1,1); + appfile = id.section("---",0,0).section("::",1,1); + if(!QFile::exists(appfile) && appfile.endsWith(".desktop")){ + //might be a relative path - try to find the file + appfile = LUtils::AppToAbsolute(appfile.section("/",-1) ); + } if(!QFile::exists(appfile)){ appfile.clear(); } connect(button, SIGNAL(clicked()), this, SLOT(AppClicked())); this->layout()->setContentsMargins(0,0,0,0); -- cgit