# Namespace KDesktopFileActions

Module | kio
Namespace | KDesktopFileActions

KDesktopFileActions provides a number of methods related to actions in desktop files.

### methods

- builtinServices (url)

  returns QList<KServiceAction>

  Argument | Type | Default
  --- | --- | ---
  url | KUrl |

  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

- executeService (urls, service)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  urls | KUrl.List |
  service | KServiceAction |

  Execute service on the list of urls.

  urls - the list of urls

  service - the service to execute

- run (_url, _is_local)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  _url | KUrl |
  _is_local | bool |

  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.

  _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

- userDefinedServices (path, bLocalFiles)

  returns QList<KServiceAction>

  Argument | Type | Default
  --- | --- | ---
  path | QString |
  bLocalFiles | bool |

  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.

  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

- userDefinedServices (path, desktopFile, bLocalFiles, file_list)

  returns QList<KServiceAction>

  Argument | Type | Default
  --- | --- | ---
  path | QString |
  desktopFile | KDesktopFile |
  bLocalFiles | bool |
  file_list | KUrl.List | KUrl.List()

  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.

- userDefinedServices (service, bLocalFiles, file_list)

  returns QList<KServiceAction>

  Argument | Type | Default
  --- | --- | ---
  service | KService |
  bLocalFiles | bool |
  file_list | KUrl.List | KUrl.List()

  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.

  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