[gcr] gcr: Don't show empty dates in gnupg key renderer
- From: Stefan Walter <stefw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gcr] gcr: Don't show empty dates in gnupg key renderer
- Date: Wed, 30 Nov 2011 11:09:31 +0000 (UTC)
commit 8db137b0d9c747773d2e4978fb8295eaf2ec5f80
Author: Stef Walter <stefw collabora co uk>
Date: Wed Nov 30 11:55:26 2011 +0100
gcr: Don't show empty dates in gnupg key renderer
* Also hide capabilities line if none are present
gcr/gcr-gnupg-renderer.c | 2 +-
gcr/gcr-record.c | 8 ++++++--
2 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/gcr/gcr-gnupg-renderer.c b/gcr/gcr-gnupg-renderer.c
index f3d6da9..7040577 100644
--- a/gcr/gcr-gnupg-renderer.c
+++ b/gcr/gcr-gnupg-renderer.c
@@ -375,7 +375,7 @@ append_key_record (GcrGnupgRenderer *self,
/* Capabilities */
value = _gcr_record_get_raw (record, GCR_RECORD_PUB_CAPS);
- if (value != NULL) {
+ if (value != NULL && value[0] != '\0') {
display = capabilities_for_codes (value);
_gcr_display_view_append_value (view, renderer, _("Capabilities"), display, FALSE);
g_free (display);
diff --git a/gcr/gcr-record.c b/gcr/gcr-record.c
index 0d2f44b..157d255 100644
--- a/gcr/gcr-record.c
+++ b/gcr/gcr-record.c
@@ -607,8 +607,12 @@ _gcr_record_get_date (GcrRecord *record,
/* Try to parse as a number */
result = strtoul (raw, &end, 10);
- if (end != NULL && end[0] == '\0')
- return g_date_time_new_from_unix_utc (result);
+ if (end != NULL && end[0] == '\0') {
+ if (result == 0)
+ return NULL;
+ else
+ return g_date_time_new_from_unix_utc (result);
+ }
/* Try to parse as a date */
memset (&tm, 0, sizeof (tm));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]