Commit a109a38d authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

const'ify variables

parent 993c3eae
......@@ -58,7 +58,7 @@ Analyzer *OpenLogMode::createAnalyzer(const QVariant &options)
QList<LogFile> OpenLogMode::createLogFiles()
{
// Open a standard Filedialog
QUrl openingFileName(QFileDialog::getOpenFileUrl(parent, i18n("Open Location"), QUrl(), QString()));
const QUrl openingFileName(QFileDialog::getOpenFileUrl(parent, i18n("Open Location"), QUrl(), QString()));
logDebug() << "Opening file : " << openingFileName.url();
if (openingFileName.isEmpty()) {
......@@ -66,14 +66,14 @@ QList<LogFile> OpenLogMode::createLogFiles()
}
if (openingFileName.isValid()) {
LogFile logFile(openingFileName, Globals::instance().informationLogLevel());
const LogFile logFile(openingFileName, Globals::instance().informationLogLevel());
QList<LogFile> logFiles;
logFiles.append(logFile);
return logFiles;
}
QString message(i18n("Malformed URL. Unable to open this file."));
const QString message(i18n("Malformed URL. Unable to open this file."));
KMessageBox::error(parent, message, i18n("Unable to open this file."), KMessageBox::Notify);
return QList<LogFile>();
......
......@@ -31,8 +31,7 @@
QList<LogMode *> PostfixLogModeFactory::createLogModes() const
{
QList<LogMode *> logModes;
logModes.append(new PostfixLogMode());
const QList<LogMode *> logModes {new PostfixLogMode()};
return logModes;
}
......
......@@ -31,8 +31,7 @@
QList<LogMode *> SystemLogModeFactory::createLogModes() const
{
QList<LogMode *> logModes;
logModes.append(new SystemLogMode());
const QList<LogMode *> logModes {new SystemLogMode()};
return logModes;
}
......
......@@ -60,9 +60,7 @@ LogLine *XorgAnalyzer::parseMessage(const QString &logLine, const LogFile &origi
{
QString string(logLine);
QString type;
type = string.left(4);
const QString type = string.left(4);
LogLevel *logLineType = findTypeName(type);
......
......@@ -31,8 +31,7 @@
QList<LogMode *> XorgLogModeFactory::createLogModes() const
{
QList<LogMode *> logModes;
logModes.append(new XorgLogMode());
const QList<LogMode *> logModes {new XorgLogMode()};
return logModes;
}
......
......@@ -31,8 +31,7 @@
QList<LogMode *> XSessionLogModeFactory::createLogModes() const
{
QList<LogMode *> logModes;
logModes.append(new XSessionLogMode());
const QList<LogMode *> logModes {new XSessionLogMode()};
return logModes;
}
......
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