From 62ec1b9f334cba7cb7e85196a0e27970640e0c78 Mon Sep 17 00:00:00 2001 From: zach Date: Tue, 19 May 2026 16:15:39 +0200 Subject: [PATCH] cleanup unneeded logging --- Drawers/DrawingInput.qml | 1 - Greeter/Helpers/SystemUsage.qml | 1 - Greeter/Helpers/Users.qml | 64 +++++++++-------------------- Modules/Launcher/Services/Apps.qml | 1 - Modules/Settings/SettingsSearch.qml | 2 - Modules/Shortcuts.qml | 1 - 6 files changed, 20 insertions(+), 50 deletions(-) diff --git a/Drawers/DrawingInput.qml b/Drawers/DrawingInput.qml index 3fdcd33..0851a66 100644 --- a/Drawers/DrawingInput.qml +++ b/Drawers/DrawingInput.qml @@ -32,7 +32,6 @@ CustomMouseArea { if (root.visibilities.isDrawing && (event.buttons & Qt.LeftButton)) { root.drawing.points.push(Qt.point(x, y)); - console.log(root.drawing.points); root.drawing.requestPaint(); } diff --git a/Greeter/Helpers/SystemUsage.qml b/Greeter/Helpers/SystemUsage.qml index e613060..11813f3 100644 --- a/Greeter/Helpers/SystemUsage.qml +++ b/Greeter/Helpers/SystemUsage.qml @@ -346,7 +346,6 @@ Singleton { stdout: StdioCollector { onStreamFinished: { - console.log("this is running"); if (root.gpuType === "GENERIC") { const percs = text.trim().split("\n"); const sum = percs.reduce((acc, d) => acc + parseInt(d, 10), 0); diff --git a/Greeter/Helpers/Users.qml b/Greeter/Helpers/Users.qml index d2ffdc9..77a9935 100644 --- a/Greeter/Helpers/Users.qml +++ b/Greeter/Helpers/Users.qml @@ -7,23 +7,30 @@ import QtQuick Singleton { id: root - // The list of users that can log in graphically - // Each user object has: username, uid, home, shell, gecos (full name), face (avatar path) + readonly property string defaultUserFile: "/etc/zshell-greeter/default-user" + property int selectedIndex: 0 + readonly property var selectedUser: selectedIndex >= 0 && selectedIndex < users.length ? users[selectedIndex] : null + readonly property string selectedUsername: selectedUser ? selectedUser.username : "" property var users: [] - // The currently selected user index - property int selectedIndex: 0 + function saveDefaultUser(): void { + if (selectedUser) { + defaultUserStorage.setText(selectedUser.username); + } + } - // The currently selected user object (or null if none) - readonly property var selectedUser: selectedIndex >= 0 && selectedIndex < users.length ? users[selectedIndex] : null + function selectNext(): void { + if (users.length === 0) + return; + selectedIndex = (selectedIndex + 1) % users.length; + } - // Convenience property for the selected username - readonly property string selectedUsername: selectedUser ? selectedUser.username : "" + function selectPrevious(): void { + if (users.length === 0) + return; + selectedIndex = (selectedIndex - 1 + users.length) % users.length; + } - // Path to store the default user preference - readonly property string defaultUserFile: "/etc/zshell-greeter/default-user" - - // Select a user by username function selectUser(username: string): bool { for (let i = 0; i < users.length; i++) { if (users[i].username === username) { @@ -34,28 +41,6 @@ Singleton { return false; } - // Select the next user in the list (wraps around) - function selectNext(): void { - if (users.length === 0) - return; - selectedIndex = (selectedIndex + 1) % users.length; - } - - // Select the previous user in the list (wraps around) - function selectPrevious(): void { - if (users.length === 0) - return; - selectedIndex = (selectedIndex - 1 + users.length) % users.length; - } - - // Save the current user as the default for next login - function saveDefaultUser(): void { - if (selectedUser) { - defaultUserStorage.setText(selectedUser.username); - } - } - - // Process to fetch the list of graphical users Process { id: userLister @@ -67,13 +52,10 @@ Singleton { try { root.users = JSON.parse(text); - // If we have users and no selection yet, try to select the default user if (root.users.length > 0) { - // Try to load the default user if (defaultUserStorage.loaded) { const defaultUsername = defaultUserStorage.text().trim(); if (defaultUsername && !root.selectUser(defaultUsername)) { - // Default user not found, select first user root.selectedIndex = 0; } } else { @@ -87,15 +69,14 @@ Singleton { } } - // FileView for persisting the default user FileView { id: defaultUserStorage path: root.defaultUserFile preload: true + onLoadFailed: {} onLoaded: { - // If users are already loaded, try to select the default user if (root.users.length > 0) { const defaultUsername = text().trim(); if (defaultUsername) { @@ -103,10 +84,5 @@ Singleton { } } } - - onLoadFailed: { - // File doesn't exist yet, that's fine - we'll create it on first save - console.log("No default user file found, will use first user"); - } } } diff --git a/Modules/Launcher/Services/Apps.qml b/Modules/Launcher/Services/Apps.qml index 3d4446c..dbd10fd 100644 --- a/Modules/Launcher/Services/Apps.qml +++ b/Modules/Launcher/Services/Apps.qml @@ -13,7 +13,6 @@ Searcher { function launch(entry: DesktopEntry): void { appDb.incrementFrequency(entry.id); - console.log(root.command); if (entry.runInTerminal) Quickshell.execDetached({ diff --git a/Modules/Settings/SettingsSearch.qml b/Modules/Settings/SettingsSearch.qml index cd69af7..ac7906e 100644 --- a/Modules/Settings/SettingsSearch.qml +++ b/Modules/Settings/SettingsSearch.qml @@ -51,8 +51,6 @@ Item { implicitHeight: searchContainer.implicitHeight implicitWidth: 200 - Component.onCompleted: console.log(root.height) - Shortcut { sequence: "/" diff --git a/Modules/Shortcuts.qml b/Modules/Shortcuts.qml index 82a27d3..0a57d75 100644 --- a/Modules/Shortcuts.qml +++ b/Modules/Shortcuts.qml @@ -19,7 +19,6 @@ Scope { if (!root.launcherInterrupted && !root.hasFullscreen) { const visibilities = Visibilities.getForActive(); visibilities.launcher = !visibilities.launcher; - console.log(root.launcherInterrupted); } root.launcherInterrupted = false; }