Verified Commit 1dcf514e authored by Carl Schwan's avatar Carl Schwan 🚴
Browse files

Don't compare string with empty string

Summary: Instead compare string length with an integer

Test Plan: Compile && run

Reviewers: #plasma, iasensio

Reviewed By: iasensio

Subscribers: broulik, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29772
parent ab5d3101
......@@ -36,7 +36,7 @@ Loader {
title: root.title
selectExisting: !root.isSaveDialog
folder: (root.lastFolder == "") ? shortcuts.home : root.lastFolder
folder: root.lastFolder || shortcuts.home
nameFilters: [ i18n("KWin Rules (*.kwinrule)") ]
defaultSuffix: "*.kwinrule"
......
......@@ -91,7 +91,7 @@ QQC2.ComboBox {
QQC2.ToolTip {
text: model.tooltip
visible: hovered && (model.tooltip != "")
visible: hovered && (model.tooltip.length > 0)
}
Component.onCompleted: {
......
......@@ -106,7 +106,7 @@ Kirigami.AbstractListItem {
QQC2.ToolTip {
text: model.description
visible: hovered && (text != "")
visible: hovered && (text.length > 0)
}
}
}
......@@ -162,7 +162,7 @@ ScrollViewKCM {
Layout.alignment: Qt.AlignVCenter
QQC2.ToolTip {
text: model.description
visible: hovered && (model.description != "")
visible: hovered && (model.description.length > 0)
}
}
QQC2.Label {
......@@ -262,7 +262,7 @@ ScrollViewKCM {
if (!showItem) {
return false;
}
if (filterString != "") {
if (filterString.length > 0) {
return sourceModel.data(index, RulesModel.NameRole).toLowerCase().includes(filterString)
}
return true;
......
......@@ -67,7 +67,7 @@ ScrollViewKCM {
}
Kirigami.PlaceholderMessage {
visible: ruleBookView.count == 0
visible: ruleBookView.count === 0
anchors.centerIn: parent
width: parent.width - (units.largeSpacing * 4)
text: i18n("No rules for specific windows are currently set");
......@@ -84,7 +84,7 @@ ScrollViewKCM {
iconName: "object-select-symbolic"
text: checked ? i18n("Unselect All") : i18n("Select All")
checkable: true
checked: selectedIndexes.length == ruleBookView.count
checked: selectedIndexes.length === ruleBookView.count
onToggled: {
if (checked) {
selectedIndexes = [...Array(ruleBookView.count).keys()]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment