[libpeas] Do not call peas_activatable_deactivate() twice in DemoWindow



commit f584ebf63d2900552b28868d3bb19f6718045866
Author: Steve Frécinaux <code istique net>
Date:   Tue Jan 25 19:52:22 2011 +0100

    Do not call peas_activatable_deactivate() twice in DemoWindow
    
    The "extension-removed" callback already takes care of doing that, so
    there is no point doing it once more.
    
    The "extension-removed" documentation was also updated to reflect this
    behaviour.

 libpeas/peas-extension-set.c |    3 ++-
 peas-demo/peas-demo-window.c |   12 ------------
 2 files changed, 2 insertions(+), 13 deletions(-)
---
diff --git a/libpeas/peas-extension-set.c b/libpeas/peas-extension-set.c
index 4f3322e..a0e02f7 100644
--- a/libpeas/peas-extension-set.c
+++ b/libpeas/peas-extension-set.c
@@ -393,7 +393,8 @@ peas_extension_set_class_init (PeasExtensionSetClass *klass)
    *
    * The extension-added signal is emitted when a new extension is about to be
    * removed from the #PeasExtensionSet. It happens when a plugin implementing
-   * the extension set's extension type is unloaded.
+   * the extension set's extension type is unloaded, or when the
+   * #PeasExtensionSet itself is destroyed.
    *
    * You should connect to this signal in order to clean up the extensions
    * when their plugin is unload. Note that this signal is not fired for the
diff --git a/peas-demo/peas-demo-window.c b/peas-demo/peas-demo-window.c
index 01d32ca..cc2c3fd 100644
--- a/peas-demo/peas-demo-window.c
+++ b/peas-demo/peas-demo-window.c
@@ -45,17 +45,6 @@ on_extension_removed (PeasExtensionSet *set,
   peas_activatable_deactivate (PEAS_ACTIVATABLE (exten));
 }
 
-static gboolean
-on_delete_event (GtkWidget *window,
-                 GdkEvent  *event,
-                 gpointer   user_data)
-{
-  DemoWindow *dw = DEMO_WINDOW (window);
-  peas_extension_set_call (dw->exten_set, "deactivate");
-
-  return FALSE;
-}
-
 static void
 demo_window_init (DemoWindow *dw)
 {
@@ -79,7 +68,6 @@ demo_window_init (DemoWindow *dw)
 
   g_signal_connect (dw->exten_set, "extension-added", G_CALLBACK (on_extension_added), dw);
   g_signal_connect (dw->exten_set, "extension-removed", G_CALLBACK (on_extension_removed), dw);
-  g_signal_connect (dw, "delete-event", G_CALLBACK (on_delete_event), NULL);
 }
 
 static void



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