Skip to content

Commit 07ea4de

Browse files
committed
io/ipchandler: add registry logs
1 parent 2629e21 commit 07ea4de

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/io/ipchandler.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include <qcontainerfwd.h>
55
#include <qdebug.h>
66
#include <qlogging.h>
7+
#include <qloggingcategory.h>
78
#include <qmetaobject.h>
89
#include <qobject.h>
910
#include <qobjectdefs.h>
@@ -14,10 +15,15 @@
1415
#include <qtypes.h>
1516

1617
#include "../core/generation.hpp"
18+
#include "../core/logcat.hpp"
1719
#include "ipc.hpp"
1820

1921
namespace qs::io::ipc {
2022

23+
namespace {
24+
QS_LOGGING_CATEGORY(logIpcHandler, "quickshell.ipchandler", QtWarningMsg)
25+
}
26+
2127
bool IpcFunction::resolve(QString& error) {
2228
if (this->method.parameterCount() > 10) {
2329
error = "Due to technical limitations, IPC functions can only have 10 arguments.";
@@ -210,6 +216,7 @@ IpcHandlerRegistry* IpcHandlerRegistry::forGeneration(EngineGeneration* generati
210216
if (!ext) {
211217
ext = new IpcHandlerRegistry();
212218
generation->registerExtension(&key, ext);
219+
qCDebug(logIpcHandler) << "Created new IPC handler registry" << ext << "for" << generation;
213220
}
214221

215222
return dynamic_cast<IpcHandlerRegistry*>(ext);
@@ -232,10 +239,12 @@ void IpcHandler::updateRegistration(bool destroying) {
232239

233240
if (this->registeredState.enabled) {
234241
registry->deregisterHandler(this);
242+
qCDebug(logIpcHandler) << "Deregistered" << this << "from registry" << registry;
235243
}
236244

237245
if (this->targetState.enabled && !this->targetState.target.isEmpty()) {
238246
registry->registerHandler(this);
247+
qCDebug(logIpcHandler) << "Registered" << this << "to registry" << registry;
239248
}
240249
}
241250

0 commit comments

Comments
 (0)