Blob Blame History Raw
From d31ce6b696cdae0e28aca49e0c8887b450114780 Mon Sep 17 00:00:00 2001
From: "Jasper St. Pierre" <jstpierre@mecheye.net>
Date: Tue, 22 Oct 2013 15:08:39 -0400
Subject: [PATCH] ItemEditor: Make sure to include the extension in the icon
 name

---
 Alacarte/ItemEditor.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/Alacarte/ItemEditor.py b/Alacarte/ItemEditor.py
index 2330de0..64d713f 100644
--- a/Alacarte/ItemEditor.py
+++ b/Alacarte/ItemEditor.py
@@ -33,8 +33,6 @@ def try_icon_name(filename):
     if not filename.endswith(EXTENSIONS):
         return filename
 
-    filename = filename[:-4]
-
     theme = Gtk.IconTheme.get_default()
     resolved_path = None
     for path in theme.get_search_path():
@@ -50,7 +48,10 @@ def try_icon_name(filename):
     if len(parts) != 4:
         return filename
 
-    return parts[3]
+    icon_name = parts[3]
+
+    # strip extension
+    return icon_name[:-4]
 
 def get_icon_string(image):
     filename = image.props.file
-- 
1.9.0