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

noreply at xfce.org noreply at xfce.org
Sat Aug 20 18:33:19 CEST 2016


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

gottcode pushed a commit to annotated tag v1.0.1
in repository panel-plugins/xfce4-whiskermenu-plugin.

commit c06de0843023669741041f418b2abcf0f0214584
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