forked from openlp/openlp
deleteTheme cleanups
This commit is contained in:
parent
db025be243
commit
42619d455b
|
@ -1,3 +1,4 @@
|
||||||
|
import os.path
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
||||||
|
|
||||||
|
@ -253,15 +254,14 @@ class ThemeManager(QtGui.QWidget):
|
||||||
The theme to delete.
|
The theme to delete.
|
||||||
"""
|
"""
|
||||||
self.themelist.remove(theme)
|
self.themelist.remove(theme)
|
||||||
th = theme + u'.png'
|
thumb = theme + u'.png'
|
||||||
try:
|
try:
|
||||||
os.remove(os.path.join(self.path, th))
|
os.remove(os.path.join(self.path, thumb))
|
||||||
os.remove(os.path.join(self.thumbPath, th))
|
os.remove(os.path.join(self.thumbPath, thumb))
|
||||||
encoding = get_filesystem_encoding()
|
encoding = get_filesystem_encoding()
|
||||||
shutil.rmtree(os.path.join(self.path, theme).encode(encoding))
|
shutil.rmtree(os.path.join(self.path, theme).encode(encoding))
|
||||||
except OSError:
|
except OSError:
|
||||||
#if not present do not worry
|
log.exception(u'Error deleting theme %s', theme)
|
||||||
pass
|
|
||||||
# As we do not reload the themes push out the change
|
# As we do not reload the themes push out the change
|
||||||
# Reaload the list as the internal lists and events need
|
# Reaload the list as the internal lists and events need
|
||||||
# to be triggered
|
# to be triggered
|
||||||
|
|
Loading…
Reference in New Issue