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.
This commit is contained in:
Volodymyr Rudyi 2012-04-08 00:30:03 +03:00 committed by Thibault Saunier
parent b102df2d4d
commit 963cce240c

View file

@ -1101,9 +1101,20 @@ load_pitivi_file_from_uri (GESFormatter * self,
return FALSE; 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); xmlXPathFreeContext (priv->xpathCtx);