fix namespaces and logging names

This commit is contained in:
2026-06-04 14:56:20 +02:00
parent b6e7ee7a54
commit a477fb2e22
6 changed files with 45 additions and 45 deletions
+2 -2
View File
@@ -2,7 +2,7 @@
#include <algorithm> #include <algorithm>
namespace caelestia::internal { namespace ZShell::internal {
CircularBuffer::CircularBuffer(QObject* parent) CircularBuffer::CircularBuffer(QObject* parent)
: QObject(parent) { : QObject(parent) {
@@ -92,4 +92,4 @@ qreal CircularBuffer::at(int index) const {
return m_data[actualIndex]; return m_data[actualIndex];
} }
} // namespace caelestia::internal } // namespace ZShell::internal
+2 -2
View File
@@ -4,7 +4,7 @@
#include <qqmlintegration.h> #include <qqmlintegration.h>
#include <qvector.h> #include <qvector.h>
namespace caelestia::internal { namespace ZShell::internal {
class CircularBuffer : public QObject { class CircularBuffer : public QObject {
Q_OBJECT Q_OBJECT
@@ -41,4 +41,4 @@ int m_count = 0;
int m_capacity = 0; int m_capacity = 0;
}; };
} // namespace caelestia::internal } // namespace ZShell::internal
+24 -24
View File
@@ -6,7 +6,7 @@
#include <QtDBus/qdbusreply.h> #include <QtDBus/qdbusreply.h>
#include <qloggingcategory.h> #include <qloggingcategory.h>
Q_LOGGING_CATEGORY(lcLidWatcher, "caelestia.internal.logindmanager", QtInfoMsg) Q_LOGGING_CATEGORY(lcLidWatcher, "ZShell.internal.logindmanager", QtInfoMsg)
namespace ZShell::internal { namespace ZShell::internal {
@@ -14,27 +14,27 @@ LidWatcher::LidWatcher(QObject* parent) : QObject(parent) {
auto bus = QDBusConnection::systemBus(); auto bus = QDBusConnection::systemBus();
if (!bus.isConnected()) { if (!bus.isConnected()) {
qCWarning(lcLidWatcher) qCWarning(lcLidWatcher)
<< "Failed to connect to system bus:" << bus.lastError().message(); << "Failed to connect to system bus:" << bus.lastError().message();
return; return;
} }
bool ok = bus.connect("org.freedesktop.login1", bool ok = bus.connect("org.freedesktop.login1",
"/org/freedesktop/login1", "/org/freedesktop/login1",
"org.freedesktop.login1.Manager", "org.freedesktop.login1.Manager",
"PrepareForSleep", "PrepareForSleep",
this, this,
SLOT(handlePrepareForSleep(bool))); SLOT(handlePrepareForSleep(bool)));
if (!ok) { if (!ok) {
qCWarning(lcLidWatcher) qCWarning(lcLidWatcher)
<< "Failed to connect to PrepareForSleep signal:" << "Failed to connect to PrepareForSleep signal:"
<< bus.lastError().message(); << bus.lastError().message();
} }
QDBusInterface login1("org.freedesktop.login1", QDBusInterface login1("org.freedesktop.login1",
"/org/freedesktop/login1", "/org/freedesktop/login1",
"org.freedesktop.login1.Manager", "org.freedesktop.login1.Manager",
bus); bus);
const QDBusReply<QDBusObjectPath> reply = login1.call("GetSession", "auto"); const QDBusReply<QDBusObjectPath> reply = login1.call("GetSession", "auto");
if (!reply.isValid()) { if (!reply.isValid()) {
qCWarning(lcLidWatcher) << "Failed to get session path"; qCWarning(lcLidWatcher) << "Failed to get session path";
@@ -43,27 +43,27 @@ LidWatcher::LidWatcher(QObject* parent) : QObject(parent) {
const auto sessionPath = reply.value().path(); const auto sessionPath = reply.value().path();
ok = bus.connect("org.freedesktop.login1", ok = bus.connect("org.freedesktop.login1",
sessionPath, sessionPath,
"org.freedesktop.login1.Session", "org.freedesktop.login1.Session",
"Lock", "Lock",
this, this,
SLOT(handleLockRequested())); SLOT(handleLockRequested()));
if (!ok) { if (!ok) {
qCWarning(lcLidWatcher) qCWarning(lcLidWatcher)
<< "Failed to connect to Lock signal:" << bus.lastError().message(); << "Failed to connect to Lock signal:" << bus.lastError().message();
} }
ok = bus.connect("org.freedesktop.login1", ok = bus.connect("org.freedesktop.login1",
sessionPath, sessionPath,
"org.freedesktop.login1.Session", "org.freedesktop.login1.Session",
"Unlock", "Unlock",
this, this,
SLOT(handleUnlockRequested())); SLOT(handleUnlockRequested()));
if (!ok) { if (!ok) {
qCWarning(lcLidWatcher) << "Failed to connect to Unlock signal:" qCWarning(lcLidWatcher) << "Failed to connect to Unlock signal:"
<< bus.lastError().message(); << bus.lastError().message();
} }
} }
+13 -13
View File
@@ -6,22 +6,22 @@
namespace ZShell::internal { namespace ZShell::internal {
class LidWatcher : public QObject { class LidWatcher : public QObject {
Q_OBJECT Q_OBJECT
QML_ELEMENT QML_ELEMENT
public: public:
explicit LidWatcher(QObject* parent = nullptr); explicit LidWatcher(QObject* parent = nullptr);
signals: signals:
void aboutToSleep(); void aboutToSleep();
void resumed(); void resumed();
void lockRequested(); void lockRequested();
void unlockRequested(); void unlockRequested();
private slots: private slots:
void handlePrepareForSleep(bool sleep); void handlePrepareForSleep(bool sleep);
void handleLockRequested(); void handleLockRequested();
void handleUnlockRequested(); void handleUnlockRequested();
}; };
} // namespace ZShell::internal } // namespace ZShell::internal
+2 -2
View File
@@ -4,7 +4,7 @@
#include <qpainterpath.h> #include <qpainterpath.h>
#include <qpen.h> #include <qpen.h>
namespace caelestia::internal { namespace ZShell::internal {
SparklineItem::SparklineItem(QQuickItem* parent) SparklineItem::SparklineItem(QQuickItem* parent)
: QQuickPaintedItem(parent) { : QQuickPaintedItem(parent) {
@@ -212,4 +212,4 @@ void SparklineItem::setLineWidth(qreal width) {
update(); update();
} }
} // namespace caelestia::internal } // namespace ZShell::internal
+2 -2
View File
@@ -7,7 +7,7 @@
#include "circularbuffer.hpp" #include "circularbuffer.hpp"
namespace caelestia::internal { namespace ZShell::internal {
class SparklineItem : public QQuickPaintedItem { class SparklineItem : public QQuickPaintedItem {
Q_OBJECT Q_OBJECT
@@ -87,4 +87,4 @@ int m_historyLength = 30;
qreal m_lineWidth = 2.0; qreal m_lineWidth = 2.0;
}; };
} // namespace caelestia::internal } // namespace ZShell::internal