From 8fb06b3faf66d82f1c82bdc67adce61b45c92e85 Mon Sep 17 00:00:00 2001 From: Et0h Date: Thu, 1 Oct 2015 23:34:51 +0100 Subject: [PATCH] Don't trigger playlist update multiple times when inserting files --- syncplay/ui/gui.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/syncplay/ui/gui.py b/syncplay/ui/gui.py index 377f19b..1a7db76 100644 --- a/syncplay/ui/gui.py +++ b/syncplay/ui/gui.py @@ -146,6 +146,7 @@ class MainWindow(QtGui.QMainWindow): window.addFolderToPlaylist(dropfilepath) else: super(MainWindow.PlaylistWidget, self).dropEvent(event) + window.playlistUpdated() class PlaylistWidget(QtGui.QListWidget): selfWindow = None @@ -162,11 +163,6 @@ class MainWindow(QtGui.QMainWindow): super(MainWindow.PlaylistWidget, self).rowsMoved(sourceParent, sourceStart, sourceEnd, destinationParent, destinationRow) self.selfWindow.playlistUpdated() - def rowsInserted(self, parent, start, end): - if self.selfWindow: - super(MainWindow.PlaylistWidget, self).rowsInserted(parent, start, end) - self.selfWindow.playlistUpdated() - def rowsRemoved(self, parent, start, end): if self.selfWindow: super(MainWindow.PlaylistWidget, self).rowsRemoved(parent, start, end) @@ -207,6 +203,7 @@ class MainWindow(QtGui.QMainWindow): window.setPlaylistInsertPosition(indexRow) else: super(MainWindow.PlaylistWidget, self).dragMoveEvent(event) + self.selfWindow.playlistUpdated() def dropEvent(self, event): window = self.parent().parent().parent().parent().parent().parent()