Fix: don't use time_t as property in GLib.Object.
This isn't actually supported by GLib and as such is going to be checked on a stricter basis by valac. Together with --fatal-warnings, this gives errors on newer valac versions.
This commit is contained in:
parent
825a33d11c
commit
383ee15992
3 changed files with 9 additions and 5 deletions
|
|
@ -295,7 +295,7 @@ private class Geary.ImapDB.Database : Geary.Db.VersionedDatabase {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
time_t as_time_t = (internaldate != null ?
|
time_t as_time_t = (internaldate != null ?
|
||||||
Geary.Imap.InternalDate.decode(internaldate).as_time_t : -1);
|
Geary.Imap.InternalDate.decode(internaldate).to_time_t() : -1);
|
||||||
|
|
||||||
Db.Statement update = cx.prepare(
|
Db.Statement update = cx.prepare(
|
||||||
"UPDATE MessageTable SET internaldate_time_t=? WHERE id=?");
|
"UPDATE MessageTable SET internaldate_time_t=? WHERE id=?");
|
||||||
|
|
|
||||||
|
|
@ -246,7 +246,7 @@ private class Geary.ImapDB.MessageRow {
|
||||||
if (email.fields.is_all_set(Geary.Email.Field.PROPERTIES)) {
|
if (email.fields.is_all_set(Geary.Email.Field.PROPERTIES)) {
|
||||||
Geary.Imap.EmailProperties? imap_properties = (Geary.Imap.EmailProperties) email.properties;
|
Geary.Imap.EmailProperties? imap_properties = (Geary.Imap.EmailProperties) email.properties;
|
||||||
internaldate = (imap_properties != null) ? imap_properties.internaldate.serialize() : null;
|
internaldate = (imap_properties != null) ? imap_properties.internaldate.serialize() : null;
|
||||||
internaldate_time_t = (imap_properties != null) ? imap_properties.internaldate.as_time_t : -1;
|
internaldate_time_t = (imap_properties != null) ? imap_properties.internaldate.to_time_t() : -1;
|
||||||
rfc822_size = (imap_properties != null) ? imap_properties.rfc822_size.value : -1;
|
rfc822_size = (imap_properties != null) ? imap_properties.rfc822_size.value : -1;
|
||||||
|
|
||||||
fields = fields.set(Geary.Email.Field.PROPERTIES);
|
fields = fields.set(Geary.Email.Field.PROPERTIES);
|
||||||
|
|
|
||||||
|
|
@ -28,18 +28,15 @@ public class Geary.Imap.InternalDate : Geary.MessageData.AbstractMessageData, Ge
|
||||||
};
|
};
|
||||||
|
|
||||||
public DateTime value { get; private set; }
|
public DateTime value { get; private set; }
|
||||||
public time_t as_time_t { get; private set; }
|
|
||||||
public string? original { get; private set; default = null; }
|
public string? original { get; private set; default = null; }
|
||||||
|
|
||||||
private InternalDate(string original, DateTime datetime) {
|
private InternalDate(string original, DateTime datetime) {
|
||||||
this.original = original;
|
this.original = original;
|
||||||
value = datetime;
|
value = datetime;
|
||||||
as_time_t = Time.datetime_to_time_t(datetime);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public InternalDate.from_date_time(DateTime datetime) throws ImapError {
|
public InternalDate.from_date_time(DateTime datetime) throws ImapError {
|
||||||
value = datetime;
|
value = datetime;
|
||||||
as_time_t = Time.datetime_to_time_t(datetime);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static InternalDate decode(string internaldate) throws ImapError {
|
public static InternalDate decode(string internaldate) throws ImapError {
|
||||||
|
|
@ -93,6 +90,13 @@ public class Geary.Imap.InternalDate : Geary.MessageData.AbstractMessageData, Ge
|
||||||
|
|
||||||
return new InternalDate(internaldate, datetime);
|
return new InternalDate(internaldate, datetime);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the value of the InternalDate as a time_t representation.
|
||||||
|
*/
|
||||||
|
public time_t to_time_t () {
|
||||||
|
return Time.datetime_to_time_t(this.value);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the {@link InternalDate} as a {@link Parameter}.
|
* Returns the {@link InternalDate} as a {@link Parameter}.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue