← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~phill-ridout/openlp/1012110_2.0 into lp:openlp/2.0

 

Phill has proposed merging lp:~phill-ridout/openlp/1012110_2.0 into lp:openlp/2.0.

Requested reviews:
  Raoul Snyman (raoul-snyman)
Related bugs:
  Bug #1012110 in OpenLP: "pptviewlib does not accept unicode filename"
  https://bugs.launchpad.net/openlp/+bug/1012110

For more details, see:
https://code.launchpad.net/~phill-ridout/openlp/1012110_2.0/+merge/189494

Fixes bug #1012110 by encoding the file name with the file system encoding
-- 
https://code.launchpad.net/~phill-ridout/openlp/1012110_2.0/+merge/189494
Your team OpenLP Core is subscribed to branch lp:openlp/2.0.
=== modified file 'openlp/plugins/presentations/lib/pptviewcontroller.py'
--- openlp/plugins/presentations/lib/pptviewcontroller.py	2013-08-20 18:30:15 +0000
+++ openlp/plugins/presentations/lib/pptviewcontroller.py	2013-10-06 08:30:19 +0000
@@ -29,6 +29,7 @@
 
 import os
 import logging
+import sys
 
 if os.name == u'nt':
     from ctypes import cdll
@@ -125,11 +126,13 @@
         renderer = self.controller.plugin.renderer
         rect = renderer.screens.current[u'size']
         rect = RECT(rect.x(), rect.y(), rect.right(), rect.bottom())
-        filepath = str(self.filepath.replace(u'/', u'\\'))
+        filepath = os.path.normpath(self.filepath)
+        preview_path = os.path.join(self.get_temp_folder(), u'slide')
         if not os.path.isdir(self.get_temp_folder()):
             os.makedirs(self.get_temp_folder())
-        self.pptid = self.controller.process.OpenPPT(filepath, None, rect,
-            str(self.get_temp_folder()) + '\\slide')
+        file_system_encoding = sys.getfilesystemencoding()
+        self.pptid = self.controller.process.OpenPPT(filepath.encode(file_system_encoding), None, rect,
+            preview_path.encode(file_system_encoding))
         if self.pptid >= 0:
             self.create_thumbnails()
             self.stop_presentation()


Follow ups