[pitivi] mainwindow: Use existing SourceFactory when viewing a source.



commit 6fdddcc2b5ac3b4f765dbc5447133af4158f66b1
Author: Edward Hervey <bilboed bilboed com>
Date:   Tue May 12 16:44:22 2009 +0200

    mainwindow: Use existing SourceFactory when viewing a source.
---
 pitivi/ui/mainwindow.py |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/pitivi/ui/mainwindow.py b/pitivi/ui/mainwindow.py
index 8763518..17d03de 100644
--- a/pitivi/ui/mainwindow.py
+++ b/pitivi/ui/mainwindow.py
@@ -861,8 +861,13 @@ class PitiviMainWindow(gtk.Window, Loggable):
             context.finish(False, False, ctime)
             return
 
-        from pitivi.factories.file import FileSourceFactory
-        self._viewFactory(FileSourceFactory(uri))
+        # Use factory from our source list if we have the given uri
+        if uri in self.project.sources:
+            fact = self.project.sources[uri]
+        else:
+            from pitivi.factories.file import FileSourceFactory
+            fact = FileSourceFactory(uri)
+        self._viewFactory(fact)
         context.finish(True, False, ctime)
 
     def _viewFactory(self, factory):



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]