Commit e7a37425 authored by Hannah von Reth's avatar Hannah von Reth Committed by Nicolas Fella
Browse files

Replace url().path() with url().toLocalFile()

This fixes support for no unix platforms.
toLocalFile() results in C:/foo instead of /C:/foo
parent 303c7cb5
......@@ -66,7 +66,7 @@ void FileAnalyzer::deleteLogFiles()
// Remove the watching on the monitored files
foreach (LogFileReader *logFileReader, logFileReaders) {
logDebug() << "Remove file : " << logFileReader->logFile().url().path();
logDebug() << "Remove file : " << logFileReader->logFile().url().toLocalFile();
delete logFileReader;
}
......@@ -91,7 +91,7 @@ void FileAnalyzer::setLogFiles(const QList<LogFile> &logFiles)
void FileAnalyzer::logFileChanged(LogFileReader *logFileReader, ReadingMode readingMode,
const QStringList &content)
{
QString filePath = logFileReader->logFile().url().path();
QString filePath = logFileReader->logFile().url().toLocalFile();
if (readingMode == Analyzer::FullRead)
logDebug() << "File " << filePath << " has been modified on full read.";
else
......@@ -153,7 +153,7 @@ int FileAnalyzer::insertLines(const QStringList &bufferedLines, const LogFile &l
// If there is no line
if (bufferedLines.isEmpty()) {
logWarning() << "File is empty : " << logFile.url().path();
logWarning() << "File is empty : " << logFile.url().toLocalFile();
}
int stop = 0;
......@@ -196,7 +196,7 @@ int FileAnalyzer::insertLines(const QStringList &bufferedLines, const LogFile &l
++currentPosition;
}
logDebug() << "Total read lines :" << (bufferedLines.size() - stop) << "(" << logFile.url().path() << ")";
logDebug() << "Total read lines :" << (bufferedLines.size() - stop) << "(" << logFile.url().toLocalFile() << ")";
return insertedLogLineCount;
}
......
......@@ -62,13 +62,13 @@ KioLogFileReader::KioLogFileReader(const LogFile &logFile)
d->fileWatch = new KDirWatch(this);
connect(d->fileWatch, &KDirWatch::dirty, this, &KioLogFileReader::watchFile);
d->fileWatch->addFile(logFile.url().path());
d->fileWatch->addFile(logFile.url().toLocalFile());
/*
d->fileWatch.setInterval(1000);
connect(& (d->fileWatch), SIGNAL(timeout()), this, SLOT(watchFile()));
*/
logDebug() << "Starting " << logFile.url().path();
logDebug() << "Starting " << logFile.url().toLocalFile();
}
KioLogFileReader::~KioLogFileReader()
......
......@@ -91,20 +91,20 @@ void LoadingBar::startLoading(const LogMode &logMode, const LogFile &logFile, in
if (d->firstLoading)
d->label->setText(i18np("Loading <b>%2</b>...<br /><i>%3</i> - (<b>%4</b>)",
"Loading <b>%2</b>...<br /><i>%3</i> - (<b>%4</b>/%1 files)", fileCount,
logMode.name(), logFile.url().path(), fileIndex));
logMode.name(), logFile.url().toLocalFile(), fileIndex));
else
d->label->setText(i18np("Reloading <b>%2</b>...<br /><i>%3</i> - (<b>%4</b>)",
"Reloading <b>%2</b>...<br /><i>%3</i> - (<b>%4</b>/%1 files)", fileCount,
logMode.name(), logFile.url().path(), fileIndex));
logMode.name(), logFile.url().toLocalFile(), fileIndex));
}
// Only one file
else {
if (d->firstLoading)
d->label->setText(
i18n("Loading <b>%1</b>...<br /><i>%2</i>", logMode.name(), logFile.url().path()));
i18n("Loading <b>%1</b>...<br /><i>%2</i>", logMode.name(), logFile.url().toLocalFile()));
else
d->label->setText(
i18n("Reloading <b>%1</b>...<br /><i>%2</i>", logMode.name(), logFile.url().path()));
i18n("Reloading <b>%1</b>...<br /><i>%2</i>", logMode.name(), logFile.url().toLocalFile()));
}
}
......
......@@ -80,13 +80,13 @@ void LocalLogFileReader::init()
// Init current file position
d->previousFilePosition = 0;
logDebug() << "Reading local file " << d->logFile.url().path();
logDebug() << "Reading local file " << d->logFile.url().toLocalFile();
}
void LocalLogFileReader::watchFile(bool enable)
{
Q_D(LocalLogFileReader);
QString filePath = d->logFile.url().path();
QString filePath = d->logFile.url().toLocalFile();
if (enable == true) {
logDebug() << "Monitoring file : " << filePath;
......@@ -108,7 +108,7 @@ void LocalLogFileReader::watchFile(bool enable)
QIODevice *LocalLogFileReader::open()
{
Q_D(LocalLogFileReader);
QString filePath = d->logFile.url().path();
const QString filePath = d->logFile.url().toLocalFile();
if (d->logFile.url().isValid() == false) {
QString message(i18n("This file is not valid. Please adjust it in the settings of KSystemLog."));
......@@ -186,7 +186,7 @@ QStringList LocalLogFileReader::readContent(QIODevice *inputDevice)
// Get the size file for the next calculation
d->previousFilePosition = inputDevice->size();
logDebug() << "New file position : " << d->previousFilePosition << " (" << d->logFile.url().path() << ")";
logDebug() << "New file position : " << d->previousFilePosition << " (" << d->logFile.url().toLocalFile() << ")";
return rawBuffer;
}
......@@ -203,13 +203,13 @@ void LocalLogFileReader::logFileModified()
QIODevice *inputDevice = open();
if (inputDevice == nullptr) {
logCritical() << "Could not open file " << d->logFile.url().path();
logCritical() << "Could not open file " << d->logFile.url().toLocalFile();
return;
}
// If there are new lines in the file, insert only them or this is the first time we read this file
if (d->previousFilePosition != 0 && d->previousFilePosition <= inputDevice->size()) {
logDebug() << "Reading from position " << d->previousFilePosition << " (" << d->logFile.url().path()
logDebug() << "Reading from position " << d->previousFilePosition << " (" << d->logFile.url().toLocalFile()
<< ")";
if (inputDevice->isSequential()) {
......
......@@ -87,12 +87,12 @@ LogLevel *LogFile::defaultLogLevel() const
QDataStream &operator<<(QDataStream &out, const LogFile &logFile)
{
out << logFile.url().path();
out << logFile.url().toLocalFile();
return out;
}
QDebug &operator<<(QDebug &out, const LogFile &logFile)
{
out << logFile.url().path();
out << logFile.url().toLocalFile();
return out;
}
......@@ -212,12 +212,11 @@ LogFile LogModeConfiguration::findGenericLogFile(const QString &file)
{
LogLevel *level = Globals::instance().informationLogLevel();
QUrl url(file);
QUrl url = QUrl::fromLocalFile(file);
if (!url.isValid()) {
logWarning() << i18n("URL '%1' is not valid, skipping this URL.", url.path());
return LogFile(QUrl(), Globals::instance().noLogLevel());
}
return LogFile(url, level);
}
......@@ -240,7 +239,7 @@ QList<LogFile> LogModeConfiguration::findNoModeLogFiles(const QStringList &strin
LogLevel *level = Globals::instance().noLogLevel();
foreach (const QString &string, stringList) {
QUrl url(string);
QUrl url = QUrl::fromLocalFile(string);
if (!url.isValid()) {
logWarning() << i18n("URL '%1' is not valid, skipping this URL.", url.path());
continue;
......
......@@ -75,7 +75,7 @@ void ProcessOutputLogFileReader::init()
d->processUpdater.setInterval(PROCESS_OUTPUT_UPDATER_INTERVAL);
connect(&(d->processUpdater), &QTimer::timeout, this, &ProcessOutputLogFileReader::startProcess);
logDebug() << "Using process name " << d->logFile.url().path();
logDebug() << "Using process name " << d->logFile.url().toLocalFile();
}
void ProcessOutputLogFileReader::watchFile(bool enable)
......@@ -83,7 +83,7 @@ void ProcessOutputLogFileReader::watchFile(bool enable)
Q_D(ProcessOutputLogFileReader);
if (enable == true) {
logDebug() << "Monitoring process : " << d->logFile.url().path();
logDebug() << "Monitoring process : " << d->logFile.url().toLocalFile();
// Reinit current file position
d->previousLinesCount = 0;
......@@ -118,7 +118,7 @@ void ProcessOutputLogFileReader::startProcess()
connect(d->process, SIGNAL(finished(int,QProcess::ExitStatus)), this,
SLOT(emitProcessOutput(int,QProcess::ExitStatus)));
d->process->start(d->logFile.url().path(), QStringList(), QIODevice::ReadOnly | QIODevice::Text);
d->process->start(d->logFile.url().toLocalFile(), QStringList(), QIODevice::ReadOnly | QIODevice::Text);
d->process->waitForStarted();
......@@ -133,7 +133,7 @@ void ProcessOutputLogFileReader::closeProcess()
// Get the size file for the next calculation
d->previousLinesCount = d->availableStandardOutput.count();
logDebug() << "New lines count : " << d->previousLinesCount << " (" << d->logFile.url().path() << ")";
logDebug() << "New lines count : " << d->previousLinesCount << " (" << d->logFile.url().toLocalFile() << ")";
d->availableStandardOutput.clear();
......@@ -157,7 +157,7 @@ void ProcessOutputLogFileReader::emitProcessOutput(int /*exitCode*/, QProcess::E
<< d->availableStandardOutput.count() << "currently";
if (exitStatus == QProcess::CrashExit) {
QString message(i18n("The process '%1' crashed.", d->logFile.url().path()));
QString message(i18n("The process '%1' crashed.", d->logFile.url().toLocalFile()));
emit errorOccured(i18n("Process Crashed"), message);
emit statusBarChanged(message);
}
......@@ -171,7 +171,7 @@ void ProcessOutputLogFileReader::emitProcessOutput(int /*exitCode*/, QProcess::E
}
// If there are new lines in the file, insert only them or this is the first time we read this file
else if (d->previousLinesCount != 0 && d->previousLinesCount <= d->availableStandardOutput.count()) {
logDebug() << "Reading from line " << d->previousLinesCount << " (" << d->logFile.url().path() << ")";
logDebug() << "Reading from line " << d->previousLinesCount << " (" << d->logFile.url().toLocalFile() << ")";
QStringList newOutputs;
......
......@@ -234,7 +234,7 @@ void LoggerDialog::sendMessage()
if (fileActivation->isChecked()) {
arguments << QStringLiteral("-f");
arguments << file->url().path();
arguments << file->url().toLocalFile();
}
// Else, the user types the content of its message
else {
......
......@@ -116,7 +116,7 @@ protected:
list.append(message);
return new LogLine(logLineInternalIdGenerator++, QDateTime(date, time), list,
originalFile.url().path(), Globals::instance().informationLogLevel(), logMode);
originalFile.url().toLocalFile(), Globals::instance().informationLogLevel(), logMode);
}
};
......
......@@ -129,7 +129,7 @@ protected:
list.append(message);
list.append(url);
return new LogLine(logLineInternalIdGenerator++, dateTime, list, originalLogFile.url().path(),
return new LogLine(logLineInternalIdGenerator++, dateTime, list, originalLogFile.url().toLocalFile(),
Globals::instance().informationLogLevel(), logMode);
}
};
......
......@@ -137,7 +137,7 @@ protected:
list.append(line);
return new LogLine(logLineInternalIdGenerator++, QDateTime(date, time), list,
originalLogFile.url().path(), findLogLevel(level), logMode);
originalLogFile.url().toLocalFile(), findLogLevel(level), logMode);
}
private:
......
......@@ -97,7 +97,7 @@ public Q_SLOTS:
.findLogMode(QStringLiteral(AUTHENTICATION_LOG_MODE_ID))
->logModeConfiguration<AuthenticationConfiguration *>();
authenticationConfiguration->setAuthenticationPath(authenticationUrlRequester->url().path());
authenticationConfiguration->setAuthenticationPath(authenticationUrlRequester->url().toLocalFile());
}
void readConfig() override
......@@ -123,7 +123,7 @@ public Q_SLOTS:
protected:
bool isValid() const override
{
if (authenticationUrlRequester->url().path().isEmpty() == false) {
if (authenticationUrlRequester->url().toLocalFile().isEmpty() == false) {
return true;
}
......
......@@ -94,7 +94,7 @@ QStringList FileListHelper::findPaths(const QList<QUrl> &urls)
paths.append(foundPath);
}
} else {
paths.append(url.path());
paths.append(url.toLocalFile());
}
}
}
......@@ -119,7 +119,7 @@ bool FileListHelper::isValidFile(const QUrl &url)
}
// If it's a directory, it's not valid
if (QDir(url.path()).exists()) {
if (QDir(url.toLocalFile()).exists()) {
return false;
}
......@@ -156,19 +156,19 @@ QUrl FileListHelper::openUrl(const QString &originPath)
QStringList FileListHelper::expandJoker(const QUrl &url)
{
QDir directory = QDir(url.path().left(url.path().count() - url.fileName().count()));
const QFileInfo info(url.toLocalFile());
logDebug() << "Dir " << directory.path();
QString filename = url.fileName();
logDebug() << "Dir " << info.dir().path();
QString filename = info.fileName();
if (filename.isEmpty()) {
return QStringList();
}
QStringList foundPaths;
const QStringList files = directory.entryList(QStringList(filename), QDir::Files | QDir::NoSymLinks);
const QStringList files = info.dir().entryList(QStringList(filename), QDir::Files | QDir::NoSymLinks);
foreach (const QString &file, files) {
foundPaths.append(directory.absoluteFilePath(file));
foundPaths.append(info.dir().absoluteFilePath(file));
}
return foundPaths;
......
......@@ -101,7 +101,7 @@ QList<LogFile> GenericLogModeConfiguration::findGenericLogFiles()
else
level = Globals::instance().informationLogLevel();
QUrl url(stringValue);
const QUrl url = QUrl::fromLocalFile(stringValue);
if (!url.isValid()) {
logWarning() << i18n("URL '%1' is not valid, skipping this URL.", url.path());
continue;
......
......@@ -176,7 +176,7 @@ LogLine *SyslogAnalyzer::parseMessage(const QString &logLine, const LogFile &ori
list.append(process);
list.append(message);
return new LogLine(logLineInternalIdGenerator++, dateTime, list, originalFile.url().path(),
return new LogLine(logLineInternalIdGenerator++, dateTime, list, originalFile.url().toLocalFile(),
originalFile.defaultLogLevel(), logMode);
}
......@@ -185,7 +185,7 @@ inline LogLine *SyslogAnalyzer::undefinedLogLine(const QString &message, const L
QStringList items;
items << undefinedHostName() << undefinedProcess() << message;
return new LogLine(logLineInternalIdGenerator++, QDateTime::currentDateTime(), items,
originalFile.url().path(), originalFile.defaultLogLevel(), logMode);
originalFile.url().toLocalFile(), originalFile.defaultLogLevel(), logMode);
}
inline QString SyslogAnalyzer::undefinedHostName()
......
......@@ -104,7 +104,7 @@ protected:
LogLevel *logLevel = findLevel(capturedTexts.at(capturedTexts.count() - 1));
return new LogLine(logLineInternalIdGenerator++, dateTime, capturedTexts,
originalLogFile.url().path(), logLevel, logMode);
originalLogFile.url().toLocalFile(), logLevel, logMode);
}
inline LogLevel *findLevel(const QString &status) const
......
......@@ -63,7 +63,7 @@ LogLine *CupsAnalyzer::parseMessage(const QString &logLine, const LogFile &origi
QStringList list;
list.append(message);
return new LogLine(logLineInternalIdGenerator++, dateTime, list, originalLogFile.url().path(),
return new LogLine(logLineInternalIdGenerator++, dateTime, list, originalLogFile.url().toLocalFile(),
findLogLevel(level), logMode);
}
......
......@@ -90,7 +90,7 @@ protected:
QDateTime dateTime = ParsingHelper::instance()->parseHttpDateTime(capturedTexts.takeAt(3));
return new LogLine(logLineInternalIdGenerator++, dateTime, capturedTexts,
originalLogFile.url().path(), Globals::instance().informationLogLevel(), logMode);
originalLogFile.url().toLocalFile(), Globals::instance().informationLogLevel(), logMode);
}
};
......
......@@ -99,7 +99,7 @@ protected:
LogLevel *logLevel = findLogLevel(capturedTexts.takeAt(0));
return new LogLine(logLineInternalIdGenerator++, dateTime, capturedTexts,
originalLogFile.url().path(), logLevel, logMode);
originalLogFile.url().toLocalFile(), logLevel, logMode);
}
LogLevel *findLogLevel(const QString &level)
......
......@@ -125,7 +125,7 @@ protected:
*/
LogLine *line
= new LogLine(logLineInternalIdGenerator++, dateTime, messages, originalLogFile.url().path(),
= new LogLine(logLineInternalIdGenerator++, dateTime, messages, originalLogFile.url().toLocalFile(),
Globals::instance().informationLogLevel(), logMode);
return line;
......
......@@ -136,7 +136,7 @@ protected:
LogLine *returnedLogLine = currentLogLine;
currentLogLine = new LogLine(logLineInternalIdGenerator++, QDateTime(date, time), list,
originalLogFile.url().path(),
originalLogFile.url().toLocalFile(),
Globals::instance().informationLogLevel(), logMode);
return returnedLogLine;
......
......@@ -77,7 +77,7 @@ LogLine *XorgAnalyzer::parseMessage(const QString &logLine, const LogFile &origi
list.append(logLineType->name());
list.append(string);
return new LogLine(logLineInternalIdGenerator++, currentDateTime, list, originalFile.url().path(),
return new LogLine(logLineInternalIdGenerator++, currentDateTime, list, originalFile.url().toLocalFile(),
logLineType, logMode);
}
......
......@@ -108,7 +108,7 @@ protected:
logLevel = Globals::instance().informationLogLevel();
return new LogLine(logLineInternalIdGenerator++, currentDateTime, QStringList() << program << message,
originalFile.url().path(), logLevel, logMode);
originalFile.url().toLocalFile(), logLevel, logMode);
}
private:
......
......@@ -89,7 +89,7 @@ public Q_SLOTS:
.findLogMode(QStringLiteral(X_SESSION_LOG_MODE_ID))
->logModeConfiguration<XSessionConfiguration *>();
configuration->setXSessionPath(xsessionUrlRequester->url().path());
configuration->setXSessionPath(xsessionUrlRequester->url().toLocalFile());
configuration->setIgnoreXorgErrors(ignoreXorgErrors->isChecked());
}
......@@ -118,7 +118,7 @@ public Q_SLOTS:
protected:
bool isValid() const override
{
if (xsessionUrlRequester->url().path().isEmpty() == false) {
if (xsessionUrlRequester->url().toLocalFile().isEmpty() == false) {
return true;
}
......
......@@ -117,7 +117,7 @@ void KernelAnalyzerTest::testUbuntuDmesg()
assertedDateTime = assertedDateTime.addSecs(22);
assertedDateTime = assertedDateTime.addMSecs(232);
testUtil.testLine(logLines.at(0), logFiles.at(0).url().path(), Globals::instance().informationLogLevel(),
testUtil.testLine(logLines.at(0), logFiles.at(0).url().toLocalFile(), Globals::instance().informationLogLevel(),
assertedDateTime, items);
testUtil.destroyReader(kernelAnalyzer);
......@@ -149,7 +149,7 @@ void KernelAnalyzerTest::testSuseDmesg()
QStringList items = QStringList() << QStringLiteral("r8169") << QStringLiteral("eth0: link down");
testUtil.testLine(logLines.at(0), logFiles.at(0).url().path(), Globals::instance().informationLogLevel(),
testUtil.testLine(logLines.at(0), logFiles.at(0).url().toLocalFile(), Globals::instance().informationLogLevel(),
kernelAnalyzer->findStartupTime(), items);
testUtil.destroyReader(kernelAnalyzer);
......
......@@ -95,7 +95,7 @@ void SystemAnalyzerTest::testOneLine()
<< QStringLiteral("[11663.656000] eth1: no IPv6 routers present");
const int year = QDate::currentDate().year();
testUtil.testLine(logLines.at(0), logFiles.at(0).url().path(), logFiles.at(0).defaultLogLevel(),
testUtil.testLine(logLines.at(0), logFiles.at(0).url().toLocalFile(), logFiles.at(0).defaultLogLevel(),
QDateTime(QDate(year, 8, 21), QTime(22, 52, 44)), items
);
......@@ -171,7 +171,7 @@ void SystemAnalyzerTest::testMultipleLines()
addedLines << QStringLiteral("Aug 18 17:04:28 localhost test: Test line 1");
addedLines << QStringLiteral("Aug 18 17:04:30 localhost test: Test line 2");
testUtil.addLogLines(logFile.url().path(), addedLines);
testUtil.addLogLines(logFile.url().toLocalFile(), addedLines);
// Assert that the model has been updated
QCOMPARE(model->itemCount(), 50);
......@@ -215,29 +215,29 @@ void SystemAnalyzerTest::testStrangeLines()
// Classical log line
items = QStringList() << QStringLiteral("localhost") << QStringLiteral("kernel")
<< QStringLiteral("Kernel panic");
testUtil.testLine(model->logLines().at(0), logFiles.at(0).url().path(), logFiles.at(0).defaultLogLevel(),
testUtil.testLine(model->logLines().at(0), logFiles.at(0).url().toLocalFile(), logFiles.at(0).defaultLogLevel(),
QDateTime(QDate(year, 8, 10), QTime(17, 04, 28)), items);
//-- MARK -- log line
items = QStringList() << QStringLiteral("localhost") << QStringLiteral("syslog")
<< QStringLiteral("-- MARK --");
testUtil.testLine(model->logLines().at(1), logFiles.at(0).url().path(), logFiles.at(0).defaultLogLevel(),
testUtil.testLine(model->logLines().at(1), logFiles.at(0).url().toLocalFile(), logFiles.at(0).defaultLogLevel(),
QDateTime(QDate(year, 8, 11), QTime(13, 49, 38)), items);
// Last message repeated n time log line
items = QStringList() << QStringLiteral("localhost") << QStringLiteral("syslog")
<< QStringLiteral("last message repeated 4 times");
testUtil.testLine(model->logLines().at(2), logFiles.at(0).url().path(), logFiles.at(0).defaultLogLevel(),
testUtil.testLine(model->logLines().at(2), logFiles.at(0).url().toLocalFile(), logFiles.at(0).defaultLogLevel(),
QDateTime(QDate(year, 8, 12), QTime(18, 10, 32)), items);
//"Aug 13 17:04:28 testprocess: Say ouhou " -> No host name
items = QStringList() << undefined << QStringLiteral("testprocess") << QStringLiteral("Say ouhou ");
testUtil.testLine(model->logLines().at(3), logFiles.at(0).url().path(), logFiles.at(0).defaultLogLevel(),
testUtil.testLine(model->logLines().at(3), logFiles.at(0).url().toLocalFile(), logFiles.at(0).defaultLogLevel(),
QDateTime(QDate(year, 8, 13), QTime(17, 04, 28)), items);
//"Aug 14 17:04:28 localhost kernel say ouhou" -> No process name and not a syslog message
items = QStringList() << QStringLiteral("localhost") << undefined << QStringLiteral("kernel say ouhou");
testUtil.testLine(model->logLines().at(4), logFiles.at(0).url().path(), logFiles.at(0).defaultLogLevel(),
testUtil.testLine(model->logLines().at(4), logFiles.at(0).url().toLocalFile(), logFiles.at(0).defaultLogLevel(),
QDateTime(QDate(year, 8, 14), QTime(17, 04, 28)), items);
//"Aug 15 22:39:01 localhost /USR/SBIN/CRON[9433]: (root) CMD ( [ -d /var/lib/php5 ] && find
......@@ -246,7 +246,7 @@ void SystemAnalyzerTest::testStrangeLines()
<< QStringLiteral(
"(root) CMD ( [ -d /var/lib/php5 ] && find /var/lib/php5/ -type f -cmin "
"+$(/usr/lib/php5/maxlifetime) -print0 | xargs -r -0 rm)");
testUtil.testLine(model->logLines().at(5), logFiles.at(0).url().path(), logFiles.at(0).defaultLogLevel(),
testUtil.testLine(model->logLines().at(5), logFiles.at(0).url().toLocalFile(), logFiles.at(0).defaultLogLevel(),
QDateTime(QDate(year, 8, 15), QTime(22, 39, 01)), items);
//"blablalbla" -> Invalid line
......@@ -321,7 +321,7 @@ void SystemAnalyzerTest::testMaxLines()
QStringList addedLines;
addedLines << QStringLiteral("Aug 18 10:00:00 localhost test: Line 8");
testUtil.addLogLines(logFile.url().path(), addedLines);
testUtil.addLogLines(logFile.url().toLocalFile(), addedLines);
QCOMPARE(model->itemCount(), 5);
compareWithMinTime(model->logLines(), QDateTime(QDate(2007, 8, 18), QTime(11, 0, 0)));
......@@ -332,7 +332,7 @@ void SystemAnalyzerTest::testMaxLines()
addedLines.clear();
addedLines << QStringLiteral("Aug 18 10:00:00 localhost test: Line 9");
addedLines << QStringLiteral("Aug 18 19:00:00 localhost test: Line 10");
testUtil.addLogLines(logFile.url().path(), addedLines);
testUtil.addLogLines(logFile.url().toLocalFile(), addedLines);
QCOMPARE(model->itemCount(), 6);
compareWithMinTime(model->logLines(), QDateTime(QDate(2007, 8, 18), QTime(11, 0, 0)));
......@@ -340,7 +340,7 @@ void SystemAnalyzerTest::testMaxLines()
addedLines.clear();
addedLines << QStringLiteral("Aug 18 20:00:00 localhost test: Line 11");
addedLines << QStringLiteral("Aug 18 21:00:00 localhost test: Line 12");
testUtil.addLogLines(logFile.url().path(), addedLines);
testUtil.addLogLines(logFile.url().toLocalFile(), addedLines);
QCOMPARE(model->itemCount(), 6);
compareWithMinTime(model->logLines(), QDateTime(QDate(2007, 8, 18), QTime(13, 0, 0)));
......
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