Cleanup all the console.log

Also renamed Github to GitHub
This commit is contained in:
quadbyte 2025-08-12 14:19:58 -04:00
parent f62a0e5f83
commit 0d196b2917
11 changed files with 47 additions and 47 deletions

View file

@ -68,7 +68,7 @@ NLoader {
anchors.fill: parent
antialiasing: true
renderTarget: Canvas.FramebufferObject
onPaint: function () {
onPaint: {
const ctx = getContext("2d")
ctx.reset()
ctx.clearRect(0, 0, width, height)

View file

@ -100,7 +100,7 @@ Item {
trayPanel.show()
} else {
console.log("Tray: no menu available for", modelData.id, "or trayMenu not set")
console.log("[Tray] no menu available for", modelData.id, "or trayMenu not set")
}
}
}

View file

@ -17,7 +17,7 @@ NLoader {
// Ensure panel shows itself once created
Component.onCompleted: {
console.log("[DemoPanel] Component completed, showing panel...")
console.log("[DemoPanel] Component completed, showing panel")
show()
}
@ -127,7 +127,7 @@ NLoader {
label: "Label"
description: "Description"
onToggled: function (value) {
console.log("NToggle: " + value)
console.log("[DemoPanel] NToggle:", value)
}
}
@ -150,7 +150,7 @@ NLoader {
optionsLabels: ["Cat", "Dog", "Bird", "Monkey", "Fish", "Turtle", "Elephant", "Tiger"]
currentKey: "cat"
onSelected: function (value) {
console.log("NComboBox: selected " + value)
console.log("[DemoPanel] NComboBox: selected ", value)
}
}

View file

@ -10,13 +10,13 @@ import qs.Widgets
ColumnLayout {
id: root
property string latestVersion: Github.latestVersion
property string latestVersion: GitHub.latestVersion
property string currentVersion: "v1.2.1" // Fallback version
property var contributors: Github.contributors
property var contributors: GitHub.contributors
Component.onCompleted: {
// Initialize the Github service
Github.init()
// Initialize the GitHub service
GitHub.init()
}
spacing: 0

View file

@ -54,7 +54,7 @@ Singleton {
function onMutedChanged() {
root._muted = (sink?.audio.muted ?? true)
console.log("[Audio] onMuteChanged " + root._muted)
console.log("[Audio] onMuteChanged:", root._muted)
}
}
}

View file

@ -10,7 +10,7 @@ Singleton {
property string githubDataFile: Quickshell.env("NOCTALIA_GITHUB_FILE") || (Settings.cacheDir + "github.json")
property int githubUpdateFrequency: 60 * 60 // 1 hour expressed in seconds
property var data: adapter // Used to access via Github.data.xxx.yyy
property var data: adapter // Used to access via GitHub.data.xxx.yyy
property bool isFetchingData: false
// Public properties for easy access
@ -32,7 +32,7 @@ Singleton {
onLoadFailed: function (error) {
if (error.toString().includes("No such file") || error === 2) {
// File doesn't exist, create it with default values
console.log("[Github] Creating new cache file...")
console.log("[GitHub] Creating new cache file")
writeAdapter()
// Fetch data after a short delay to ensure file is created
Qt.callLater(() => {
@ -59,11 +59,11 @@ Singleton {
function loadFromCache() {
const now = Date.now()
if (!data.timestamp || (now - data.timestamp > githubUpdateFrequency * 1000)) {
console.log("[Github] Cache expired or missing, fetching new data from GitHub...")
console.log("[GitHub] Cache expired or missing, fetching new data from GitHub...")
fetchFromGitHub()
return
}
console.log("[Github] Loading cached GitHub data (age: " + Math.round((now - data.timestamp) / 60000) + " minutes)")
console.log("[GitHub] Loading cached GitHub data (age:", Math.round((now - data.timestamp) / 60000),"minutes)")
if (data.version) {
root.latestVersion = data.version
@ -76,7 +76,7 @@ Singleton {
// --------------------------------
function fetchFromGitHub() {
if (isFetchingData) {
console.warn("[Github] GitHub data is still fetching")
console.warn("[GitHub] GitHub data is still fetching")
return
}
@ -122,15 +122,15 @@ Singleton {
const version = data.tag_name
root.data.version = version
root.latestVersion = version
console.log("[Github] Latest version fetched from GitHub:", version)
console.log("[GitHub] Latest version fetched from GitHub:", version)
} else {
console.log("[Github] No tag_name in GitHub response")
console.log("[GitHub] No tag_name in GitHub response")
}
} else {
console.log("[Github] Empty response from GitHub API")
console.log("[GitHub] Empty response from GitHub API")
}
} catch (e) {
console.error("[Github] Failed to parse version:", e)
console.error("[GitHub] Failed to parse version:", e)
}
// Check if both processes are done
@ -152,14 +152,14 @@ Singleton {
const data = JSON.parse(response)
root.data.contributors = data || []
root.contributors = root.data.contributors
console.log("[Github] Contributors fetched from GitHub:", root.contributors.length)
console.log("[GitHub] Contributors fetched from GitHub:", root.contributors.length)
} else {
console.log("[Github] Empty response from GitHub API for contributors")
console.log("[GitHub] Empty response from GitHub API for contributors")
root.data.contributors = []
root.contributors = []
}
} catch (e) {
console.error("[Github] Failed to parse contributors:", e)
console.error("[GitHub] Failed to parse contributors:", e)
root.data.contributors = []
root.contributors = []
}

View file

@ -90,7 +90,7 @@ Singleton {
if ((data.latitude === "") || (data.longitude === "") || (data.name !== Settings.data.location.name)) {
_geocodeLocation(Settings.data.location.name, function (latitude, longitude) {
console.log("[Location] Geocoded " + Settings.data.location.name + " to: " + latitude + " / " + longitude)
console.log("[Location] Geocoded", Settings.data.location.name, "to:", latitude, "/", longitude)
// Save location name
data.name = Settings.data.location.name

View file

@ -38,11 +38,6 @@ Singleton {
}
FileView {
// TBC ? needed for SWWW only ?
// Qt.callLater(function () {
// WallpaperManager.setCurrentWallpaper(settings.currentWallpaper, true);
// })
path: settingsFile
watchChanges: true
onFileChanged: reload()

View file

@ -13,7 +13,7 @@ Singleton {
loadWallpapers()
// Only set initial wallpaper if it's not empty
if (currentWallpaper !== "") {
console.log("Wallpapers: Initializing with wallpaper:", currentWallpaper)
console.log("[WP] initializing with:", currentWallpaper)
setCurrentWallpaper(currentWallpaper, true)
}
// Don't start random wallpaper during initialization
@ -34,7 +34,7 @@ Singleton {
}
function changeWallpaper(path) {
console.log("Wallpapers: changeWallpaper called with:", path)
console.log("[WP] changing to:", path)
setCurrentWallpaper(path, false)
}
@ -54,7 +54,7 @@ Singleton {
changeWallpaperProcess.running = true
} else {
// Fallback: update the settings directly for non-SWWW mode
console.log("Non-SWWW mode: Setting wallpaper directly")
//console.log("[WP] Not using Swww, setting wallpaper directly")
}
if (randomWallpaperTimer.running) {
@ -97,7 +97,7 @@ Singleton {
function startSWWWDaemon() {
if (Settings.data.wallpaper.swww.enabled) {
console.log("SWWW: Attempting to start swww-daemon...")
console.log("[SWWW] Requesting swww-daemon")
startDaemonProcess.running = true
}
}
@ -144,10 +144,10 @@ Singleton {
}
onExited: function (exitCode, exitStatus) {
console.log("SWWW: Process finished with exit code:", exitCode, "status:", exitStatus)
console.log("[SWWW] Process finished with exit code:", exitCode, "status:", exitStatus)
if (exitCode !== 0) {
console.log("SWWW: Process failed. Make sure swww-daemon is running with: swww-daemon")
console.log("SWWW: You can start it with: swww-daemon --format xrgb")
console.log("[SWWW] Process failed. Make sure swww-daemon is running with: swww-daemon")
console.log("[SWWW] You can start it with: swww-daemon --format xrgb")
}
}
}
@ -157,6 +157,11 @@ Singleton {
command: ["wallust", "run", currentWallpaper, "-u", "-k", "-d", "Assets/Wallust"]
workingDirectory: Quickshell.shellDir
running: false
stdout: StdioCollector {
onStreamFinished: {
// console.log(this.text)
}
}
}
Process {
@ -165,15 +170,15 @@ Singleton {
running: false
onStarted: {
console.log("SWWW: Daemon start process initiated")
console.log("[SWWW] Daemon start process initiated")
}
onExited: function (exitCode, exitStatus) {
console.log("SWWW: Daemon start process finished with exit code:", exitCode)
console.log("[SWWW] Daemon start process finished with exit code:", exitCode)
if (exitCode === 0) {
console.log("SWWW: Daemon started successfully")
console.log("[SWWW] Daemon started successfully")
} else {
console.log("SWWW: Failed to start daemon. It might already be running.")
console.log("[SWWW] Failed to start daemon, may already be running")
}
}
}

View file

@ -17,7 +17,7 @@ Singleton {
property var hlWorkspaces: Hyprland.workspaces.values
// Detect which compositor we're using
Component.onCompleted: {
console.log("WorkspaceManager initializing...")
console.log("[WS] Initializing workspaces service")
detectCompositor()
}
@ -25,27 +25,27 @@ Singleton {
try {
try {
if (Hyprland.eventSocketPath) {
console.log("Detected Hyprland compositor")
console.log("[WS] Detected Hyprland compositor")
isHyprland = true
isNiri = false
initHyprland()
return
}
} catch (e) {
console.log("Hyprland not available:", e)
console.log("[WS] Hyprland not available:", e)
}
if (typeof Niri !== "undefined") {
console.log("Detected Niri service")
console.log("[WS] Detected Niri service")
isHyprland = false
isNiri = true
initNiri()
return
}
console.log("No supported compositor detected")
console.log("[WS] Could not detect any supported compositor")
} catch (e) {
console.error("Error detecting compositor:", e)
console.error("[WS] Error detecting compositor:", e)
}
}
@ -102,7 +102,7 @@ Singleton {
}
workspacesChanged()
} catch (e) {
console.error("Error updating Hyprland workspaces:", e)
console.error("[WS] Error updating Hyprland workspaces:", e)
}
}

View file

@ -18,7 +18,7 @@ Loader {
sourceComponent: content
// onLoaded: {
// console.log("NLoader onLoaded: " + item.toString());
// console.log("[NLoader] onLoaded:", item.toString());
// }
onActiveChanged: {
if (active && item && item.show) {