Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions Sailfish/ownNotes/python/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ def get_files_index(self,):
pass

return index

def move(self, relpathfrom, relpathto):
pathfrom = self.get_abspath(relpathfrom)
pathto = self.get_abspath(relpathto)
os.rename(pathfrom, pathto)

def rm(self, relpath):
path = self.get_abspath(relpath)
Expand Down Expand Up @@ -520,15 +525,15 @@ def _conflictLocal(self, wdc, ldc, relpath):

conflict_path = os.path.splitext(relpath)[0] + '.Conflict.txt' # FIXME

ldc.rename(relpath, conflict_path)
ldc.move(relpath, conflict_path)
self._download(wdc, ldc, relpath)

# Test if it s a real conflict
if ldc.getsize(relpath) == 0: # Test size to avoid ownCloud Bug
ldc.remove(relpath)
ldc.rename(conflict_path, relpath)
if ldc.get_size(relpath) == 0: # Test size to avoid ownCloud Bug
ldc.rm(relpath)
ldc.move(conflict_path, relpath)
elif ldc.get_md5(relpath) == ldc.get_md5(conflict_path):
ldc.remove(conflict_path)
ldc.rm(conflict_path)
else:
self._upload(wdc, ldc, conflict_path)

Expand Down