soylent r170 - trunk/src
- From: treitter svn gnome org
- To: svn-commits-list gnome org
- Subject: soylent r170 - trunk/src
- Date: Mon, 23 Jun 2008 02:49:53 +0000 (UTC)
Author: treitter
Date: Mon Jun 23 02:49:52 2008
New Revision: 170
URL: http://svn.gnome.org/viewvc/soylent?rev=170&view=rev
Log:
simplify the web constants
Modified:
trunk/src/soylent-browser-person-view.c
Modified: trunk/src/soylent-browser-person-view.c
==============================================================================
--- trunk/src/soylent-browser-person-view.c (original)
+++ trunk/src/soylent-browser-person-view.c Mon Jun 23 02:49:52 2008
@@ -30,6 +30,12 @@
E_CONTACT_PHONE_MOBILE,};
const gchar *CONTEXT_LIST_PHONE[] = {"work", "home", "cell",};
+const guint E_CONTACT_FIELDS_WEB[] = {E_CONTACT_HOMEPAGE_URL,
+ E_CONTACT_BLOG_URL,
+ E_CONTACT_CALENDAR_URI,
+ E_CONTACT_VIDEO_URL,};
+const gchar *CONTEXT_LIST_WEB[] = {"homepage", "blog", "calendar", "video",};
+
typedef struct pre_save_im_tag pre_save_im_t;
struct pre_save_im_tag
{
@@ -3290,12 +3296,6 @@
soylent_browser_person_view_web_update (SoylentBrowser *browser,
SoylentPerson *person)
{
- const guint e_contact_fields[] = {E_CONTACT_HOMEPAGE_URL,
- E_CONTACT_BLOG_URL,
- E_CONTACT_CALENDAR_URI,
- E_CONTACT_VIDEO_URL,};
- const guint NUM_TYPE = 4;
- const gchar *type_list[] = {"homepage", "blog", "calendar", "video",};
gboolean retval = FALSE;
GladeXML *wtree = NULL;
EContact *e_contact = NULL;
@@ -3303,7 +3303,7 @@
GtkHBox *hbox_web = NULL;
GtkFrame *frame_web = NULL;
gchar *widget_name = NULL;
- guint type = 0;
+ guint context = 0;
guint num_entries_set = 0;
const gchar *web_name = NULL;
@@ -3329,18 +3329,20 @@
* change anything. */
soylent_browser_person_view_save_changes (NULL, browser);
- for (type = 0; type < NUM_TYPE; type++)
+ for (context = 0; context < ARRAY_LEN (CONTEXT_LIST_WEB); context++)
{
- widget_name = g_strdup_printf ("entry_person_web_%s", type_list[type]);
+ widget_name = g_strdup_printf ("entry_person_web_%s",
+ CONTEXT_LIST_WEB[context]);
entry_web = GTK_ENTRY (glade_xml_get_widget (wtree, widget_name));
g_free (widget_name);
- widget_name = g_strdup_printf ("hbox_person_web_%s", type_list[type]);
+ widget_name = g_strdup_printf ("hbox_person_web_%s",
+ CONTEXT_LIST_WEB[context]);
hbox_web = GTK_HBOX (glade_xml_get_widget (wtree, widget_name));
g_free (widget_name);
- web_name = e_contact_get_const (e_contact, e_contact_fields[type]);
+ web_name = e_contact_get_const (e_contact, E_CONTACT_FIELDS_WEB[context]);
/* Apparently e_contact_get_const sometimes returns a pointer to an empty
* string instead of NULL */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]