repo: Fix crash due to last timestamp being empty when adding a new empty project

This commit is contained in:
Hylke Bons 2014-11-07 16:55:25 +00:00
parent 5cd196dad0
commit 175ab1fcbc
3 changed files with 18 additions and 16 deletions

View file

@ -88,7 +88,15 @@ namespace SparkleLib {
public bool IsBuffering { get; private set; }
public double ProgressPercentage { get; private set; }
public double ProgressSpeed { get; private set; }
public DateTime LastSync { get { return ChangeSets [0].Timestamp; }}
public DateTime LastSync {
get {
if (ChangeSets != null && ChangeSets.Count > 0)
return ChangeSets [0].Timestamp;
else
return DateTime.MinValue;
}
}
public virtual string Identifier {
get {

View file

@ -46,7 +46,10 @@ namespace SparkleShare {
public string StatusMessage {
get {
string status_message = string.Format ("Synced {0}", this.repo.LastSync.ToPrettyDate ());
string status_message = "Waiting to sync";
if (!this.repo.LastSync.Equals (DateTime.MinValue))
status_message = string.Format ("Synced {0}", this.repo.LastSync.ToPrettyDate ());
if (this.repo.Status == SyncStatus.SyncUp)
status_message = "Sending changes… " + this.repo.ProgressPercentage + "%";

View file

@ -1,16 +1,8 @@
Points of contact:
Maintainer:
Maintainer:
Hylke Bons <hylkebons@gmail.com>
Marketing:
Alexandre Saiz Verdaguer <alex@sparkleshare.net>
Translations:
Łukasz Jernaś <deejay1@srem.org>
Code:
Contributors:
Alejandro Serrano <trupill@gmail.com>
Alexandre Saiz Verdaguer <a@alexandresaiz.com>
@ -40,14 +32,13 @@ Code:
Travis Glenn Hansen <travisghansen@yahoo.com>
Vincent Untz <vuntz@gnome.org>
Will Thompson <will@willthompson.co.uk>
Artwork:
Designers:
Andreas Nilsson <andreasn@gnome.org>
Jakub Steiner <jimmac@redhat.com>
Hylke Bons <hylkebons@gmail.com>
Lapo Calamandrei <calamandrei@gmail.com>
Thanks very much!