[gnome-font-viewer] font-view: strip "Version" string from the version field
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-font-viewer] font-view: strip "Version" string from the version field
- Date: Tue, 1 May 2012 15:13:16 +0000 (UTC)
commit 2e481de0130e105410199a10e0f11f3c5f9c825d
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Tue May 1 10:54:40 2012 -0400
font-view: strip "Version" string from the version field
No need to show "Version" twice
src/font-view.c | 23 ++++++++++++++++++++++-
1 files changed, 22 insertions(+), 1 deletions(-)
---
diff --git a/src/font-view.c b/src/font-view.c
index 13f8fa8..89150c9 100644
--- a/src/font-view.c
+++ b/src/font-view.c
@@ -130,6 +130,26 @@ strip_whitespace (gchar **original)
*original = g_string_free (reassembled, FALSE);
}
+#define MATCH_VERSION_STR "Version"
+
+static void
+strip_version (gchar **original)
+{
+ gchar *ptr, *stripped;
+
+ ptr = g_strstr_len (*original, -1, MATCH_VERSION_STR);
+ if (!ptr)
+ return;
+
+ ptr += strlen (MATCH_VERSION_STR);
+ stripped = g_strdup (ptr);
+
+ strip_whitespace (&stripped);
+
+ g_free (*original);
+ *original = stripped;
+}
+
static void
add_row (GtkWidget *grid,
const gchar *name,
@@ -227,7 +247,8 @@ populate_grid (FontViewApplication *self,
}
}
if (version) {
- add_row (grid, _("Version"), version, FALSE);
+ strip_version (&version);
+ add_row (grid, _("Version"), version, FALSE);
g_free (version);
}
if (copyright) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]