← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~googol-hush/openlp/suggestion into lp:openlp

 

googol has proposed merging lp:~googol-hush/openlp/suggestion into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)


Put the item's row in an array. After sorting the array we continue as used.
-- 
https://code.launchpad.net/~googol-hush/openlp/suggestion/+merge/28651
Your team OpenLP Core is requested to review the proposed merge of lp:~googol-hush/openlp/suggestion into lp:openlp.
=== modified file 'openlp/plugins/images/lib/mediaitem.py'
--- openlp/plugins/images/lib/mediaitem.py	2010-06-24 15:50:40 +0000
+++ openlp/plugins/images/lib/mediaitem.py	2010-06-28 15:59:25 +0000
@@ -120,8 +120,12 @@
         if check_item_selected(self.ListView, translate('ImagePlugin.MediaItem',
             'You must select an item to delete.')):
             items = self.ListView.selectedIndexes()
+            row_count = []
             for item in items:
-                text = self.ListView.item(item.row())
+                row_count.append(item.row())
+            row_count.sort(reverse=True)
+            for item in row_count:
+                text = self.ListView.item(item)
                 if text:
                     try:
                         os.remove(os.path.join(self.servicePath,
@@ -129,7 +133,7 @@
                     except OSError:
                         #if not present do not worry
                         pass
-                self.ListView.takeItem(item.row())
+                self.ListView.takeItem(item)
                 SettingsManager.set_list(self.settingsSection,
                     self.settingsSection, self.getFileList())
 


Follow ups