From 963cce240cf59531faad010ac17a8b49fd2ec091 Mon Sep 17 00:00:00 2001 From: Volodymyr Rudyi Date: Sun, 8 Apr 2012 00:30:03 +0300 Subject: [PATCH] ges-pitivi-formatter: Fixed loading of projects with empty timeline Because 'project-loaded' signal was triggered from track object loading callback in case with projects that have empty timeline this signal was never emitted. --- ges/ges-pitivi-formatter.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/ges/ges-pitivi-formatter.c b/ges/ges-pitivi-formatter.c index 0ad06f4f0f..b12387ab4a 100644 --- a/ges/ges-pitivi-formatter.c +++ b/ges/ges-pitivi-formatter.c @@ -1101,9 +1101,20 @@ load_pitivi_file_from_uri (GESFormatter * self, return FALSE; } - if (!make_timeline_objects (self)) { - GST_ERROR ("Couldn't deserialise the project properly"); - return FALSE; + + + /* If there are no timeline objects to load we should emit + * 'project-loaded' signal. + */ + if (!g_hash_table_size (priv->timeline_objects_table)) { + GESFormatterClass *klass = GES_FORMATTER_GET_CLASS (self); + + klass->project_loaded (self, GES_PITIVI_FORMATTER (self)->priv->timeline); + } else { + if (!make_timeline_objects (self)) { + GST_ERROR ("Couldn't deserialise the project properly"); + return FALSE; + } } xmlXPathFreeContext (priv->xpathCtx);