[totem] main: Handle current browse source disappearing
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem] main: Handle current browse source disappearing
- Date: Thu, 6 Feb 2014 14:33:51 +0000 (UTC)
commit c52fb2a21cbea92ce57ac410e331f422bc575d9b
Author: Bastien Nocera <hadess hadess net>
Date: Thu Feb 6 15:29:23 2014 +0100
main: Handle current browse source disappearing
src/totem-grilo.c | 24 ++++++++++++++++++++++--
1 files changed, 22 insertions(+), 2 deletions(-)
---
diff --git a/src/totem-grilo.c b/src/totem-grilo.c
index 4b92800..d42ae66 100644
--- a/src/totem-grilo.c
+++ b/src/totem-grilo.c
@@ -1250,8 +1250,8 @@ remove_browse_result (GtkTreeModel *model,
static void
source_removed_cb (GrlRegistry *registry,
- GrlSource *source,
- gpointer user_data)
+ GrlSource *source,
+ gpointer user_data)
{
GrlSupportedOps ops;
TotemGrilo *self = TOTEM_GRILO (user_data);
@@ -1260,6 +1260,26 @@ source_removed_cb (GrlRegistry *registry,
/* Remove source and content from browse results */
if (ops & GRL_OP_BROWSE) {
+ /* Inside the removed browse source? */
+ if (self->priv->browser_filter_model) {
+ GtkTreePath *path;
+ GtkTreeIter iter;
+
+ g_object_get (G_OBJECT (self->priv->browser_filter_model), "virtual-root", &path,
NULL);
+ if (path != NULL &&
+ gtk_tree_model_get_iter (self->priv->browser_model, &iter, path)) {
+ GrlSource *current_source;
+
+ gtk_tree_model_get (self->priv->browser_model, &iter,
+ MODEL_RESULTS_SOURCE, ¤t_source,
+ -1);
+ if (current_source == source)
+ set_browser_filter_model_for_path (self, NULL);
+ g_clear_object (¤t_source);
+ }
+ g_clear_pointer (&path, gtk_tree_path_free);
+ }
+
gtk_tree_model_foreach (self->priv->browser_model,
remove_browse_result,
source);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]