[Pkg-owncloud-commits] [owncloud-client] 285/333: Put the sync log in the actual folder

Sandro Knauß hefee-guest at moszumanska.debian.org
Thu Apr 17 23:17:05 UTC 2014


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 eaf5681f6123871498ad50f8c6edcc772715dabb
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Wed Apr 2 16:36:32 2014 +0200

    Put the sync log in the actual folder
---
 csync/src/csync_exclude.c     |  8 ++++++++
 src/mirall/folder.cpp         |  2 +-
 src/mirall/syncrunfilelog.cpp | 10 +++++++---
 src/mirall/syncrunfilelog.h   |  2 +-
 4 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/csync/src/csync_exclude.c b/csync/src/csync_exclude.c
index 42225a0..94d8128 100644
--- a/csync/src/csync_exclude.c
+++ b/csync/src/csync_exclude.c
@@ -183,6 +183,14 @@ CSYNC_EXCLUDE_TYPE csync_excluded(CSYNC *ctx, const char *path, int filetype) {
       goto out;
   }
 
+  rc = csync_fnmatch(".owncloudsync.log*", bname, 0);
+  if (rc == 0) {
+      match = CSYNC_FILE_SILENTLY_EXCLUDED;
+      SAFE_FREE(bname);
+      SAFE_FREE(dname);
+      goto out;
+  }
+
   /* Always ignore conflict files, not only via the exclude list */
   rc = csync_fnmatch("*_conflict-*", bname, 0);
   if (rc == 0) {
diff --git a/src/mirall/folder.cpp b/src/mirall/folder.cpp
index 0e817f4..0f8fa66 100644
--- a/src/mirall/folder.cpp
+++ b/src/mirall/folder.cpp
@@ -298,7 +298,7 @@ void Folder::bubbleUpSyncResult()
 
     SyncRunFileLog syncFileLog;
 
-    syncFileLog.start( _engine->stopWatch() );
+    syncFileLog.start(path(),  _engine->stopWatch() );
 
     QElapsedTimer timer;
     timer.start();
diff --git a/src/mirall/syncrunfilelog.cpp b/src/mirall/syncrunfilelog.cpp
index 8942759..4291900 100644
--- a/src/mirall/syncrunfilelog.cpp
+++ b/src/mirall/syncrunfilelog.cpp
@@ -14,6 +14,7 @@
 #include "mirall/syncrunfilelog.h"
 #include "mirall/utility.h"
 #include "mirall/mirallconfigfile.h"
+#include "filesystem.h"
 #include <qfileinfo.h>
 
 namespace Mirall {
@@ -77,11 +78,12 @@ QString SyncRunFileLog::instructionToStr( csync_instructions_e inst )
 }
 
 
-void SyncRunFileLog::start( const Utility::StopWatch &stopWatch )
+void SyncRunFileLog::start(const QString &folderPath,  const Utility::StopWatch &stopWatch )
 {
     const qint64 logfileMaxSize = 1024*1024; // 1MiB
-    MirallConfigFile cfg;
-    const QString filename = cfg.configPath() + QLatin1String("sync_log");
+
+    // Note; this name is ignored in csync_exclude.c
+    const QString filename = folderPath + QLatin1String(".owncloudsync.log");
 
     // When the file is too big, just rename it to an old name.
     QFileInfo info(filename);
@@ -106,6 +108,8 @@ void SyncRunFileLog::start( const Utility::StopWatch &stopWatch )
                 "size | fileId | status | errorString | http result code | "
                 "other size | other modtime | other etag | other fileId | "
                 "other instruction" << endl;
+
+        FileSystem::setFileHidden(filename, true);
     }
 
 
diff --git a/src/mirall/syncrunfilelog.h b/src/mirall/syncrunfilelog.h
index ae70bd2..c9d006d 100644
--- a/src/mirall/syncrunfilelog.h
+++ b/src/mirall/syncrunfilelog.h
@@ -28,7 +28,7 @@ class SyncRunFileLog
 {
 public:
     SyncRunFileLog();
-    void start( const Utility::StopWatch &stopWatch );
+    void start( const QString& folderPath, const Utility::StopWatch& stopWatch );
     void logItem( const SyncFileItem& item );
     void close();
 

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