[gnome-calendar] window: perform the search even for empty strings
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] window: perform the search even for empty strings
- Date: Sat, 3 Jan 2015 14:42:51 +0000 (UTC)
commit 29d5af6bca7f92b01157ac410773eb609d64068d
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Sat Jan 3 12:42:41 2015 -0200
window: perform the search even for empty strings
This will keep consistency, since empty search is performed for the first time, then it's ignored.
src/gcal-window.c | 27 ++++++++++-----------------
1 files changed, 10 insertions(+), 17 deletions(-)
---
diff --git a/src/gcal-window.c b/src/gcal-window.c
index e04b7dd..846bf74 100644
--- a/src/gcal-window.c
+++ b/src/gcal-window.c
@@ -1021,31 +1021,24 @@ search_changed (GtkEditable *editable,
if (gtk_search_bar_get_search_mode (GTK_SEARCH_BAR (priv->search_bar)))
{
+ gchar *query;
+
+ /* perform the search */
+ query = g_strdup_printf ("(contains? \"summary\" \"%s\")", gtk_entry_get_text (GTK_ENTRY
(priv->search_entry)));
+ gcal_manager_set_query (priv->manager, query);
+ g_free (query);
if (gtk_entry_get_text_length (GTK_ENTRY (priv->search_entry)) != 0)
{
gchar *title;
- gchar *query;
-
- title =
- g_strdup_printf (
- _("Results for \"%s\""),
- gtk_entry_get_text (GTK_ENTRY (priv->search_entry)));
- gtk_header_bar_set_title (GTK_HEADER_BAR (priv->header_bar),
- title);
- g_free (title);
- /**/
- query =
- g_strdup_printf ("(contains? \"summary\" \"%s\")",
- gtk_entry_get_text (GTK_ENTRY (priv->search_entry)));
- gcal_manager_set_query (priv->manager, query);
- g_free (query);
+ title = g_strdup_printf (_("Results for \"%s\""), gtk_entry_get_text (GTK_ENTRY
(priv->search_entry)));
+ gtk_header_bar_set_title (GTK_HEADER_BAR (priv->header_bar), title);
+ g_free (title);
}
else
{
- gtk_header_bar_set_title (GTK_HEADER_BAR (priv->header_bar),
- "");
+ gtk_header_bar_set_title (GTK_HEADER_BAR (priv->header_bar), "");
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]