The special attribute of a Cluster should be boolean.

This commit is contained in:
Philipp Wolfer
2011-03-06 21:44:34 +01:00
parent 87df5ff13f
commit a3422a96dd
2 changed files with 6 additions and 6 deletions

View File

@@ -121,7 +121,7 @@ class Album(DataObject, Item):
self._after_load_callbacks = queue.Queue()
self.current_release_event = None
self.release_events = []
self.unmatched_files = Cluster(_("Unmatched Files"), special=2, related_album=self)
self.unmatched_files = Cluster(_("Unmatched Files"), special=True, related_album=self)
def __repr__(self):
return '<Album %s %r>' % (self.id, self.metadata[u"album"])

View File

@@ -231,7 +231,7 @@ class MainPanel(QtGui.QSplitter):
for i, column in enumerate(self.columns):
item.setText(i, cluster.column(column[1]))
album = cluster.related_album
if cluster.special == 2 and album and album.loaded:
if cluster.special and album and album.loaded:
self.views[1].update_album(album, update_tracks=False)
def add_file_to_cluster(self, cluster, file):
@@ -240,7 +240,7 @@ class MainPanel(QtGui.QSplitter):
except KeyError:
self.log.debug("Item for %r not found", cluster)
return
if cluster.special == 2 and cluster.files:
if cluster.special and cluster.files:
cluster_item.setHidden(False)
self.update_cluster(cluster, cluster_item)
item = QtGui.QTreeWidgetItem(cluster_item)
@@ -249,7 +249,7 @@ class MainPanel(QtGui.QSplitter):
def add_files_to_cluster(self, cluster, files):
cluster_item = self.item_from_object(cluster)
if cluster.special == 2 and cluster.files:
if cluster.special and cluster.files:
cluster_item.setHidden(False)
self.update_cluster(cluster, cluster_item)
items = []
@@ -270,7 +270,7 @@ class MainPanel(QtGui.QSplitter):
if cluster_item.takeChild(index):
self.unregister_object(file)
self.update_cluster(cluster, cluster_item)
if cluster.special == 2 and not cluster.files:
if cluster.special and not cluster.files:
cluster_item.setHidden(True)
@@ -541,7 +541,7 @@ class BaseTreeView(QtGui.QTreeWidget):
item = QtGui.QTreeWidgetItem(cluster_item)
self.panel.register_object(file, item)
self.panel.update_file(file, item)
if cluster.special == 2 and not cluster.files:
if cluster.special and not cluster.files:
cluster_item.setHidden(True)
class FileTreeView(BaseTreeView):