kwin: Fix warnings

This commit is contained in:
Devin Lin 2023-10-28 12:06:59 -07:00
parent 93395acd02
commit 557c4d27e1
3 changed files with 18 additions and 20 deletions

View file

@ -26,7 +26,6 @@
"Description[x-test]": "xxAllows you to switch between running tasks with a mobile interface.xx", "Description[x-test]": "xxAllows you to switch between running tasks with a mobile interface.xx",
"Description[zh_CN]": "允许您使用移动界面在正在运行的任务之间切换。", "Description[zh_CN]": "允许您使用移动界面在正在运行的任务之间切换。",
"EnabledByDefault": true, "EnabledByDefault": true,
"Id": "mobiletaskswitcher",
"License": "GPL", "License": "GPL",
"Name": "Mobile Task Switcher", "Name": "Mobile Task Switcher",
"Name[ca@valencia]": "Commutador de tasques del mòbil", "Name[ca@valencia]": "Commutador de tasques del mòbil",

View file

@ -9,12 +9,12 @@ import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings
Item { Item {
id: root id: root
function run(client) { function run(window) {
if (!ShellSettings.Settings.convergenceModeEnabled) { if (!ShellSettings.Settings.convergenceModeEnabled) {
client.setMaximize(true, true); window.noBorder = true;
client.noBorder = true; window.setMaximize(true, true);
} else { } else {
client.noBorder = false; window.noBorder = false;
} }
} }
@ -22,11 +22,11 @@ Item {
target: ShellSettings.Settings target: ShellSettings.Settings
function onConvergenceModeEnabledChanged() { function onConvergenceModeEnabledChanged() {
const clients = KWinComponents.Workspace.windows; const windows = KWinComponents.Workspace.windows;
for (let i = 0; i < clients.length; i++) { for (let i = 0; i < windows.length; i++) {
if (clients[i].normalWindow) { if (windows[i].normalWindow) {
root.run(clients[i]); root.run(windows[i]);
} }
} }
} }
@ -35,12 +35,12 @@ Item {
Connections { Connections {
target: KWinComponents.Workspace target: KWinComponents.Workspace
function onWindowAdded(client) { function onWindowAdded(window) {
if (client.normalWindow) { if (window.normalWindow) {
client.interactiveMoveResizeFinished.connect((client) => { window.interactiveMoveResizeFinished.connect((window) => {
root.run(client); root.run(window);
}); });
root.run(client); root.run(window);
} }
} }
@ -48,11 +48,11 @@ Item {
// Windows are moved from the external screen // Windows are moved from the external screen
// to the internal screen if the external screen // to the internal screen if the external screen
// is disconnected. // is disconnected.
const clients = KWinComponents.Workspace.windows; const windows = KWinComponents.Workspace.windows;
for (var i = 0; i < clients.length; i++) { for (var i = 0; i < windows.length; i++) {
if (clients[i].normalWindow) { if (windows[i].normalWindow) {
root.run(clients[i]); root.run(windows[i]);
} }
} }
} }

View file

@ -56,8 +56,7 @@
"Description[x-test]": "xxRemoves window decorations and maximizes windows on the first screen only.xx", "Description[x-test]": "xxRemoves window decorations and maximizes windows on the first screen only.xx",
"Description[zh_CN]": "删除窗口装饰并最大化第一个屏幕上的窗口。", "Description[zh_CN]": "删除窗口装饰并最大化第一个屏幕上的窗口。",
"Icon": "preferences-system-windows", "Icon": "preferences-system-windows",
"Id": "convergentwindows", "License": "LGPL-2.1-or-later",
"Licsense": "LGPL-2.1-or-later",
"Name": "Convergent Windows", "Name": "Convergent Windows",
"Name[ca@valencia]": "Finestres convergents", "Name[ca@valencia]": "Finestres convergents",
"Name[ca]": "Finestres convergents", "Name[ca]": "Finestres convergents",