From 962f1364e47b61ef1777927fd6aee0631f2f00c1 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sun, 21 Feb 2010 23:05:03 +0000 Subject: [PATCH] Fix v2 theme importing --- openlp/core/ui/thememanager.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 9e2a8ecce..a0168324f 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -314,6 +314,7 @@ class ThemeManager(QtGui.QWidget): themename = None for file in zip.namelist(): osfile = unicode(QtCore.QDir.toNativeSeparators(file)) + theme_dir = None if osfile.endswith(os.path.sep): theme_dir = os.path.join(dir, osfile) if not os.path.exists(theme_dir): @@ -325,6 +326,10 @@ class ThemeManager(QtGui.QWidget): # not preview file if themename is None: themename = names[0] + if theme_dir is None: + theme_dir = os.path.join(dir, names[0]) + if not os.path.exists(theme_dir): + os.mkdir(os.path.join(dir, names[0])) xml_data = zip.read(file) if os.path.splitext(file)[1].lower() in [u'.xml']: if self.checkVersion1(xml_data):