[alacarte] ItemEditor: Make sure to include the extension in the icon name



commit d31ce6b696cdae0e28aca49e0c8887b450114780
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Tue Oct 22 15:08:39 2013 -0400

    ItemEditor: Make sure to include the extension in the icon name

 Alacarte/ItemEditor.py |    7 ++++---
 1 files 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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]