[evolution-kolab] EPlugin: use new action entry group name getter



commit b05ddbfcfa0b412b880a8afe20d0b543c1786eee
Author: Christian Hilberg <hilberg kernelconcepts de>
Date:   Fri Oct 19 11:13:30 2012 +0200

    EPlugin: use new action entry group name getter

 src/eplugin/e-kolab-plugin-ui.c |   29 ++++-------------------------
 1 files changed, 4 insertions(+), 25 deletions(-)
---
diff --git a/src/eplugin/e-kolab-plugin-ui.c b/src/eplugin/e-kolab-plugin-ui.c
index b7c2561..c4a84e9 100644
--- a/src/eplugin/e-kolab-plugin-ui.c
+++ b/src/eplugin/e-kolab-plugin-ui.c
@@ -143,11 +143,6 @@ kolab_folder_prop_ui_data_free (KolabFolderPropUIData *uidata)
 	if (uidata == NULL)
 		return;
 
-	/* FIXME do we need to ref/unref the shell view? */
-#if 0
-	g_object_unref (uidata->shell_view);
-#endif
-
 	/* the actual widgets will have been deleted already,
 	 * so just deleting the struct shell here
 	 */
@@ -606,16 +601,8 @@ kolab_plugin_ui_update_source_entries_cb (EShellView *shell_view,
 	g_return_if_fail (E_IS_SHELL_VIEW (shell_view));
 	g_return_if_fail (entries != NULL);
 
-	if (strstr (entries->name, "calendar") != NULL)
-		group = "calendar";
-	else if (strstr (entries->name, "tasks") != NULL)
-		group = "tasks";
-	else if (strstr (entries->name, "memos") != NULL)
-		group = "memos";
-	else if (strstr (entries->name, "contacts") != NULL)
-		group = "contacts";
-	else
-		g_return_if_reached ();
+	group = e_kolab_plugin_util_group_name_from_action_entry_name (entries->name);
+	g_return_if_fail (group != NULL);
 
 	is_kolab_source = e_kolab_plugin_util_ui_get_selected_source (shell_view,
 	                                                              NULL);
@@ -675,16 +662,8 @@ kolab_plugin_ui_setup_source_actions (EShellView *shell_view,
 	g_return_if_fail (entries != NULL);
 	g_return_if_fail (n_entries == KOLAB_CONTEXT_NUM_ENTRIES);
 
-	if (strstr (entries->name, "calendar") != NULL)
-		group = "calendar";
-	else if (strstr (entries->name, "tasks") != NULL)
-		group = "tasks";
-	else if (strstr (entries->name, "memos") != NULL)
-		group = "memos";
-	else if (strstr (entries->name, "contacts") != NULL)
-		group = "contacts";
-	else
-		g_return_if_reached ();
+	group = e_kolab_plugin_util_group_name_from_action_entry_name (entries->name);
+	g_return_if_fail (group != NULL);
 
 	shell_window = e_shell_view_get_shell_window (shell_view);
 



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