aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-03-04 00:32:04 -0600
committerTed Gould <ted@gould.cx>2010-03-04 00:32:04 -0600
commit617a39e8447ef92d564c40c489b97eca45a5f6d6 (patch)
treed12982b7d181682f9a8ab5248f62da33ddd75ce1
parent06fa866fc1177ada1b16ab4a15ffdf2a0e6d00d9 (diff)
downloadayatana-indicator-messages-617a39e8447ef92d564c40c489b97eca45a5f6d6.tar.gz
ayatana-indicator-messages-617a39e8447ef92d564c40c489b97eca45a5f6d6.tar.bz2
ayatana-indicator-messages-617a39e8447ef92d564c40c489b97eca45a5f6d6.zip
Refactoring into a helper
-rw-r--r--src/default-applications.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/src/default-applications.c b/src/default-applications.c
index 5347b43..6aca047 100644
--- a/src/default-applications.c
+++ b/src/default-applications.c
@@ -6,17 +6,18 @@
struct default_db_t {
const gchar * desktop_file;
const gchar * name;
+ const gchar * setupname;
};
struct default_db_t default_db[] = {
- {"evolution.desktop", N_("Mail")},
- {"empathy.desktop", N_("Chat")},
- {"gwibber.desktop", N_("Microblogging")},
+ {"evolution.desktop", N_("Mail"), N_("Set Up Mail...")},
+ {"empathy.desktop", N_("Chat"), N_("Set Up Chat...")},
+ {"gwibber.desktop", N_("Microblogging"), N_("Set Up Microblogging...")},
{NULL, NULL}
};
-const gchar *
-get_default_name (gchar * desktop_path)
+struct default_db_t *
+get_default_helper (gchar * desktop_path)
{
g_return_val_if_fail(desktop_path != NULL, NULL);
gchar * basename = g_path_get_basename(desktop_path);
@@ -31,9 +32,19 @@ get_default_name (gchar * desktop_path)
g_free(basename);
- if (default_db[i].name != NULL) {
- return default_db[i].name;
+ if (default_db[i].desktop_file != NULL) {
+ return &default_db[i];
}
return NULL;
}
+
+const gchar *
+get_default_name (gchar * desktop_path)
+{
+ struct default_db_t * db = get_default_helper(desktop_path);
+
+ if (db == NULL)
+ return NULL;
+ return db->name;
+}