Add debug logs to ArchUpdater

This commit is contained in:
Ly-sec 2025-08-31 15:28:54 +02:00
parent ff0c83a04c
commit 7a2fa4a773
4 changed files with 31 additions and 10 deletions

View file

@ -19,7 +19,6 @@ Row {
spacing: Style.marginS * scaling spacing: Style.marginS * scaling
visible: getTitle() !== "" visible: getTitle() !== ""
function getTitle() { function getTitle() {
// Use the service's focusedWindowTitle property which is updated immediately // Use the service's focusedWindowTitle property which is updated immediately
// when WindowOpenedOrChanged events are received // when WindowOpenedOrChanged events are received
@ -89,8 +88,7 @@ Row {
width: { width: {
if (mouseArea.containsMouse) { if (mouseArea.containsMouse) {
return Math.round(Math.min(fullTitleMetrics.contentWidth, root.maxWidth * scaling)) return Math.round(Math.min(fullTitleMetrics.contentWidth, root.maxWidth * scaling))
} } else {
else {
return Math.round(Math.min(fullTitleMetrics.contentWidth, root.minWidth * scaling)) return Math.round(Math.min(fullTitleMetrics.contentWidth, root.minWidth * scaling))
} }
} }

View file

@ -146,8 +146,7 @@ Row {
width: { width: {
if (mouseArea.containsMouse) { if (mouseArea.containsMouse) {
return Math.round(Math.min(fullTitleMetrics.contentWidth, root.maxWidth * scaling)) return Math.round(Math.min(fullTitleMetrics.contentWidth, root.maxWidth * scaling))
} } else {
else {
return Math.round(Math.min(fullTitleMetrics.contentWidth, root.minWidth * scaling)) return Math.round(Math.min(fullTitleMetrics.contentWidth, root.minWidth * scaling))
} }
} }

View file

@ -1,4 +1,4 @@
pragma ComponentBehavior: Bound pragma ComponentBehavior
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
@ -65,8 +65,9 @@ Rectangle {
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
acceptedButtons: Qt.LeftButton | Qt.RightButton acceptedButtons: Qt.LeftButton | Qt.RightButton
onPressed: function(mouse) { onPressed: function (mouse) {
if (!taskbarItem.modelData) return if (!taskbarItem.modelData)
return
if (mouse.button === Qt.LeftButton) { if (mouse.button === Qt.LeftButton) {
try { try {

View file

@ -360,9 +360,16 @@ Singleton {
function doPoll() { function doPoll() {
// Prevent excessive polling // Prevent excessive polling
if (aurBusy || !canPoll) { if (aurBusy || !canPoll) {
if (aurBusy) {
Logger.log("ArchUpdater", "Poll skipped - already checking for updates")
} else {
Logger.log("ArchUpdater", "Poll skipped - cooldown period active")
}
return return
} }
Logger.log("ArchUpdater", "Automatic poll triggered")
// Check if we have a cached AUR helper // Check if we have a cached AUR helper
if (cachedAurHelper !== "") { if (cachedAurHelper !== "") {
// Clear error state when helper is available // Clear error state when helper is available
@ -374,6 +381,9 @@ Singleton {
checkAurUpdatesProcess.command = [cachedAurHelper, "-Qu"] checkAurUpdatesProcess.command = [cachedAurHelper, "-Qu"]
checkAurOnlyProcess.command = [cachedAurHelper, getAurOnlyFlag()] checkAurOnlyProcess.command = [cachedAurHelper, getAurOnlyFlag()]
Logger.log("ArchUpdater", "Poll commands:", cachedAurHelper + " -Qu", "and",
cachedAurHelper + " " + getAurOnlyFlag())
// Start AUR updates check (includes both repo and AUR packages) // Start AUR updates check (includes both repo and AUR packages)
checkAurUpdatesProcess.running = true checkAurUpdatesProcess.running = true
lastPollTime = Date.now() lastPollTime = Date.now()
@ -381,6 +391,7 @@ Singleton {
// AUR helper detection is still in progress or failed // AUR helper detection is still in progress or failed
// Try to detect again if not already in progress // Try to detect again if not already in progress
if (!yayCheckProcess.running && !paruCheckProcess.running) { if (!yayCheckProcess.running && !paruCheckProcess.running) {
Logger.log("ArchUpdater", "No AUR helper cached, starting detection...")
getAurHelper() getAurHelper()
} }
Logger.warn("ArchUpdater", "AUR helper detection in progress or failed") Logger.warn("ArchUpdater", "AUR helper detection in progress or failed")
@ -399,6 +410,7 @@ Singleton {
// Update all packages (repo + AUR) // Update all packages (repo + AUR)
function runUpdate() { function runUpdate() {
if (totalUpdates === 0) { if (totalUpdates === 0) {
Logger.log("ArchUpdater", "No updates available, polling for updates...")
doPoll() doPoll()
return return
} }
@ -415,6 +427,8 @@ Singleton {
if (cachedAurHelper !== "" && (aurUpdates > 0 || updates > 0)) { if (cachedAurHelper !== "" && (aurUpdates > 0 || updates > 0)) {
// Use AUR helper for full system update (handles both repo and AUR) // Use AUR helper for full system update (handles both repo and AUR)
const command = generateUpdateCommand(cachedAurHelper + " -Syu") 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]) Quickshell.execDetached([terminal, "-e", "bash", "-c", command])
} else if (cachedAurHelper === "") { } else if (cachedAurHelper === "") {
// No AUR helper found // No AUR helper found
@ -483,6 +497,8 @@ Singleton {
// Reset update state (useful for manual recovery) // Reset update state (useful for manual recovery)
function resetUpdateState() { function resetUpdateState() {
Logger.log("ArchUpdater", "Reset update state triggered")
// Clear all update states // Clear all update states
updateInProgress = false updateInProgress = false
updateFailed = false updateFailed = false
@ -503,9 +519,12 @@ Singleton {
function forceRefresh() { function forceRefresh() {
// Prevent multiple simultaneous refreshes // Prevent multiple simultaneous refreshes
if (aurBusy) { if (aurBusy) {
Logger.log("ArchUpdater", "Refresh skipped - already checking for updates")
return return
} }
Logger.log("ArchUpdater", "Manual refresh triggered")
// Clear error states when refreshing // Clear error states when refreshing
updateFailed = false updateFailed = false
lastUpdateError = "" lastUpdateError = ""
@ -523,6 +542,9 @@ Singleton {
checkAurUpdatesProcess.command = [cachedAurHelper, "-Qu"] checkAurUpdatesProcess.command = [cachedAurHelper, "-Qu"]
checkAurOnlyProcess.command = [cachedAurHelper, getAurOnlyFlag()] checkAurOnlyProcess.command = [cachedAurHelper, getAurOnlyFlag()]
Logger.log("ArchUpdater", "Refresh commands:", cachedAurHelper + " -Qu", "and",
cachedAurHelper + " " + getAurOnlyFlag())
// Force refresh by bypassing cooldown // Force refresh by bypassing cooldown
checkAurUpdatesProcess.running = true checkAurUpdatesProcess.running = true
lastPollTime = Date.now() lastPollTime = Date.now()
@ -530,6 +552,7 @@ Singleton {
// AUR helper detection is still in progress or failed // AUR helper detection is still in progress or failed
// Try to detect again if not already in progress // Try to detect again if not already in progress
if (!yayCheckProcess.running && !paruCheckProcess.running) { if (!yayCheckProcess.running && !paruCheckProcess.running) {
Logger.log("ArchUpdater", "No AUR helper cached, starting detection...")
getAurHelper() getAurHelper()
} }
Logger.warn("ArchUpdater", "AUR helper detection in progress or failed") Logger.warn("ArchUpdater", "AUR helper detection in progress or failed")