[gnome-photos] properties-dialog: Be more robust when checking validity of ctime



commit 68e1cde1010d38165d4826338c5b285a417329aa
Author: Debarshi Ray <debarshir gnome org>
Date:   Sun Feb 4 14:29:53 2018 +0100

    properties-dialog: Be more robust when checking validity of ctime
    
    The absence of a valid creation timestamp is indicated by -1. However,
    it's more robust to use a positive check for a valid timestamp instead
    of comparing against the magic value of -1.
    
    Ideally, there would be an assertion to enforce that an invalid value
    is always indicated by -1, but it seems overkill in this case.

 src/photos-properties-dialog.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/photos-properties-dialog.c b/src/photos-properties-dialog.c
index 7ba80e38..ff5b5e4a 100644
--- a/src/photos-properties-dialog.c
+++ b/src/photos-properties-dialog.c
@@ -413,7 +413,7 @@ photos_properties_dialog_constructed (GObject *object)
   date_modified_str = g_date_time_format (date_modified, "%c");
 
   ctime = photos_base_item_get_date_created (item);
-  if (ctime != -1)
+  if (ctime >= 0)
     {
       g_autoptr (GDateTime) date_created = NULL;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]