|
tuned-switcher 1.1.0
Performance profile manager
|
#include <portalrequest.h>


Public Types | |
| enum class | BackgroundResult { Disabled , Enabled , Cancelled , Timeout , Unknown , NotFinished } |
Signals | |
| void | finished () |
Public Member Functions | |
| PortalRequest (QObject *parent=nullptr) | |
| bool | RequestBackground (const bool) |
| BackgroundResult | GetResult () const |
| unsigned int | GetVersion () const |
Private Slots | |
| void | RequestResponseEvent (const unsigned int, const QVariantMap &) |
Private Member Functions | |
| QString | CreateHandleToken () const |
| QString | CreateReasonString () const |
| const QVariantMap | CreateOptionsStructure (const bool) const |
| const QList< QVariant > | CreateRequestStructure (const bool) const |
| PortalRequest::BackgroundResult | ExtractAutostartValue () const |
| void | RequestResponseError () |
Private Attributes | |
| const QString | PortalBusName = QStringLiteral("org.freedesktop.portal.Desktop") |
| const QString | PortalBusPath = QStringLiteral("/org/freedesktop/portal/desktop") |
| const QString | PortalBusBackgroundInterface = QStringLiteral("org.freedesktop.portal.Background") |
| const QString | PortalBusRequestInterface = QStringLiteral("org.freedesktop.portal.Request") |
| const QString | PortalBusMethodNameRequestBackground = QStringLiteral("RequestBackground") |
| const QString | PortalBusSignalNameResponse = QStringLiteral("Response") |
| const QString | PortalBusFieldNameAutostart = QStringLiteral("autostart") |
| const QString | PortalBusPropertyNameVersion = QStringLiteral("version") |
| const QString | DBusPropertyInterface = QStringLiteral("org.freedesktop.DBus.Properties") |
| const QString | DBusPropertyMethodNameGet = QStringLiteral("Get") |
| bool | ResponseFinished = false |
| unsigned long | ResponseCode = 255UL |
| QVariantMap | ResponseResults |
| QDBusConnection | DBusInstance = QDBusConnection::sessionBus() |
Class for working with portals.
|
strong |
Enum with IDs of result codes, used by various methods.
|
explicit |
Main constructor of the PortalRequest class.
| parent | Parent. |
|
private |
Constructs and returns special DBus object path for the request interface.
|
private |
Constructs and returns special Options structure for the desktop portal service.
| autostart | New autorun status. |
|
private |
Constructs and returns DBus activation reason for the request interface.
|
private |
Constructs and returns special Request structure for the desktop portal service.
| autostart | New autorun status. |
|
private |
Extracts and returns the result of the asynchronous operation.
|
signal |
Asynchronous request completed signal.
| PortalRequest::BackgroundResult PortalRequest::GetResult | ( | ) | const |
Returns the result of the asynchronous operation.
| unsigned int PortalRequest::GetVersion | ( | ) | const |
Returns version of the PortalRequest portal as an unsigned integer.
| bool PortalRequest::RequestBackground | ( | const bool | autostart | ) |
Runs the RequestBackground method and returns the DBus method call status. The GetResult() method should be called after receiving the finished() signal to obtain the result.
| autostart | New autorun status. |
| true | The requested method was called successfully. |
| false | An error occurred when trying to call the the requested method. |
|
private |
Sets error values to various private fields and calls finished() slot.
|
privateslot |
Response received event slot. Sets received values to various private fields and calls finished() slot.
| response | Response code: 0 - success; 1 - cancelled; 2 - timeout. |
| results | Results data. |
|
private |
Stores DBus instance.
|
private |
Stores the Systemd Properties DBus interface.
|
private |
Stores the Systemd DBus GetProperty method name.
|
private |
Stores the desktop portal Background DBus interface.
|
private |
Stores the desktop portal DBus Autostart field name.
|
private |
Stores the desktop portal DBus RequestBackground method name.
|
private |
Stores the desktop portal DBus interface name.
|
private |
Stores the desktop portal DBus object path.
|
private |
Stores the desktop portal DBus Version property name.
|
private |
Stores the desktop portal Request DBus interface.
|
private |
Stores the desktop portal DBus Response signal name.
|
private |
Stores the response code after running the asynchronous operation.
|
private |
Stores the status of the asynchronous operation.
|
private |
Stores the response results after running the asynchronous operation.