SyncOptions syncOptions;
syncOptions.fillFromEnvironmentVariables();
syncOptions.verifyChunkSizes();
+ syncOptions.setIsCmd(true);
SyncEngine engine(account, options.source_dir, syncOptions, folder, &db);
engine.setIgnoreHiddenFiles(options.ignoreHiddenFiles);
engine.setNetworkLimits(options.uplimit, options.downlimit);
qCInfo(lcEngine) << "#### Post-Reconcile end #################################################### " << _stopWatch.addLapTime(QStringLiteral("Post-Reconcile Finished")) << "ms";
};
- if (!_hasNoneFiles && _hasRemoveFile && ConfigFile().promptDeleteFiles()) {
+ const auto displayDialog = ConfigFile().promptDeleteFiles() && !_syncOptions.isCmd();
+ if (!_hasNoneFiles && _hasRemoveFile && displayDialog) {
qCInfo(lcEngine) << "All the files are going to be changed, asking the user";
int side = 0; // > 0 means more deleted on the server. < 0 means more deleted on the client
for (const auto &it : _syncItems) {
SyncOptions::SyncOptions()
: _vfs(new VfsOff)
+ , _isCmd(false)
{
}
_fileRegex.setPatternOptions(Utility::fsCasePreserving() ? QRegularExpression::CaseInsensitiveOption : QRegularExpression::NoPatternOption);
_fileRegex.setPattern(pattern);
}
+
+void SyncOptions::setIsCmd(const bool isCmd)
+{
+ _isCmd = isCmd;
+}
+
+bool SyncOptions::isCmd() const
+{
+ return _isCmd;
+}
*/
void verifyChunkSizes();
-
/** A regular expression to match file names
* If no pattern is provided the default is an invalid regular expression.
*/
*/
void setPathPattern(const QString &pattern);
+ /** sync had been started via nextcloudcmd command line */
+ [[nodiscard]] bool isCmd() const;
+ void setIsCmd(const bool isCmd);
+
private:
/**
* Only sync files that match the expression
qint64 _minChunkSize = chunkV2MinChunkSize;
qint64 _maxChunkSize = chunkV2MaxChunkSize;
+
+ bool _isCmd = false;
};
}