From 7a2fa4a7738f8ac8e4e5d6ff277e0947a2072d2c Mon Sep 17 00:00:00 2001 From: Ly-sec Date: Sun, 31 Aug 2025 15:28:54 +0200 Subject: [PATCH] Add debug logs to ArchUpdater --- Modules/Bar/Widgets/ActiveWindow.qml | 4 +--- Modules/Bar/Widgets/MediaMini.qml | 5 ++--- Modules/Bar/Widgets/Taskbar.qml | 9 +++++---- Services/ArchUpdaterService.qml | 23 +++++++++++++++++++++++ 4 files changed, 31 insertions(+), 10 deletions(-) diff --git a/Modules/Bar/Widgets/ActiveWindow.qml b/Modules/Bar/Widgets/ActiveWindow.qml index 19a1f0a..c9f98ca 100644 --- a/Modules/Bar/Widgets/ActiveWindow.qml +++ b/Modules/Bar/Widgets/ActiveWindow.qml @@ -19,7 +19,6 @@ Row { spacing: Style.marginS * scaling visible: getTitle() !== "" - function getTitle() { // Use the service's focusedWindowTitle property which is updated immediately // when WindowOpenedOrChanged events are received @@ -89,8 +88,7 @@ Row { width: { if (mouseArea.containsMouse) { return Math.round(Math.min(fullTitleMetrics.contentWidth, root.maxWidth * scaling)) - } - else { + } else { return Math.round(Math.min(fullTitleMetrics.contentWidth, root.minWidth * scaling)) } } diff --git a/Modules/Bar/Widgets/MediaMini.qml b/Modules/Bar/Widgets/MediaMini.qml index 7ae85be..b909a84 100644 --- a/Modules/Bar/Widgets/MediaMini.qml +++ b/Modules/Bar/Widgets/MediaMini.qml @@ -146,8 +146,7 @@ Row { width: { if (mouseArea.containsMouse) { return Math.round(Math.min(fullTitleMetrics.contentWidth, root.maxWidth * scaling)) - } - else { + } else { return Math.round(Math.min(fullTitleMetrics.contentWidth, root.minWidth * scaling)) } } @@ -216,4 +215,4 @@ Row { target: anchor positionAbove: Settings.data.bar.position === "bottom" } -} \ No newline at end of file +} diff --git a/Modules/Bar/Widgets/Taskbar.qml b/Modules/Bar/Widgets/Taskbar.qml index 04da2e0..c11fd62 100644 --- a/Modules/Bar/Widgets/Taskbar.qml +++ b/Modules/Bar/Widgets/Taskbar.qml @@ -1,4 +1,4 @@ -pragma ComponentBehavior: Bound +pragma ComponentBehavior import QtQuick import QtQuick.Controls @@ -65,9 +65,10 @@ Rectangle { cursorShape: Qt.PointingHandCursor acceptedButtons: Qt.LeftButton | Qt.RightButton - onPressed: function(mouse) { - if (!taskbarItem.modelData) return - + onPressed: function (mouse) { + if (!taskbarItem.modelData) + return + if (mouse.button === Qt.LeftButton) { try { taskbarItem.modelData.activate() diff --git a/Services/ArchUpdaterService.qml b/Services/ArchUpdaterService.qml index 120d0c3..c4953de 100644 --- a/Services/ArchUpdaterService.qml +++ b/Services/ArchUpdaterService.qml @@ -360,9 +360,16 @@ Singleton { function doPoll() { // Prevent excessive polling if (aurBusy || !canPoll) { + if (aurBusy) { + Logger.log("ArchUpdater", "Poll skipped - already checking for updates") + } else { + Logger.log("ArchUpdater", "Poll skipped - cooldown period active") + } return } + Logger.log("ArchUpdater", "Automatic poll triggered") + // Check if we have a cached AUR helper if (cachedAurHelper !== "") { // Clear error state when helper is available @@ -374,6 +381,9 @@ Singleton { checkAurUpdatesProcess.command = [cachedAurHelper, "-Qu"] checkAurOnlyProcess.command = [cachedAurHelper, getAurOnlyFlag()] + Logger.log("ArchUpdater", "Poll commands:", cachedAurHelper + " -Qu", "and", + cachedAurHelper + " " + getAurOnlyFlag()) + // Start AUR updates check (includes both repo and AUR packages) checkAurUpdatesProcess.running = true lastPollTime = Date.now() @@ -381,6 +391,7 @@ Singleton { // AUR helper detection is still in progress or failed // Try to detect again if not already in progress if (!yayCheckProcess.running && !paruCheckProcess.running) { + Logger.log("ArchUpdater", "No AUR helper cached, starting detection...") getAurHelper() } Logger.warn("ArchUpdater", "AUR helper detection in progress or failed") @@ -399,6 +410,7 @@ Singleton { // Update all packages (repo + AUR) function runUpdate() { if (totalUpdates === 0) { + Logger.log("ArchUpdater", "No updates available, polling for updates...") doPoll() return } @@ -415,6 +427,8 @@ Singleton { if (cachedAurHelper !== "" && (aurUpdates > 0 || updates > 0)) { // Use AUR helper for full system update (handles both repo and AUR) const command = generateUpdateCommand(cachedAurHelper + " -Syu") + Logger.log("ArchUpdater", "Full update command:", cachedAurHelper + " -Syu") + Logger.log("ArchUpdater", "Executing in terminal:", terminal) Quickshell.execDetached([terminal, "-e", "bash", "-c", command]) } else if (cachedAurHelper === "") { // No AUR helper found @@ -483,6 +497,8 @@ Singleton { // Reset update state (useful for manual recovery) function resetUpdateState() { + Logger.log("ArchUpdater", "Reset update state triggered") + // Clear all update states updateInProgress = false updateFailed = false @@ -503,9 +519,12 @@ Singleton { function forceRefresh() { // Prevent multiple simultaneous refreshes if (aurBusy) { + Logger.log("ArchUpdater", "Refresh skipped - already checking for updates") return } + Logger.log("ArchUpdater", "Manual refresh triggered") + // Clear error states when refreshing updateFailed = false lastUpdateError = "" @@ -523,6 +542,9 @@ Singleton { checkAurUpdatesProcess.command = [cachedAurHelper, "-Qu"] checkAurOnlyProcess.command = [cachedAurHelper, getAurOnlyFlag()] + Logger.log("ArchUpdater", "Refresh commands:", cachedAurHelper + " -Qu", "and", + cachedAurHelper + " " + getAurOnlyFlag()) + // Force refresh by bypassing cooldown checkAurUpdatesProcess.running = true lastPollTime = Date.now() @@ -530,6 +552,7 @@ Singleton { // AUR helper detection is still in progress or failed // Try to detect again if not already in progress if (!yayCheckProcess.running && !paruCheckProcess.running) { + Logger.log("ArchUpdater", "No AUR helper cached, starting detection...") getAurHelper() } Logger.warn("ArchUpdater", "AUR helper detection in progress or failed")