1 /*
2     SPDX-FileCopyrightText: 2007 Nicolas Ternisien <nicolas.ternisien@gmail.com>
3 
4     SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 #include "kernelLogMode.h"
8 
9 #include <KLocalizedString>
10 
11 #include "ksystemlog_debug.h"
12 
13 #include "kernelAnalyzer.h"
14 #include "kernelItemBuilder.h"
15 
16 #include <QAction>
17 
KernelLogMode()18 KernelLogMode::KernelLogMode()
19     : LogMode(QStringLiteral(KERNEL_LOG_MODE_ID), i18n("Kernel Log"), QStringLiteral(KERNEL_MODE_ICON))
20 {
21     d->logModeConfigurationWidget = nullptr;
22 
23     d->itemBuilder = new KernelItemBuilder();
24 
25     d->action = createDefaultAction();
26     d->action->setToolTip(i18n("Display the kernel log."));
27     d->action->setWhatsThis(
28         i18n("Displays the kernel log in the current tab. This log is only useful for users who want to know why "
29              "the Kernel does not detect their hardware or what is the cause of the last <i>kernel "
30              "panic/oops</i>."));
31 }
32 
~KernelLogMode()33 KernelLogMode::~KernelLogMode()
34 {
35 }
36 
createAnalyzer(const QVariant & options)37 Analyzer *KernelLogMode::createAnalyzer(const QVariant &options)
38 {
39     Q_UNUSED(options)
40     return new KernelAnalyzer(this);
41 }
42 
createLogFiles()43 QVector<LogFile> KernelLogMode::createLogFiles()
44 {
45     const QVector<LogFile> logFiles{LogFile(QUrl::fromLocalFile(QStringLiteral("/bin/dmesg")), Globals::instance().informationLogLevel())};
46     return logFiles;
47 }
48