[gnome-software] Don't start a search if the entry is empty
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] Don't start a search if the entry is empty
- Date: Fri, 30 Aug 2013 04:19:58 +0000 (UTC)
commit 8f6ba49aa19d17d2dd8628193501ceede69174f1
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Aug 30 00:19:34 2013 -0400
Don't start a search if the entry is empty
src/gs-shell.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/gs-shell.c b/src/gs-shell.c
index e856b66..a4ae173 100644
--- a/src/gs-shell.c
+++ b/src/gs-shell.c
@@ -181,10 +181,14 @@ static void
gs_shell_search_activated_cb (GtkEntry *entry, GsShell *shell)
{
GsShellPrivate *priv = shell->priv;
+ const gchar *text;
+
+ text = gtk_entry_get_text (entry);
+ if (text[0] == '\0')
+ return;
if (gs_shell_get_mode (shell) == GS_SHELL_MODE_SEARCH) {
- gs_shell_search_refresh (shell->priv->shell_search,
- gtk_entry_get_text (entry));
+ gs_shell_search_refresh (shell->priv->shell_search, text);
} else {
priv->search_back_id = priv->mode;
gs_shell_set_mode (shell, GS_SHELL_MODE_SEARCH);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]