From 9cba7ea0a5f8522f33a918724bf650d89a6d4115 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 1 Feb 2013 13:26:14 +0530 Subject: [PATCH] Fix #1112225 (Column icons . Add rule) --- src/calibre/gui2/preferences/coloring.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/calibre/gui2/preferences/coloring.py b/src/calibre/gui2/preferences/coloring.py index fdd2d623ae..020e35adea 100644 --- a/src/calibre/gui2/preferences/coloring.py +++ b/src/calibre/gui2/preferences/coloring.py @@ -306,11 +306,12 @@ class RuleEditor(QDialog): # {{{ self.filename_box.setInsertPolicy(self.filename_box.InsertAlphabetically) d = os.path.join(config_dir, 'cc_icons') self.icon_file_names = [] - for icon_file in os.listdir(d): - icon_file = lower(icon_file) - if os.path.exists(os.path.join(d, icon_file)): - if icon_file.endswith('.png'): - self.icon_file_names.append(icon_file) + if os.path.exists(d): + for icon_file in os.listdir(d): + icon_file = lower(icon_file) + if os.path.exists(os.path.join(d, icon_file)): + if icon_file.endswith('.png'): + self.icon_file_names.append(icon_file) self.icon_file_names.sort(key=sort_key) self.update_filename_box()