Edit WifiPanel.qml

This commit is contained in:
Ly-sec 2025-08-03 18:08:48 +02:00
parent 70c0debe99
commit 9fce72f054

View file

@ -151,17 +151,16 @@ Item {
function replaceQuickshell(ssid: string): string {
const newName = ssid.replace("quickshell-", "");
if (!ssid.startsWith("quickshell-")){
if (!ssid.startsWith("quickshell-")) {
return newName;
}
if (newName in wifiLogic.networks){
if (wifiLogic.networks && newName in wifiLogic.networks) {
console.log(`Quickshell ${newName} already exists, deleting old profile`)
deleteProfileProcess.connName = ssid;
deleteProfileProcess.running = true;
}
console.log(`Changing from ${ssid} to ${newName}`)
renameConnectionProcess.oldName = ssid;
renameConnectionProcess.newName = newName;
@ -256,17 +255,22 @@ Item {
stdout: StdioCollector {
onStreamFinished: {
console.log("Renamed connection '" + renameConnectionProcess.oldName + "' to '" + renameConnectionProcess.newName + "'");
console.log("Successfully renamed connection '" +
renameConnectionProcess.oldName + "' to '" +
renameConnectionProcess.newName + "'");
}
}
stderr: StdioCollector {
onStreamFinished: {
console.error("Error renaming connection '" + renameConnectionProcess.oldName + "':", text);
if (text.trim() !== "" && !text.toLowerCase().includes("warning")) {
console.error("Error renaming connection:", text);
}
}
}
}
// Process to rename a connection
Process {
id: deleteProfileProcess