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
1=== modified file 'src/timezone-completion.c'
2--- src/timezone-completion.c 2011-02-24 16:41:37 +0000
3+++ src/timezone-completion.c 2011-03-23 13:40:46 +0000
4@@ -58,12 +58,26 @@
5
6 G_DEFINE_TYPE (TimezoneCompletion, timezone_completion, GTK_TYPE_ENTRY_COMPLETION);
7
8+static gboolean
9+match_func (GtkEntryCompletion *completion, const gchar *key,
10+ GtkTreeIter *iter, gpointer user_data)
11+{
12+ // geonames does the work for us
13+ return TRUE;
14+}
15+
16 static void
17 save_and_use_model (TimezoneCompletion * completion, GtkTreeModel * model)
18 {
19 TimezoneCompletionPrivate * priv = TIMEZONE_COMPLETION_GET_PRIVATE(completion);
20
21 g_hash_table_insert (priv->request_table, g_strdup (priv->request_text), g_object_ref (model));
22+
23+ if (model == priv->initial_model)
24+ gtk_entry_completion_set_match_func (GTK_ENTRY_COMPLETION (completion), NULL, NULL, NULL);
25+ else
26+ gtk_entry_completion_set_match_func (GTK_ENTRY_COMPLETION (completion), match_func, NULL, NULL);
27+
28 gtk_entry_completion_set_model (GTK_ENTRY_COMPLETION (completion), model);
29 gtk_entry_completion_complete (GTK_ENTRY_COMPLETION (completion));
30 }
31@@ -317,14 +331,6 @@
32 g_value_unset (&country_val);
33 }
34
35-static gboolean
36-match_func (GtkEntryCompletion *completion, const gchar *key,
37- GtkTreeIter *iter, gpointer user_data)
38-{
39- // geonames does the work for us
40- return TRUE;
41-}
42-
43 static void
44 timezone_completion_class_init (TimezoneCompletionClass *klass)
45 {
46@@ -345,7 +351,6 @@
47
48 priv->initial_model = GTK_TREE_MODEL (get_initial_model ());
49
50- gtk_entry_completion_set_match_func (GTK_ENTRY_COMPLETION (self), match_func, NULL, NULL);
51 g_object_set (G_OBJECT (self),
52 "text-column", TIMEZONE_COMPLETION_NAME,
53 "popup-set-width", FALSE,

Subscribers

People subscribed via source and target branches