Merge lp:~mterry/indicator-datetime/filter-when-no-internet into lp:indicator-datetime/0.3

Proposed by Michael Terry
Status: Merged
Merged at revision: 74
Proposed branch: lp:~mterry/indicator-datetime/filter-when-no-internet
Merge into: lp:indicator-datetime/0.3
Diff against target: 53 lines (+14/-9)
1 file modified
src/timezone-completion.c (+14/-9)
To merge this branch: bzr merge lp:~mterry/indicator-datetime/filter-when-no-internet
Reviewer Review Type Date Requested Status
Indicator Applet Developers Pending
Review via email: mp+54521@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/timezone-completion.c'
--- src/timezone-completion.c 2011-02-24 16:41:37 +0000
+++ src/timezone-completion.c 2011-03-23 13:40:46 +0000
@@ -58,12 +58,26 @@
5858
59G_DEFINE_TYPE (TimezoneCompletion, timezone_completion, GTK_TYPE_ENTRY_COMPLETION);59G_DEFINE_TYPE (TimezoneCompletion, timezone_completion, GTK_TYPE_ENTRY_COMPLETION);
6060
61static gboolean
62match_func (GtkEntryCompletion *completion, const gchar *key,
63 GtkTreeIter *iter, gpointer user_data)
64{
65 // geonames does the work for us
66 return TRUE;
67}
68
61static void69static void
62save_and_use_model (TimezoneCompletion * completion, GtkTreeModel * model)70save_and_use_model (TimezoneCompletion * completion, GtkTreeModel * model)
63{71{
64 TimezoneCompletionPrivate * priv = TIMEZONE_COMPLETION_GET_PRIVATE(completion);72 TimezoneCompletionPrivate * priv = TIMEZONE_COMPLETION_GET_PRIVATE(completion);
6573
66 g_hash_table_insert (priv->request_table, g_strdup (priv->request_text), g_object_ref (model));74 g_hash_table_insert (priv->request_table, g_strdup (priv->request_text), g_object_ref (model));
75
76 if (model == priv->initial_model)
77 gtk_entry_completion_set_match_func (GTK_ENTRY_COMPLETION (completion), NULL, NULL, NULL);
78 else
79 gtk_entry_completion_set_match_func (GTK_ENTRY_COMPLETION (completion), match_func, NULL, NULL);
80
67 gtk_entry_completion_set_model (GTK_ENTRY_COMPLETION (completion), model);81 gtk_entry_completion_set_model (GTK_ENTRY_COMPLETION (completion), model);
68 gtk_entry_completion_complete (GTK_ENTRY_COMPLETION (completion));82 gtk_entry_completion_complete (GTK_ENTRY_COMPLETION (completion));
69}83}
@@ -317,14 +331,6 @@
317 g_value_unset (&country_val);331 g_value_unset (&country_val);
318}332}
319333
320static gboolean
321match_func (GtkEntryCompletion *completion, const gchar *key,
322 GtkTreeIter *iter, gpointer user_data)
323{
324 // geonames does the work for us
325 return TRUE;
326}
327
328static void334static void
329timezone_completion_class_init (TimezoneCompletionClass *klass)335timezone_completion_class_init (TimezoneCompletionClass *klass)
330{336{
@@ -345,7 +351,6 @@
345351
346 priv->initial_model = GTK_TREE_MODEL (get_initial_model ());352 priv->initial_model = GTK_TREE_MODEL (get_initial_model ());
347353
348 gtk_entry_completion_set_match_func (GTK_ENTRY_COMPLETION (self), match_func, NULL, NULL);
349 g_object_set (G_OBJECT (self),354 g_object_set (G_OBJECT (self),
350 "text-column", TIMEZONE_COMPLETION_NAME,355 "text-column", TIMEZONE_COMPLETION_NAME,
351 "popup-set-width", FALSE,356 "popup-set-width", FALSE,

Subscribers

People subscribed via source and target branches