[Pkg-owncloud-commits] [owncloud-client] 104/498: Merge remote-tracking branch 'origin/1.8'

Sandro Knauß hefee-guest at moszumanska.debian.org
Tue Aug 11 14:48:40 UTC 2015


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 6b27d2e703521ff27e745617f93a66473f574998
Merge: abaf213 f344b42
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Tue May 26 12:28:31 2015 +0200

    Merge remote-tracking branch 'origin/1.8'

 CMakeLists.txt                                |   2 +-
 ChangeLog                                     |  31 +++++
 admin/win/nsi/l10n/.tx/config                 |  48 +++----
 admin/win/nsi/l10n/Norwegian.nsh              |  46 +++++++
 admin/win/nsi/l10n/bin/build_locale_nsi.py    |   2 +-
 admin/win/nsi/l10n/bin/l10n.sh                |   1 +
 admin/win/nsi/l10n/languages.nsh              |   3 +-
 cmake/modules/NSIS.template.in                |  16 ++-
 cmake/modules/QtVersionAbstraction.cmake      |   1 +
 config.h.in                                   |   2 +
 csync/tests/ownCloud/ownCloud/Test.pm         |   7 +-
 csync/tests/ownCloud/t_recall.pl              |  85 ++++++++++++
 src/gui/accountsettings.ui                    |   3 +
 src/gui/accountstate.cpp                      |  16 ++-
 src/gui/accountstate.h                        |   2 +
 src/gui/folderwizard.h                        |   1 +
 src/gui/wizard/owncloudhttpcredspage.ui       |   3 +
 src/libsync/CMakeLists.txt                    |  10 +-
 src/libsync/configfile.cpp                    |  15 +++
 src/libsync/configfile.h                      |   6 +
 src/libsync/filesystem.cpp                    |  59 +++++++++
 src/libsync/filesystem.h                      |   9 ++
 src/libsync/networkjobs.cpp                   |   9 +-
 src/libsync/owncloudpropagator.cpp            |  15 +++
 src/libsync/ownsql.cpp                        |   2 +-
 src/libsync/propagatedownload.cpp             |  73 ++++++++++-
 src/libsync/propagatedownload.h               |  10 +-
 src/libsync/propagateupload.cpp               |  65 +++++++++-
 src/libsync/propagateupload.h                 |  10 ++
 src/libsync/propagatorjobs.h                  |  16 +++
 src/libsync/syncengine.cpp                    |  17 +--
 src/libsync/syncfileitem.h                    |   1 +
 src/libsync/syncjournaldb.cpp                 |  60 ++++-----
 src/libsync/syncjournaldb.h                   |   9 --
 src/libsync/theme.cpp                         |   9 +-
 src/libsync/theme.h                           |   9 +-
 src/libsync/transmissionchecksumvalidator.cpp | 151 ++++++++++++++++++++++
 src/libsync/transmissionchecksumvalidator.h   |  74 +++++++++++
 src/libsync/utility.cpp                       |  20 ++-
 src/libsync/utility.h                         |   2 +-
 test/CMakeLists.txt                           |   2 +
 test/testfilesystem.h                         |  93 ++++++++++++++
 test/testowncloudpropagator.h                 |   2 +-
 test/testtranschecksumvalidator.h             | 159 +++++++++++++++++++++++
 translations/client_ca.ts                     | 129 +++++++++++--------
 translations/client_cs.ts                     | 129 +++++++++++--------
 translations/client_de.ts                     | 133 ++++++++++---------
 translations/client_el.ts                     | 129 +++++++++++--------
 translations/client_en.ts                     | 129 +++++++++++--------
 translations/client_es.ts                     | 129 +++++++++++--------
 translations/client_es_AR.ts                  | 129 +++++++++++--------
 translations/client_et.ts                     | 129 +++++++++++--------
 translations/client_eu.ts                     | 129 +++++++++++--------
 translations/client_fa.ts                     | 129 +++++++++++--------
 translations/client_fi.ts                     | 129 +++++++++++--------
 translations/client_fr.ts                     | 137 +++++++++++---------
 translations/client_gl.ts                     | 129 +++++++++++--------
 translations/client_hu.ts                     | 129 +++++++++++--------
 translations/client_it.ts                     | 129 +++++++++++--------
 translations/client_ja.ts                     | 129 +++++++++++--------
 translations/client_nl.ts                     | 131 +++++++++++--------
 translations/client_pl.ts                     | 129 +++++++++++--------
 translations/client_pt.ts                     | 178 ++++++++++++++------------
 translations/client_pt_BR.ts                  | 136 +++++++++++---------
 translations/client_ru.ts                     | 129 +++++++++++--------
 translations/client_sk.ts                     | 129 +++++++++++--------
 translations/client_sl.ts                     | 129 +++++++++++--------
 translations/client_sr.ts                     | 129 +++++++++++--------
 translations/client_sv.ts                     | 129 +++++++++++--------
 translations/client_th.ts                     | 129 +++++++++++--------
 translations/client_tr.ts                     | 129 +++++++++++--------
 translations/client_uk.ts                     | 129 +++++++++++--------
 translations/client_zh_CN.ts                  | 145 ++++++++++++---------
 translations/client_zh_TW.ts                  | 129 +++++++++++--------
 74 files changed, 3319 insertions(+), 1813 deletions(-)

