[gnome-software] trivial: Only use double quotes for app name if it's more than one word
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] trivial: Only use double quotes for app name if it's more than one word
- Date: Sat, 10 Sep 2016 18:38:05 +0000 (UTC)
commit 7d405ccfe40aeb7921c6c2863956d70280d70c0c
Author: Richard Hughes <richard hughsie com>
Date: Sat Sep 10 19:37:28 2016 +0100
trivial: Only use double quotes for app name if it's more than one word
src/gs-shell.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/src/gs-shell.c b/src/gs-shell.c
index 2822e4d..d9ac7ec 100644
--- a/src/gs-shell.c
+++ b/src/gs-shell.c
@@ -710,12 +710,16 @@ gs_shell_get_title_from_origin (GsApp *app)
return g_strdup_printf ("“%s”", gs_app_get_id (app));
}
+/* return a name for the app, using quotes if the name is more than one word */
static gchar *
gs_shell_get_title_from_app (GsApp *app)
{
- /* get a title, falling back */
- if (gs_app_get_name (app) != NULL)
- return g_strdup_printf ("“%s”", gs_app_get_name (app));
+ const gchar *tmp = gs_app_get_name (app);
+ if (tmp != NULL) {
+ if (g_strstr_len (tmp, -1, " ") != NULL)
+ return g_strdup_printf ("“%s”", tmp);
+ return g_strdup (tmp);
+ }
return g_strdup_printf ("“%s”", gs_app_get_id (app));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]