1// SPDX-FileCopyrightText: 2023 Alexander Lohnau <alexander.lohnau@gmx.de>
2// SPDX-License-Identifier: LGPL-2.0-or-later
3#include "action.h"
4
5#include <QIcon>
6
7namespace KRunner
8{
9class ActionPrivate
10{
11public:
12 explicit ActionPrivate(const QString id, const QString text, const QString iconName)
13 : m_id(id)
14 , m_text(text)
15 , m_iconSource(iconName)
16 {
17 }
18 explicit ActionPrivate() = default;
19 explicit ActionPrivate(const ActionPrivate &action) = default;
20 const QString m_id;
21 const QString m_text;
22 const QString m_iconSource;
23};
24
25Action::Action(const QString &id, const QString &iconName, const QString &text)
26 : d(new ActionPrivate(id, text, iconName))
27{
28}
29Action::Action(const Action &action)
30 : d(new ActionPrivate(*action.d))
31{
32}
33Action::Action()
34 : d(new ActionPrivate())
35{
36}
37
38Action::~Action() = default;
39Action &Action::operator=(const Action &other)
40{
41 d.reset(p: new ActionPrivate(*other.d));
42 return *this;
43}
44
45QString Action::id() const
46{
47 return d->m_id;
48}
49QString Action::text() const
50{
51 return d->m_text;
52}
53QString Action::iconSource() const
54{
55 return d->m_iconSource;
56}
57}
58
59#include "moc_action.cpp"
60

source code of krunner/src/action.cpp