diff --cc src/libsync/propagatedownload.cpp
index d028624,73815d1..f7af0b8
--- a/src/libsync/propagatedownload.cpp
+++ b/src/libsync/propagatedownload.cpp
@@@ -508,9 -524,55 +524,55 @@@ QString makeConflictFileName(const QStr
      return conflictFileName;
  }
  
+ 
+ namespace { // Anonymous namespace for the recall feature
+ static QString makeRecallFileName(const QString &fn)
+ {
+     QString recallFileName(fn);
+     // Add _recall-XXXX  before the extention.
+     int dotLocation = recallFileName.lastIndexOf('.');
+     // If no extention, add it at the end  (take care of cases like foo/.hidden or foo.bar/file)
+     if (dotLocation <= recallFileName.lastIndexOf('/') + 1) {
+         dotLocation = recallFileName.size();
+     }
+ 
+     QString timeString = QDateTime::currentDateTime().toString("yyyyMMdd-hhmmss");
+     recallFileName.insert(dotLocation, "_.sys.admin#recall#-" + timeString);
+ 
+     return recallFileName;
+ }
+ 
+ static void handleRecallFile(const QString &fn)
+ {
+     qDebug() << "handleRecallFile: " << fn;
+ 
+     FileSystem::setFileHidden(fn, true);
+ 
+     QFile file(fn);
+     if (!file.open(QIODevice::ReadOnly)) {
+         qWarning() << "Could not open recall file" << file.errorString();
+         return;
+     }
+     QFileInfo existingFile(fn);
+     QDir thisDir = existingFile.dir();
+ 
+     while (!file.atEnd()) {
+         QByteArray line = file.readLine();
+         line.chop(1); // remove trailing \n
+         QString fpath = thisDir.filePath(line);
+         QString rpath = makeRecallFileName(fpath);
+ 
+         // if previously recalled file exists then remove it (copy will not overwrite it)
+         QFile(rpath).remove();
+         qDebug() << "Copy recall file: " << fpath << " -> " << rpath;
+         QFile::copy(fpath,rpath);
+     }
+ }
+ } // end namespace
+ 
  void PropagateDownloadFileQNAM::downloadFinished()
  {
 -    QString fn = _propagator->getFilePath(_item._file);
 +    QString fn = _propagator->getFilePath(_item->_file);
  
      // In case of file name clash, report an error
      // This can happen if another parallel download saved a clashing file.
@@@ -586,12 -648,17 +648,17 @@@
  
      // Maybe we downloaded a newer version of the file than we thought we would...
      // Get up to date information for the journal.
 -    _item._size = FileSystem::getSize(fn);
 +    _item->_size = FileSystem::getSize(fn);
  
 -    _propagator->_journal->setFileRecord(SyncJournalFileRecord(_item, fn));
 -    _propagator->_journal->setDownloadInfo(_item._file, SyncJournalDb::DownloadInfo());
 +    _propagator->_journal->setFileRecord(SyncJournalFileRecord(*_item, fn));
 +    _propagator->_journal->setDownloadInfo(_item->_file, SyncJournalDb::DownloadInfo());
      _propagator->_journal->commit("download file start2");
      done(isConflict ? SyncFileItem::Conflict : SyncFileItem::Success);
+ 
+     // handle the special recall file
+     if(_item._file == QLatin1String(".sys.admin#recall#") || _item._file.endsWith("/.sys.admin#recall#")) {
+         handleRecallFile(fn);
+     }
  }
  
  void PropagateDownloadFileQNAM::slotDownloadProgress(qint64 received, qint64)
