cleanup unneeded logging
This commit is contained in:
@@ -32,7 +32,6 @@ CustomMouseArea {
|
|||||||
|
|
||||||
if (root.visibilities.isDrawing && (event.buttons & Qt.LeftButton)) {
|
if (root.visibilities.isDrawing && (event.buttons & Qt.LeftButton)) {
|
||||||
root.drawing.points.push(Qt.point(x, y));
|
root.drawing.points.push(Qt.point(x, y));
|
||||||
console.log(root.drawing.points);
|
|
||||||
root.drawing.requestPaint();
|
root.drawing.requestPaint();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -346,7 +346,6 @@ Singleton {
|
|||||||
|
|
||||||
stdout: StdioCollector {
|
stdout: StdioCollector {
|
||||||
onStreamFinished: {
|
onStreamFinished: {
|
||||||
console.log("this is running");
|
|
||||||
if (root.gpuType === "GENERIC") {
|
if (root.gpuType === "GENERIC") {
|
||||||
const percs = text.trim().split("\n");
|
const percs = text.trim().split("\n");
|
||||||
const sum = percs.reduce((acc, d) => acc + parseInt(d, 10), 0);
|
const sum = percs.reduce((acc, d) => acc + parseInt(d, 10), 0);
|
||||||
|
|||||||
+20
-44
@@ -7,23 +7,30 @@ import QtQuick
|
|||||||
Singleton {
|
Singleton {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
// The list of users that can log in graphically
|
readonly property string defaultUserFile: "/etc/zshell-greeter/default-user"
|
||||||
// Each user object has: username, uid, home, shell, gecos (full name), face (avatar path)
|
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: []
|
property var users: []
|
||||||
|
|
||||||
// The currently selected user index
|
function saveDefaultUser(): void {
|
||||||
property int selectedIndex: 0
|
if (selectedUser) {
|
||||||
|
defaultUserStorage.setText(selectedUser.username);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// The currently selected user object (or null if none)
|
function selectNext(): void {
|
||||||
readonly property var selectedUser: selectedIndex >= 0 && selectedIndex < users.length ? users[selectedIndex] : null
|
if (users.length === 0)
|
||||||
|
return;
|
||||||
|
selectedIndex = (selectedIndex + 1) % users.length;
|
||||||
|
}
|
||||||
|
|
||||||
// Convenience property for the selected username
|
function selectPrevious(): void {
|
||||||
readonly property string selectedUsername: selectedUser ? selectedUser.username : ""
|
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 {
|
function selectUser(username: string): bool {
|
||||||
for (let i = 0; i < users.length; i++) {
|
for (let i = 0; i < users.length; i++) {
|
||||||
if (users[i].username === username) {
|
if (users[i].username === username) {
|
||||||
@@ -34,28 +41,6 @@ Singleton {
|
|||||||
return false;
|
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 {
|
Process {
|
||||||
id: userLister
|
id: userLister
|
||||||
|
|
||||||
@@ -67,13 +52,10 @@ Singleton {
|
|||||||
try {
|
try {
|
||||||
root.users = JSON.parse(text);
|
root.users = JSON.parse(text);
|
||||||
|
|
||||||
// If we have users and no selection yet, try to select the default user
|
|
||||||
if (root.users.length > 0) {
|
if (root.users.length > 0) {
|
||||||
// Try to load the default user
|
|
||||||
if (defaultUserStorage.loaded) {
|
if (defaultUserStorage.loaded) {
|
||||||
const defaultUsername = defaultUserStorage.text().trim();
|
const defaultUsername = defaultUserStorage.text().trim();
|
||||||
if (defaultUsername && !root.selectUser(defaultUsername)) {
|
if (defaultUsername && !root.selectUser(defaultUsername)) {
|
||||||
// Default user not found, select first user
|
|
||||||
root.selectedIndex = 0;
|
root.selectedIndex = 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -87,15 +69,14 @@ Singleton {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// FileView for persisting the default user
|
|
||||||
FileView {
|
FileView {
|
||||||
id: defaultUserStorage
|
id: defaultUserStorage
|
||||||
|
|
||||||
path: root.defaultUserFile
|
path: root.defaultUserFile
|
||||||
preload: true
|
preload: true
|
||||||
|
|
||||||
|
onLoadFailed: {}
|
||||||
onLoaded: {
|
onLoaded: {
|
||||||
// If users are already loaded, try to select the default user
|
|
||||||
if (root.users.length > 0) {
|
if (root.users.length > 0) {
|
||||||
const defaultUsername = text().trim();
|
const defaultUsername = text().trim();
|
||||||
if (defaultUsername) {
|
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");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ Searcher {
|
|||||||
|
|
||||||
function launch(entry: DesktopEntry): void {
|
function launch(entry: DesktopEntry): void {
|
||||||
appDb.incrementFrequency(entry.id);
|
appDb.incrementFrequency(entry.id);
|
||||||
console.log(root.command);
|
|
||||||
|
|
||||||
if (entry.runInTerminal)
|
if (entry.runInTerminal)
|
||||||
Quickshell.execDetached({
|
Quickshell.execDetached({
|
||||||
|
|||||||
@@ -51,8 +51,6 @@ Item {
|
|||||||
implicitHeight: searchContainer.implicitHeight
|
implicitHeight: searchContainer.implicitHeight
|
||||||
implicitWidth: 200
|
implicitWidth: 200
|
||||||
|
|
||||||
Component.onCompleted: console.log(root.height)
|
|
||||||
|
|
||||||
Shortcut {
|
Shortcut {
|
||||||
sequence: "/"
|
sequence: "/"
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ Scope {
|
|||||||
if (!root.launcherInterrupted && !root.hasFullscreen) {
|
if (!root.launcherInterrupted && !root.hasFullscreen) {
|
||||||
const visibilities = Visibilities.getForActive();
|
const visibilities = Visibilities.getForActive();
|
||||||
visibilities.launcher = !visibilities.launcher;
|
visibilities.launcher = !visibilities.launcher;
|
||||||
console.log(root.launcherInterrupted);
|
|
||||||
}
|
}
|
||||||
root.launcherInterrupted = false;
|
root.launcherInterrupted = false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user