Merge branch 'main' into sdfs
This commit is contained in:
commit
2dffd4fbfd
24 changed files with 135 additions and 61 deletions
|
|
@ -600,6 +600,8 @@ default, you must create it manually.
|
|||
"paths": {
|
||||
"mediaGif": "root:/assets/bongocat.gif",
|
||||
"sessionGif": "root:/assets/kurukuru.gif",
|
||||
"noNotifsPic": "root:/assets/dino.png",
|
||||
"lockNoNotifsPic": "root:/assets/dino.png",
|
||||
"wallpaperDir": "~/Pictures/Wallpapers",
|
||||
"lyricsDir": "~/Music/lyrics"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -394,7 +394,9 @@ Singleton {
|
|||
wallpaperDir: paths.wallpaperDir,
|
||||
lyricsDir: paths.lyricsDir,
|
||||
sessionGif: paths.sessionGif,
|
||||
mediaGif: paths.mediaGif
|
||||
mediaGif: paths.mediaGif,
|
||||
noNotifsPic: paths.noNotifsPic,
|
||||
lockNoNotifsPic: paths.lockNoNotifsPic
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,4 +6,6 @@ JsonObject {
|
|||
property string lyricsDir: `${Paths.home}/Music/lyrics/`
|
||||
property string sessionGif: "root:/assets/kurukuru.gif"
|
||||
property string mediaGif: "root:/assets/bongocat.gif"
|
||||
property string noNotifsPic: "root:/assets/dino.png"
|
||||
property string lockNoNotifsPic: "root:/assets/dino.png"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import Caelestia
|
||||
|
|
@ -115,7 +116,7 @@ Scope {
|
|||
const visibilities = Visibilities.getForActive();
|
||||
visibilities[drawer] = !visibilities[drawer];
|
||||
} else {
|
||||
console.warn(`[IPC] Drawer "${drawer}" does not exist`);
|
||||
console.warn(lc, `Drawer "${drawer}" does not exist`);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -154,4 +155,11 @@ Scope {
|
|||
|
||||
target: "toaster"
|
||||
}
|
||||
|
||||
LoggingCategory {
|
||||
id: lc
|
||||
|
||||
name: "caelestia.qml.shortcuts"
|
||||
defaultLogLevel: LoggingCategory.Info
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ Item {
|
|||
|
||||
onStatusChanged: {
|
||||
if (status === Loader.Error) {
|
||||
console.error("[AppearancePane] Wallpaper loader error!");
|
||||
console.error(lc, "Wallpaper loader error!");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -259,4 +259,11 @@ Item {
|
|||
|
||||
rightContent: appearanceRightContentComponent
|
||||
}
|
||||
|
||||
LoggingCategory {
|
||||
id: lc
|
||||
|
||||
name: "caelestia.qml.controlcenter.appearance"
|
||||
defaultLogLevel: LoggingCategory.Info
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
pragma ComponentBehavior: Bound
|
||||
|
||||
import ".."
|
||||
import "../components"
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import Quickshell.Widgets
|
||||
import ".."
|
||||
import "../components"
|
||||
import qs.components
|
||||
import qs.components.containers
|
||||
import qs.components.controls
|
||||
import qs.components.effects
|
||||
import qs.components.containers
|
||||
import qs.services
|
||||
import qs.config
|
||||
|
||||
|
|
|
|||
|
|
@ -110,10 +110,10 @@ Item {
|
|||
return;
|
||||
|
||||
if (event.modifiers & Qt.ControlModifier) {
|
||||
if (event.key === Qt.Key_J) {
|
||||
if (event.key === Qt.Key_J || event.key === Qt.Key_N) {
|
||||
list.currentList?.incrementCurrentIndex();
|
||||
event.accepted = true;
|
||||
} else if (event.key === Qt.Key_K) {
|
||||
} else if (event.key === Qt.Key_K || event.key === Qt.Key_P) {
|
||||
list.currentList?.decrementCurrentIndex();
|
||||
event.accepted = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import qs.components.containers
|
|||
import qs.components.effects
|
||||
import qs.services
|
||||
import qs.config
|
||||
import qs.utils
|
||||
|
||||
ColumnLayout {
|
||||
id: root
|
||||
|
|
@ -49,7 +50,7 @@ ColumnLayout {
|
|||
|
||||
Image {
|
||||
asynchronous: true
|
||||
source: Qt.resolvedUrl(`${Quickshell.shellDir}/assets/dino.png`)
|
||||
source: Paths.absolutePath(Config.paths.lockNoNotifsPic)
|
||||
fillMode: Image.PreserveAspectFit
|
||||
sourceSize.width: clipRect.width * 0.8
|
||||
|
||||
|
|
|
|||
|
|
@ -96,10 +96,10 @@ Column {
|
|||
return;
|
||||
|
||||
if (event.modifiers & Qt.ControlModifier) {
|
||||
if (event.key === Qt.Key_J && KeyNavigation.down) {
|
||||
if ((event.key === Qt.Key_J || event.key === Qt.Key_N) && KeyNavigation.down) {
|
||||
KeyNavigation.down.focus = true;
|
||||
event.accepted = true;
|
||||
} else if (event.key === Qt.Key_K && KeyNavigation.up) {
|
||||
} else if ((event.key === Qt.Key_K || event.key === Qt.Key_P) && KeyNavigation.up) {
|
||||
KeyNavigation.up.focus = true;
|
||||
event.accepted = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ pragma ComponentBehavior: Bound
|
|||
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import Quickshell.Widgets
|
||||
import qs.components
|
||||
import qs.components.containers
|
||||
|
|
@ -10,6 +9,7 @@ import qs.components.controls
|
|||
import qs.components.effects
|
||||
import qs.services
|
||||
import qs.config
|
||||
import qs.utils
|
||||
|
||||
Item {
|
||||
id: root
|
||||
|
|
@ -96,7 +96,7 @@ Item {
|
|||
|
||||
Image {
|
||||
asynchronous: true
|
||||
source: Quickshell.shellPath("assets/dino.png")
|
||||
source: Paths.absolutePath(Config.paths.noNotifsPic)
|
||||
fillMode: Image.PreserveAspectFit
|
||||
sourceSize.width: clipRect.width * 0.8
|
||||
|
||||
|
|
|
|||
|
|
@ -6,9 +6,12 @@
|
|||
#include <qfileinfo.h>
|
||||
#include <qfuturewatcher.h>
|
||||
#include <qimagereader.h>
|
||||
#include <qloggingcategory.h>
|
||||
#include <qpainter.h>
|
||||
#include <qtconcurrentrun.h>
|
||||
|
||||
Q_LOGGING_CATEGORY(lcCim, "caelestia.internal.cim", QtInfoMsg)
|
||||
|
||||
namespace caelestia::internal {
|
||||
|
||||
qreal CachingImageManager::effectiveScale() const {
|
||||
|
|
@ -132,7 +135,7 @@ void CachingImageManager::updateSource(const QString& path) {
|
|||
emit cachePathChanged();
|
||||
|
||||
if (!cache.isLocalFile()) {
|
||||
qWarning() << "CachingImageManager::updateSource: cachePath" << cache << "is not a local file";
|
||||
qCWarning(lcCim) << "updateSource: cachePath" << cache << "is not a local file";
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -161,7 +164,7 @@ void CachingImageManager::createCache(
|
|||
QImage image(path);
|
||||
|
||||
if (image.isNull()) {
|
||||
qWarning() << "CachingImageManager::createCache: failed to read" << path;
|
||||
qCWarning(lcCim) << "createCache: failed to read" << path;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -188,7 +191,7 @@ void CachingImageManager::createCache(
|
|||
|
||||
const QString parent = QFileInfo(cache).absolutePath();
|
||||
if (!QDir().mkpath(parent) || !image.save(cache)) {
|
||||
qWarning() << "CachingImageManager::createCache: failed to save to" << cache;
|
||||
qCWarning(lcCim) << "createCache: failed to save to" << cache;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -196,7 +199,7 @@ void CachingImageManager::createCache(
|
|||
QString CachingImageManager::sha256sum(const QString& path) {
|
||||
QFile file(path);
|
||||
if (!file.open(QIODevice::ReadOnly)) {
|
||||
qWarning() << "CachingImageManager::sha256sum: failed to open" << path;
|
||||
qCWarning(lcCim) << "sha256sum: failed to open" << path;
|
||||
return "";
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,8 +3,11 @@
|
|||
#include <qdir.h>
|
||||
#include <qjsonarray.h>
|
||||
#include <qlocalsocket.h>
|
||||
#include <qloggingcategory.h>
|
||||
#include <qvariant.h>
|
||||
|
||||
Q_LOGGING_CATEGORY(lcHypr, "caelestia.internal.hypr", QtInfoMsg)
|
||||
|
||||
namespace caelestia::internal::hypr {
|
||||
|
||||
HyprExtras::HyprExtras(QObject* parent)
|
||||
|
|
@ -16,8 +19,7 @@ HyprExtras::HyprExtras(QObject* parent)
|
|||
, m_devices(new HyprDevices(this)) {
|
||||
const auto his = qEnvironmentVariable("HYPRLAND_INSTANCE_SIGNATURE");
|
||||
if (his.isEmpty()) {
|
||||
qWarning()
|
||||
<< "HyprExtras::HyprExtras: $HYPRLAND_INSTANCE_SIGNATURE is unset. Unable to connect to Hyprland socket.";
|
||||
qCWarning(lcHypr) << "$HYPRLAND_INSTANCE_SIGNATURE is unset. Unable to connect to Hyprland socket.";
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -26,8 +28,7 @@ HyprExtras::HyprExtras(QObject* parent)
|
|||
hyprDir = "/tmp/hypr/" + his;
|
||||
|
||||
if (!QDir(hyprDir).exists()) {
|
||||
qWarning() << "HyprExtras::HyprExtras: Hyprland socket directory does not exist. Unable to connect to "
|
||||
"Hyprland socket.";
|
||||
qCWarning(lcHypr) << "Hyprland socket directory does not exist. Unable to connect to Hyprland socket.";
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
@ -62,7 +63,7 @@ void HyprExtras::message(const QString& message) {
|
|||
|
||||
makeRequest(message, [](bool success, const QByteArray& res) {
|
||||
if (!success) {
|
||||
qWarning() << "HyprExtras::message: request error:" << QString::fromUtf8(res);
|
||||
qCWarning(lcHypr) << "message: request error:" << QString::fromUtf8(res);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -74,7 +75,7 @@ void HyprExtras::batchMessage(const QStringList& messages) {
|
|||
|
||||
makeRequest("[[BATCH]]" + messages.join(";"), [](bool success, const QByteArray& res) {
|
||||
if (!success) {
|
||||
qWarning() << "HyprExtras::batchMessage: request error:" << QString::fromUtf8(res);
|
||||
qCWarning(lcHypr) << "batchMessage: request error:" << QString::fromUtf8(res);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -95,7 +96,7 @@ void HyprExtras::applyOptions(const QVariantHash& options) {
|
|||
if (success) {
|
||||
refreshOptions();
|
||||
} else {
|
||||
qWarning() << "HyprExtras::applyOptions: request error" << QString::fromUtf8(res);
|
||||
qCWarning(lcHypr) << "applyOptions: request error" << QString::fromUtf8(res);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -145,15 +146,15 @@ void HyprExtras::refreshDevices() {
|
|||
|
||||
void HyprExtras::socketError(QLocalSocket::LocalSocketError error) const {
|
||||
if (!m_socketValid) {
|
||||
qWarning() << "HyprExtras::socketError: unable to connect to Hyprland event socket:" << error;
|
||||
qCWarning(lcHypr) << "socketError: unable to connect to Hyprland event socket:" << error;
|
||||
} else {
|
||||
qWarning() << "HyprExtras::socketError: Hyprland event socket error:" << error;
|
||||
qCWarning(lcHypr) << "socketError: Hyprland event socket error:" << error;
|
||||
}
|
||||
}
|
||||
|
||||
void HyprExtras::socketStateChanged(QLocalSocket::LocalSocketState state) {
|
||||
if (state == QLocalSocket::UnconnectedState && m_socketValid) {
|
||||
qWarning() << "HyprExtras::socketStateChanged: Hyprland event socket disconnected.";
|
||||
qCWarning(lcHypr) << "socketStateChanged: Hyprland event socket disconnected.";
|
||||
}
|
||||
|
||||
m_socketValid = state == QLocalSocket::ConnectedState;
|
||||
|
|
@ -206,7 +207,7 @@ HyprExtras::SocketPtr HyprExtras::makeRequest(
|
|||
});
|
||||
|
||||
QObject::connect(socket.data(), &QLocalSocket::errorOccurred, this, [=](QLocalSocket::LocalSocketError err) {
|
||||
qWarning() << "HyprExtras::makeRequest: error making request:" << err << "| request:" << request;
|
||||
qCWarning(lcHypr) << "makeRequest: error making request:" << err << "| request:" << request;
|
||||
callback(false, {});
|
||||
socket->close();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -4,6 +4,9 @@
|
|||
#include <QtDBus/qdbuserror.h>
|
||||
#include <QtDBus/qdbusinterface.h>
|
||||
#include <QtDBus/qdbusreply.h>
|
||||
#include <qloggingcategory.h>
|
||||
|
||||
Q_LOGGING_CATEGORY(lcLogindManager, "caelestia.internal.logindmanager", QtInfoMsg)
|
||||
|
||||
namespace caelestia::internal {
|
||||
|
||||
|
|
@ -11,7 +14,7 @@ LogindManager::LogindManager(QObject* parent)
|
|||
: QObject(parent) {
|
||||
auto bus = QDBusConnection::systemBus();
|
||||
if (!bus.isConnected()) {
|
||||
qWarning() << "LogindManager::LogindManager: failed to connect to system bus:" << bus.lastError().message();
|
||||
qCWarning(lcLogindManager) << "Failed to connect to system bus:" << bus.lastError().message();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -19,14 +22,13 @@ LogindManager::LogindManager(QObject* parent)
|
|||
"PrepareForSleep", this, SLOT(handlePrepareForSleep(bool)));
|
||||
|
||||
if (!ok) {
|
||||
qWarning() << "LogindManager::LogindManager: failed to connect to PrepareForSleep signal:"
|
||||
<< bus.lastError().message();
|
||||
qCWarning(lcLogindManager) << "Failed to connect to PrepareForSleep signal:" << bus.lastError().message();
|
||||
}
|
||||
|
||||
QDBusInterface login1("org.freedesktop.login1", "/org/freedesktop/login1", "org.freedesktop.login1.Manager", bus);
|
||||
const QDBusReply<QDBusObjectPath> reply = login1.call("GetSession", "auto");
|
||||
if (!reply.isValid()) {
|
||||
qWarning() << "LogindManager::LogindManager: failed to get session path";
|
||||
qCWarning(lcLogindManager) << "Failed to get session path";
|
||||
return;
|
||||
}
|
||||
const auto sessionPath = reply.value().path();
|
||||
|
|
@ -35,14 +37,14 @@ LogindManager::LogindManager(QObject* parent)
|
|||
SLOT(handleLockRequested()));
|
||||
|
||||
if (!ok) {
|
||||
qWarning() << "LogindManager::LogindManager: failed to connect to Lock signal:" << bus.lastError().message();
|
||||
qCWarning(lcLogindManager) << "Failed to connect to Lock signal:" << bus.lastError().message();
|
||||
}
|
||||
|
||||
ok = bus.connect("org.freedesktop.login1", sessionPath, "org.freedesktop.login1.Session", "Unlock", this,
|
||||
SLOT(handleUnlockRequested()));
|
||||
|
||||
if (!ok) {
|
||||
qWarning() << "LogindManager::LogindManager: failed to connect to Unlock signal:" << bus.lastError().message();
|
||||
qCWarning(lcLogindManager) << "Failed to connect to Unlock signal:" << bus.lastError().message();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,13 +3,16 @@
|
|||
#include "service.hpp"
|
||||
#include <algorithm>
|
||||
#include <pipewire/pipewire.h>
|
||||
#include <qdebug.h>
|
||||
#include <qloggingcategory.h>
|
||||
#include <qmutex.h>
|
||||
#include <spa/param/audio/format-utils.h>
|
||||
#include <spa/param/latency-utils.h>
|
||||
#include <stop_token>
|
||||
#include <vector>
|
||||
|
||||
Q_LOGGING_CATEGORY(lcAc, "caelestia.services.ac", QtInfoMsg)
|
||||
Q_LOGGING_CATEGORY(lcAcWorker, "caelestia.services.ac.worker", QtInfoMsg)
|
||||
|
||||
namespace caelestia::services {
|
||||
|
||||
PipeWireWorker::PipeWireWorker(std::stop_token token, AudioCollector* collector)
|
||||
|
|
@ -23,13 +26,19 @@ PipeWireWorker::PipeWireWorker(std::stop_token token, AudioCollector* collector)
|
|||
|
||||
m_loop = pw_main_loop_new(nullptr);
|
||||
if (!m_loop) {
|
||||
qWarning() << "PipeWireWorker::init: failed to create PipeWire main loop";
|
||||
qCWarning(lcAcWorker) << "init: failed to create PipeWire main loop";
|
||||
pw_deinit();
|
||||
return;
|
||||
}
|
||||
|
||||
timespec timeout = { 0, 10 * SPA_NSEC_PER_MSEC };
|
||||
m_timer = pw_loop_add_timer(pw_main_loop_get_loop(m_loop), handleTimeout, this);
|
||||
if (!m_timer) {
|
||||
qCWarning(lcAcWorker) << "init: failed to create timer";
|
||||
pw_main_loop_destroy(m_loop);
|
||||
pw_deinit();
|
||||
return;
|
||||
}
|
||||
pw_loop_update_timer(pw_main_loop_get_loop(m_loop), m_timer, &timeout, &timeout, false);
|
||||
|
||||
auto props = pw_properties_new(
|
||||
|
|
@ -55,6 +64,7 @@ PipeWireWorker::PipeWireWorker(std::stop_token token, AudioCollector* collector)
|
|||
params[0] = spa_format_audio_raw_build(&b, SPA_PARAM_EnumFormat, &info);
|
||||
|
||||
pw_stream_events events{};
|
||||
events.version = PW_VERSION_STREAM_EVENTS;
|
||||
events.state_changed = [](void* data, pw_stream_state, pw_stream_state state, const char*) {
|
||||
auto* self = static_cast<PipeWireWorker*>(data);
|
||||
self->streamStateChanged(state);
|
||||
|
|
@ -65,13 +75,19 @@ PipeWireWorker::PipeWireWorker(std::stop_token token, AudioCollector* collector)
|
|||
};
|
||||
|
||||
m_stream = pw_stream_new_simple(pw_main_loop_get_loop(m_loop), "caelestia-shell", props, &events, this);
|
||||
if (!m_stream) {
|
||||
qCWarning(lcAcWorker) << "init: failed to create stream";
|
||||
pw_main_loop_destroy(m_loop);
|
||||
pw_deinit();
|
||||
return;
|
||||
}
|
||||
|
||||
const int success = pw_stream_connect(m_stream, PW_DIRECTION_INPUT, PW_ID_ANY,
|
||||
static_cast<pw_stream_flags>(
|
||||
PW_STREAM_FLAG_AUTOCONNECT | PW_STREAM_FLAG_MAP_BUFFERS | PW_STREAM_FLAG_RT_PROCESS),
|
||||
params, 1);
|
||||
if (success < 0) {
|
||||
qWarning() << "PipeWireWorker::init: failed to connect stream";
|
||||
qCWarning(lcAcWorker) << "init: failed to connect stream";
|
||||
pw_stream_destroy(m_stream);
|
||||
pw_main_loop_destroy(m_loop);
|
||||
pw_deinit();
|
||||
|
|
|
|||
|
|
@ -2,9 +2,12 @@
|
|||
|
||||
#include "audiocollector.hpp"
|
||||
#include "service.hpp"
|
||||
#include <qdebug.h>
|
||||
#include <qloggingcategory.h>
|
||||
#include <qthread.h>
|
||||
|
||||
Q_LOGGING_CATEGORY(lcAp, "caelestia.services.ap", QtInfoMsg)
|
||||
Q_LOGGING_CATEGORY(lcApProcessor, "caelestia.services.ap.processor", QtInfoMsg)
|
||||
|
||||
namespace caelestia::services {
|
||||
|
||||
AudioProcessor::AudioProcessor(QObject* parent)
|
||||
|
|
@ -48,7 +51,7 @@ AudioProvider::~AudioProvider() {
|
|||
|
||||
void AudioProvider::init() {
|
||||
if (!m_processor) {
|
||||
qWarning() << "AudioProvider::init: attempted to init with no processor set";
|
||||
qCWarning(lcAp) << "init: attempted to init with no processor set";
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,10 @@
|
|||
#include "audioprovider.hpp"
|
||||
#include <cava/cavacore.h>
|
||||
#include <cstddef>
|
||||
#include <qdebug.h>
|
||||
#include <qloggingcategory.h>
|
||||
|
||||
Q_LOGGING_CATEGORY(lcCava, "caelestia.services.cava", QtInfoMsg)
|
||||
Q_LOGGING_CATEGORY(lcCavaProcessor, "caelestia.services.cava.processor", QtInfoMsg)
|
||||
|
||||
namespace caelestia::services {
|
||||
|
||||
|
|
@ -57,7 +60,7 @@ void CavaProcessor::process() {
|
|||
|
||||
void CavaProcessor::setBars(int bars) {
|
||||
if (bars < 0) {
|
||||
qWarning() << "CavaProcessor::setBars: bars must be greater than 0. Setting to 0.";
|
||||
qCWarning(lcCavaProcessor) << "setBars: bars must be greater than 0. Setting to 0.";
|
||||
bars = 0;
|
||||
}
|
||||
|
||||
|
|
@ -109,7 +112,7 @@ int CavaProvider::bars() const {
|
|||
|
||||
void CavaProvider::setBars(int bars) {
|
||||
if (bars < 0) {
|
||||
qWarning() << "CavaProvider::setBars: bars must be greater than 0. Setting to 0.";
|
||||
qCWarning(lcCava) << "setBars: bars must be greater than 0. Setting to 0.";
|
||||
bars = 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
#include "service.hpp"
|
||||
|
||||
#include <qdebug.h>
|
||||
#include <qpointer.h>
|
||||
|
||||
namespace caelestia::services {
|
||||
|
|
|
|||
|
|
@ -1,9 +1,12 @@
|
|||
#include "appdb.hpp"
|
||||
|
||||
#include <qloggingcategory.h>
|
||||
#include <qsqldatabase.h>
|
||||
#include <qsqlquery.h>
|
||||
#include <quuid.h>
|
||||
|
||||
Q_LOGGING_CATEGORY(lcAppDb, "caelestia.appdb", QtInfoMsg)
|
||||
|
||||
namespace caelestia {
|
||||
|
||||
AppEntry::AppEntry(QObject* entry, unsigned int frequency, QObject* parent)
|
||||
|
|
@ -180,7 +183,7 @@ void AppDb::setFavouriteApps(const QStringList& favApps) {
|
|||
if (re.isValid()) {
|
||||
m_favouriteAppsRegex << re;
|
||||
} else {
|
||||
qWarning() << "AppDb::setFavouriteApps: Regular expression is not valid: " << re.pattern();
|
||||
qCWarning(lcAppDb) << "setFavouriteApps: regular expression is not valid:" << re.pattern();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -218,7 +221,7 @@ void AppDb::incrementFrequency(const QString& id) {
|
|||
emit appsChanged();
|
||||
}
|
||||
} else {
|
||||
qWarning() << "AppDb::incrementFrequency: could not find app with id" << id;
|
||||
qCWarning(lcAppDb) << "incrementFrequency: could not find app with id" << id;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,8 +6,11 @@
|
|||
#include <qdir.h>
|
||||
#include <qfileinfo.h>
|
||||
#include <qfuturewatcher.h>
|
||||
#include <qloggingcategory.h>
|
||||
#include <qqmlengine.h>
|
||||
|
||||
Q_LOGGING_CATEGORY(lcCUtils, "caelestia.cutils", QtInfoMsg)
|
||||
|
||||
namespace caelestia {
|
||||
|
||||
void CUtils::saveItem(QQuickItem* target, const QUrl& path) {
|
||||
|
|
@ -32,17 +35,17 @@ void CUtils::saveItem(QQuickItem* target, const QUrl& path, const QRect& rect, Q
|
|||
|
||||
void CUtils::saveItem(QQuickItem* target, const QUrl& path, const QRect& rect, QJSValue onSaved, QJSValue onFailed) {
|
||||
if (!target) {
|
||||
qWarning() << "CUtils::saveItem: a target is required";
|
||||
qCWarning(lcCUtils) << "saveItem: a target is required";
|
||||
return;
|
||||
}
|
||||
|
||||
if (!path.isLocalFile()) {
|
||||
qWarning() << "CUtils::saveItem:" << path << "is not a local file";
|
||||
qCWarning(lcCUtils) << "saveItem:" << path << "is not a local file";
|
||||
return;
|
||||
}
|
||||
|
||||
if (!target->window()) {
|
||||
qWarning() << "CUtils::saveItem: unable to save target" << target << "without a window";
|
||||
qCWarning(lcCUtils) << "saveItem: unable to save target" << target << "without a window";
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -82,7 +85,7 @@ void CUtils::saveItem(QQuickItem* target, const QUrl& path, const QRect& rect, Q
|
|||
onSaved.call(args);
|
||||
}
|
||||
} else {
|
||||
qWarning() << "CUtils::saveItem: failed to save" << path;
|
||||
qCWarning(lcCUtils) << "saveItem: failed to save" << path;
|
||||
if (onFailed.isCallable()) {
|
||||
if (engine) {
|
||||
onFailed.call({ engine->toScriptValue(QVariant::fromValue(path)) });
|
||||
|
|
@ -99,17 +102,17 @@ void CUtils::saveItem(QQuickItem* target, const QUrl& path, const QRect& rect, Q
|
|||
|
||||
bool CUtils::copyFile(const QUrl& source, const QUrl& target, bool overwrite) const {
|
||||
if (!source.isLocalFile()) {
|
||||
qWarning() << "CUtils::copyFile: source" << source << "is not a local file";
|
||||
qCWarning(lcCUtils) << "copyFile: source" << source << "is not a local file";
|
||||
return false;
|
||||
}
|
||||
if (!target.isLocalFile()) {
|
||||
qWarning() << "CUtils::copyFile: target" << target << "is not a local file";
|
||||
qCWarning(lcCUtils) << "copyFile: target" << target << "is not a local file";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (overwrite && QFile::exists(target.toLocalFile())) {
|
||||
if (!QFile::remove(target.toLocalFile())) {
|
||||
qWarning() << "CUtils::copyFile: overwrite was specified but failed to remove" << target.toLocalFile();
|
||||
qCWarning(lcCUtils) << "copyFile: overwrite was specified but failed to remove" << target.toLocalFile();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -119,7 +122,7 @@ bool CUtils::copyFile(const QUrl& source, const QUrl& target, bool overwrite) co
|
|||
|
||||
bool CUtils::deleteFile(const QUrl& path) const {
|
||||
if (!path.isLocalFile()) {
|
||||
qWarning() << "CUtils::deleteFile: path" << path << "is not a local file";
|
||||
qCWarning(lcCUtils) << "deleteFile: path" << path << "is not a local file";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -128,7 +131,7 @@ bool CUtils::deleteFile(const QUrl& path) const {
|
|||
|
||||
QString CUtils::toLocalFile(const QUrl& url) const {
|
||||
if (!url.isLocalFile()) {
|
||||
qWarning() << "CUtils::toLocalFile: given url is not a local file" << url;
|
||||
qCWarning(lcCUtils) << "toLocalFile: given url is not a local file" << url;
|
||||
return QString();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,8 +4,11 @@
|
|||
#include <QtQuick/qquickitemgrabresult.h>
|
||||
#include <qfuturewatcher.h>
|
||||
#include <qimage.h>
|
||||
#include <qloggingcategory.h>
|
||||
#include <qquickwindow.h>
|
||||
|
||||
Q_LOGGING_CATEGORY(lcImageAnalyser, "caelestia.imageanalyser", QtInfoMsg)
|
||||
|
||||
namespace caelestia {
|
||||
|
||||
ImageAnalyser::ImageAnalyser(QObject* parent)
|
||||
|
|
@ -152,7 +155,7 @@ void ImageAnalyser::update() {
|
|||
|
||||
void ImageAnalyser::analyse(QPromise<AnalyseResult>& promise, const QImage& image, int rescaleSize) {
|
||||
if (image.isNull()) {
|
||||
qWarning() << "ImageAnalyser::analyse: image is null";
|
||||
qCWarning(lcImageAnalyser) << "analyse: image is null";
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,14 @@
|
|||
#include "requests.hpp"
|
||||
|
||||
#include <qjsvalueiterator.h>
|
||||
#include <qloggingcategory.h>
|
||||
#include <qnetworkaccessmanager.h>
|
||||
#include <qnetworkcookiejar.h>
|
||||
#include <qnetworkreply.h>
|
||||
#include <qnetworkrequest.h>
|
||||
|
||||
Q_LOGGING_CATEGORY(lcRequests, "caelestia.requests", QtInfoMsg)
|
||||
|
||||
namespace caelestia {
|
||||
|
||||
Requests::Requests(QObject* parent)
|
||||
|
|
@ -14,7 +17,7 @@ Requests::Requests(QObject* parent)
|
|||
|
||||
void Requests::get(const QUrl& url, QJSValue onSuccess, QJSValue onError, QJSValue headers) const {
|
||||
if (!onSuccess.isCallable()) {
|
||||
qWarning() << "Requests::get: onSuccess is not callable";
|
||||
qCWarning(lcRequests) << "get: onSuccess is not callable";
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -41,7 +44,7 @@ void Requests::get(const QUrl& url, QJSValue onSuccess, QJSValue onError, QJSVal
|
|||
} else if (onError.isCallable()) {
|
||||
onError.call({ reply->errorString() });
|
||||
} else {
|
||||
qWarning() << "Requests::get: request failed with error" << reply->errorString();
|
||||
qCWarning(lcRequests) << "get: request failed with error" << reply->errorString();
|
||||
}
|
||||
|
||||
reply->deleteLater();
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
#include "toaster.hpp"
|
||||
|
||||
#include <qdebug.h>
|
||||
#include <qlogging.h>
|
||||
#include <qtimer.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -391,7 +391,7 @@ Singleton {
|
|||
}
|
||||
|
||||
if (!result.success && root.pendingConnection && retries < maxRetries) {
|
||||
console.warn("[NMCLI] Connection failed, retrying... (attempt " + (retries + 1) + "/" + maxRetries + ")");
|
||||
console.warn(lc, "Connection failed, retrying... (attempt " + (retries + 1) + "/" + maxRetries + ")");
|
||||
Qt.callLater(() => {
|
||||
connectWireless(ssid, password, bssid, callback, retries + 1);
|
||||
}, 1000);
|
||||
|
|
@ -417,7 +417,7 @@ Singleton {
|
|||
loadSavedConnections(() => {});
|
||||
activateConnection(ssid, callback);
|
||||
} else {
|
||||
console.warn("[NMCLI] Connection profile creation failed, trying fallback...");
|
||||
console.warn(lc, "Connection profile creation failed, trying fallback...");
|
||||
let fallbackCmd = [root.nmcliCommandDevice, root.nmcliCommandWifi, "connect", ssid, root.connectionParamPassword, password];
|
||||
executeCommand(fallbackCmd, fallbackResult => {
|
||||
if (callback)
|
||||
|
|
@ -1277,6 +1277,13 @@ Singleton {
|
|||
}
|
||||
}
|
||||
|
||||
LoggingCategory {
|
||||
id: lc
|
||||
|
||||
name: "caelestia.qml.services.nmcli"
|
||||
defaultLogLevel: LoggingCategory.Info
|
||||
}
|
||||
|
||||
component CommandProcess: Process {
|
||||
id: proc
|
||||
|
||||
|
|
|
|||
|
|
@ -454,7 +454,7 @@ Singleton {
|
|||
onStreamFinished: {
|
||||
const error = text.trim();
|
||||
if (error && !error.includes("[#]")) {
|
||||
console.warn("VPN disconnection error:", error);
|
||||
console.warn(lc, "Disconnection error:", error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -476,4 +476,11 @@ Singleton {
|
|||
interval: 500
|
||||
onTriggered: root.checkStatus()
|
||||
}
|
||||
|
||||
LoggingCategory {
|
||||
id: lc
|
||||
|
||||
name: "caelestia.qml.services.vpn"
|
||||
defaultLogLevel: LoggingCategory.Info
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue