[emerillon] Remove layer when disabling search plugin



commit 0699c0dca67d058dd0805f7a995735484a8fe095
Author: Pierre-Luc Beaudoin <pierre-luc beaudoin novopia com>
Date:   Fri Oct 16 17:51:04 2009 -0400

    Remove layer when disabling search plugin
    
    Requires libchamplain 0.4.1

 plugins/search/search.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/plugins/search/search.c b/plugins/search/search.c
index 19f0f16..7bbc6b3 100644
--- a/plugins/search/search.c
+++ b/plugins/search/search.c
@@ -487,6 +487,7 @@ activated (EthosPlugin *plugin)
   priv->layer = champlain_selection_layer_new();
   champlain_view_add_layer (priv->map_view,
       priv->layer);
+
   /* FIXME: when ChamplainSelectionLayer grows a selection-changed
    * signal, connect to it */
   clutter_actor_show (CLUTTER_ACTOR (priv->layer));
@@ -498,7 +499,7 @@ static void
 deactivated (EthosPlugin *plugin)
 {
   GtkWidget *window, *toolbar, *sidebar;
-  /* ChamplainView *view; */
+  ChamplainView *view;
   SearchPluginPrivate *priv = SEARCH_PLUGIN (plugin)->priv;
 
   if (priv->proxy)
@@ -522,10 +523,11 @@ deactivated (EthosPlugin *plugin)
   window = emerillon_window_dup_default ();
   toolbar = emerillon_window_get_toolbar (EMERILLON_WINDOW (window));
   sidebar = emerillon_window_get_sidebar (EMERILLON_WINDOW (window));
-  /* view = emerillon_window_get_map_view (EMERILLON_WINDOW (window));
-   * FIXME: when libchamplain grows a remove_layer, use it!
-   */
+  view = emerillon_window_get_map_view (EMERILLON_WINDOW (window));
 
+#if CHAMPLAIN_CHECK_VERSION(0, 4, 1)
+  champlain_view_remove_layer (view, priv->layer);
+#endif
 
   gtk_container_remove (GTK_CONTAINER (toolbar), GTK_WIDGET (priv->search_item));
   emerillon_sidebar_remove_page (EMERILLON_SIDEBAR (sidebar), priv->search_page);



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