[Pkg-owncloud-commits] [owncloud-client] 283/333: don't add the list of field on the log for every sync

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

    don't add the list of field on the log for every sync
---
 src/mirall/syncrunfilelog.cpp | 23 ++++++++++++-----------
 src/mirall/syncrunfilelog.h   |  1 -
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/mirall/syncrunfilelog.cpp b/src/mirall/syncrunfilelog.cpp
index eface29..8942759 100644
--- a/src/mirall/syncrunfilelog.cpp
+++ b/src/mirall/syncrunfilelog.cpp
@@ -85,7 +85,9 @@ void SyncRunFileLog::start( const Utility::StopWatch &stopWatch )
 
     // When the file is too big, just rename it to an old name.
     QFileInfo info(filename);
-    if (info.exists() && info.size() > logfileMaxSize) {
+    bool exists = info.exists();
+    if (exists && info.size() > logfileMaxSize) {
+        exists = false;
         QString newFilename = filename + QLatin1String(".1");
         QFile::remove(newFilename);
         QFile::rename(filename, newFilename);
@@ -98,9 +100,17 @@ void SyncRunFileLog::start( const Utility::StopWatch &stopWatch )
     QDateTime dt = stopWatch.startTime();
     QDateTime de = stopWatch.timeOfLap(QLatin1String("Sync Finished"));
 
+    if (!exists) {
+        // We are creating a new file, add the note.
+        _out << "# timestamp | duration | file | instruction | modtime | etag | "
+                "size | fileId | status | errorString | http result code | "
+                "other size | other modtime | other etag | other fileId | "
+                "other instruction" << endl;
+    }
+
+
     _out << "#=#=#=# Syncrun started " << dateTimeStr(dt) << " until " << dateTimeStr(de) << " ("
             << stopWatch.durationOfLap(QLatin1String("Sync Finished")) << " msec)" << endl;
-    _start = true;
 }
 
 void SyncRunFileLog::logItem( const SyncFileItem& item )
@@ -110,15 +120,6 @@ void SyncRunFileLog::logItem( const SyncFileItem& item )
         return;
     }
 
-    // log a list of fields if the log really adds lines.
-    if( _start ) {
-        _out << "# timestamp | duration | file | instruction | modtime | etag | "
-                "size | fileId | status | errorString | http result code | "
-                "other size | other modtime | other etag | other fileId | "
-                "other instruction" << endl;
-        _start = false;
-    }
-
     const QChar L = QLatin1Char('|');
     _out << item._responseTimeStamp << L;
     _out << QString::number(item._requestDuration) << L;
diff --git a/src/mirall/syncrunfilelog.h b/src/mirall/syncrunfilelog.h
index 161d26d..ae70bd2 100644
--- a/src/mirall/syncrunfilelog.h
+++ b/src/mirall/syncrunfilelog.h
@@ -40,7 +40,6 @@ private:
 
     QScopedPointer<QFile> _file;
     QTextStream _out;
-    bool        _start;
 
 };
 }

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