QML UI: Fix the segfault when closing via QML

This commit is contained in:
Thomas Perl 2011-04-01 14:19:42 +02:00
parent b425ce95e1
commit 1dd00e0a55

View file

@ -120,7 +120,7 @@ class Controller(UiData):
@Slot() @Slot()
def quit(self): def quit(self):
self.root.quit() self.root.quit.emit()
@Slot() @Slot()
def switcher(self): def switcher(self):
@ -166,9 +166,11 @@ def QML(filename):
if os.path.exists(filename): if os.path.exists(filename):
return filename return filename
class qtPodder(object): class qtPodder(QObject):
def __init__(self, args, gpodder_core): def __init__(self, args, gpodder_core):
QObject.__init__(self)
self.app = QApplication(args) self.app = QApplication(args)
self.quit.connect(self.on_quit)
self.core = gpodder_core self.core = gpodder_core
self.config = self.core.config self.config = self.core.config
@ -217,10 +219,11 @@ class qtPodder(object):
def run(self): def run(self):
return self.app.exec_() return self.app.exec_()
def quit(self): quit = Signal()
def on_quit(self):
self.save_pending_data() self.save_pending_data()
self.core.shutdown() self.core.shutdown()
self.view.setSource('')
self.app.quit() self.app.quit()
def open_context_menu(self, items): def open_context_menu(self, items):