[pitivi] application: fix not_media_file signal handling.
- From: Edward Hervey <edwardrv src gnome org>
- To: svn-commits-list gnome org
- Subject: [pitivi] application: fix not_media_file signal handling.
- Date: Wed, 25 Mar 2009 14:45:52 -0400 (EDT)
commit 1107e88e3234e2b67aab6125c8f6801789d45ad2
Author: Alessandro Decina <alessandro decina collabora co uk>
Date: Wed Mar 25 13:48:13 2009 +0100
application: fix not_media_file signal handling.
---
pitivi/application.py | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/pitivi/application.py b/pitivi/application.py
index 3876425..641cd1f 100644
--- a/pitivi/application.py
+++ b/pitivi/application.py
@@ -235,21 +235,26 @@ class InteractivePitivi(Pitivi):
if add_to_timeline:
self._uris = uris
self._duration = self.current.timeline.duration
- self.current.sources.connect("file_added", self._addSourceCb, True)
- self.current.sources.connect("not_media_file", self._addSourceCb,
- False)
+ self.current.sources.connect("file_added", self._addSourceCb)
+ self.current.sources.connect("not_media_file", self._notMediaFileCb)
self.current.sources.addUris(uris)
- def _addSourceCb(self, unused_sourcelist, factory, add):
+ def _addSourceCb(self, unused_sourcelist, factory):
if factory.name in self._uris:
self._uris.remove(factory.name)
if not self._uris:
self.current.sources.disconnect_by_function(self._addSourceCb)
- if add:
+
t = self.current.timeline.addSourceFactory(factory)
t.start = self._duration
self._duration += t.duration
+ def _notMediaFileCb(self, sourcelist, uri, error, debug):
+ if uri in self._uris:
+ self._uris.remove(uri)
+ if not self._uris:
+ self.current.sources.disconnect_by_function(self._notMediaFileCb)
+
# properties
def _get_mainloop(self):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]