From 0543df9beac83471121e1dfec25167f2ce43e1df Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Thu, 13 Jan 2011 05:23:41 +0900 Subject: [PATCH] if lastSync = 0, make sure we force in the right direction --- ankiqt/ui/sync.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ankiqt/ui/sync.py b/ankiqt/ui/sync.py index f4ad761eb..9f0fbcf41 100755 --- a/ankiqt/ui/sync.py +++ b/ankiqt/ui/sync.py @@ -187,13 +187,16 @@ sync was aborted. Please report this error.""") self.deck = None try: self.deck = DeckStorage.Deck(path) - if not self.deck.lastSync: - self.conflictResolution = "keepLocal" client = SyncClient(self.deck) client.setServer(proxy) # need to do anything? start = time.time() if client.prepareSync(proxy.timediff): + if self.deck.lastSync <= 0: + if client.remoteTime > client.localTime: + self.conflictResolution = "keepRemote" + else: + self.conflictResolution = "keepLocal" changes = True # summary if not self.conflictResolution and not self.onlyMerge: