[evolution-kolab/ek-wip-gui: 9/10] EPlugin: fixed an Evo crasher in the PIM actions code path



commit a8ab6c2f4b6025fea42de20c2a2407f3ba09a4b0
Author: Christian Hilberg <hilberg kernelconcepts de>
Date:   Tue Feb 14 18:19:04 2012 +0100

    EPlugin: fixed an Evo crasher in the PIM actions code path
    
    * do not unref the action_group gotten from the
      shell_window for PIM groups
    * fixed c&p error (set "calendar" group then the
      GtkActionGroup entry's name matches "calendar")
    * explicitly test for strstr() (not) returning
      NULL

 src/eplugin/e-kolab-plugin-ui.c |   13 +++++--------
 1 files changed, 5 insertions(+), 8 deletions(-)
---
diff --git a/src/eplugin/e-kolab-plugin-ui.c b/src/eplugin/e-kolab-plugin-ui.c
index 4156235..54e0520 100644
--- a/src/eplugin/e-kolab-plugin-ui.c
+++ b/src/eplugin/e-kolab-plugin-ui.c
@@ -308,7 +308,7 @@ kolab_plugin_ui_update_source_entries_cb (EShellView *shell_view,
 	g_return_if_fail (entries != NULL);
 
 	if (strstr (entries->name, "calendar") != NULL)
-		group = "tasks";
+		group = "calendar";
 	else if (strstr (entries->name, "tasks") != NULL)
 		group = "tasks";
 	else if (strstr (entries->name, "memos") != NULL)
@@ -333,8 +333,6 @@ kolab_plugin_ui_update_source_entries_cb (EShellView *shell_view,
 	                                KOLAB_CONTEXT_NUM_ENTRIES,
 	                                is_kolab_source,
 	                                is_online);
-
-	g_object_unref (action_group);
 }
 
 static void
@@ -375,16 +373,15 @@ kolab_plugin_ui_setup_source_actions (EShellView *shell_view,
 
 	g_assert (E_IS_SHELL_VIEW (shell_view));
 	g_return_if_fail (entries != NULL);
-	g_return_if_fail (n_entries > 0);
 	g_return_if_fail (n_entries == KOLAB_CONTEXT_NUM_ENTRIES);
 
-	if (strstr (entries->name, "calendar"))
+	if (strstr (entries->name, "calendar") != NULL)
 		group = "calendar";
-	else if (strstr (entries->name, "tasks"))
+	else if (strstr (entries->name, "tasks") != NULL)
 		group = "tasks";
-	else if (strstr (entries->name, "memos"))
+	else if (strstr (entries->name, "memos") != NULL)
 		group = "memos";
-	else if (strstr (entries->name, "contacts"))
+	else if (strstr (entries->name, "contacts") != NULL)
 		group = "contacts";
 	else
 		g_return_if_reached ();



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