From 1a63ad67f0e79603f1d8f4401257c1e04dbc90b6 Mon Sep 17 00:00:00 2001 From: Juan Carlos Cornejo Date: Tue, 13 Dec 2011 20:53:30 -0500 Subject: [PATCH] Fixed a bug where at startup, the client attempted to re-download already deleted files. --- owncloud_sync_qt/OwnCloudSync.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/owncloud_sync_qt/OwnCloudSync.cpp b/owncloud_sync_qt/OwnCloudSync.cpp index 2841f6a1d..9c0c284de 100644 --- a/owncloud_sync_qt/OwnCloudSync.cpp +++ b/owncloud_sync_qt/OwnCloudSync.cpp @@ -693,13 +693,17 @@ void OwnCloudSync::syncFiles() query = queryDBFileInfo(serverName,"local_files"); } if( !query.next() ) { - if( serverType == "collection") { - localDirs.append(serverName); - } else { - mDownloadingFiles.enqueue(FileInfo(serverName,serverSize)); - mTotalToDownload += serverSize; + // If this is the first run, it could also just be a deleted file + query = queryDBFileInfo(serverName,"local_files"); + if(mIsFirstRun && !query.next()) { // Could have just been a deleted file. + if( serverType == "collection") { + localDirs.append(serverName); + } else { + mDownloadingFiles.enqueue(FileInfo(serverName,serverSize)); + mTotalToDownload += serverSize; + } + syncDebug() << "DOWNLOAD new file: " << serverName; } - syncDebug() << "DOWNLOAD new file: " << serverName; } } for( int i = 0; i < mDownloadConflict.size(); i++ ) {