[pitivi] medialibrary: Avoid switching assets when loading the project



commit ba5ab381b6d8fee8d5e32fc5818f4bb2e7c49995
Author: Alexandru Băluț <alexandru balut gmail com>
Date:   Sun Jun 26 00:08:11 2016 +0200

    medialibrary: Avoid switching assets when loading the project
    
    Without this, the media library calls switchProxies when the timeline
    container is not setup yet and has no ges_timeline so a backtrace is
    printed. Since this call is not necessary when loading the project, a
    simple check on `loaded` is enough.
    
    Should have been part of 817889761cf5f6f59571395b2ce5d6542aa2d628
    
    Differential Revision: https://phabricator.freedesktop.org/D1126

 pitivi/medialibrary.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/pitivi/medialibrary.py b/pitivi/medialibrary.py
index 5084a24..72cc341 100644
--- a/pitivi/medialibrary.py
+++ b/pitivi/medialibrary.py
@@ -900,7 +900,8 @@ class MediaLibraryWidget(Gtk.Box, Loggable):
         if not proxy:
             self._addAsset(asset)
 
-        self.app.gui.timeline_ui.switchProxies(asset)
+        if self._project.loaded:
+            self.app.gui.timeline_ui.switchProxies(asset)
 
     def _assetAddedCb(self, unused_project, asset):
         """Checks whether the asset added to the project should be shown."""


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