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

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 "xsessionConfiguration.h"
0008 
0009 XSessionConfiguration::XSessionConfiguration()
0010 {
0011     mConfiguration->setCurrentGroup(QStringLiteral("XSessionLogMode"));
0012 
0013     mConfiguration->addItemString(QStringLiteral("LogFilePath"), mXsessionPath, QStringLiteral("~/.xsession-errors"), QStringLiteral("LogFilePath"));
0014 
0015     mConfiguration->addItemBool(QStringLiteral("IgnoreXorgErrors"), mIgnoreXorgErrors, false, QStringLiteral("IgnoreXorgErrors"));
0016 
0017     QStringList defaultXorgErrorKeywords;
0018     defaultXorgErrorKeywords.append(QStringLiteral("X Error"));
0019     defaultXorgErrorKeywords.append(QStringLiteral("  Major opcode"));
0020     defaultXorgErrorKeywords.append(QStringLiteral("  Minor opcode"));
0021     defaultXorgErrorKeywords.append(QStringLiteral("  Resource id"));
0022     mConfiguration->addItemStringList(QStringLiteral("XorgErrorKeywords"), mXorgErrorKeywords, defaultXorgErrorKeywords, QStringLiteral("XorgErrorKeywords"));
0023 
0024     const QStringList defaultWarningKeywords{QStringLiteral("WARNING")};
0025     mConfiguration->addItemStringList(QStringLiteral("WarningKeywords"), mWarningKeywords, defaultWarningKeywords, QStringLiteral("WarningKeywords"));
0026 
0027     const QStringList defaultErrorKeywords{QStringLiteral("ERROR")};
0028     mConfiguration->addItemStringList(QStringLiteral("ErrorKeywords"), mErrorKeywords, defaultErrorKeywords, QStringLiteral("ErrorKeywords"));
0029 }
0030 
0031 XSessionConfiguration::~XSessionConfiguration()
0032 {
0033 }
0034 
0035 QStringList XSessionConfiguration::xorgErrorKeywords() const
0036 {
0037     return mXorgErrorKeywords;
0038 }
0039 
0040 bool XSessionConfiguration::isIgnoreXorgErrors() const
0041 {
0042     return mIgnoreXorgErrors;
0043 }
0044 
0045 void XSessionConfiguration::setIgnoreXorgErrors(bool ignore)
0046 {
0047     mIgnoreXorgErrors = ignore;
0048 }
0049 
0050 QString XSessionConfiguration::xsessionPath() const
0051 {
0052     return mXsessionPath;
0053 }
0054 
0055 void XSessionConfiguration::setXSessionPath(const QString &xsessionPath)
0056 {
0057     mXsessionPath = xsessionPath;
0058 }
0059 
0060 QStringList XSessionConfiguration::warningKeywords() const
0061 {
0062     return mWarningKeywords;
0063 }
0064 
0065 QStringList XSessionConfiguration::errorKeywords() const
0066 {
0067     return mErrorKeywords;
0068 }
0069 
0070 #include "moc_xsessionConfiguration.cpp"