forked from openlp/openlp
Fix duplicate file save bug
Fix Dnd bug bzr-revno: 1074 Fixes: https://launchpad.net/bugs/656177
This commit is contained in:
commit
e37682cb03
@ -96,7 +96,7 @@ class MediaManagerItem(QtGui.QWidget):
|
||||
#TODO: plugin should not be the parent in future
|
||||
self.plugin = parent # plugin
|
||||
visible_title = self.plugin.getString(StringContent.VisibleName)
|
||||
self.title = visible_title[u'title']
|
||||
self.title = unicode(visible_title[u'title'])
|
||||
self.settingsSection = self.plugin.name.lower()
|
||||
if isinstance(icon, QtGui.QIcon):
|
||||
self.icon = icon
|
||||
|
@ -101,9 +101,9 @@ class ServiceItem(object):
|
||||
self.main = None
|
||||
self.footer = None
|
||||
self.bg_image_bytes = None
|
||||
self._new_item()
|
||||
self.search_string = u''
|
||||
self.data_string = u''
|
||||
self._new_item()
|
||||
|
||||
def _new_item(self):
|
||||
"""
|
||||
|
@ -602,6 +602,7 @@ class ServiceManager(QtGui.QWidget):
|
||||
zip = None
|
||||
file = None
|
||||
try:
|
||||
write_list = []
|
||||
zip = zipfile.ZipFile(unicode(filename), 'w')
|
||||
for item in self.serviceItems:
|
||||
service.append({u'serviceitem':item[u'service_item']
|
||||
@ -611,6 +612,9 @@ class ServiceManager(QtGui.QWidget):
|
||||
path_from = unicode(os.path.join(
|
||||
frame[u'path'],
|
||||
frame[u'title']))
|
||||
# On write a file once
|
||||
if not path_from in write_list:
|
||||
write_list.append(path_from)
|
||||
zip.write(path_from.encode(u'utf-8'))
|
||||
file = open(servicefile, u'wb')
|
||||
cPickle.dump(service, file)
|
||||
|
Loading…
Reference in New Issue
Block a user