Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/desktop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Kamm <mail@ckamm.de>2016-06-09 15:10:47 +0300
committerChristian Kamm <mail@ckamm.de>2016-06-09 15:10:47 +0300
commit85a173e1746b268416b18f9c377ee317d937ddac (patch)
tree9b8c23792e304f6b74e6b19b1cf3bb57b194c3bf /src/gui/syncrunfilelog.cpp
parent87b4693a9db6e7d6812b257d3af072f653b87aae (diff)
Log: Write the sync log during propagation #3108
...instead of when done with the sync. This way we get information even if the client crashes.
Diffstat (limited to 'src/gui/syncrunfilelog.cpp')
-rw-r--r--src/gui/syncrunfilelog.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gui/syncrunfilelog.cpp b/src/gui/syncrunfilelog.cpp
index 988d15dea..3013f6c87 100644
--- a/src/gui/syncrunfilelog.cpp
+++ b/src/gui/syncrunfilelog.cpp
@@ -87,7 +87,7 @@ QString SyncRunFileLog::instructionToStr( csync_instructions_e inst )
}
-void SyncRunFileLog::start(const QString &folderPath, const Utility::StopWatch &stopWatch )
+void SyncRunFileLog::start(const QString &folderPath)
{
const qint64 logfileMaxSize = 1024*1024; // 1MiB
@@ -108,8 +108,6 @@ void SyncRunFileLog::start(const QString &folderPath, const Utility::StopWatch
_file->open(QIODevice::WriteOnly | QIODevice::Append | QIODevice::Text);
_out.setDevice( _file.data() );
- QDateTime dt = stopWatch.startTime();
- QDateTime de = stopWatch.timeOfLap(QLatin1String("Sync Finished"));
if (!exists) {
// We are creating a new file, add the note.
@@ -122,8 +120,8 @@ void SyncRunFileLog::start(const QString &folderPath, const Utility::StopWatch
}
- _out << "#=#=#=# Syncrun started " << dateTimeStr(dt) << " until " << dateTimeStr(de) << " ("
- << stopWatch.durationOfLap(QLatin1String("Sync Finished")) << " msec)" << endl;
+ _duration.start();
+ _out << "#=#=#=# Syncrun started " << dateTimeStr(QDateTime::currentDateTime()) << endl;
}
void SyncRunFileLog::logItem( const SyncFileItem& item )
@@ -162,8 +160,10 @@ void SyncRunFileLog::logItem( const SyncFileItem& item )
_out << endl;
}
-void SyncRunFileLog::close()
+void SyncRunFileLog::finish()
{
+ _out << "#=#=#=# Syncrun finished " << dateTimeStr(QDateTime::currentDateTime())
+ << " (duration: " << _duration.elapsed() << " msec)" << endl;
_file->close();
}