KNotifyConfig Class
Represent the configuration for an event. More...
- Header:
#include <KNotifyConfig> - CMake:
find_package(KF6 REQUIRED COMPONENTS Notifications)
target_link_libraries(mytarget PRIVATE KF6::Notifications)
List of all members, including inherited members
Public Types
Public Functions
- KNotifyConfig(const QString &applicationName, const QString &eventId)
- KNotifyConfig::Actions actions() const (since 6.30)
- QString applicationName() const
- QString eventId() const
- bool isValid() const
- QString readEntry(const QString &key) const
- QString readGlobalEntry(const QString &key) const
- QString readPathEntry(const QString &key) const
Static Public Members
Detailed Description
Member Type Documentation
[since 6.30] enum KNotifyConfig::Action
flags KNotifyConfig::Actions
| Constant | Value | Description |
|---|---|---|
KNotifyConfig::Popup |
0x1 |
Show a popup |
KNotifyConfig::Sound |
0x2 |
Play a sound |
This enum was introduced in Qt 6.30.
The Actions type is a typedef for QFlags<Action>. It stores an OR combination of Action values.
Member Function Documentation
KNotifyConfig::KNotifyConfig(const QString &applicationName, const QString &eventId)
Creates a notify config for the given application name and event id
applicationName The application name, typically the name of the notifyrc file without its extension.
eventId The notification event ID, i.e. the part after Event/ in its notifyrc file.
[since 6.30] KNotifyConfig::Actions KNotifyConfig::actions() const
The actions for this notification.
This function was introduced in Qt 6.30.
QString KNotifyConfig::applicationName() const
the name of the application that triggered the notification
QString KNotifyConfig::eventId() const
the name of the notification
bool KNotifyConfig::isValid() const
Whether there exists an event with the given id under the given application name.
QString KNotifyConfig::readEntry(const QString &key) const
Returns entry from the relevant Event/ notifyrc config group
This will return the configuration from the user for the given key. It first look into the user config file, and then in the global config file.
Returns a null string if the entry doesn't exist
QString KNotifyConfig::readGlobalEntry(const QString &key) const
Returns entry from the relevant Global notifyrc config group
This will return the configuration from the user for the given key. It first look into the user config file, and then in the global config file.
Returns a null string if the entry doesn't exist
QString KNotifyConfig::readPathEntry(const QString &key) const
Returns path entry from the relevant Event/ notifyrc config group
This will return the configuration from the user for the given key and interpret it as a path.
[static] void KNotifyConfig::reparseConfiguration()
reparse the cached configs. to be used when the config may have changed