← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~raoul-snyman/openlp/bug-802146 into lp:openlp

 

Raoul Snyman has proposed merging lp:~raoul-snyman/openlp/bug-802146 into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)
Related bugs:
  Bug #802146 in OpenLP: "SongShow Plus import crash"
  https://bugs.launchpad.net/openlp/+bug/802146

For more details, see:
https://code.launchpad.net/~raoul-snyman/openlp/bug-802146/+merge/71780

Fixed bug #802146: Couldn't import some SongShowPlus files.
Rearranged the file menu as well to be in a more logical order, and to look a little nicer.
-- 
https://code.launchpad.net/~raoul-snyman/openlp/bug-802146/+merge/71780
Your team OpenLP Core is requested to review the proposed merge of lp:~raoul-snyman/openlp/bug-802146 into lp:openlp.
=== modified file 'openlp/core/ui/mainwindow.py'
--- openlp/core/ui/mainwindow.py	2011-08-11 09:01:25 +0000
+++ openlp/core/ui/mainwindow.py	2011-08-16 21:24:24 +0000
@@ -305,10 +305,10 @@
         add_actions(self.fileExportMenu,
             (self.exportThemeItem, self.exportLanguageItem))
         add_actions(self.fileMenu, (self.fileNewItem, self.fileOpenItem,
-            self.fileSaveItem, self.fileSaveAsItem, None,
-            self.recentFilesMenu.menuAction(), None, self.printServiceOrderItem,
-            None, self.fileImportMenu.menuAction(),
-            self.fileExportMenu.menuAction(), self.fileExitItem))
+            self.fileSaveItem, self.fileSaveAsItem,
+            self.recentFilesMenu.menuAction(), None,
+            self.fileImportMenu.menuAction(), self.fileExportMenu.menuAction(),
+            None, self.printServiceOrderItem, self.fileExitItem))
         add_actions(self.viewModeMenu, (self.modeDefaultItem,
             self.modeSetupItem, self.modeLiveItem))
         add_actions(self.viewMenu, (self.viewModeMenu.menuAction(),

=== modified file 'openlp/plugins/songs/lib/songshowplusimport.py'
--- openlp/plugins/songs/lib/songshowplusimport.py	2011-06-14 05:45:23 +0000
+++ openlp/plugins/songs/lib/songshowplusimport.py	2011-08-16 21:24:24 +0000
@@ -102,7 +102,6 @@
         if not isinstance(self.import_source, list):
             return
         self.import_wizard.progressBar.setMaximum(len(self.import_source))
-
         for file in self.import_source:
             self.sspVerseOrderList = []
             otherCount = 0
@@ -111,7 +110,6 @@
             self.import_wizard.incrementProgressBar(
                 WizardStrings.ImportingType % file_name, 0)
             songData = open(file, 'rb')
-
             while True:
                 blockKey, = struct.unpack("I", songData.read(4))
                 # The file ends with 4 NUL's
@@ -126,8 +124,9 @@
                         songData.read(2))
                     verseName = songData.read(verseNameLength)
                 lengthDescriptorSize, = struct.unpack("B", songData.read(1))
+                log.debug(lengthDescriptorSize)
                 # Detect if/how long the length descriptor is
-                if lengthDescriptorSize == 12:
+                if lengthDescriptorSize == 12 or lengthDescriptorSize == 20:
                     lengthDescriptor, = struct.unpack("I", songData.read(4))
                 elif lengthDescriptorSize == 2:
                     lengthDescriptor = 1
@@ -135,6 +134,7 @@
                     lengthDescriptor = 0
                 else:
                     lengthDescriptor, = struct.unpack("B", songData.read(1))
+                log.debug(lengthDescriptorSize)
                 data = songData.read(lengthDescriptor)
                 if blockKey == TITLE:
                     self.title = unicode(data, u'cp1252')


Follow ups