KDesktopFileAction Class
Class for representing an Action of a desktop file. More...
| Header: | #include <KDesktopFileAction> |
| CMake: | find_package(KF6 REQUIRED COMPONENTS Config)target_link_libraries(mytarget PRIVATE KF6::ConfigCore) |
| Since: | 6.0 |
Public Functions
| KDesktopFileAction() | |
| KDesktopFileAction(const QString &name, const QString &text, const QString &icon, const QString &exec, const QString &desktopFilePath) | |
| QString | actionsKey() const |
| QString | desktopFilePath() const |
| QString | exec() const |
| QString | icon() const |
| bool | isSeparator() const |
| QString | name() const |
Detailed Description
This represents an Action following the freedesktop Desktop Entry Spec.
See also KDesktopFile.
Member Function Documentation
[explicit] KDesktopFileAction::KDesktopFileAction()
Constructs an empty KDesktopFileAction.
Needed so the Action can be stored in containers that require type T to be default constructible (such as QVariant).
[explicit] KDesktopFileAction::KDesktopFileAction(const QString &name, const QString &text, const QString &icon, const QString &exec, const QString &desktopFilePath)
Constructs a KDesktopFileAction at the given desktopFilePath with all minimum required properties name, text, icon, and exec.
QString KDesktopFileAction::actionsKey() const
Returns the action's internal name.
For instance "Actions=Setup;"... and the group "[Desktop Action Setup]" define an action with the name "Setup".
QString KDesktopFileAction::desktopFilePath() const
Returns the path of the desktop file this action was loaded from.
QString KDesktopFileAction::exec() const
Returns the action's exec command, as defined by the "Exec=" key in the desktop action group.
QString KDesktopFileAction::icon() const
Returns the action's icon, as defined by the "Icon=" key in the desktop action group.
bool KDesktopFileAction::isSeparator() const
Returns whether the action is a separator.
This is true when actionsKey contains "_SEPARATOR_".
QString KDesktopFileAction::name() const
Returns the action's name, as defined by the "Name=" key in the desktop action group.