[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 26/473: Fix handling of non-standard icon extensions.

noreply at xfce.org noreply at xfce.org
Mon Feb 16 23:53:16 CET 2015


This is an automated email from the git hooks/post-receive script.

gottcode pushed a commit to branch master
in repository panel-plugins/xfce4-whiskermenu-plugin.

commit 211b93c1f13562a19b90dcd7221b55f1ab20dd27
Author: Graeme Gott <graeme at gottcode.org>
Date:   Wed Jun 26 12:02:19 2013 -0400

    Fix handling of non-standard icon extensions.
---
 src/launcher.cpp |   21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/src/launcher.cpp b/src/launcher.cpp
index b7adaf5..f2db143 100644
--- a/src/launcher.cpp
+++ b/src/launcher.cpp
@@ -90,7 +90,26 @@ Launcher::Launcher(GarconMenuItem* item) :
 		if (!g_path_is_absolute(icon))
 		{
 			gchar* pos = g_strrstr(icon, ".");
-			m_icon = !pos ? g_strdup(icon) : g_strndup(icon, pos - icon);
+			if (!pos)
+			{
+				m_icon = g_strdup(icon);
+			}
+			else
+			{
+				gchar* suffix = g_utf8_casefold(pos, -1);
+				if ((strcmp(suffix, ".png") == 0)
+						|| (strcmp(suffix, ".xpm") == 0)
+						|| (strcmp(suffix, ".svg") == 0)
+						|| (strcmp(suffix, ".svgz") == 0))
+				{
+					m_icon = g_strndup(icon, pos - icon);
+				}
+				else
+				{
+					m_icon = g_strdup(icon);
+				}
+				g_free(suffix);
+			}
 		}
 		else
 		{

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list