File indexing completed on 2024-05-12 05:48:40
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 "sambaAccessLogMode.h" 0008 0009 #include <QAction> 0010 0011 #include <KLocalizedString> 0012 0013 #include "ksystemlog_debug.h" 0014 0015 #include "sambaAnalyzer.h" 0016 #include "sambaConfiguration.h" 0017 #include "sambaConfigurationWidget.h" 0018 #include "sambaItemBuilder.h" 0019 0020 SambaAccessLogMode::SambaAccessLogMode(QSharedPointer<SambaConfiguration> &sambaConfiguration, 0021 SambaConfigurationWidget *sambaConfigurationWidget, 0022 SambaItemBuilder *itemBuilder) 0023 : LogMode(QStringLiteral(SAMBA_ACCESS_LOG_MODE_ID), i18n("Samba Access Log"), QStringLiteral(SAMBA_ACCESS_MODE_ICON)) 0024 { 0025 d->logModeConfiguration = sambaConfiguration; 0026 d->logModeConfigurationWidget = sambaConfigurationWidget; 0027 d->itemBuilder = itemBuilder; 0028 0029 // Samba Log Action 0030 d->action = createDefaultAction(); 0031 d->action->setToolTip(i18n("Display the Samba Access log.")); 0032 d->action->setWhatsThis( 0033 i18n("Displays the Samba Access log in the current tab. This log mode allows you to see connections " 0034 "between your shares and remote hosts.")); 0035 0036 checkLogFilesPresence(sambaConfiguration->sambaAccessPaths()); 0037 } 0038 0039 SambaAccessLogMode::~SambaAccessLogMode() 0040 { 0041 } 0042 0043 Analyzer *SambaAccessLogMode::createAnalyzer(const QVariant &options) 0044 { 0045 Q_UNUSED(options) 0046 return new SambaAnalyzer(this); 0047 } 0048 0049 QVector<LogFile> SambaAccessLogMode::createLogFiles() 0050 { 0051 auto *sambaConfiguration = logModeConfiguration<SambaConfiguration *>(); 0052 return sambaConfiguration->findNoModeLogFiles(sambaConfiguration->sambaAccessPaths()); 0053 } 0054 0055 #include "moc_sambaAccessLogMode.cpp"