chore: fix rest of linter warnings

This commit is contained in:
2 * r + 2 * t 2026-03-22 01:31:52 +11:00
parent be3da5a114
commit 2a54c089a4
35 changed files with 114 additions and 61 deletions

View file

@ -1,7 +1,9 @@
import Quickshell
import Quickshell.Wayland
// qmllint disable uncreatable-type
PanelWindow {
// qmllint enable uncreatable-type
required property string name
WlrLayershell.namespace: `caelestia-${name}`

View file

@ -44,7 +44,7 @@ StyledRect {
step: root.step
value: root.value
onValueModified: value => {
root.onValueModified(value);
root.onValueModified(value); // qmllint disable use-proper-function
}
}
}

View file

@ -40,7 +40,7 @@ StyledRect {
checked: root.checked
enabled: root.enabled
onToggled: {
root.onToggled(checked);
root.onToggled(checked); // qmllint disable use-proper-function
}
}
}

View file

@ -1,5 +1,7 @@
import Quickshell.Hyprland
// qmllint disable unresolved-type
GlobalShortcut {
// qmllint enable unresolved-type
appid: "caelestia"
}

View file

@ -5,10 +5,10 @@ import Quickshell
Singleton {
// Literally just here to shorten accessing stuff :woe:
// Also kinda so I can keep accessing it with `Appearance.xxx` instead of `Config.appearance.xxx`
readonly property AppearanceConfig.Rounding rounding: Config.appearance.rounding
readonly property AppearanceConfig.Spacing spacing: Config.appearance.spacing
readonly property AppearanceConfig.Padding padding: Config.appearance.padding
readonly property AppearanceConfig.FontStuff font: Config.appearance.font
readonly property AppearanceConfig.Anim anim: Config.appearance.anim
readonly property AppearanceConfig.Transparency transparency: Config.appearance.transparency
readonly property AppearanceConfig.Rounding rounding: Config.appearance.rounding // qmllint disable missing-property
readonly property AppearanceConfig.Spacing spacing: Config.appearance.spacing // qmllint disable missing-property
readonly property AppearanceConfig.Padding padding: Config.appearance.padding // qmllint disable missing-property
readonly property AppearanceConfig.FontStuff font: Config.appearance.font // qmllint disable missing-property
readonly property AppearanceConfig.Anim anim: Config.appearance.anim // qmllint disable missing-property
readonly property AppearanceConfig.Transparency transparency: Config.appearance.transparency // qmllint disable missing-property
}

View file

