1 /* 2 KApacheLog, a apache log viewer tool 3 SPDX-FileCopyrightText: 2007 Nicolas Ternisien <nicolas.ternisien@gmail.com> 4 5 SPDX-License-Identifier: GPL-2.0-or-later 6 */ 7 8 #include "xorgConfigurationWidget.h" 9 XorgConfigurationWidget()10XorgConfigurationWidget::XorgConfigurationWidget() 11 : LogModeConfigurationWidget(i18n("X.org Log"), QStringLiteral(XORG_MODE_ICON), i18n("X.org Log")) 12 { 13 auto layout = new QHBoxLayout(this); 14 15 mFileList = new FileList(this, i18n("<p>These files will be analyzed to show the <b>X.org log</b>.</p>")); 16 connect(mFileList, &FileList::fileListChanged, this, &LogModeConfigurationWidget::configurationChanged); 17 layout->addWidget(mFileList); 18 } 19 saveConfig()20void XorgConfigurationWidget::saveConfig() 21 { 22 auto *xorgConfiguration = Globals::instance().findLogMode(QStringLiteral(XORG_LOG_MODE_ID))->logModeConfiguration<XorgConfiguration *>(); 23 24 xorgConfiguration->setXorgPaths(mFileList->paths()); 25 } 26 readConfig()27void XorgConfigurationWidget::readConfig() 28 { 29 auto *xorgConfiguration = Globals::instance().findLogMode(QStringLiteral(XORG_LOG_MODE_ID))->logModeConfiguration<XorgConfiguration *>(); 30 31 mFileList->removeAllItems(); 32 33 mFileList->addPaths(xorgConfiguration->xorgPaths()); 34 } 35 defaultConfig()36void XorgConfigurationWidget::defaultConfig() 37 { 38 // TODO Find a way to read the configuration per default 39 readConfig(); 40 } 41 isValid() const42bool XorgConfigurationWidget::isValid() const 43 { 44 if (!mFileList->isEmpty()) { 45 return true; 46 } 47 48 return false; 49 } 50