linux: fix build
This commit is contained in:
parent
975ae072de
commit
4e0ee26e35
|
@ -5,7 +5,6 @@ SOURCES = \
|
|||
Defines.cs \
|
||||
SparkleAnnouncement.cs \
|
||||
SparkleBackend.cs \
|
||||
SparkleWrappers.cs \
|
||||
SparkleConfig.cs \
|
||||
SparkleExceptions.cs \
|
||||
SparkleExtensions.cs \
|
||||
|
@ -16,7 +15,8 @@ SOURCES = \
|
|||
SparkleListenerTcp.cs \
|
||||
SparkleRepoBase.cs \
|
||||
SparkleUser.cs \
|
||||
SparkleWatcher.cs
|
||||
SparkleWatcher.cs \
|
||||
SparkleWrappers.cs
|
||||
|
||||
|
||||
install-data-hook:
|
||||
|
|
|
@ -37,53 +37,19 @@ namespace SparkleLib {
|
|||
public string Revision;
|
||||
public DateTime Timestamp;
|
||||
public DateTime FirstTimestamp;
|
||||
public bool IsMagical = false;
|
||||
public Uri RemoteUrl;
|
||||
|
||||
public List<SparkleChange> Changes = new List<SparkleChange> ();
|
||||
|
||||
|
||||
public string RelativeTimestamp {
|
||||
get {
|
||||
TimeSpan time_span = DateTime.Now - Timestamp;
|
||||
|
||||
if (time_span <= TimeSpan.FromSeconds (60))
|
||||
return "just now";
|
||||
|
||||
if (time_span <= TimeSpan.FromMinutes (60))
|
||||
return time_span.Minutes > 1
|
||||
? time_span.Minutes + " minutes ago"
|
||||
: "a minute ago";
|
||||
|
||||
if (time_span <= TimeSpan.FromHours (24))
|
||||
return time_span.Hours > 1
|
||||
? time_span.Hours + " hours ago"
|
||||
: "an hour ago";
|
||||
|
||||
if (time_span <= TimeSpan.FromDays (30))
|
||||
return time_span.Days > 1
|
||||
? time_span.Days + " days ago"
|
||||
: "a day ago";
|
||||
|
||||
if (time_span <= TimeSpan.FromDays (365))
|
||||
return time_span.Days > 30
|
||||
? (time_span.Days / 30) + " months ago"
|
||||
: "a month ago";
|
||||
|
||||
return time_span.Days > 365
|
||||
? (time_span.Days / 365) + " years ago"
|
||||
: "a year ago";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class SparkleChange {
|
||||
|
||||
public SparkleChangeType Type;
|
||||
public string Path;
|
||||
public string MovedPath;
|
||||
public DateTime Timestamp;
|
||||
|
||||
public string Path;
|
||||
public string MovedToPath;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue