diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2023-06-14 20:36:17 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2023-06-14 20:36:17 +0200 |
commit | 31804433d72460cbe0a39f9f8ea5e76058d84cda (patch) | |
tree | 2084a84c39f159c6aea254775dc0880d52579d45 /src/db/EventTable.vala | |
parent | a9898fb3f39c44a85876930ef6b2558052569ae6 (diff) | |
parent | d443a3c2509889533ca812c163056bace396b586 (diff) |
Update upstream source from tag 'upstream/0.32.1'
Update to upstream version '0.32.1'
with Debian dir c460ad6e13d3c39eaa2d5399059385e64e6fba4c
Diffstat (limited to 'src/db/EventTable.vala')
-rw-r--r-- | src/db/EventTable.vala | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/db/EventTable.vala b/src/db/EventTable.vala index 593d51c..3b7df17 100644 --- a/src/db/EventTable.vala +++ b/src/db/EventTable.vala @@ -25,7 +25,7 @@ public struct EventID { public class EventRow { public EventID event_id; public string? name; - public time_t time_created; + public int64 time_created; public string? primary_source_id; public string? comment; } @@ -80,7 +80,7 @@ public class EventTable : DatabaseTable { -1, out stmt); assert(res == Sqlite.OK); - time_t time_created = (time_t) now_sec(); + int64 time_created = now_sec(); res = stmt.bind_text(1, primary_source_id); assert(res == Sqlite.OK); @@ -151,7 +151,7 @@ public class EventTable : DatabaseTable { if (row.name != null && row.name.length == 0) row.name = null; row.primary_source_id = source_id_upgrade(stmt.column_int64(1), stmt.column_text(2)); - row.time_created = (time_t) stmt.column_int64(3); + row.time_created = stmt.column_int64(3); row.comment = stmt.column_text(4); return row; @@ -183,7 +183,7 @@ public class EventTable : DatabaseTable { row.event_id = EventID(stmt.column_int64(0)); row.name = stmt.column_text(1); row.primary_source_id = source_id_upgrade(stmt.column_int64(2), stmt.column_text(3)); - row.time_created = (time_t) stmt.column_int64(4); + row.time_created = stmt.column_int64(4); row.comment = stmt.column_text(5); event_rows.add(row); @@ -218,12 +218,12 @@ public class EventTable : DatabaseTable { return update_text_by_id(event_id.id, "primary_source_id", primary_source_id); } - public time_t get_time_created(EventID event_id) { + public DateTime? get_time_created(EventID event_id) { Sqlite.Statement stmt; if (!select_by_id(event_id.id, "time_created", out stmt)) - return 0; + return null; - return (time_t) stmt.column_int64(0); + return new DateTime.from_unix_utc(stmt.column_int64(0)); } public bool set_comment(EventID event_id, string new_comment) { |