[Pkg-owncloud-commits] [owncloud-client] 255/333: Avoid copies of the StopWatch

Sandro Knauß hefee-guest at moszumanska.debian.org
Thu Apr 17 23:17:01 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 ba896b05505423b65d5c534c90b0161fd525fb2e
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Fri Mar 28 09:39:32 2014 +0100

    Avoid copies of the StopWatch
---
 src/mirall/syncengine.h       | 2 +-
 src/mirall/syncrunfilelog.cpp | 2 +-
 src/mirall/syncrunfilelog.h   | 2 +-
 src/mirall/utility.cpp        | 6 +++---
 src/mirall/utility.h          | 6 +++---
 5 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/mirall/syncengine.h b/src/mirall/syncengine.h
index 7844f7d..e7d53ee 100644
--- a/src/mirall/syncengine.h
+++ b/src/mirall/syncengine.h
@@ -60,7 +60,7 @@ public:
     /* Abort the sync.  Called from the main thread */
     void abort();
 
-    Utility::StopWatch stopWatch() { return _stopWatch; }
+    Utility::StopWatch &stopWatch() { return _stopWatch; }
 
 signals:
     void csyncError( const QString& );
diff --git a/src/mirall/syncrunfilelog.cpp b/src/mirall/syncrunfilelog.cpp
index cad6067..41b1b65 100644
--- a/src/mirall/syncrunfilelog.cpp
+++ b/src/mirall/syncrunfilelog.cpp
@@ -76,7 +76,7 @@ QString SyncRunFileLog::instructionToStr( csync_instructions_e inst )
 }
 
 
-void SyncRunFileLog::start( Utility::StopWatch stopWatch )
+void SyncRunFileLog::start( const Utility::StopWatch &stopWatch )
 {
     MirallConfigFile cfg;
     _file.reset(new QFile(cfg.configPath() + QLatin1String("sync_log") ));
diff --git a/src/mirall/syncrunfilelog.h b/src/mirall/syncrunfilelog.h
index 6682cf5..161d26d 100644
--- a/src/mirall/syncrunfilelog.h
+++ b/src/mirall/syncrunfilelog.h
@@ -28,7 +28,7 @@ class SyncRunFileLog
 {
 public:
     SyncRunFileLog();
-    void start( Utility::StopWatch stopWatch );
+    void start( const Utility::StopWatch &stopWatch );
     void logItem( const SyncFileItem& item );
     void close();
 
diff --git a/src/mirall/utility.cpp b/src/mirall/utility.cpp
index 6da0f7a..1a37939 100644
--- a/src/mirall/utility.cpp
+++ b/src/mirall/utility.cpp
@@ -515,12 +515,12 @@ quint64 Utility::StopWatch::addLapTime( const QString& lapName )
     return re;
 }
 
-QDateTime Utility::StopWatch::startTime()
+QDateTime Utility::StopWatch::startTime() const
 {
     return _startTime;
 }
 
-QDateTime Utility::StopWatch::timeOfLap( const QString& lapName )
+QDateTime Utility::StopWatch::timeOfLap( const QString& lapName ) const
 {
     quint64 t = durationOfLap(lapName);
     if( t ) {
@@ -531,7 +531,7 @@ QDateTime Utility::StopWatch::timeOfLap( const QString& lapName )
     return QDateTime();
 }
 
-quint64 Utility::StopWatch::durationOfLap( const QString& lapName )
+quint64 Utility::StopWatch::durationOfLap( const QString& lapName ) const
 {
     QPair<QString, quint64> lapPair;
 
diff --git a/src/mirall/utility.h b/src/mirall/utility.h
index 904d2b8..90aca54 100644
--- a/src/mirall/utility.h
+++ b/src/mirall/utility.h
@@ -79,9 +79,9 @@ namespace Utility
         quint64 addLapTime( const QString& lapName );
 
         // out helpers, return the masured times.
-        QDateTime startTime();
-        QDateTime timeOfLap( const QString& lapName );
-        quint64 durationOfLap( const QString& lapName );
+        QDateTime startTime() const;
+        QDateTime timeOfLap( const QString& lapName ) const;
+        quint64 durationOfLap( const QString& lapName ) const;
     };
 }
 

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