Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Executables dropped on Quick Launch should get a default icon instead of path text #39

Closed
willbprog127 opened this issue May 25, 2014 · 5 comments

Comments

@willbprog127
Copy link
Contributor

I have a special executable of Firefox, for example, in a local directory. When I drop the executable on the Quick Launch, it creates a huge button with the executable's path instead of using the 'default missing app icon'. See also #30.

lxqt-issue1

Ubuntu 14.04 64-bit, panel version: 0.7.0+bzr577+201405240832~ubuntu14.04.1

@willbprog127 willbprog127 changed the title Executables (not .desktop files) dropped on Quick Launch should get a default icon instead of path text Executables dropped on Quick Launch should get a default icon instead of path text May 25, 2014
@willbprog127
Copy link
Contributor Author

I was able to get the desired result with:

diff --git a/plugin-quicklaunch/quicklaunchaction.cpp b/plugin-quicklaunch/quicklaunchaction.cpp
index 83b31dc..27c43c0 100644
--- a/plugin-quicklaunch/quicklaunchaction.cpp
+++ b/plugin-quicklaunch/quicklaunchaction.cpp
@@ -53,8 +53,9 @@ QuickLaunchAction::QuickLaunchAction(const QString & name,
     m_settingsMap["exec"] = exec;
     m_settingsMap["icon"] = icon;

-    if (icon.isNull())
-        setIcon(XdgIcon::defaultApplicationIcon());
+    if (icon == "" || icon.isNull()) {
+        setIcon(QIcon::fromTheme("image-missing"));
+    }
     else
         setIcon(QIcon(icon));

lxqt-issue3

@jleclanche
Copy link
Member

XdgIcon::defaultApplicationIcon() is the better call.

I didn't look too close but when can the icon be null at all? If it can be both empty and null this might be an issue with qtxdg.

@willbprog127
Copy link
Contributor Author

Yes, you're right. This works:

diff --git a/plugin-quicklaunch/quicklaunchaction.cpp b/plugin-quicklaunch/quicklaunchaction.cpp
index 83b31dc..ec9447b 100644
--- a/plugin-quicklaunch/quicklaunchaction.cpp
+++ b/plugin-quicklaunch/quicklaunchaction.cpp
@@ -53,8 +53,9 @@ QuickLaunchAction::QuickLaunchAction(const QString & name,
     m_settingsMap["exec"] = exec;
     m_settingsMap["icon"] = icon;

-    if (icon.isNull())
+    if (icon == "" || icon.isNull()) {
         setIcon(XdgIcon::defaultApplicationIcon());
+    }
     else
         setIcon(QIcon(icon));

lxqt-issue4

@willbprog127
Copy link
Contributor Author

Should I submit this as a patch, or...? I'm not really proficient on git yet, so not sure if a PR should be done instead?

@paulolieuthier
Copy link
Contributor

A PR would be nice, IMO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants