changed paths of logfiles

This commit is contained in:
Kilian Pfeiffer 2018-04-17 15:54:05 +02:00
parent 4c40789dca
commit faf64958ec
2 changed files with 10 additions and 2 deletions

View file

@ -95,8 +95,14 @@ void SyncRunFileLog::start(const QString &folderPath)
{ {
const qint64 logfileMaxSize = 1024 * 1024; // 1MiB const qint64 logfileMaxSize = 1024 * 1024; // 1MiB
// Note; this name is ignored in csync_exclude.c const QString foldername = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
const QString filename = folderPath + QLatin1String(".owncloudsync.log"); if(!QDir(foldername).exists()) {
QDir().mkdir(foldername);
}
int length = folderPath.split(QString(QDir::separator())).length();
const QString filename = foldername + QString(QDir::separator()) ///
+"." + folderPath.split(QString(QDir::separator())).at(length - 2) + QLatin1String("_sync.log");
// When the file is too big, just rename it to an old name. // When the file is too big, just rename it to an old name.
QFileInfo info(filename); QFileInfo info(filename);

View file

@ -19,6 +19,8 @@
#include <QTextStream> #include <QTextStream>
#include <QScopedPointer> #include <QScopedPointer>
#include <QElapsedTimer> #include <QElapsedTimer>
#include <QStandardPaths>
#include <QDir>
#include "syncfileitem.h" #include "syncfileitem.h"