aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Terry <mike@mterry.name>2011-03-23 16:37:20 -0500
committerMichael Terry <mike@mterry.name>2011-03-23 16:37:20 -0500
commit2021a9554f85a9f78f1b65de30cb78572dab2752 (patch)
tree7fa8b1b8bfd4131e2ce40dda23ccd02bdd6e2ee5
parent44cde00066303e185b615cd1efb0d3bb1ffb0071 (diff)
downloadayatana-indicator-datetime-2021a9554f85a9f78f1b65de30cb78572dab2752.tar.gz
ayatana-indicator-datetime-2021a9554f85a9f78f1b65de30cb78572dab2752.tar.bz2
ayatana-indicator-datetime-2021a9554f85a9f78f1b65de30cb78572dab2752.zip
add utc to relevant results
-rw-r--r--src/timezone-completion.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/timezone-completion.c b/src/timezone-completion.c
index a2fa643..c1ffb42 100644
--- a/src/timezone-completion.c
+++ b/src/timezone-completion.c
@@ -229,6 +229,20 @@ json_parse_ready (GObject *object, GAsyncResult *res, gpointer user_data)
json_reader_end_element (reader);
}
+ if (strlen (priv->request_text) < 4) {
+ gchar * lower_text = g_ascii_strdown (priv->request_text, -1);
+ if (g_strcmp0 (lower_text, "ut") == 0 ||
+ g_strcmp0 (lower_text, "utc") == 0) {
+ GtkTreeIter iter;
+ gtk_list_store_append (store, &iter);
+ gtk_list_store_set (store, &iter,
+ TIMEZONE_COMPLETION_ZONE, "UTC",
+ TIMEZONE_COMPLETION_NAME, "UTC",
+ -1);
+ }
+ g_free (lower_text);
+ }
+
save_and_use_model (completion, GTK_TREE_MODEL (store));
g_object_unref (G_OBJECT (reader));
}
@@ -372,6 +386,13 @@ get_initial_model (void)
g_free (name);
}
+ GtkTreeIter iter;
+ gtk_list_store_append (store, &iter);
+ gtk_list_store_set (store, &iter,
+ TIMEZONE_COMPLETION_ZONE, "UTC",
+ TIMEZONE_COMPLETION_NAME, "UTC",
+ -1);
+
tz_db_free (db);
return store;
}
@@ -389,7 +410,9 @@ data_func (GtkCellLayout *cell_layout, GtkCellRenderer *cell,
-1);
gchar * user_name;
- if (admin1 == NULL || admin1[0] == 0) {
+ if (country == NULL || country[0] == 0) {
+ user_name = g_strdup (name);
+ } else if (admin1 == NULL || admin1[0] == 0) {
user_name = g_strdup_printf ("%s <small>(%s)</small>", name, country);
} else {
user_name = g_strdup_printf ("%s <small>(%s, %s)</small>", name, admin1, country);