Warning, file /plasma/plasma-systemmonitor/src/CommandLineArguments.cpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /**
0002  * SPDX-FileCopyrightText: 2023 Arjen Hiemstra <ahiemstra@heimr.nl>
0003  *
0004  * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005  */
0006 
0007 #include "CommandLineArguments.h"
0008 
0009 using namespace Qt::StringLiterals;
0010 
0011 CommandLineArguments::CommandLineArguments(QObject *parent)
0012     : QObject(parent)
0013 {
0014 }
0015 
0016 QString CommandLineArguments::pageId() const
0017 {
0018     if (s_commandLineParser) {
0019         return s_commandLineParser->value(u"page-id"_s);
0020     }
0021 
0022     return QString{};
0023 }
0024 
0025 QString CommandLineArguments::pageName() const
0026 {
0027     if (s_commandLineParser) {
0028         return s_commandLineParser->value(u"page-name"_s);
0029     }
0030 
0031     return QString{};
0032 }
0033 
0034 QVariant CommandLineArguments::aboutData() const
0035 {
0036     return QVariant::fromValue(KAboutData::applicationData());
0037 }
0038 
0039 void CommandLineArguments::setCommandLineParser(std::shared_ptr<QCommandLineParser> parser)
0040 {
0041     s_commandLineParser = parser;
0042 }