aboutsummaryrefslogtreecommitdiff
path: root/src/timezone-completion.c
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2011-03-29 11:18:57 -0500
committerTed Gould <ted@gould.cx>2011-03-29 11:18:57 -0500
commit5e0da43a9b1a98225279161db5b5f574b409736f (patch)
tree5db05fce6fdcec93cb4f145561556132d675e295 /src/timezone-completion.c
parent72b47b902755c77611774e082e1f3f7d66f171f1 (diff)
parent143f495ab94cb006954c036cf29079cbb49d584b (diff)
downloadayatana-indicator-datetime-5e0da43a9b1a98225279161db5b5f574b409736f.tar.gz
ayatana-indicator-datetime-5e0da43a9b1a98225279161db5b5f574b409736f.tar.bz2
ayatana-indicator-datetime-5e0da43a9b1a98225279161db5b5f574b409736f.zip
Update to map to make it lovely and UTC fixes
Diffstat (limited to 'src/timezone-completion.c')
-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 a73ebf9..2e1afc0 100644
--- a/src/timezone-completion.c
+++ b/src/timezone-completion.c
@@ -230,6 +230,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));
}
@@ -374,6 +388,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;
}
@@ -391,7 +412,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);