From: Christian Kamm Date: Mon, 29 Jan 2018 10:16:50 +0000 (+0100) Subject: SyncOptions: Add default placeholder suffix X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~21^2~468^2~610 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=40f23031668f163e46ce88da9d183d5049cfb9ba;p=nextcloud-desktop.git SyncOptions: Add default placeholder suffix Otherwise each test has to set this up anew. --- diff --git a/src/libsync/syncengine.cpp b/src/libsync/syncengine.cpp index 5770a5d3a..93cab726f 100644 --- a/src/libsync/syncengine.cpp +++ b/src/libsync/syncengine.cpp @@ -861,6 +861,12 @@ void SyncEngine::startSync() _csync_ctx->new_files_are_placeholders = _syncOptions._newFilesArePlaceholders; _csync_ctx->placeholder_suffix = _syncOptions._placeholderSuffix.toUtf8(); + if (_csync_ctx->new_files_are_placeholders && _csync_ctx->placeholder_suffix.isEmpty()) { + csyncError(tr("Using placeholder files, but placeholder suffix is not set")); + finalize(false); + return; + } + // If needed, make sure we have up to date E2E information before the // discovery phase, otherwise we start right away if (_account->capabilities().clientSideEncryptionAvailable()) { diff --git a/src/libsync/syncoptions.h b/src/libsync/syncoptions.h index 2e302bda9..ea48cd83e 100644 --- a/src/libsync/syncoptions.h +++ b/src/libsync/syncoptions.h @@ -38,7 +38,7 @@ struct SyncOptions /** Create a placeholder for new files instead of downloading */ bool _newFilesArePlaceholders = false; - QString _placeholderSuffix; + QString _placeholderSuffix = ".owncloud"; /** The initial un-adjusted chunk size in bytes for chunked uploads, both * for old and new chunking algorithm, which classifies the item to be chunked