[Pkg-owncloud-commits] [owncloud-client] 57/470: Merge pull request #4389 from Bottswana/deleteprompt

Sandro Knauß hefee-guest at moszumanska.debian.org
Thu May 12 16:24:44 UTC 2016


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit a76ba06817289bebb0033bd0fddb533b6ac20640
Merge: 86fb832 f442195
Author: Markus Goetz <markus at woboq.com>
Date:   Mon Feb 22 15:44:50 2016 +0100

    Merge pull request #4389 from Bottswana/deleteprompt
    
    Add option to disable the delete all files prompt

 src/libsync/configfile.cpp | 13 +++++++++++++
 src/libsync/configfile.h   |  3 +++
 src/libsync/syncengine.cpp |  5 ++++-
 3 files changed, 20 insertions(+), 1 deletion(-)

diff --cc src/libsync/syncengine.cpp
index ac3b3ea,4a7c738..8f4f2c0
--- a/src/libsync/syncengine.cpp
+++ b/src/libsync/syncengine.cpp
@@@ -828,20 -813,21 +829,22 @@@ void SyncEngine::slotDiscoveryJobFinish
          (*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);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list