mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-22 21:15:55 +03:00
Avoid copies of the StopWatch
This commit is contained in:
parent
36a2c861c2
commit
ba896b0550
5 changed files with 9 additions and 9 deletions
|
@ -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& );
|
||||
|
|
|
@ -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") ));
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue