From 9ca1d49ef773adae2a26758a61c9db3b029d93b1 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Sun, 27 Jan 2019 16:11:00 -0500 Subject: Make sure the applauncher panel plugin uses the same LFileInfo class as other tools. --- .../panel-plugins/applauncher/AppLaunchButton.cpp | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'src-qt5/core/lumina-desktop/panel-plugins') 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 98770f18..46a5c338 100644 --- a/src-qt5/core/lumina-desktop/panel-plugins/applauncher/AppLaunchButton.cpp +++ b/src-qt5/core/lumina-desktop/panel-plugins/applauncher/AppLaunchButton.cpp @@ -35,20 +35,15 @@ AppLaunchButtonPlugin::~AppLaunchButtonPlugin(){ void AppLaunchButtonPlugin::updateButtonVisuals(){ QIcon icon; QString tooltip = tr("Click to assign an application"); - if(appfile.endsWith(".desktop")){ - XDGDesktop desk(appfile); - if(desk.isValid()){ - icon = LXDG::findIcon(desk.icon, "unknown"); - tooltip = QString(tr("Launch %1")).arg(desk.name); - }else{ - icon = LXDG::findIcon("task-attention",""); - appfile.clear(); - } - }else if(QFile::exists(appfile)){ - icon = LXDG::findMimeIcon(appfile.section("/",-1)); + LFileInfo info(appfile); + if(info.isDesktopFile()){ + icon = LXDG::findIcon(info.iconfile(), "unknown"); + tooltip = QString(tr("Launch %1")).arg(info.XDG()->name); + }else if(info.exists()){ + icon = LXDG::findIcon(info.iconfile(), "unknown"); tooltip = QString(tr("Open %1")).arg(appfile.section("/",-1)); }else{ - icon = LXDG::findIcon("task-attention", ""); + icon = LXDG::findIcon("task-attention", ""); } button->setIcon( icon ); button->setToolTip(tooltip); -- cgit