Sailfish OS
  • Info
  • User Experience
  • Cases
  • Community
  • Developers
  • Contact
  • Get Sailfish OS
Select Page
  • Info
  • User Experience
  • Cases
  • Community
  • Developers
  • Contact
  • Get Sailfish OS

API Documentation

Documentation for developing SailfishOS applications
  • API Documentation
  • Libsailfishapp
  • Sailfish Silica
    • Documentation
    • Icon Reference
  • Sailfish Components
    • Sailfish Accounts
    • Sailfish Bluetooth
    • Sailfish Contacts
    • Sailfish Crypto
    • Sailfish Gallery
    • Sailfish Media
    • Sailfish Pickers
    • Sailfish Secrets
    • Sailfish Share
    • Sailfish Telephony
    • Sailfish Webview
    • Amber Web Authorization
    • Amber MPRIS
  • Nemo QML Plugins
    • Configuration
    • Contacts
    • D-Bus
    • Keepalive
    • Notifications
    • Thumbnailer
  • Sailfish Middleware
    • MDM Framework
    • MDM Policy Framework
    • User Manager Daemon
  • API Documentation
  • Libsailfishapp
  • Sailfish Silica
    • Documentation
    • Icon Reference
  • Sailfish Components
    • Sailfish Accounts
    • Sailfish Bluetooth
    • Sailfish Contacts
    • Sailfish Crypto
    • Sailfish Gallery
    • Sailfish Media
    • Sailfish Pickers
    • Sailfish Secrets
    • Sailfish Share
    • Sailfish Telephony
    • Sailfish Webview
    • Amber Web Authorization
    • Amber MPRIS
  • Nemo QML Plugins
    • Configuration
    • Contacts
    • D-Bus
    • Keepalive
    • Notifications
    • Thumbnailer
  • Sailfish Middleware
    • MDM Framework
    • MDM Policy Framework
    • User Manager Daemon

Contents

  • Public Types
  • Public Functions
  • Detailed Description

Autostart Class

(Sailfish::Mdm::Autostart)

The Autostart class controls auto-starting of applications. More...

Header: #include <mdm-autostart.h>
  • List of all members, including inherited members

Public Types

enum Result { Success, InternalError, InvalidDesktopFile, AlreadyAutostarted }

Public Functions

Autostart(QObject *parent = Q_NULLPTR)
virtual ~Autostart()
Result add(const QString &desktopFilePath)
QStringList query(Autostart::Result &result)
Result remove(const QString &desktopFilePath)

Detailed Description

The Autostart class controls auto-starting of applications.

Applications can be added to or removed from the list of applications that are auto-started when the system starts.

To use this class, clients must add the following to their qmake project:

 CONFIG += link_pkgconfig
 PKGCONFIG += sailfishmdm

and then #include <mdm-autostart.h>.

Example of usage:

 #include <mdm-autostart.h>

 void example()
 {
     Sailfish::Mdm::Autostart autostart;
     autostart.add("/usr/share/applications/your-favourite-app.desktop");
 }

Member Type Documentation

enum Autostart::Result

Describes the result of an add() or remove() action.

ConstantValueDescription
Sailfish::Mdm::Autostart::Success0The action succeeded.
Sailfish::Mdm::Autostart::InternalError1An internal API error was encountered.
Sailfish::Mdm::Autostart::InvalidDesktopFile2The specified desktop file is not valid.
Sailfish::Mdm::Autostart::AlreadyAutostarted3add() was called for an application that has already been added.

Member Function Documentation

Autostart::Autostart(QObject *parent = Q_NULLPTR)

Default constructs an instance of Autostart.

[virtual] Autostart::~Autostart()

Destroys the instance of Autostart. The destructor is virtual.

Result Autostart::add(const QString &desktopFilePath)

Adds a given application to be auto-started at system startup. The desktopFilePath is the path to the desktop file of the application.

QStringList Autostart::query(Autostart::Result &result)

Queries the currently auto-started applications and sets result to the result of the action. Returns a list of the currently auto-started applications' desktop file paths.

Result Autostart::remove(const QString &desktopFilePath)

Removes a given application so it will no longer be auto-started at system startup. The desktopFilePath is the path to the desktop file of the application.

  • Legal
  • Contact Us
  • Jolla Mobile Ltd © 2025

  • Facebook
  • Twitter
  • Mastodon
  • YouTube
  • LinkedIn