SearchItem: fix undefined warnings

This commit is contained in:
end-4
2025-09-24 09:25:36 +02:00
parent 7e491ce7d8
commit 263299b97d
@@ -16,11 +16,11 @@ RippleButton {
property string query property string query
property bool entryShown: entry?.shown ?? true property bool entryShown: entry?.shown ?? true
property string itemType: entry?.type ?? Translation.tr("App") property string itemType: entry?.type ?? Translation.tr("App")
property string itemName: entry?.name property string itemName: entry?.name ?? ""
property string itemIcon: entry?.icon ?? "" property string itemIcon: entry?.icon ?? ""
property var itemExecute: entry?.execute property var itemExecute: entry?.execute
property string fontType: entry?.fontType ?? "main" property string fontType: entry?.fontType ?? "main"
property string itemClickActionName: entry?.clickActionName property string itemClickActionName: entry?.clickActionName ?? "Open"
property string bigText: entry?.bigText ?? "" property string bigText: entry?.bigText ?? ""
property string materialSymbol: entry?.materialSymbol ?? "" property string materialSymbol: entry?.materialSymbol ?? ""
property string cliphistRawString: entry?.cliphistRawString ?? "" property string cliphistRawString: entry?.cliphistRawString ?? ""
@@ -233,8 +233,8 @@ RippleButton {
delegate: RippleButton { delegate: RippleButton {
id: actionButton id: actionButton
required property var modelData required property var modelData
property string iconName: modelData.icon property string iconName: modelData.icon ?? ""
property string materialIconName: modelData.materialIcon property string materialIconName: modelData.materialIcon ?? ""
implicitHeight: 34 implicitHeight: 34
implicitWidth: 34 implicitWidth: 34
@@ -246,7 +246,7 @@ RippleButton {
anchors.centerIn: parent anchors.centerIn: parent
Loader { Loader {
anchors.centerIn: parent anchors.centerIn: parent
active: !(actionButton.iconName && actionButton.iconName !== "") || actionButton.materialIconName active: !(actionButton.iconName !== "") || actionButton.materialIconName
sourceComponent: MaterialSymbol { sourceComponent: MaterialSymbol {
text: actionButton.materialIconName || "video_settings" text: actionButton.materialIconName || "video_settings"
font.pixelSize: Appearance.font.pixelSize.hugeass font.pixelSize: Appearance.font.pixelSize.hugeass
@@ -255,7 +255,7 @@ RippleButton {
} }
Loader { Loader {
anchors.centerIn: parent anchors.centerIn: parent
active: !actionButton.materialIconName && actionButton.iconName && actionButton.iconName !== "" active: actionButton.materialIconName.length == 0 && actionButton.iconName && actionButton.iconName !== ""
sourceComponent: IconImage { sourceComponent: IconImage {
source: Quickshell.iconPath(actionButton.iconName) source: Quickshell.iconPath(actionButton.iconName)
implicitSize: 20 implicitSize: 20