File indexing completed on 2024-05-19 05:49:17

0001 /*
0002     SPDX-FileCopyrightText: 2007 Nicolas Ternisien <nicolas.ternisien@gmail.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #include "postfixLogMode.h"
0008 
0009 #include <KLocalizedString>
0010 
0011 #include "ksystemlog_debug.h"
0012 
0013 #include "postfixAnalyzer.h"
0014 #include "postfixConfiguration.h"
0015 #include "postfixConfigurationWidget.h"
0016 
0017 #include "logModeItemBuilder.h"
0018 
0019 PostfixLogMode::PostfixLogMode()
0020     : LogMode(QStringLiteral(POSTFIX_LOG_MODE_ID), i18n("Postfix Log"), QStringLiteral(POSTFIX_MODE_ICON))
0021 {
0022     d->logModeConfiguration = QSharedPointer<PostfixConfiguration>(new PostfixConfiguration());
0023 
0024     d->logModeConfigurationWidget = new PostfixConfigurationWidget();
0025 
0026     d->itemBuilder = new LogModeItemBuilder();
0027 
0028     d->action = createDefaultAction();
0029     d->action->setToolTip(i18n("Display the Postfix log."));
0030     d->action->setWhatsThis(
0031         i18n("Displays the Postfix log in the current tab. Postfix is the most known and used mail server in the "
0032              "Linux world."));
0033 
0034     checkLogFilesPresence(logModeConfiguration<PostfixConfiguration *>()->logFilesPaths());
0035 }
0036 
0037 PostfixLogMode::~PostfixLogMode()
0038 {
0039 }
0040 
0041 Analyzer *PostfixLogMode::createAnalyzer(const QVariant &options)
0042 {
0043     Q_UNUSED(options)
0044     return new PostfixAnalyzer(this);
0045 }
0046 
0047 QVector<LogFile> PostfixLogMode::createLogFiles()
0048 {
0049     return logModeConfiguration<PostfixConfiguration *>()->findGenericLogFiles();
0050 }
0051 
0052 #include "moc_postfixLogMode.cpp"