opt._newBigFolderSizeLimit = newFolderLimit.first ? newFolderLimit.second * 1000LL * 1000LL : -1; // convert from MB to B
opt._confirmExternalStorage = cfgFile.confirmExternalStorage();
opt._moveFilesToTrash = cfgFile.moveToTrash();
+ opt._usePlaceholders = _definition.usePlaceholders;
QByteArray chunkSizeEnv = qgetenv("OWNCLOUD_CHUNK_SIZE");
if (!chunkSizeEnv.isEmpty()) {
settings.setValue(QLatin1String("targetPath"), folder.targetPath);
settings.setValue(QLatin1String("paused"), folder.paused);
settings.setValue(QLatin1String("ignoreHiddenFiles"), folder.ignoreHiddenFiles);
+ settings.setValue(QLatin1String("usePlaceholders"), folder.usePlaceholders);
// Happens only on Windows when the explorer integration is enabled.
if (!folder.navigationPaneClsid.isNull())
folder->paused = settings.value(QLatin1String("paused")).toBool();
folder->ignoreHiddenFiles = settings.value(QLatin1String("ignoreHiddenFiles"), QVariant(true)).toBool();
folder->navigationPaneClsid = settings.value(QLatin1String("navigationPaneClsid")).toUuid();
+ folder->usePlaceholders = settings.value(QLatin1String("usePlaceholders")).toBool();
settings.endGroup();
// Old settings can contain paths with native separators. In the rest of the
bool paused = false;
/// whether the folder syncs hidden files
bool ignoreHiddenFiles = false;
+ /// New files are downloaded as placeholders
+ bool usePlaceholders = false;
/// The CLSID where this folder appears in registry for the Explorer navigation pane entry.
QUuid navigationPaneClsid;
// Check for the directEditing capability
void fetchDirectEditors(const QUrl &directEditingURL, const QString &directEditingETag);
- bool usePlaceholders() const { return _usePlaceholders; }
- void setUsePlaceholders(bool use) { _usePlaceholders = use; }
-
public slots:
/// Used when forgetting credentials
void clearQNAMCache();
private:
bool _isRemoteWipeRequested_HACK = false;
// <-- FIXME MS@2019-12-07
-
- bool _usePlaceholders = false;
};
}
return shouldDiscoverLocally(path);
};
- _csync_ctx->new_files_are_placeholders = account()->usePlaceholders();
+ _csync_ctx->new_files_are_placeholders = _syncOptions._usePlaceholders;
// If needed, make sure we have up to date E2E information before the
// discovery phase, otherwise we start right away
/** If remotely deleted files are needed to move to trash */
bool _moveFilesToTrash = false;
+ /** Create a placeholder for new files instead of downloading */
+ bool _usePlaceholders = false;
+
/** 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
*
QFETCH(bool, doLocalDiscovery);
FakeFolder fakeFolder{FileInfo()};
- fakeFolder.syncEngine().account()->setUsePlaceholders(true);
+ SyncOptions syncOptions;
+ syncOptions._usePlaceholders = true;
+ fakeFolder.syncEngine().setSyncOptions(syncOptions);
QCOMPARE(fakeFolder.currentLocalState(), fakeFolder.currentRemoteState());
QSignalSpy completeSpy(&fakeFolder.syncEngine(), SIGNAL(itemCompleted(const SyncFileItemPtr &)));
void testWithNormalSync()
{
FakeFolder fakeFolder{FileInfo::A12_B12_C12_S12()};
- fakeFolder.syncEngine().account()->setUsePlaceholders(true);
+ SyncOptions syncOptions;
+ syncOptions._usePlaceholders = true;
+ fakeFolder.syncEngine().setSyncOptions(syncOptions);
QCOMPARE(fakeFolder.currentLocalState(), fakeFolder.currentRemoteState());
QSignalSpy completeSpy(&fakeFolder.syncEngine(), SIGNAL(itemCompleted(const SyncFileItemPtr &)));
void testPlaceholderDownload()
{
FakeFolder fakeFolder{FileInfo()};
- fakeFolder.syncEngine().account()->setUsePlaceholders(true);
+ SyncOptions syncOptions;
+ syncOptions._usePlaceholders = true;
+ fakeFolder.syncEngine().setSyncOptions(syncOptions);
QCOMPARE(fakeFolder.currentLocalState(), fakeFolder.currentRemoteState());
QSignalSpy completeSpy(&fakeFolder.syncEngine(), SIGNAL(itemCompleted(const SyncFileItemPtr &)));