Skip to content

Commit aa9f8cd

Browse files
committed
dbus/properties: dbus/dbusutil -> dbus/properties
1 parent 74d1bb9 commit aa9f8cd

File tree

7 files changed

+33
-29
lines changed

7 files changed

+33
-29
lines changed

src/dbus/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ qt_add_dbus_interface(DBUS_INTERFACES
88
)
99

1010
qt_add_library(quickshell-dbus STATIC
11-
dbusutil.cpp
11+
properties.cpp
1212
${DBUS_INTERFACES}
1313
)
1414

src/dbus/dbusutil.cpp renamed to src/dbus/properties.cpp

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "dbusutil.hpp"
1+
#include "properties.hpp"
22
#include <algorithm>
33
#include <utility>
44

@@ -22,7 +22,7 @@
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

2727
namespace qs::dbus {
2828

@@ -114,27 +114,28 @@ void asyncReadPropertyInternal(
114114
void 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

125126
void 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

200201
void 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

213214
void 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
}

src/dbus/dbusutil.hpp renamed to src/dbus/properties.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
class DBusPropertiesInterface;
2121

22-
Q_DECLARE_LOGGING_CATEGORY(logDbus);
22+
Q_DECLARE_LOGGING_CATEGORY(logDbusProperties);
2323

2424
namespace qs::dbus {
2525

src/services/status_notifier/host.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include <qtmetamacros.h>
1212
#include <unistd.h>
1313

14-
#include "../../dbus/dbusutil.hpp"
14+
#include "../../dbus/properties.hpp"
1515
#include "dbus_watcher_interface.h"
1616
#include "item.hpp"
1717
#include "watcher.hpp"

src/services/status_notifier/item.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include <qtmetamacros.h>
1818

1919
#include "../../core/iconimageprovider.hpp"
20-
#include "../../dbus/dbusutil.hpp"
20+
#include "../../dbus/properties.hpp"
2121
#include "dbus_item.h"
2222
#include "dbus_item_types.hpp"
2323
#include "host.hpp"

src/services/status_notifier/item.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include <qtmetamacros.h>
1010
#include <qtypes.h>
1111

12-
#include "../../dbus/dbusutil.hpp"
12+
#include "../../dbus/properties.hpp"
1313
#include "dbus_item.h"
1414
#include "dbus_item_types.hpp"
1515

src/services/status_notifier/qml.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include <qtmetamacros.h>
1010
#include <qtypes.h>
1111

12-
#include "../../dbus/dbusutil.hpp"
12+
#include "../../dbus/properties.hpp"
1313
#include "host.hpp"
1414
#include "item.hpp"
1515

0 commit comments

Comments
 (0)