Commit a88b35d3 authored by Boudewijn Rempt's avatar Boudewijn Rempt Committed by Blackbeard (alberto flores)

Add a log line for instant preview

parent ee5df6ef
......@@ -147,18 +147,20 @@ void KisUsageLogger::writeHeader()
void KisUsageLogger::rotateLog()
{
d->logFile.open(QFile::ReadOnly);
QString log = QString::fromUtf8(d->logFile.readAll());
int sectionCount = log.count(s_sectionHeader);
int nextSectionIndex = log.indexOf(s_sectionHeader, s_sectionHeader.length());
while(sectionCount >= s_maxLogs) {
log = log.remove(0, log.indexOf(s_sectionHeader, nextSectionIndex));
nextSectionIndex = log.indexOf(s_sectionHeader, s_sectionHeader.length());
sectionCount = log.count(s_sectionHeader);
if (d->logFile.exists()) {
d->logFile.open(QFile::ReadOnly);
QString log = QString::fromUtf8(d->logFile.readAll());
int sectionCount = log.count(s_sectionHeader);
int nextSectionIndex = log.indexOf(s_sectionHeader, s_sectionHeader.length());
while(sectionCount >= s_maxLogs) {
log = log.remove(0, log.indexOf(s_sectionHeader, nextSectionIndex));
nextSectionIndex = log.indexOf(s_sectionHeader, s_sectionHeader.length());
sectionCount = log.count(s_sectionHeader);
}
d->logFile.close();
d->logFile.open(QFile::WriteOnly);
d->logFile.write(log.toUtf8());
d->logFile.close();
}
d->logFile.close();
d->logFile.open(QFile::WriteOnly);
d->logFile.write(log.toUtf8());
d->logFile.close();
}
......@@ -45,6 +45,8 @@
#include <KoSelection.h>
#include <KoShapeController.h>
#include <KisUsageLogger.h>
#include <kis_lod_transform.h>
#include "kis_tool_proxy.h"
#include "kis_coordinates_converter.h"
......@@ -1264,6 +1266,8 @@ void KisCanvas2::setLodAllowedInCanvas(bool value)
KisConfig cfg(false);
cfg.setLevelOfDetailEnabled(m_d->lodAllowedInImage);
KisUsageLogger::log(QString("Instant Preview Setting: %1").arg(m_d->lodAllowedInImage));
}
bool KisCanvas2::lodAllowedInCanvas() const
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment