KRunner

action.cpp
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}
34 : d(new ActionPrivate())
35{
36}
37
38Action::~Action() = default;
39Action &Action::operator=(const Action &other)
40{
41 d.reset(new ActionPrivate(*other.d));
42 return *this;
43}
44
45QString Action::id() const
46{
47 return d->m_id;
48}
50{
51 return d->m_text;
52}
54{
55 return d->m_iconSource;
56}
57}
58
59#include "moc_action.cpp"
This class represents an action that will be shown next to a match.
Definition action.h:23
QString text
User-visible text.
Definition action.h:26
Action()
Empty constructor creating invalid action.
Definition action.cpp:33
QString iconSource
Source for the icon: Name of the icon from a theme, file path or file URL.
Definition action.h:28
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 24 2024 12:01:02 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.