[Pkg-owncloud-commits] [owncloud-client] 28/470: Merge branch restore_backup

Sandro Knauß hefee-guest at moszumanska.debian.org
Thu May 12 16:24:40 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 c93ecfbfb5a2b9c7278e4838125bdcebf6dce4df
Merge: 41d8d77 1bb76f5
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Wed Feb 10 17:47:06 2016 +0100

    Merge branch restore_backup

 src/gui/folder.cpp         | 21 +++++++++++
 src/gui/folder.h           |  2 ++
 src/libsync/syncengine.cpp | 89 +++++++++++++++++++++++++++++++++++++---------
 src/libsync/syncengine.h   | 21 ++++++++++-
 4 files changed, 115 insertions(+), 18 deletions(-)

diff --cc src/libsync/syncengine.cpp
index 59dca10,54f33a3..1d10fe2
--- a/src/libsync/syncengine.cpp
+++ b/src/libsync/syncengine.cpp
@@@ -542,14 -543,8 +544,9 @@@ int SyncEngine::treewalkFile( TREE_WALK
      case CSYNC_INSTRUCTION_ERROR:
          dir = SyncFileItem::None;
          break;
-     case CSYNC_INSTRUCTION_EVAL:
-     case CSYNC_INSTRUCTION_NEW:
 +    case CSYNC_INSTRUCTION_TYPE_CHANGE:
      case CSYNC_INSTRUCTION_SYNC:
-     case CSYNC_INSTRUCTION_STAT_ERROR:
-     default:
-         dir = remote ? SyncFileItem::Down : SyncFileItem::Up;
-         if (!remote && file->instruction == CSYNC_INSTRUCTION_SYNC) {
+         if (!remote) {
              // An upload of an existing file means that the file was left unchanged on the server
              // This counts as a NONE for detecting if all the files on the server were changed
              _hasNoneFiles = true;
@@@ -816,19 -824,26 +828,39 @@@ void SyncEngine::slotDiscoveryJobFinish
          (*it)->_file = adjustRenamedPath((*it)->_file);
      }
  
 +    // 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) {
+         qDebug() << Q_FUNC_INFO << "All the files are going to be changed, asking the user";
+         bool cancel = false;
+         emit aboutToRemoveAllFiles(_syncedItems.first()->_direction, &cancel);
+         if (cancel) {
+             qDebug() << Q_FUNC_INFO << "Abort sync";
+             finalize(false);
+             return;
+         }
+     }
+     if (!_hasForwardInTimeFiles && _backInTimeFiles >= 2) {
+         qDebug() << "All the changes are bringing files in the past, asking the user";
+         // this typically happen when a backup is restored on the server
+         bool restore = false;
+         emit aboutToRestoreBackup(&restore);
+         if (restore) {
+             restoreOldFiles();
+         }
+     }
+ 
      // Sort items per destination
      std::sort(_syncedItems.begin(), _syncedItems.end());
  

-- 
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