diff --cc src/libsync/propagatedownload.h
index c63aa2a,68a059f..ea14c06
--- a/src/libsync/propagatedownload.h
+++ b/src/libsync/propagatedownload.h
@@@ -101,14 -101,11 +101,11 @@@ private slots
  
  class PropagateDownloadFileQNAM : public PropagateItemJob {
      Q_OBJECT
-     QPointer<GETFileJob> _job;
- 
- //  QFile *_file;
-     QFile _tmpFile;
  public:
 -    PropagateDownloadFileQNAM(OwncloudPropagator* propagator,const SyncFileItem& item)
 +    PropagateDownloadFileQNAM(OwncloudPropagator* propagator,const SyncFileItemPtr& item)
          : PropagateItemJob(propagator, item) {}
      void start() Q_DECL_OVERRIDE;
+ 
  private slots:
      void slotGetFinished();
      void abort() Q_DECL_OVERRIDE;
diff --cc src/libsync/propagateupload.cpp
index 8af40cb,208e632..2cf42c4
--- a/src/libsync/propagateupload.cpp
+++ b/src/libsync/propagateupload.cpp
@@@ -197,17 -200,47 +200,46 @@@ void PropagateUploadFileQNAM::start(
          return;
      }
  
-     const QString fullFilePath(_propagator->getFilePath(_item->_file));
 -    const QString filePath = _propagator->getFilePath(_item._file);
++    const QString filePath = _propagator->getFilePath(_item->_file);
+ 
+     // remember the modtime before checksumming to be able to detect a file
+     // change during the checksum calculation
+     _item._modtime = FileSystem::getModTime(filePath);
+ 
+     _stopWatch.start();
+ 
+     // do whatever is needed to add a checksum to the http upload request.
+     // in any case, the validator will emit signal startUpload to let the flow
+     // continue in slotStartUpload here.
+     TransmissionChecksumValidator *validator = new TransmissionChecksumValidator(filePath, this);
+     connect(validator, SIGNAL(validated(QByteArray)), this, SLOT(slotStartUpload(QByteArray)));
+     validator->uploadValidation();
+ }
+ 
+ void PropagateUploadFileQNAM::slotStartUpload(const QByteArray& checksum)
+ {
 -    const QString fullFilePath(_propagator->getFilePath(_item._file));
+ 
+     _item._checksum = checksum;
  
      if (!FileSystem::fileExists(fullFilePath)) {
          done(SyncFileItem::SoftError, tr("File Removed"));
          return;
      }
+     _stopWatch.addLapTime(QLatin1String("Checksum"));
+ 
+     time_t prevModtime = _item._modtime; // the _item value was set in PropagateUploadFileQNAM::start()
+     // but a potential checksum calculation could have taken some time during which the file could
+     // have been changed again, so better check again here.
  
-     // Update the mtime and size, it might have changed since discovery.
 -    _item._modtime = FileSystem::getModTime(fullFilePath);
 +    _item->_modtime = FileSystem::getModTime(fullFilePath);
+     if( prevModtime != _item._modtime ) {
+         _propagator->_anotherSyncNeeded = true;
+         done(SyncFileItem::SoftError, tr("Local file changed during syncing. It will be resumed."));
+         return;
+     }
+ 
      quint64 fileSize = FileSystem::getSize(fullFilePath);
 -    _item._size = fileSize;
 +    _item->_size = fileSize;
  
      // But skip the file if the mtime is too close to 'now'!
      // That usually indicates a file that is still being changed
@@@ -391,9 -424,21 +423,21 @@@ void PropagateUploadFileQNAM::startNext
      headers["OC-Async"] = "1";
      headers["OC-Chunk-Size"]= QByteArray::number(quint64(chunkSize()));
      headers["Content-Type"] = "application/octet-stream";
 -    headers["X-OC-Mtime"] = QByteArray::number(qint64(_item._modtime));
 +    headers["X-OC-Mtime"] = QByteArray::number(qint64(_item->_modtime));
+ 
 -    if(_item._file.contains(".sys.admin#recall#")) {
++    if(_item->_file.contains(".sys.admin#recall#")) {
+         // This is a file recall triggered by the admin.  Note: the
+         // recall list file created by the admin and downloaded by the
+         // client (.sys.admin#recall#) also falls into this category
+         // (albeit users are not supposed to mess up with it)
+ 
+         // We use a special tag header so that the server may decide to store this file away in some admin stage area
+         // And not directly in the user's area (what would trigger redownloads etc).
+         headers["OC-Tag"] = ".sys.admin#recall#";
+     }
+ 
 -    if (!_item._etag.isEmpty() && _item._etag != "empty_etag" &&
 -            _item._instruction != CSYNC_INSTRUCTION_NEW  // On new files never send a If-Match
 +    if (!_item->_etag.isEmpty() && _item->_etag != "empty_etag" &&
 +            _item->_instruction != CSYNC_INSTRUCTION_NEW  // On new files never send a If-Match
              ) {
          // We add quotes because the owncloud server always add quotes around the etag, and
          //  csync_owncloud.c's owncloud_file_id always strip the quotes.
@@@ -640,7 -693,12 +692,12 @@@ void PropagateUploadFileQNAM::slotPutFi
          // Well, the mtime was not set
  #endif
      }
+ 
+     // performance logging
+     _item._requestDuration = _stopWatch.stop();
+     qDebug() << "*==* duration UPLOAD" << _item._size << _stopWatch.durationOfLap(QLatin1String("Checksum")) << _item._requestDuration;
+ 
 -    finalize(_item);
 +    finalize(*_item);
  }
  
  void PropagateUploadFileQNAM::finalize(const SyncFileItem &copy)
diff --cc src/libsync/propagateupload.h
index 2840857,2a34faa..946a9fd
--- a/src/libsync/propagateupload.h
+++ b/src/libsync/propagateupload.h
@@@ -163,8 -167,12 +167,12 @@@ private
      QElapsedTimer _duration;
      QVector<PUTFileJob*> _jobs; /// network jobs that are currently in transit
      bool _finished; // Tells that all the jobs have been finished
+ 
+     // measure the performance of checksum calc and upload
+     Utility::StopWatch _stopWatch;
+ 
  public:
 -    PropagateUploadFileQNAM(OwncloudPropagator* propagator,const SyncFileItem& item)
 +    PropagateUploadFileQNAM(OwncloudPropagator* propagator,const SyncFileItemPtr& item)
          : PropagateItemJob(propagator, item), _startChunk(0), _currentChunk(0), _chunkCount(0), _transferId(0), _finished(false) {}
      void start() Q_DECL_OVERRIDE;
  private slots:

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