(*it)->_file = adjustRenamedPath((*it)->_file);
}
- // Sort items per destination
- std::sort(_syncedItems.begin(), _syncedItems.end());
-
- // make sure everything is allowed
- checkForPermission();
-
- // To announce the beginning of the sync
- emit aboutToPropagate(_syncedItems);
- // it's important to do this before ProgressInfo::start(), to announce start of new sync
- emit transmissionProgress(*_progressInfo);
- _progressInfo->start();
+ // Check for invalid character in old server version
+ if (_account->serverVersionInt() < 0x080100) {
+ // Server version older than 8.1 don't support these character in filename.
+ static const QRegExp invalidCharRx("[\\\\:?*\"<>|]");
+ for (auto it = _syncedItems.begin(); it != _syncedItems.end(); ++it) {
+ if ((*it)->_direction == SyncFileItem::Up &&
+ (*it)->destination().contains(invalidCharRx)) {
+ (*it)->_errorString = tr("File name contains at least one invalid character");
+ (*it)->_instruction = CSYNC_INSTRUCTION_IGNORE;
+ }
+ }
+ }
- if (!_hasNoneFiles && _hasRemoveFile) {
+ // Check the config file before displaying prompt in case it is disabled.
+ ConfigFile cfgFile;
+ if (!_hasNoneFiles && _hasRemoveFile && cfgFile.promptDeleteFiles()) {
qDebug() << Q_FUNC_INFO << "All the files are going to be changed, asking the user";
bool cancel = false;
emit aboutToRemoveAllFiles(_syncedItems.first()->_direction, &cancel);