Re: [evolution-patches] Shell : patch to have a component without buttons
- From: Sarfraaz Ahmed <asarfraaz novell com>
- To: Not Zed <notzed ximian com>
- Cc: Patches List <evolution-patches lists ximian com>
- Subject: Re: [evolution-patches] Shell : patch to have a component without buttons
- Date: Fri, 22 Jul 2005 12:10:43 +0530
Thanks for the review comments.
I have removed the g_strdup of strings, and also the check for NULL
bonobo controls.
I am attaching the new patch.
Please let me know if this is fine to commit.
On Thu, 2005-07-21 at 23:53 +0800, Not Zed wrote:
> None of this change is necessary, g_strdup already does this null check.
> This bit here is the really only important bit, none of the other stuff
> is strictly necessary (you could return empty controls, for instance).
>
> +
> + if (!info->button_label || !info->menu_label)
> + continue;
>
> It saves a lot of changes I think.
>
It sure does. The whole patch is reduced to just 10 lines :)
>
Thanks
-- Sarfraaz
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/shell/ChangeLog,v
retrieving revision 1.1531
diff -u -p -u -p -r1.1531 ChangeLog
--- ChangeLog 21 Jul 2005 08:59:53 -0000 1.1531
+++ ChangeLog 22 Jul 2005 06:30:34 -0000
@@ -1,3 +1,10 @@
+2005-07-21 Sarfraaz Ahmed <asarfraaz novell com>
+
+ * e-component-registry.c (query_components): Dont enter default values
+ for button label and menu label
+ * e-shell-window.c (setup_widgets): Dont add the sidebar button when
+ there is no label.
+
2005-07-21 Sankar P <psankar novell com>
* shell.error.xml : Added string for forget password prompt.
Index: e-component-registry.c
===================================================================
RCS file: /cvs/gnome/evolution/shell/e-component-registry.c,v
retrieving revision 1.55
diff -u -p -u -p -r1.55 e-component-registry.c
--- e-component-registry.c 16 May 2005 04:46:40 -0000 1.55
+++ e-component-registry.c 22 Jul 2005 06:30:34 -0000
@@ -201,14 +201,10 @@ query_components (EComponentRegistry *re
}
label = bonobo_server_info_prop_lookup (& info_list->_buffer[i], "evolution:button_label", language_list);
- if (label == NULL)
- label = g_strdup (_("Unknown"));
-
+
tooltips = bonobo_server_info_prop_lookup (& info_list->_buffer[i], "evolution:button_tooltips", language_list);
menu_label = bonobo_server_info_prop_lookup (& info_list->_buffer[i], "evolution:menu_label", language_list);
- if (menu_label == NULL)
- menu_label = g_strdup (_("Unknown"));
menu_accelerator = bonobo_server_info_prop_lookup (& info_list->_buffer[i], "evolution:menu_accelerator", language_list);
Index: e-shell-window.c
===================================================================
RCS file: /cvs/gnome/evolution/shell/e-shell-window.c,v
retrieving revision 1.36
diff -u -p -u -p -r1.36 e-shell-window.c
--- e-shell-window.c 21 Jul 2005 07:09:23 -0000 1.36
+++ e-shell-window.c 22 Jul 2005 06:30:35 -0000
@@ -695,6 +695,9 @@ setup_widgets (EShellWindow *window)
ComponentView *view = component_view_new (info->id, info->alias, button_id);
window->priv->component_views = g_slist_prepend (window->priv->component_views, view);
+
+ if (!info->button_label || !info->menu_label)
+ continue;
e_sidebar_add_button (E_SIDEBAR (priv->sidebar), info->button_label, info->button_tooltips, info->button_icon, button_id);
g_string_printf(xml, "SwitchComponent-%s", info->alias);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]