@ -436,9 +436,9 @@ Singleton {
JSON.parse(text());
const elapsed = timer.elapsedMs();
// Only show toast for external changes (not our own saves) and when elapsed time is meaningful
if (adapter.utilities.toasts.configLoaded && !root.recentlySaved && elapsed > 0) {
Toaster.toast(qsTr("Config loaded"), qsTr("Config loaded in %1ms").arg(elapsed), "rule_settings");
} else if (adapter.utilities.toasts.configLoaded && root.recentlySaved && elapsed > 0) {
if (adapter.utilities.toasts.configLoaded && !root.recentlySaved && elapsed > 0) { // qmllint disable unresolved-type
Toaster.toast(qsTr("Config loaded"), qsTr("Config loaded in %1ms").arg(elapsed), "rule_settings"); // qmllint disable unresolved-type
} else if (adapter.utilities.toasts.configLoaded && root.recentlySaved && elapsed > 0) { // qmllint disable unresolved-type
Toaster.toast(qsTr("Config saved"), qsTr("Config reloaded in %1ms").arg(elapsed), "rule_settings");
}
} catch (e) {
@ -451,7 +451,7 @@ Singleton {
}
onSaveFailed: err => Toaster.toast(qsTr("Failed to save config"), FileViewError.toString(err), "settings_alert", Toast.Error)
JsonAdapter {
JsonAdapter { // qmllint disable unresolved-type
id: adapter
property AppearanceConfig appearance: AppearanceConfig {}

View file

@ -11,13 +11,17 @@ Scope {
property bool launcherInterrupted
readonly property bool hasFullscreen: Hypr.focusedWorkspace?.toplevels.values.some(t => t.lastIpcObject.fullscreen === 2) ?? false
// qmllint disable unresolved-type
CustomShortcut {
// qmllint enable unresolved-type
name: "controlCenter"
description: "Open control center"
onPressed: WindowFactory.create()
}
// qmllint disable unresolved-type
CustomShortcut {
// qmllint enable unresolved-type
name: "showall"
description: "Toggle launcher, dashboard and osd"
onPressed: {
@ -28,7 +32,9 @@ Scope {
}
}
// qmllint disable unresolved-type
CustomShortcut {
// qmllint enable unresolved-type
name: "dashboard"
description: "Toggle dashboard"
onPressed: {
@ -39,7 +45,9 @@ Scope {
}
}
// qmllint disable unresolved-type
CustomShortcut {
// qmllint enable unresolved-type
name: "session"
description: "Toggle session menu"
onPressed: {
@ -50,7 +58,9 @@ Scope {
}
}
// qmllint disable unresolved-type
CustomShortcut {
// qmllint enable unresolved-type
name: "launcher"
description: "Toggle launcher"
onPressed: root.launcherInterrupted = false
@ -63,13 +73,17 @@ Scope {
}
}
// qmllint disable unresolved-type
CustomShortcut {
// qmllint enable unresolved-type
name: "launcherInterrupt"
description: "Interrupt launcher keybind"
onPressed: root.launcherInterrupted = true
}
// qmllint disable unresolved-type
CustomShortcut {
// qmllint enable unresolved-type
name: "sidebar"
description: "Toggle sidebar"
onPressed: {
@ -80,7 +94,9 @@ Scope {
}
}
// qmllint disable unresolved-type
CustomShortcut {
// qmllint enable unresolved-type
name: "utilities"
description: "Toggle utilities"
onPressed: {

View file

@ -79,7 +79,9 @@ Scope {
target: "picker"
}
// qmllint disable unresolved-type
CustomShortcut {
// qmllint enable unresolved-type
name: "screenshot"
description: "Open screenshot tool"
onPressed: {
@ -90,7 +92,9 @@ Scope {
}
}
// qmllint disable unresolved-type
CustomShortcut {
// qmllint enable unresolved-type
name: "screenshotFreeze"
description: "Open screenshot tool (freeze mode)"
onPressed: {
@ -101,7 +105,9 @@ Scope {
}
}
// qmllint disable unresolved-type
CustomShortcut {
// qmllint enable unresolved-type
name: "screenshotClip"
description: "Open screenshot tool (clipboard)"
onPressed: {
@ -112,7 +118,9 @@ Scope {
}
}
// qmllint disable unresolved-type
CustomShortcut {
// qmllint enable unresolved-type
name: "screenshotFreezeClip"
description: "Open screenshot tool (freeze mode, clipboard)"
onPressed: {

View file

@ -82,7 +82,7 @@ Item {
width: root.contentWidth
screen: root.screen
visibilities: root.visibilities
popouts: root.popouts
popouts: root.popouts // qmllint disable incompatible-type
}
}
}

View file

@ -178,9 +178,9 @@ StyledRect {
MaterialIcon {
animate: true
text: {
if (!Bluetooth.defaultAdapter?.enabled)
if (!Bluetooth.defaultAdapter?.enabled) // qmllint disable unresolved-type
return "bluetooth_disabled";
if (Bluetooth.devices.values.some(d => d.connected))
if (Bluetooth.devices.values.some(d => d.connected)) // qmllint disable unresolved-type
return "bluetooth_connected";
return "bluetooth";
}
@ -190,7 +190,7 @@ StyledRect {
// Connected bluetooth devices
Repeater {
model: ScriptModel {
values: Bluetooth.devices.values.filter(d => d.state !== BluetoothDeviceState.Disconnected)
values: Bluetooth.devices.values.filter(d => d.state !== BluetoothDeviceState.Disconnected) // qmllint disable unresolved-type
}
MaterialIcon {
@ -204,7 +204,7 @@ StyledRect {
fill: 1
SequentialAnimation on opacity {
running: device.modelData?.state !== BluetoothDeviceState.Connected
running: device.modelData?.state !== BluetoothDeviceState.Connected // qmllint disable unresolved-type
alwaysRunToEnd: true
loops: Animation.Infinite

View file

@ -52,8 +52,8 @@ Item {
required property var modelData
readonly property Workspace start: root.workspaces.count > 0 ? root.workspaces.itemAt(getWsIdx(modelData.start)) ?? null : null
readonly property Workspace end: root.workspaces.count > 0 ? root.workspaces.itemAt(getWsIdx(modelData.end)) ?? null : null
readonly property Workspace start: root.workspaces.count > 0 ? root.workspaces.itemAt(getWsIdx(modelData.start)) ?? null : null // qmllint disable incompatible-type
readonly property Workspace end: root.workspaces.count > 0 ? root.workspaces.itemAt(getWsIdx(modelData.end)) ?? null : null // qmllint disable incompatible-type
function getWsIdx(ws: int): int {
let i = ws - 1;

View file

@ -92,7 +92,7 @@ Item {
ScreencopyView {
id: preview
captureSource: Hypr.activeToplevel?.wayland ?? null
captureSource: Hypr.activeToplevel?.wayland ?? null // qmllint disable unresolved-type
live: visible
constraintSize.width: Config.bar.sizes.windowPreviewSize

View file

@ -26,9 +26,9 @@ ColumnLayout {
Toggle {
label: qsTr("Enabled")
checked: Bluetooth.defaultAdapter?.enabled ?? false
checked: Bluetooth.defaultAdapter?.enabled ?? false // qmllint disable unresolved-type
toggle.onToggled: {
const adapter = Bluetooth.defaultAdapter;
const adapter = Bluetooth.defaultAdapter; // qmllint disable unresolved-type
if (adapter)
adapter.enabled = checked;
}
@ -36,9 +36,9 @@ ColumnLayout {
Toggle {
label: qsTr("Discovering")
checked: Bluetooth.defaultAdapter?.discovering ?? false
checked: Bluetooth.defaultAdapter?.discovering ?? false // qmllint disable unresolved-type
toggle.onToggled: {
const adapter = Bluetooth.defaultAdapter;
const adapter = Bluetooth.defaultAdapter; // qmllint disable unresolved-type
if (adapter)
adapter.discovering = checked;
}
@ -48,7 +48,7 @@ ColumnLayout {
Layout.topMargin: Appearance.spacing.small
Layout.rightMargin: Appearance.padding.small
text: {
const devices = Bluetooth.devices.values;
const devices = Bluetooth.devices.values; // qmllint disable unresolved-type
let available = qsTr("%1 device%2 available").arg(devices.length).arg(devices.length === 1 ? "" : "s");
const connected = devices.filter(d => d.connected).length;
if (connected > 0)
@ -61,14 +61,14 @@ ColumnLayout {
Repeater {
model: ScriptModel {
values: [...Bluetooth.devices.values].sort((a, b) => (b.connected - a.connected) || (b.paired - a.paired) || a.name.localeCompare(b.name)).slice(0, 5)
values: [...Bluetooth.devices.values].sort((a, b) => (b.connected - a.connected) || (b.paired - a.paired) || a.name.localeCompare(b.name)).slice(0, 5) // qmllint disable unresolved-type
}
RowLayout {
id: device
required property BluetoothDevice modelData
readonly property bool loading: modelData.state === BluetoothDeviceState.Connecting || modelData.state === BluetoothDeviceState.Disconnecting
readonly property bool loading: modelData.state === BluetoothDeviceState.Connecting || modelData.state === BluetoothDeviceState.Disconnecting // qmllint disable unresolved-type
Layout.fillWidth: true
Layout.rightMargin: Appearance.padding.small
@ -108,7 +108,7 @@ ColumnLayout {
implicitHeight: connectIcon.implicitHeight + Appearance.padding.small
radius: Appearance.rounding.full
color: Qt.alpha(Colours.palette.m3primary, device.modelData.state === BluetoothDeviceState.Connected ? 1 : 0)
color: Qt.alpha(Colours.palette.m3primary, device.modelData.state === BluetoothDeviceState.Connected ? 1 : 0) // qmllint disable unresolved-type
CircularIndicator {
anchors.fill: parent
@ -120,7 +120,7 @@ ColumnLayout {
device.modelData.connected = !device.modelData.connected;
}
color: device.modelData.state === BluetoothDeviceState.Connected ? Colours.palette.m3onPrimary : Colours.palette.m3onSurface
color: device.modelData.state === BluetoothDeviceState.Connected ? Colours.palette.m3onPrimary : Colours.palette.m3onSurface // qmllint disable unresolved-type
disabled: device.loading
}
@ -130,7 +130,7 @@ ColumnLayout {
anchors.centerIn: parent
animate: true
text: device.modelData.connected ? "link_off" : "link"
color: device.modelData.state === BluetoothDeviceState.Connected ? Colours.palette.m3onPrimary : Colours.palette.m3onSurface
color: device.modelData.state === BluetoothDeviceState.Connected ? Colours.palette.m3onPrimary : Colours.palette.m3onSurface // qmllint disable unresolved-type
opacity: device.loading ? 0 : 1

View file

@ -45,7 +45,7 @@ ColumnLayout {
Layout.preferredHeight: visible ? implicitHeight : 0
Layout.topMargin: visible ? Appearance.spacing.small : 0
Layout.rightMargin: Appearance.padding.small
text: qsTr("%1 networks available").arg(Nmcli.networks.length)
text: qsTr("%1 networks available").arg(Nmcli.networks.length) // qmllint disable missing-property
color: Colours.palette.m3onSurfaceVariant
font.pointSize: Appearance.font.size.small
}

View file

@ -129,7 +129,7 @@ ColumnLayout {
Layout.rightMargin: Appearance.padding.small
Layout.topMargin: Appearance.spacing.small
height: 1
implicitHeight: 1
color: Colours.palette.m3onSurfaceVariant
opacity: 0.35
}

View file

@ -7,6 +7,8 @@ import Quickshell.Io
import qs.config
import Caelestia
// TODO: handle this better later
Item {
id: model
@ -139,7 +141,7 @@ Item {
stdout: StdioCollector {
onStreamFinished: model._buildXmlMap(text)
}
onRunningChanged: if (!running && (typeof _xkbXmlBase.exitCode !== "undefined") && _xkbXmlBase.exitCode !== 0)
onRunningChanged: if (!running && (typeof _xkbXmlBase.exitCode !== "undefined") && _xkbXmlBase.exitCode !== 0) // qmllint disable missing-property
_xkbXmlEvdev.running = true
}

View file

@ -685,10 +685,10 @@ Item {
property real smoothMax: targetMax
anchors.fill: parent
line1: NetworkUsage.uploadBuffer
line1: NetworkUsage.uploadBuffer // qmllint disable missing-type
line1Color: Colours.palette.m3secondary
line1FillAlpha: 0.15
line2: NetworkUsage.downloadBuffer
line2: NetworkUsage.downloadBuffer // qmllint disable missing-type
line2Color: Colours.palette.m3tertiary
line2FillAlpha: 0.2
maxValue: smoothMax

View file

@ -213,7 +213,7 @@ Item {
anchors.margins: Appearance.padding.large * 2
playing: Players.active?.isPlaying ?? false
speed: Audio.beatTracker.bpm / Appearance.anim.mediaGifSpeedAdjustment
speed: Audio.beatTracker.bpm / Appearance.anim.mediaGifSpeedAdjustment // qmllint disable unresolved-type
source: Paths.absolutePath(Config.paths.mediaGif)
asynchronous: true
fillMode: AnimatedImage.PreserveAspectFit

View file

@ -22,14 +22,14 @@ Shape {
preferredRendererType: Shape.CurveRenderer
Osd.Background {
wrapper: root.panels.osd
wrapper: root.panels.osd // qmllint disable incompatible-type
startX: root.width - root.panels.session.width - root.panels.sidebar.width
startY: (root.height - wrapper.height) / 2 - rounding
}
Notifications.Background {
wrapper: root.panels.notifications
wrapper: root.panels.notifications // qmllint disable incompatible-type
sidebar: sidebar
startX: root.width
@ -37,28 +37,28 @@ Shape {
}
Session.Background {
wrapper: root.panels.session
wrapper: root.panels.session // qmllint disable incompatible-type
startX: root.width - root.panels.sidebar.width
startY: (root.height - wrapper.height) / 2 - rounding
}
Launcher.Background {
wrapper: root.panels.launcher
wrapper: root.panels.launcher // qmllint disable incompatible-type
startX: (root.width - wrapper.width) / 2 - rounding
startY: root.height
}
Dashboard.Background {
wrapper: root.panels.dashboard
wrapper: root.panels.dashboard // qmllint disable incompatible-type
startX: (root.width - wrapper.width) / 2 - rounding
startY: 0
}
BarPopouts.Background {
wrapper: root.panels.popouts
wrapper: root.panels.popouts // qmllint disable incompatible-type
invertBottomRounding: wrapper.y + wrapper.height + 1 >= root.height
startX: wrapper.x
@ -66,7 +66,7 @@ Shape {
}
Utilities.Background {
wrapper: root.panels.utilities
wrapper: root.panels.utilities // qmllint disable incompatible-type
sidebar: sidebar
startX: root.width
@ -76,7 +76,7 @@ Shape {
Sidebar.Background {
id: sidebar
wrapper: root.panels.sidebar
wrapper: root.panels.sidebar // qmllint disable incompatible-type
panels: root.panels
startX: root.width

View file

@ -64,7 +64,7 @@ Variants {
height: win.height - Config.border.clampedThickness * 2 - win.dragMaskPadding * 2
intersection: Intersection.Xor
regions: regions.instances
regions: regions.instances // qmllint disable stale-property-read
}
anchors.top: true

View file

@ -25,13 +25,13 @@ Scope {
lock: lock
}
CustomShortcut {
CustomShortcut { // qmllint disable unresolved-type
name: "lock"
description: "Lock the current session"
onPressed: lock.locked = true
}
CustomShortcut {
CustomShortcut { // qmllint disable unresolved-type
name: "unlock"
description: "Unlock the current session"
onPressed: lock.unlock()

View file

@ -18,7 +18,7 @@ Item {
Image {
anchors.fill: parent
source: Players.active?.trackArtUrl ?? ""
source: Players.active?.trackArtUrl ?? "" // qmllint disable incompatible-type
asynchronous: true
fillMode: Image.PreserveAspectCrop

View file

@ -132,7 +132,7 @@ Scope {
id: availProc
command: ["sh", "-c", "fprintd-list $USER"]
onExited: code => {
onExited: code => { // qmllint disable signal-handler-parameters
fprint.available = code === 0;
fprint.checkAvail();
}

View file

@ -85,7 +85,7 @@ StyledRect {
return;
const actions = root.modelData.actions;
if (actions?.length === 1)
if (actions.length === 1)
actions[0].invoke();
}

View file

@ -2,6 +2,7 @@ pragma ComponentBehavior: Bound
import qs.components
import qs.config
import qs.modules.bar.popouts as BarPopouts
import Quickshell
import QtQuick
@ -10,7 +11,7 @@ Item {
required property DrawerVisibilities visibilities
required property Item sidebar
required property Item popouts
required property BarPopouts.Wrapper popouts
readonly property PersistentProperties props: PersistentProperties {
property bool recordingListExpanded: false

View file

@ -89,9 +89,9 @@ StyledRect {
roleValue: "bluetooth"
delegate: Toggle {
icon: "bluetooth"
checked: Bluetooth.defaultAdapter?.enabled ?? false
checked: Bluetooth.defaultAdapter?.enabled ?? false // qmllint disable unresolved-type
onClicked: {
const adapter = Bluetooth.defaultAdapter;
const adapter = Bluetooth.defaultAdapter; // qmllint disable unresolved-type
if (adapter)
adapter.enabled = !adapter.enabled;
}

View file

@ -69,7 +69,7 @@ Item {
anchors.centerIn: parent
captureSource: root.client?.wayland ?? null
captureSource: root.client?.wayland ?? null // qmllint disable unresolved-type
live: true
constraintSize.width: root.client ? parent.height * Math.min(root.screen.width / root.screen.height, root.client?.lastIpcObject.size[0] / root.client?.lastIpcObject.size[1]) : parent.height

View file

@ -92,13 +92,17 @@ Singleton {
}
}
// qmllint disable unresolved-type
CustomShortcut {
// qmllint enable unresolved-type
name: "brightnessUp"
description: "Increase brightness"
onPressed: root.increaseBrightness()
}
// qmllint disable unresolved-type
CustomShortcut {
// qmllint enable unresolved-type
name: "brightnessDown"
description: "Decrease brightness"
onPressed: root.decreaseBrightness()

View file

@ -207,7 +207,9 @@ Singleton {
target: "hypr"
}
// qmllint disable unresolved-type
CustomShortcut {
// qmllint enable unresolved-type
name: "refreshDevices"
description: "Reload devices"
onPressed: extras.refreshDevices()

View file

@ -903,7 +903,7 @@ Singleton {
}
}
onExited: code => {
onExited: code => { // qmllint disable signal-handler-parameters
exitCode = code;
Qt.callLater(() => {
@ -1268,7 +1268,7 @@ Singleton {
id: rescanProc
command: ["nmcli", "dev", root.nmcliCommandWifi, "list", "--rescan", "yes"]
onExited: root.getNetworks()
onExited: root.getNetworks() // qmllint disable signal-handler-parameters
}
Process {
@ -1283,7 +1283,7 @@ Singleton {
stdout: SplitParser {
onRead: root.refreshOnConnectionChange()
}
onExited: monitorRestartTimer.start()
onExited: monitorRestartTimer.start() // qmllint disable signal-handler-parameters
}
Timer {

View file

@ -51,7 +51,9 @@ QtObject {
readonly property LazyLoader dummyImageLoader: LazyLoader {
active: false
// qmllint disable uncreatable-type
PanelWindow {
// qmllint enable uncreatable-type
implicitWidth: Config.notifs.sizes.image
implicitHeight: Config.notifs.sizes.image
color: "transparent"
@ -216,7 +218,9 @@ QtObject {
urgency = notification.urgency;
resident = notification.resident;
hasActionIcons = notification.hasActionIcons;
// qmllint disable unresolved-type
actions = notification.actions.map(a => ({
// qmllint enable unresolved-type
identifier: a.identifier,
text: a.text,
invoke: () => a.invoke()

View file

@ -105,7 +105,9 @@ Singleton {
}
}
// qmllint disable unresolved-type
CustomShortcut {
// qmllint enable unresolved-type
name: "clearNotifs"
description: "Clear all notifications"
onPressed: {

View file

@ -41,7 +41,9 @@ Singleton {
reloadableId: "players"
}
// qmllint disable unresolved-type
CustomShortcut {
// qmllint enable unresolved-type
name: "mediaToggle"
description: "Toggle media playback"
onPressed: {
@ -51,7 +53,9 @@ Singleton {
}
}
// qmllint disable unresolved-type
CustomShortcut {
// qmllint enable unresolved-type
name: "mediaPrev"
description: "Previous track"
onPressed: {
@ -61,7 +65,9 @@ Singleton {
}
}
// qmllint disable unresolved-type
CustomShortcut {
// qmllint enable unresolved-type
name: "mediaNext"
description: "Next track"
onPressed: {
@ -71,7 +77,9 @@ Singleton {
}
}
// qmllint disable unresolved-type
CustomShortcut {
// qmllint enable unresolved-type
name: "mediaStop"
description: "Stop media playback"
onPressed: root.active?.stop()

View file

@ -46,7 +46,7 @@ Singleton {
running: true
command: ["pidof", "gpu-screen-recorder"]
onExited: code => {
onExited: code => { // qmllint disable signal-handler-parameters
props.running = code === 0;
if (code === 0) {
@ -77,6 +77,6 @@ Singleton {
props.elapsed++;
}
target: Time
target: Time // qmllint disable incompatible-type
}
}

View file

@ -128,7 +128,9 @@ Singleton {
id: statusProc
command: ["ip", "link", "show"]
// qmllint disable incompatible-type
environment: ({
// qmllint enable incompatible-type
LANG: "C.UTF-8",
LC_ALL: "C.UTF-8"
})
@ -143,7 +145,7 @@ Singleton {
Process {
id: connectProc
onExited: statusCheckTimer.start()
onExited: statusCheckTimer.start() // qmllint disable signal-handler-parameters
stderr: StdioCollector {
onStreamFinished: {
const error = text.trim();
@ -159,7 +161,7 @@ Singleton {
Process {
id: disconnectProc
onExited: statusCheckTimer.start()
onExited: statusCheckTimer.start() // qmllint disable signal-handler-parameters
stderr: StdioCollector {
onStreamFinished: {
const error = text.trim();