Commit 8f6cfe78 authored by Laurent Montel's avatar Laurent Montel 😁

Fix warning == vs ===

parent 65d7fa3b
......@@ -34,7 +34,7 @@ Item
}
function isType(obj, typename) {
return obj && obj.toString().indexOf(typename+"_QMLTYPE_") == 0
return obj && obj.toString().indexOf(typename+"_QMLTYPE_") === 0
}
function chooseChild(obj, validator) {
......@@ -101,7 +101,7 @@ Item
done = true;
for(var v in testRoot) {
if (v.indexOf("test_") == 0) {
if (v.indexOf("test_") === 0) {
testRoot.currentTest = v;
testRoot.reset();
testRoot[v]();
......
......@@ -36,6 +36,6 @@ DiscoverTest
button.listener.cancel()
verify(!button.isActive)
compare(cancelSpy.count, 1)
verify(state == button.application.state)
verify(state === button.application.state)
}
}
......@@ -52,7 +52,7 @@ DiscoverTest
});
var updateButton;
chooseChild(drawer, function(object) {
if (object.objectName == "updateButton") {
if (object.objectName === "updateButton") {
updateButton = object;
return true
}
......
......@@ -39,7 +39,7 @@ DiscoverTest
verify(!action.visible)
}
while(updatePage.state != "now-uptodate")
while(updatePage.state !== "now-uptodate")
waitForSignal(updatePage, "stateChanged")
}
}
......@@ -82,7 +82,7 @@ DiscoverPage {
text: i18n("%1 - %2", displayOrigin, model.application.availableVersion)
icon.name: sourceIcon
checkable: true
checked: appInfo.application == model.application
checked: appInfo.application === model.application
onTriggered: if(index>=0) {
var res = model.application
console.assert(res)
......
......@@ -93,7 +93,7 @@ DiscoverPage {
appsModel.sortRole = ResourcesProxyModel.NameRole
}
checkable: true
checked: appsModel.sortRole == ResourcesProxyModel.NameRole
checked: appsModel.sortRole === ResourcesProxyModel.NameRole
}
Action {
ActionGroup.group: sortGroup
......@@ -102,7 +102,7 @@ DiscoverPage {
appsModel.sortRole = ResourcesProxyModel.SortableRatingRole
}
checkable: true
checked: appsModel.sortRole == ResourcesProxyModel.SortableRatingRole
checked: appsModel.sortRole === ResourcesProxyModel.SortableRatingRole
}
Action {
ActionGroup.group: sortGroup
......@@ -111,7 +111,7 @@ DiscoverPage {
appsModel.sortRole = ResourcesProxyModel.SizeRole
}
checkable: true
checked: appsModel.sortRole == ResourcesProxyModel.SizeRole
checked: appsModel.sortRole === ResourcesProxyModel.SizeRole
}
Action {
ActionGroup.group: sortGroup
......@@ -120,7 +120,7 @@ DiscoverPage {
appsModel.sortRole = ResourcesProxyModel.ReleaseDateRole
}
checkable: true
checked: appsModel.sortRole == ResourcesProxyModel.ReleaseDateRole
checked: appsModel.sortRole === ResourcesProxyModel.ReleaseDateRole
}
}
]
......
......@@ -71,7 +71,7 @@ Kirigami.GlobalDrawer {
componentTrue: SearchField {
id: searchField
visible: window.leftPage && (window.leftPage.searchFor != null || window.leftPage.hasOwnProperty("search"))
visible: window.leftPage && (window.leftPage.searchFor !== null || window.leftPage.hasOwnProperty("search"))
page: window.leftPage
......@@ -149,7 +149,7 @@ Kirigami.GlobalDrawer {
id: categoryActionComponent
Kirigami.Action {
property QtObject category
readonly property bool itsMe: window.leftPage && window.leftPage.hasOwnProperty("category") && (window.leftPage.category == category)
readonly property bool itsMe: window.leftPage && window.leftPage.hasOwnProperty("category") && (window.leftPage.category === category)
text: category ? category.name : ""
checked: itsMe
visible: (!window.leftPage
......
......@@ -257,7 +257,7 @@ Kirigami.ApplicationWindow
onCurrentTopLevelChanged: {
window.pageStack.clear()
if (currentTopLevel)
window.pageStack.push(currentTopLevel, {}, window.status!=Component.Ready)
window.pageStack.push(currentTopLevel, {}, window.status!==Component.Ready)
}
UnityLauncher {
......
......@@ -24,7 +24,7 @@ ConditionalLoader
name: application.isInstalled ? "trash-empty" : "cloud-download"
color: !enabled ? Kirigami.Theme.backgroundColor : !listener.isActive ? (application.isInstalled ? Kirigami.Theme.negativeTextColor : Kirigami.Theme.positiveTextColor) : Kirigami.Theme.backgroundColor
}
enabled: !listener.isActive && application.state != AbstractResource.Broken
enabled: !listener.isActive && application.state !== AbstractResource.Broken
onTriggered: root.click()
}
readonly property QtObject cancelAction: KirigamiActionBridge {
......@@ -64,7 +64,7 @@ ConditionalLoader
}
componentFalse: Button {
enabled: application.state != AbstractResource.Broken
enabled: application.state !== AbstractResource.Broken
text: root.text
focus: true
......
......@@ -84,7 +84,7 @@ Kirigami.BasicListItem {
}
ToolButton {
icon.name: "system-run"
visible: model.application != undefined && model.application.isInstalled && !listener.isActive && model.application.canExecute
visible: model.application !== undefined && model.application.isInstalled && !listener.isActive && model.application.canExecute
onClicked: {
model.application.invokeApplication()
model.remove(index)
......
......@@ -33,7 +33,7 @@ ColumnLayout
function usefulnessToString(favorable, total)
{
return total==0
return total===0
? i18n("<em>Tell us about this review!</em>")
: i18n("<em>%1 out of %2 people found this review useful</em>", favorable, total)
}
......
......@@ -28,8 +28,8 @@ LinearGradient {
width: Units.gridUnit/2
height: Units.gridUnit/2
start: Qt.point((edge != Qt.RightEdge ? 0 : width), (edge != Qt.BottomEdge ? 0 : height))
end: Qt.point((edge != Qt.LeftEdge ? 0 : width), (edge != Qt.TopEdge ? 0 : height))
start: Qt.point((edge !== Qt.RightEdge ? 0 : width), (edge !== Qt.BottomEdge ? 0 : height))
end: Qt.point((edge !== Qt.LeftEdge ? 0 : width), (edge !== Qt.TopEdge ? 0 : height))
gradient: Gradient {
GradientStop {
position: 0.0
......
......@@ -28,7 +28,7 @@ DiscoverPage {
supportsMouseEvents: false
readonly property QtObject backend: SourcesModel.sourcesBackendByName(section)
readonly property QtObject resourcesBackend: backend.resourcesBackend
readonly property bool isDefault: ResourcesModel.currentApplicationBackend == resourcesBackend
readonly property bool isDefault: ResourcesModel.currentApplicationBackend === resourcesBackend
RowLayout {
id: sourceTitleLayout
......@@ -205,11 +205,11 @@ DiscoverPage {
readonly property variant idx: sourcesView.model.index(index, 0)
readonly property variant modelChecked: sourcesView.model.data(idx, Qt.CheckStateRole)
checked: modelChecked != Qt.Unchecked
checked: modelChecked !== Qt.Unchecked
enabled: modelChecked !== undefined
onClicked: {
sourcesView.model.setData(idx, checkState, Qt.CheckStateRole)
checked = Qt.binding(function() { return modelChecked != Qt.Unchecked; })
checked = Qt.binding(function() { return modelChecked !== Qt.Unchecked; })
}
}
Label {
......
......@@ -198,8 +198,8 @@ DiscoverPage
id: itemChecked
Layout.leftMargin: Kirigami.Units.gridUnit
Layout.alignment: Qt.AlignVCenter
checked: model.checked == Qt.Checked
onClicked: model.checked = (model.checked==Qt.Checked ? Qt.Unchecked : Qt.Checked)
checked: model.checked === Qt.Checked
onClicked: model.checked = (model.checked===Qt.Checked ? Qt.Unchecked : Qt.Checked)
enabled: !resourcesUpdatesModel.isProgressing
}
......
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