From d443a3c2509889533ca812c163056bace396b586 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Wed, 14 Jun 2023 20:35:58 +0200 Subject: New upstream version 0.32.1 --- src/core/DataCollection.vala | 2 +- src/core/DataSourceTypes.vala | 4 ++-- src/core/SourceInterfaces.vala | 15 +++++++++++++++ src/core/util.vala | 11 ++++++++--- 4 files changed, 26 insertions(+), 6 deletions(-) (limited to 'src/core') diff --git a/src/core/DataCollection.vala b/src/core/DataCollection.vala index 83a216d..044f7b6 100644 --- a/src/core/DataCollection.vala +++ b/src/core/DataCollection.vala @@ -559,7 +559,7 @@ public class DataCollection { if (!properties.unset(name)) return; - // only notify if the propery was unset (that is, was set to begin with) + // only notify if the property was unset (that is, was set to begin with) notify_property_cleared(name); // notify all items diff --git a/src/core/DataSourceTypes.vala b/src/core/DataSourceTypes.vala index a79264f..1baf387 100644 --- a/src/core/DataSourceTypes.vala +++ b/src/core/DataSourceTypes.vala @@ -72,9 +72,9 @@ public abstract class EventSource : ThumbnailSource { base (object_id); } - public abstract time_t get_start_time(); + public abstract DateTime? get_start_time(); - public abstract time_t get_end_time(); + public abstract DateTime? get_end_time(); public abstract uint64 get_total_filesize(); diff --git a/src/core/SourceInterfaces.vala b/src/core/SourceInterfaces.vala index 91a8aca..6e0c149 100644 --- a/src/core/SourceInterfaces.vala +++ b/src/core/SourceInterfaces.vala @@ -42,3 +42,18 @@ public interface Indexable : DataSource { } } +// Positionable DataSources provide a globally locatable point in longitude and latitude degrees + +public struct GpsCoords { + public int has_gps; + public double latitude; + public double longitude; + public bool equals(ref GpsCoords gps) { + return (has_gps == 0 && gps.has_gps == 0) || (latitude == gps.latitude && longitude == gps.longitude); + } +} + +public interface Positionable : DataSource { + public abstract GpsCoords get_gps_coords(); + public abstract void set_gps_coords(GpsCoords gps_coords); +} diff --git a/src/core/util.vala b/src/core/util.vala index 9507895..461d2c0 100644 --- a/src/core/util.vala +++ b/src/core/util.vala @@ -190,7 +190,12 @@ public bool null_progress_monitor(uint64 count, uint64 total) { return true; } +public static int64 nullsafe_date_time_comperator(DateTime? time_a, DateTime? time_b) { + if (time_a == null && time_b == null) return 0; -double degrees_to_radians(double theta) { - return (theta * (GLib.Math.PI / 180.0)); -} + if (time_a == null && time_b != null) return -1; + if (time_a != null && time_b == null) return 1; + + return time_a.compare(time_b); + +} \ No newline at end of file -- cgit v1.2.3