summaryrefslogtreecommitdiff
path: root/src/db/EventTable.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2023-06-28 21:35:52 +0200
committerJörg Frings-Fürst <debian@jff.email>2023-06-28 21:35:52 +0200
commitb86540b743f1a87a163ffb811c8fe22a01fefa38 (patch)
treeb47cb3bb83c2377234226fb3987ab3320a987dd9 /src/db/EventTable.vala
parentac6e0b731b9f0b2efd392e3309a5c07e2a66adad (diff)
parente905d8e16eec152d19797937f13ba3cf4b8f8aca (diff)
Merge branch 'release/debian/0.32.1-1'debian/0.32.1-1
Diffstat (limited to 'src/db/EventTable.vala')
-rw-r--r--src/db/EventTable.vala14
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) {