From 0235f251bf56829772c5dfcbf7835b2fad918741 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sat, 19 Jun 2010 14:18:38 +0100 Subject: [PATCH] Cleanups --- openlp/core/lib/__init__.py | 4 +--- openlp/core/lib/toolbar.py | 3 --- openlp/plugins/media/lib/mediaitem.py | 2 +- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/openlp/core/lib/__init__.py b/openlp/core/lib/__init__.py index 40557d446..98257c87b 100644 --- a/openlp/core/lib/__init__.py +++ b/openlp/core/lib/__init__.py @@ -95,11 +95,10 @@ def build_icon(icon): The icon to build. This can be a QIcon, a resource string in the form ``:/resource/file.png``, or a file location like ``/path/to/file.png``. """ - button_icon = None + button_icon = QtGui.QIcon() if isinstance(icon, QtGui.QIcon): button_icon = icon elif isinstance(icon, basestring): - button_icon = QtGui.QIcon() if icon.startswith(u':/'): button_icon.addPixmap(QtGui.QPixmap(icon), QtGui.QIcon.Normal, QtGui.QIcon.Off) @@ -107,7 +106,6 @@ def build_icon(icon): button_icon.addPixmap(QtGui.QPixmap.fromImage(QtGui.QImage(icon)), QtGui.QIcon.Normal, QtGui.QIcon.Off) elif isinstance(icon, QtGui.QImage): - button_icon = QtGui.QIcon() button_icon.addPixmap(QtGui.QPixmap.fromImage(icon), QtGui.QIcon.Normal, QtGui.QIcon.Off) return button_icon diff --git a/openlp/core/lib/toolbar.py b/openlp/core/lib/toolbar.py index 799852908..b2b05b8c0 100644 --- a/openlp/core/lib/toolbar.py +++ b/openlp/core/lib/toolbar.py @@ -72,9 +72,6 @@ class OpenLPToolbar(QtGui.QToolBar): ToolbarButton = None if icon: ButtonIcon = build_icon(icon) - else: - ButtonIcon = None - if ButtonIcon: if slot and not checkable: ToolbarButton = self.addAction(ButtonIcon, title, slot) else: diff --git a/openlp/plugins/media/lib/mediaitem.py b/openlp/plugins/media/lib/mediaitem.py index ae7569c10..5d8fe03a4 100644 --- a/openlp/plugins/media/lib/mediaitem.py +++ b/openlp/plugins/media/lib/mediaitem.py @@ -29,7 +29,7 @@ import os from PyQt4 import QtCore, QtGui from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon, \ - ItemCapabilities, SettingsManager, context_menu_action, Receiver, translate + ItemCapabilities, SettingsManager, translate log = logging.getLogger(__name__)