forked from openlp/openlp
Fix missing media Icon
Speed up Vacuum code. Fix 1002 bzr-revno: 1104 Fixes: https://launchpad.net/bugs/667837
This commit is contained in:
commit
6a3abbc282
@ -117,6 +117,7 @@ class Manager(object):
|
||||
settings = QtCore.QSettings()
|
||||
settings.beginGroup(plugin_name)
|
||||
self.db_url = u''
|
||||
self.is_dirty = False
|
||||
db_type = unicode(
|
||||
settings.value(u'db type', QtCore.QVariant(u'sqlite')).toString())
|
||||
if db_type == u'sqlite':
|
||||
@ -150,6 +151,7 @@ class Manager(object):
|
||||
self.session.add(object_instance)
|
||||
if commit:
|
||||
self.session.commit()
|
||||
self.is_dirty = True
|
||||
return True
|
||||
except InvalidRequestError:
|
||||
self.session.rollback()
|
||||
@ -220,6 +222,7 @@ class Manager(object):
|
||||
try:
|
||||
self.session.delete(object_instance)
|
||||
self.session.commit()
|
||||
self.is_dirty = True
|
||||
return True
|
||||
except InvalidRequestError:
|
||||
self.session.rollback()
|
||||
@ -241,6 +244,7 @@ class Manager(object):
|
||||
query = query.filter(filter_clause)
|
||||
query.delete(synchronize_session=False)
|
||||
self.session.commit()
|
||||
self.is_dirty = True
|
||||
return True
|
||||
except InvalidRequestError:
|
||||
self.session.rollback()
|
||||
@ -251,5 +255,6 @@ class Manager(object):
|
||||
"""
|
||||
VACUUM the database on exit.
|
||||
"""
|
||||
if self.is_dirty:
|
||||
engine = create_engine(self.db_url)
|
||||
engine.execute("vacuum")
|
||||
|
@ -408,6 +408,9 @@ class ThemeXML(object):
|
||||
elif field in integer_list:
|
||||
setattr(self, master + field, int(value))
|
||||
else:
|
||||
# None means an empty string so lets have one.
|
||||
if value == u'None':
|
||||
value = u''
|
||||
setattr(self, master + field, unicode(value))
|
||||
|
||||
def __str__(self):
|
||||
|
@ -56,7 +56,7 @@ class MediaMediaItem(MediaManagerItem):
|
||||
u':/media/media_video.png').toImage()
|
||||
MediaManagerItem.__init__(self, parent, self, icon)
|
||||
self.singleServiceItem = False
|
||||
self.serviceItemIconName = u':/media/media_video.png'
|
||||
self.serviceItemIconName = u':/media/image_clapperboard.png'
|
||||
|
||||
def retranslateUi(self):
|
||||
self.OnNewPrompt = translate('MediaPlugin.MediaItem', 'Select Media')
|
||||
|
Loading…
Reference in New Issue
Block a user