KConfig

kdesktopfileaction.cpp
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
34 : d(new KDesktopFileActionPrivate())
35{
36}
37
39KDesktopFileAction &KDesktopFileAction::operator=(const KDesktopFileAction &other) = default;
41KDesktopFileAction &KDesktopFileAction::operator=(KDesktopFileAction &&other) = default;
42KDesktopFileAction::~KDesktopFileAction() = default;
43
45{
46 return d->m_internalActionKey;
47}
48
50{
51 return d->m_desktopFilePath;
52}
53
55{
56 return d->m_name;
57}
58
60{
61 return d->m_icon;
62}
63
65{
66 return d->m_exec;
67}
68
70{
71 return d->m_internalActionKey == QLatin1String("_SEPARATOR_");
72}
Class for representing an Action of a desktop file.
QString actionsKey() const
bool isSeparator() const
Returns whether the action is a separator.
QString desktopFilePath() const
KDesktopFileAction()
Construct an empty KDesktopFileAction.
QString name(StandardAction id)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jun 14 2024 11:57:17 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.