[gnome-software] Don't show placeholder texts for descriptions
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] Don't show placeholder texts for descriptions
- Date: Fri, 23 Aug 2013 01:55:07 +0000 (UTC)
commit 4c2985a86aa6ae60915f124fba42920505721e86
Author: Matthias Clasen <mclasen redhat com>
Date: Thu Aug 22 21:54:26 2013 -0400
Don't show placeholder texts for descriptions
If an application has no description, don't show a text like
'The author of this application has not...'
src/gs-app-widget.c | 5 +----
src/gs-shell-installed.c | 3 ---
src/gs-shell.c | 12 +++++++-----
3 files changed, 8 insertions(+), 12 deletions(-)
---
diff --git a/src/gs-app-widget.c b/src/gs-app-widget.c
index d5288c9..beeba5c 100644
--- a/src/gs-app-widget.c
+++ b/src/gs-app-widget.c
@@ -104,10 +104,7 @@ gs_app_widget_refresh (GsAppWidget *app_widget)
return;
tmp = (gchar *)gs_app_get_description (app_widget->priv->app);
- if (tmp == NULL) {
- tmp = _("The author of this software has not included a long description.");
- }
- else {
+ if (tmp) {
s = g_string_new (tmp);
_g_string_replace (s, "\n", " ");
tmp = s->str;
diff --git a/src/gs-shell-installed.c b/src/gs-shell-installed.c
index 3310490..61dfaf3 100644
--- a/src/gs-shell-installed.c
+++ b/src/gs-shell-installed.c
@@ -134,9 +134,6 @@ gs_shell_installed_app_widget_activated_cb (GtkListBox *list_box,
}
gtk_grid_attach (GTK_GRID (grid), label, 1, 1, 1, 1);
tmp = gs_app_get_description (app);
- if (!tmp) {
- tmp = _("The author of this software has not included a long description.");
- }
label = gtk_label_new (tmp);
gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
diff --git a/src/gs-shell.c b/src/gs-shell.c
index 4eeeaea..e8d856a 100644
--- a/src/gs-shell.c
+++ b/src/gs-shell.c
@@ -231,12 +231,14 @@ gs_shell_set_overview_mode (GsShell *shell, GsShellMode mode, GsApp *app, const
gtk_widget_set_visible (widget, FALSE);
}
tmp = gs_app_get_description (app);
- if (tmp == NULL)
- tmp = _("The author of this software has not included a 'Description' in the desktop
file...");
-
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder,
"application_details_description"));
- gtk_label_set_label (GTK_LABEL (widget), tmp);
- gtk_widget_set_visible (widget, TRUE);
+ if (tmp != NULL && tmp[0] != '\0') {
+ gtk_label_set_label (GTK_LABEL (widget), tmp);
+ gtk_widget_set_visible (widget, TRUE);
+ }
+ else {
+ gtk_widget_set_visible (widget, FALSE);
+ }
pixbuf = gs_app_get_pixbuf (app);
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "application_details_icon"));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]