1/*
2 SPDX-FileCopyrightText: 2023 Alexander Lohnau <alexander.lohnau@gmx.de>
3 SPDX-License-Identifier: LGPL-2.0-or-later
4*/
5#include "kdesktopfileaction.h"
6#include <QSharedData>
7
8class KDesktopFileActionPrivate : public QSharedData
9{
10public:
11 QString m_internalActionKey;
12 QString m_name;
13 QString m_icon;
14 QString m_exec;
15 QString m_desktopFilePath;
16
17 KDesktopFileActionPrivate(const QString &name, const QString &text, const QString &icon, const QString &exec, const QString &desktopFilePath)
18 : m_internalActionKey(name)
19 , m_name(text)
20 , m_icon(icon)
21 , m_exec(exec)
22 , m_desktopFilePath(desktopFilePath)
23 {
24 }
25 KDesktopFileActionPrivate() = default;
26};
27
28KDesktopFileAction::KDesktopFileAction(const QString &name, const QString &text, const QString &icon, const QString &exec, const QString &desktopFilePath)
29 : d(new KDesktopFileActionPrivate(name, text, icon, exec, desktopFilePath))
30{
31}
32
33KDesktopFileAction::KDesktopFileAction()
34 : d(new KDesktopFileActionPrivate())
35{
36}
37
38KDesktopFileAction::KDesktopFileAction(const KDesktopFileAction &other) = default;
39KDesktopFileAction &KDesktopFileAction::operator=(const KDesktopFileAction &other) = default;
40KDesktopFileAction::KDesktopFileAction(KDesktopFileAction &&other) = default;
41KDesktopFileAction &KDesktopFileAction::operator=(KDesktopFileAction &&other) = default;
42KDesktopFileAction::~KDesktopFileAction() = default;
43
44QString KDesktopFileAction::actionsKey() const
45{
46 return d->m_internalActionKey;
47}
48
49QString KDesktopFileAction::desktopFilePath() const
50{
51 return d->m_desktopFilePath;
52}
53
54QString KDesktopFileAction::name() const
55{
56 return d->m_name;
57}
58
59QString KDesktopFileAction::icon() const
60{
61 return d->m_icon;
62}
63
64QString KDesktopFileAction::exec() const
65{
66 return d->m_exec;
67}
68
69bool KDesktopFileAction::isSeparator() const
70{
71 return d->m_internalActionKey == QLatin1String("_SEPARATOR_");
72}
73

source code of kconfig/src/core/kdesktopfileaction.cpp