1- #include " dbusutil .hpp"
1+ #include " properties .hpp"
22#include < algorithm>
33#include < utility>
44
2222
2323#include " dbus_properties.h"
2424
25- Q_LOGGING_CATEGORY (logDbus , " quickshell.dbus" , QtWarningMsg);
25+ Q_LOGGING_CATEGORY (logDbusProperties , " quickshell.dbus.properties " , QtWarningMsg);
2626
2727namespace qs ::dbus {
2828
@@ -114,27 +114,28 @@ void asyncReadPropertyInternal(
114114void AbstractDBusProperty::tryUpdate (const QVariant& variant) {
115115 auto error = this ->read (variant);
116116 if (error.isValid ()) {
117- qCWarning (logDbus).noquote () << " Error demarshalling property update for" << this ->toString ();
118- qCWarning (logDbus) << error;
117+ qCWarning (logDbusProperties).noquote ()
118+ << " Error demarshalling property update for" << this ->toString ();
119+ qCWarning (logDbusProperties) << error;
119120 } else {
120- qCDebug (logDbus ).noquote () << " Updated property " << this -> toString () << " to "
121- << this ->valueString ();
121+ qCDebug (logDbusProperties ).noquote ()
122+ << " Updated property " << this -> toString () << " to " << this ->valueString ();
122123 }
123124}
124125
125126void AbstractDBusProperty::update () {
126127 if (this ->group == nullptr ) {
127- qFatal (logDbus ) << " Tried to update dbus property" << this ->name
128- << " which is not attached to a group" ;
128+ qFatal (logDbusProperties ) << " Tried to update dbus property" << this ->name
129+ << " which is not attached to a group" ;
129130 } else {
130131 const QString propStr = this ->toString ();
131132
132133 if (this ->group ->interface == nullptr ) {
133- qFatal (logDbus ).noquote () << " Tried to update property " << propStr
134- << " of a disconnected interface" ;
134+ qFatal (logDbusProperties ).noquote ()
135+ << " Tried to update property " << propStr << " of a disconnected interface" ;
135136 }
136137
137- qCDebug (logDbus ).noquote () << " Updating property" << propStr;
138+ qCDebug (logDbusProperties ).noquote () << " Updating property" << propStr;
138139
139140 auto pendingCall =
140141 this ->group ->propertyInterface ->Get (this ->group ->interface ->interface (), this ->name );
@@ -145,8 +146,8 @@ void AbstractDBusProperty::update() {
145146 const QDBusPendingReply<QDBusVariant> reply = *call;
146147
147148 if (reply.isError ()) {
148- qCWarning (logDbus ).noquote () << " Error updating property" << propStr;
149- qCWarning (logDbus ) << reply.error ();
149+ qCWarning (logDbusProperties ).noquote () << " Error updating property" << propStr;
150+ qCWarning (logDbusProperties ) << reply.error ();
150151 } else {
151152 this ->tryUpdate (reply.value ().variant ());
152153 }
@@ -198,8 +199,8 @@ void DBusPropertyGroup::attachProperty(AbstractDBusProperty* property) {
198199}
199200
200201void DBusPropertyGroup::updateAllDirect () {
201- qCDebug (logDbus ).noquote () << " Updating all properties of " << this -> toString ()
202- << " via individual queries" ;
202+ qCDebug (logDbusProperties ).noquote ()
203+ << " Updating all properties of " << this -> toString () << " via individual queries" ;
203204
204205 if (this ->interface == nullptr ) {
205206 qFatal () << " Attempted to update properties of disconnected property group" ;
@@ -211,7 +212,8 @@ void DBusPropertyGroup::updateAllDirect() {
211212}
212213
213214void DBusPropertyGroup::updateAllViaGetAll () {
214- qCDebug (logDbus).noquote () << " Updating all properties of" << this ->toString () << " via GetAll" ;
215+ qCDebug (logDbusProperties).noquote ()
216+ << " Updating all properties of" << this ->toString () << " via GetAll" ;
215217
216218 if (this ->interface == nullptr ) {
217219 qFatal () << " Attempted to update properties of disconnected property group" ;
@@ -224,11 +226,12 @@ void DBusPropertyGroup::updateAllViaGetAll() {
224226 const QDBusPendingReply<QVariantMap> reply = *call;
225227
226228 if (reply.isError ()) {
227- qCWarning (logDbus ).noquote ()
229+ qCWarning (logDbusProperties ).noquote ()
228230 << " Error updating properties of" << this ->toString () << " via GetAll" ;
229- qCWarning (logDbus ) << reply.error ();
231+ qCWarning (logDbusProperties ) << reply.error ();
230232 } else {
231- qCDebug (logDbus).noquote () << " Received GetAll property set for" << this ->toString ();
233+ qCDebug (logDbusProperties).noquote ()
234+ << " Received GetAll property set for" << this ->toString ();
232235 this ->updatePropertySet (reply.value ());
233236 }
234237
@@ -248,7 +251,7 @@ void DBusPropertyGroup::updatePropertySet(const QVariantMap& properties) {
248251 );
249252
250253 if (prop == this ->properties .end ()) {
251- qCDebug (logDbus ) << " Ignoring untracked property update" << name << " for" << this ;
254+ qCDebug (logDbusProperties ) << " Ignoring untracked property update" << name << " for" << this ;
252255 } else {
253256 (*prop)->tryUpdate (value);
254257 }
@@ -270,8 +273,8 @@ void DBusPropertyGroup::onPropertiesChanged(
270273 const QStringList& invalidatedProperties
271274) {
272275 if (interfaceName != this ->interface ->interface ()) return ;
273- qCDebug (logDbus ).noquote () << " Received property change set and invalidations for "
274- << this ->toString ();
276+ qCDebug (logDbusProperties ).noquote ()
277+ << " Received property change set and invalidations for " << this ->toString ();
275278
276279 for (const auto & name: invalidatedProperties) {
277280 auto prop = std::find_if (
@@ -281,7 +284,8 @@ void DBusPropertyGroup::onPropertiesChanged(
281284 );
282285
283286 if (prop == this ->properties .end ()) {
284- qCDebug (logDbus) << " Ignoring untracked property invalidation" << name << " for" << this ;
287+ qCDebug (logDbusProperties) << " Ignoring untracked property invalidation" << name << " for"
288+ << this ;
285289 } else {
286290 (*prop)->update ();
287291 }
0 commit comments