diff options
author | Christian Kamm <kamm@incasoftware.de> | 2014-11-06 14:49:02 +0300 |
---|---|---|
committer | Christian Kamm <kamm@incasoftware.de> | 2014-11-06 14:49:02 +0300 |
commit | 174e1acbc732d91f8d1b4e7f65fb1288d21ec452 (patch) | |
tree | 31d0cd910df4aee7581fdd1545a1d472fcc5c9a4 /src/mirall | |
parent | 1f09a24a72c9dc0d70a4a479e0d9ea0c2d49185f (diff) |
Folder::wipe(): Remove partial downloads and -shm,-wal db files.
Diffstat (limited to 'src/mirall')
-rw-r--r-- | src/mirall/folder.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/mirall/folder.cpp b/src/mirall/folder.cpp index de1f3a2bd..8b22144ea 100644 --- a/src/mirall/folder.cpp +++ b/src/mirall/folder.cpp @@ -649,6 +649,9 @@ void Folder::wipe() { QString stateDbFile = path()+QLatin1String(".csync_journal.db"); + // Delete files that have been partially downloaded. + slotDiscardDownloadProgress(); + _journal.close(); // close the sync journal QFile file(stateDbFile); @@ -661,12 +664,11 @@ void Folder::wipe() } else { qDebug() << "WRN: statedb is empty, can not remove."; } - // Check if the tmp database file also exists - QString ctmpName = path() + QLatin1String(".csync_journal.db.ctmp"); - QFile ctmpFile( ctmpName ); - if( ctmpFile.exists() ) { - ctmpFile.remove(); - } + + // Also remove other db related files + QFile::remove( stateDbFile + ".ctmp" ); + QFile::remove( stateDbFile + "-shm" ); + QFile::remove( stateDbFile + "-wal" ); } bool Folder::setIgnoredFiles() |