KDesktopFileActions
Functions | |
KIOWIDGETS_EXPORT QList< KServiceAction > | builtinServices (const QUrl &url) |
KIOWIDGETS_EXPORT void | executeService (const QList< QUrl > &urls, const KServiceAction &service) |
KIOWIDGETS_EXPORT bool | run (const QUrl &_url, bool _is_local) |
KIOWIDGETS_EXPORT bool | runWithStartup (const QUrl &_url, bool _is_local, const QByteArray &asn) |
KIOWIDGETS_EXPORT QList< KServiceAction > | userDefinedServices (const KService &service, bool bLocalFiles, const QList< QUrl > &file_list=QList< QUrl >()) |
KIOWIDGETS_EXPORT QList< KServiceAction > | userDefinedServices (const QString &path, bool bLocalFiles) |
KIOWIDGETS_EXPORT QList< KServiceAction > | userDefinedServices (const QString &path, const KDesktopFile &desktopFile, bool bLocalFiles, const QList< QUrl > &file_list=QList< QUrl >()) |
Detailed Description
KDesktopFileActions provides a number of methods related to actions in desktop files.
Function Documentation
◆ builtinServices()
QList< KServiceAction > KDesktopFileActions::builtinServices | ( | const QUrl & | url | ) |
Returns a list of services for the given .desktop file that are handled by KIO itself.
Namely mount/unmount for FSDevice files.
- Returns
- the list of services
- Deprecated:
- since 5.82, FSDevice .desktop file template hasn't been installed for a long time. And users don't seem to mount devices using that method any more.
Definition at line 150 of file kdesktopfileactions.cpp.
◆ executeService()
void KDesktopFileActions::executeService | ( | const QList< QUrl > & | urls, |
const KServiceAction & | service | ||
) |
Execute service
on the list of urls
.
- Parameters
-
urls the list of urls service the service to execute
- Deprecated:
- Since 5.84, use KIO::ApplicationLauncherJob instead; for example:
Definition at line 266 of file kdesktopfileactions.cpp.
◆ run()
bool KDesktopFileActions::run | ( | const QUrl & | _url, |
bool | _is_local | ||
) |
Invokes the default action for the desktop entry.
If the desktop entry is not local, then only false is returned. Otherwise we would create a security problem. Only types Link and Mimetype could be followed.
- Parameters
-
_url the url to run _is_local true if the URL is local, false otherwise
- Returns
- true on success and false on failure.
- See also
- KRun::runUrl
- Deprecated:
- since 5.71, use OpenUrlJob instead
Definition at line 39 of file kdesktopfileactions.cpp.
◆ runWithStartup()
bool KDesktopFileActions::runWithStartup | ( | const QUrl & | _url, |
bool | _is_local, | ||
const QByteArray & | asn | ||
) |
Invokes the default action for the desktop entry.
If the desktop entry is not local, then only false is returned. Otherwise we would create a security problem. Only types Link and Mimetype could be followed.
Use this function if a startup notification id has already been created.
- Parameters
-
_url the url to run _is_local true if the URL is local, false otherwise asn Application startup notification id, if available
- Returns
- true on success and false on failure.
- See also
- KRun::runUrl
- Since
- 5.5
- Deprecated:
- since 5.71, use OpenUrlJob instead
Definition at line 46 of file kdesktopfileactions.cpp.
◆ userDefinedServices() [1/3]
QList< KServiceAction > KDesktopFileActions::userDefinedServices | ( | const KService & | service, |
bool | bLocalFiles, | ||
const QList< QUrl > & | file_list = QList<QUrl>() |
||
) |
Returns a list of services defined by the user as possible actions on the given .desktop file represented by the KService instance.
May include separators (see KServiceAction::isSeparator) which should appear in user-visible representations of those actions, such as separators in a menu.
- Parameters
-
path the path to the desktop file describing the services bLocalFiles true if those services are to be applied to local files only (if false, services that don't have u or U in the Exec line won't be taken into account). file_list list of urls; this allows for the menu to be changed depending on the exact files via the X-KDE-GetActionMenu extension.
- Returns
- the list of user defined actions
Definition at line 216 of file kdesktopfileactions.cpp.
◆ userDefinedServices() [2/3]
QList< KServiceAction > KDesktopFileActions::userDefinedServices | ( | const QString & | path, |
bool | bLocalFiles | ||
) |
Returns a list of services defined by the user as possible actions on the given .desktop file.
May include separators (see KServiceAction::isSeparator) which should appear in user-visible representations of those actions, such as separators in a menu.
- Parameters
-
path the path to the desktop file describing the services bLocalFiles true if those services are to be applied to local files only (if false, services that don't have u or U in the Exec line won't be taken into account).
- Returns
- the list of user defined actions
- Deprecated:
- Since 5.86, use userDefinedServices(KService, bool, QList<QUrl>) instead
Definition at line 200 of file kdesktopfileactions.cpp.
◆ userDefinedServices() [3/3]
QList< KServiceAction > KDesktopFileActions::userDefinedServices | ( | const QString & | path, |
const KDesktopFile & | desktopFile, | ||
bool | bLocalFiles, | ||
const QList< QUrl > & | file_list = QList<QUrl>() |
||
) |
Overload of userDefinedServices but also allows you to pass a list of urls for this file.
This allows for the menu to be changed depending on the exact files via the X-KDE-GetActionMenu extension.
- Deprecated:
- Since 5.86, use userDefinedServices(KService, bool, QList<QUrl>) instead
Definition at line 208 of file kdesktopfileactions.cpp.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Feb 7 2023 04:00:37 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.