[gnome-software] Don't show a modified date in 1970 for webapps
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] Don't show a modified date in 1970 for webapps
- Date: Wed, 30 Oct 2013 09:34:31 +0000 (UTC)
commit d93da5b6585de9ba348c8101d96e9696ee4ab1a6
Author: Richard Hughes <richard hughsie com>
Date: Wed Oct 30 09:34:08 2013 +0000
Don't show a modified date in 1970 for webapps
This is really us not checking the unset value in the details panel.
src/gs-app.h | 1 +
src/gs-shell-details.c | 9 ++++++---
2 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/src/gs-app.h b/src/gs-app.h
index 274d433..b7e5ba4 100644
--- a/src/gs-app.h
+++ b/src/gs-app.h
@@ -87,6 +87,7 @@ typedef enum {
GS_APP_ID_KIND_LAST
} GsAppIdKind;
+#define GS_APP_INSTALL_DATE_UNSET 0
#define GS_APP_INSTALL_DATE_UNKNOWN 1 /* 1s past the epoch */
#define GS_APP_SIZE_UNKNOWN 0
#define GS_APP_SIZE_MISSING 1
diff --git a/src/gs-shell-details.c b/src/gs-shell-details.c
index b7df7fa..919f67c 100644
--- a/src/gs-shell-details.c
+++ b/src/gs-shell-details.c
@@ -449,6 +449,7 @@ gs_shell_details_refresh_all (GsShellDetails *shell_details)
GtkWidget *widget;
const gchar *tmp;
gchar *size;
+ guint64 updated;
/* change widgets */
tmp = gs_app_get_name (priv->app);
@@ -565,12 +566,14 @@ gs_shell_details_refresh_all (GsShellDetails *shell_details)
/* set the updated date */
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "label_details_updated_value"));
- if (gs_app_get_install_date (priv->app) == GS_APP_INSTALL_DATE_UNKNOWN) {
- /* TRANSLATORS: this is where the licence is not known */
+ updated = gs_app_get_install_date (priv->app);
+ if (updated == GS_APP_INSTALL_DATE_UNKNOWN ||
+ updated == GS_APP_INSTALL_DATE_UNSET) {
+ /* TRANSLATORS: this is where the updated date is not known */
gtk_label_set_label (GTK_LABEL (widget), _("Never"));
} else {
GDateTime *dt;
- dt = g_date_time_new_from_unix_utc (gs_app_get_install_date (priv->app));
+ dt = g_date_time_new_from_unix_utc (updated);
size = g_date_time_format (dt, "%x");
g_date_time_unref (dt);
gtk_label_set_label (GTK_LABEL (widget), size);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]