mirror of
https://github.com/fergalmoran/picard.git
synced 2026-02-03 06:13:59 +00:00
Don't queue actions from the main thread.
This commit is contained in:
@@ -893,7 +893,6 @@ class Tagger(QtGui.QApplication, ComponentManager, Component):
|
||||
for album in albums:
|
||||
self.reload_album(album)
|
||||
|
||||
|
||||
def main(localedir=None):
|
||||
tagger = Tagger(localedir)
|
||||
sys.exit(tagger.run())
|
||||
app = Tagger(localedir)
|
||||
sys.exit(app.run())
|
||||
|
||||
@@ -70,8 +70,11 @@ class ThreadAssist(QtCore.QObject):
|
||||
|
||||
def proxy_to_main(self, handler, *args, **kwargs):
|
||||
"""Invoke ``handler`` with arguments ``args`` in the main thread."""
|
||||
self.to_main.put((handler, args, kwargs))
|
||||
self.emit(QtCore.SIGNAL("proxy_to_main()"))
|
||||
if self.parent().thread() == QtCore.QThread.currentThread():
|
||||
handler(*args, **kwargs)
|
||||
else:
|
||||
self.to_main.put((handler, args, kwargs))
|
||||
self.emit(QtCore.SIGNAL("proxy_to_main()"))
|
||||
|
||||
def allocate(self):
|
||||
"""Allocate a new thread."""
|
||||
|
||||
Reference in New Issue
Block a user