Changeset View
Changeset View
Standalone View
Standalone View
src/kdbusservice.h
Show First 20 Lines • Show All 109 Lines • ▼ Show 20 Line(s) | 97 | enum StartupOption { | |||
---|---|---|---|---|---|
110 | * register with D-Bus. | 110 | * register with D-Bus. | ||
111 | * | 111 | * | ||
112 | * If not set, KDBusService will quit the application if it failed to | 112 | * If not set, KDBusService will quit the application if it failed to | ||
113 | * register the service with D-Bus or a @c Unique instance can not be | 113 | * register the service with D-Bus or a @c Unique instance can not be | ||
114 | * activated. A @c Multiple instance will exit with error code @c 1. | 114 | * activated. A @c Multiple instance will exit with error code @c 1. | ||
115 | * The exit value of a @c Unique instance can be set from the running | 115 | * The exit value of a @c Unique instance can be set from the running | ||
116 | * instance with setExitValue(), the default value is @c 0. | 116 | * instance with setExitValue(), the default value is @c 0. | ||
117 | */ | 117 | */ | ||
118 | NoExitOnFailure = 4 | 118 | NoExitOnFailure = 4, | ||
119 | /** | ||||
120 | * Indicates that if there's already a unique service running, to be quit and replaced | ||||
121 | * with our own. | ||||
kossebau: A unique service which has a /MainApplication object implementing a rg.qtproject.Qt. | |||||
I'd say this is for applications using KDBusService really and it's not like this is the only usage of this org.qtproject.* here. apol: I'd say this is for applications using KDBusService really and it's not like this is the only… | |||||
By just reading the API dox, I would have assumed one can replace any "unique service" with the well-known name, not just services using the same toolkit/libaries. Only when I saw the implementation, it became obvious. kossebau: By just reading the API dox, I would have assumed one can replace any "unique service" with the… | |||||
122 | * | ||||
123 | * If exported, it will try first quitting the service calling org.qtproject.Qt.QCoreApplication.quit, | ||||
124 | * which is exported by @class KDBusService by default. | ||||
125 | * | ||||
126 | * @since 5.62 | ||||
127 | */ | ||||
128 | Replace = 8 | ||||
119 | }; | 129 | }; | ||
120 | Q_ENUM(StartupOption) | 130 | Q_ENUM(StartupOption) | ||
121 | 131 | | |||
122 | Q_DECLARE_FLAGS(StartupOptions, StartupOption) | 132 | Q_DECLARE_FLAGS(StartupOptions, StartupOption) | ||
123 | Q_FLAG(StartupOptions) | 133 | Q_FLAG(StartupOptions) | ||
124 | 134 | | |||
125 | /** | 135 | /** | ||
126 | * Tries to register the current process to D-Bus at an address based on the | 136 | * Tries to register the current process to D-Bus at an address based on the | ||
Show All 15 Lines | |||||
142 | /** | 152 | /** | ||
143 | * Destroys this object (but does not unregister the application). | 153 | * Destroys this object (but does not unregister the application). | ||
144 | * | 154 | * | ||
145 | * Deleting this object before unregister() is called (either manually or | 155 | * Deleting this object before unregister() is called (either manually or | ||
146 | * because QCoreApplication::aboutToQuit() was emitted) could confuse | 156 | * because QCoreApplication::aboutToQuit() was emitted) could confuse | ||
147 | * clients, who will see the service on the bus but will be unable to use | 157 | * clients, who will see the service on the bus but will be unable to use | ||
148 | * the activation methods. | 158 | * the activation methods. | ||
149 | */ | 159 | */ | ||
150 | ~KDBusService(); | 160 | ~KDBusService(); | ||
kossebau: @since missing | |||||
151 | 161 | | |||
Please no "bool" type argument, this makes places calling harder to understand -> https://community.kde.org/Policies/Library_Code_Policy#Flags kossebau: Please no "bool" type argument, this makes places calling harder to understand -> https… | |||||
especially given there is an options flag already, you can just add another flag for this broulik: especially given there is an `options` flag already, you can just add another flag for this | |||||
152 | /** | 162 | /** | ||
153 | * Returns true if the D-Bus registration succeeded. | 163 | * Returns true if the D-Bus registration succeeded. | ||
154 | * | 164 | * | ||
155 | * Note that this is only useful when specifying the option NoExitOnFailure. | 165 | * Note that this is only useful when specifying the option NoExitOnFailure. | ||
156 | * Otherwise, the simple fact that this process is still running indicates | 166 | * Otherwise, the simple fact that this process is still running indicates | ||
157 | * that the registration succeeded. | 167 | * that the registration succeeded. | ||
158 | */ | 168 | */ | ||
159 | bool isRegistered() const; | 169 | bool isRegistered() const; | ||
▲ Show 20 Lines • Show All 112 Lines • Show Last 20 Lines |
A unique service which has a /MainApplication object implementing a rg.qtproject.Qt.QCoreApplication interface,...
Any chance to make this non-Qt-only?