From fb5aa0313e961b26c95cba740aa67df01042c788 Mon Sep 17 00:00:00 2001 From: bbedward Date: Thu, 2 Oct 2025 12:24:45 -0400 Subject: [PATCH] cleanup debug logs, fix center section plugins --- Modules/DankBar/CenterSection.qml | 8 +++----- Modules/Settings/PluginsTab.qml | 2 +- Services/DisplayService.qml | 1 - Services/PluginService.qml | 28 +--------------------------- 4 files changed, 5 insertions(+), 34 deletions(-) diff --git a/Modules/DankBar/CenterSection.qml b/Modules/DankBar/CenterSection.qml index 8b340ab8..c6af4ebc 100644 --- a/Modules/DankBar/CenterSection.qml +++ b/Modules/DankBar/CenterSection.qml @@ -397,12 +397,10 @@ Item { // Inject PluginService for plugin widgets if (item.pluginService !== undefined) { - console.log("CenterSection: Injecting PluginService into plugin widget:", model.widgetId) - item.pluginService = PluginService - if (item.loadTimezones) { - console.log("CenterSection: Calling loadTimezones for widget:", model.widgetId) - item.loadTimezones() + if (item.pluginId !== undefined) { + item.pluginId = model.widgetId } + item.pluginService = PluginService } layoutTimer.restart() diff --git a/Modules/Settings/PluginsTab.qml b/Modules/Settings/PluginsTab.qml index 78571cdf..d95990e8 100644 --- a/Modules/Settings/PluginsTab.qml +++ b/Modules/Settings/PluginsTab.qml @@ -306,7 +306,7 @@ Item { if (PluginService.disablePlugin(currentPluginId)) { ToastService.showInfo("Plugin disabled: " + currentPluginName) if (pluginDelegate.isExpanded) { - expandedPluginId = "" + pluginsTab.expandedPluginId = "" } } else { ToastService.showError("Failed to disable plugin: " + currentPluginName) diff --git a/Services/DisplayService.qml b/Services/DisplayService.qml index d5ed51c9..c0ec9c9b 100644 --- a/Services/DisplayService.qml +++ b/Services/DisplayService.qml @@ -708,7 +708,6 @@ Singleton { onExited: function (exitCode) { geoclueAvailable = (exitCode === 0) - console.log("DisplayService: geoclue available:", geoclueAvailable) } } diff --git a/Services/PluginService.qml b/Services/PluginService.qml index ee89a3d4..d36c9fa1 100644 --- a/Services/PluginService.qml +++ b/Services/PluginService.qml @@ -54,20 +54,14 @@ Singleton { var dir = directories[i].trim() if (dir) { var manifestPath = currentDir + "/" + dir + "/plugin.json" - console.log("PluginService: Found plugin directory:", dir, "checking manifest at:", manifestPath) loadPluginManifest(manifestPath) } } - } else { - console.log("PluginService: No directories found in:", currentDir) } } } onExited: function(exitCode) { - if (exitCode !== 0) { - console.log("PluginService: Directory scan failed for:", pluginDirectories[currentScanIndex], "exit code:", exitCode) - } currentScanIndex++ if (currentScanIndex < pluginDirectories.length) { scanNextDirectory() @@ -84,7 +78,6 @@ Singleton { function scanNextDirectory() { var dir = pluginDirectories[currentScanIndex] - console.log("PluginService: Scanning directory:", dir) lsProcess.command = ["find", "-L", dir, "-maxdepth", "1", "-type", "d", "-not", "-path", dir, "-exec", "basename", "{}", ";"] lsProcess.running = true } @@ -92,9 +85,6 @@ Singleton { property var manifestReaders: ({}) function loadPluginManifest(manifestPath) { - console.log("PluginService: Loading manifest:", manifestPath) - - // Create a unique key for this manifest reader var readerId = "reader_" + Date.now() + "_" + Math.random() var catProcess = Qt.createComponent("data:text/plain,import Quickshell.Io; Process { stdout: StdioCollector { } }") @@ -103,9 +93,7 @@ Singleton { process.command = ["cat", manifestPath] process.stdout.streamFinished.connect(function() { try { - console.log("PluginService: DEBUGGING parsing manifest, text length:", process.stdout.text.length) var manifest = JSON.parse(process.stdout.text.trim()) - console.log("PluginService: Successfully parsed manifest for plugin:", manifest.id) processManifest(manifest, manifestPath) } catch (e) { console.error("PluginService: Failed to parse manifest", manifestPath, ":", e.message) @@ -138,7 +126,6 @@ Singleton { } function registerPlugin(manifest, manifestPath) { - console.log("PluginService: registerPlugin called with", manifest.id) if (!manifest.id || !manifest.name || !manifest.component) { console.error("PluginService: Invalid manifest, missing required fields:", manifestPath) return @@ -168,8 +155,6 @@ Singleton { pluginInfo.loaded = false availablePlugins[manifest.id] = pluginInfo - console.log("PluginService: Registered plugin:", manifest.id, "-", manifest.name) - console.log("PluginService: Component path:", pluginInfo.componentPath) } function hasPermission(pluginId, permission) { @@ -182,7 +167,6 @@ Singleton { } function loadPlugin(pluginId) { - console.log("PluginService: loadPlugin called for", pluginId) var plugin = availablePlugins[pluginId] if (!plugin) { console.error("PluginService: Plugin not found:", pluginId) @@ -191,7 +175,6 @@ Singleton { } if (plugin.loaded) { - console.log("PluginService: Plugin already loaded:", pluginId) return true } @@ -205,8 +188,6 @@ Singleton { try { var componentUrl = "file://" + plugin.componentPath - console.log("PluginService: Loading component from:", componentUrl) - var component = Qt.createComponent(componentUrl, Component.PreferSynchronous) if (component.status === Component.Loading) { @@ -233,7 +214,6 @@ Singleton { plugin.loaded = true loadedPlugins[pluginId] = plugin - console.log("PluginService: Successfully loaded plugin:", pluginId) pluginLoaded(pluginId) return true @@ -265,7 +245,6 @@ Singleton { plugin.loaded = false delete loadedPlugins[pluginId] - console.log("PluginService: Successfully unloaded plugin:", pluginId) pluginUnloaded(pluginId) return true @@ -300,13 +279,11 @@ Singleton { } function enablePlugin(pluginId) { - console.log("PluginService: Enabling plugin:", pluginId) SettingsData.setPluginSetting(pluginId, "enabled", true) return loadPlugin(pluginId) } function disablePlugin(pluginId) { - console.log("PluginService: Disabling plugin:", pluginId) SettingsData.setPluginSetting(pluginId, "enabled", false) return unloadPlugin(pluginId) } @@ -329,15 +306,12 @@ Singleton { } function createPluginDirectory() { - console.log("PluginService: Creating plugin directory:", pluginDirectory) var mkdirProcess = Qt.createComponent("data:text/plain,import Quickshell.Io; Process { }") if (mkdirProcess.status === Component.Ready) { var process = mkdirProcess.createObject(root) process.command = ["mkdir", "-p", pluginDirectory] process.exited.connect(function(exitCode) { - if (exitCode === 0) { - console.log("PluginService: Successfully created plugin directory") - } else { + if (exitCode !== 0) { console.error("PluginService: Failed to create plugin directory, exit code:", exitCode) } process.destroy()