Implemented UI for sync
Fixed bugs
This commit is contained in:
@@ -27,10 +27,16 @@ namespace keepass2android.Io
|
||||
{
|
||||
if (!ioc.IsLocalFile())
|
||||
return false;
|
||||
DateTime previousDate;
|
||||
if (!DateTime.TryParse(previousFileVersion, out previousDate))
|
||||
if (previousFileVersion == null)
|
||||
return false;
|
||||
return File.GetLastWriteTimeUtc(ioc.Path) > previousDate;
|
||||
DateTime previousDate;
|
||||
if (!DateTime.TryParse(previousFileVersion, CultureInfo.InvariantCulture, DateTimeStyles.None, out previousDate))
|
||||
return false;
|
||||
DateTime currentModificationDate = File.GetLastWriteTimeUtc(ioc.Path);
|
||||
TimeSpan diff = currentModificationDate - previousDate;
|
||||
return diff > TimeSpan.FromSeconds(1);
|
||||
//don't use > operator because milliseconds are truncated
|
||||
return File.GetLastWriteTimeUtc(ioc.Path) - previousDate >= TimeSpan.FromSeconds(1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@ namespace keepass2android.Io
|
||||
/// </summary>
|
||||
/// Note: This function may return false even if the file might have changed. The function
|
||||
/// should focus on being fast and cheap instead of doing things like hashing or downloading a full file.
|
||||
/// previousFileVersion may be null to indicate no previous version is known.
|
||||
/// <returns>Returns true if a change was detected, false otherwise.</returns>
|
||||
bool CheckForFileChangeFast(IOConnectionInfo ioc , string previousFileVersion);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user