Commit 6e36de2e authored by Laurent Montel's avatar Laurent Montel 😁

Fix warning == vs ===

parent 245677bf
......@@ -28,7 +28,7 @@ Item {
property QtObject menu
property Item visualParent
property variant actionList
property bool opened: menu ? (menu.status != PlasmaComponents.DialogStatus.Closed) : false
property bool opened: menu ? (menu.status !== PlasmaComponents.DialogStatus.Closed) : false
signal actionClicked(string actionId, variant actionArgument)
signal closed
......@@ -123,9 +123,9 @@ Item {
property variant actionItem
text : actionItem.text ? actionItem.text : ""
enabled : actionItem.type != "title" && ("enabled" in actionItem ? actionItem.enabled : true)
separator : actionItem.type == "separator"
section : actionItem.type == "title"
enabled : actionItem.type !== "title" && ("enabled" in actionItem ? actionItem.enabled : true)
separator : actionItem.type === "separator"
section : actionItem.type === "title"
icon : actionItem.icon ? actionItem.icon : null
checkable : actionItem.checkable ? actionItem.checkable : false
checked : actionItem.checked ? actionItem.checked : false
......
......@@ -25,13 +25,13 @@ import org.kde.plasma.core 2.0 as PlasmaCore
Item {
id: root
readonly property bool inPanel: (plasmoid.location == PlasmaCore.Types.TopEdge
|| plasmoid.location == PlasmaCore.Types.RightEdge
|| plasmoid.location == PlasmaCore.Types.BottomEdge
|| plasmoid.location == PlasmaCore.Types.LeftEdge)
readonly property bool vertical: (plasmoid.formFactor == PlasmaCore.Types.Vertical)
readonly property bool inPanel: (plasmoid.location === PlasmaCore.Types.TopEdge
|| plasmoid.location === PlasmaCore.Types.RightEdge
|| plasmoid.location === PlasmaCore.Types.BottomEdge
|| plasmoid.location === PlasmaCore.Types.LeftEdge)
readonly property bool vertical: (plasmoid.formFactor === PlasmaCore.Types.Vertical)
readonly property bool useCustomButtonImage: (plasmoid.configuration.useCustomButtonImage
&& plasmoid.configuration.customButtonImage.length != 0)
&& plasmoid.configuration.customButtonImage.length !== 0)
property QtObject dashWindow: null
onWidthChanged: updateSizeHints()
......
......@@ -36,7 +36,7 @@ Item {
width: childrenRect.width
height: childrenRect.height
property bool isDash: (plasmoid.pluginName == "org.kde.plasma.kickerdash")
property bool isDash: (plasmoid.pluginName === "org.kde.plasma.kickerdash")
property string cfg_icon: plasmoid.configuration.icon
property bool cfg_useCustomButtonImage: plasmoid.configuration.useCustomButtonImage
......
......@@ -218,7 +218,7 @@ Kicker.DashboardWindow {
for (var i = 0; i < rootModel.count; ++i) {
var model = rootModel.modelForRow(i);
if (model.description == "KICKER_ALL_MODEL") {
if (model.description === "KICKER_ALL_MODEL") {
allAppsGrid.model = model;
done = true;
break;
......@@ -321,7 +321,7 @@ Kicker.DashboardWindow {
onClicked: searchField.clear();
Keys.onPressed: {
if (event.key == Qt.Key_Tab) {
if (event.key === Qt.Key_Tab) {
event.accepted = true;
if (runnerModel.count) {
......@@ -329,7 +329,7 @@ Kicker.DashboardWindow {
} else {
systemFavoritesGrid.tryActivate(0, 0);
}
} else if (event.key == Qt.Key_Backtab) {
} else if (event.key === Qt.Key_Backtab) {
event.accepted = true;
if (tabBar.visible) {
......@@ -459,7 +459,7 @@ Kicker.DashboardWindow {
}
Keys.onPressed: {
if (event.key == Qt.Key_Tab) {
if (event.key === Qt.Key_Tab) {
event.accepted = true;
if (tabBar.visible) {
......@@ -469,7 +469,7 @@ Kicker.DashboardWindow {
} else {
mainColumn.tryActivate(0, 0);
}
} else if (event.key == Qt.Key_Backtab) {
} else if (event.key === Qt.Key_Backtab) {
event.accepted = true;
systemFavoritesGrid.tryActivate(0, 0);
}
......@@ -516,7 +516,7 @@ Kicker.DashboardWindow {
}
Keys.onPressed: {
if (event.key == Qt.Key_Tab) {
if (event.key === Qt.Key_Tab) {
event.accepted = true;
if (globalFavoritesGrid.enabled) {
......@@ -528,7 +528,7 @@ Kicker.DashboardWindow {
} else {
mainColumn.tryActivate(0, 0);
}
} else if (event.key == Qt.Key_Backtab) {
} else if (event.key === Qt.Key_Backtab) {
event.accepted = true;
if (filterList.enabled) {
......@@ -758,7 +758,7 @@ Kicker.DashboardWindow {
}
Keys.onPressed: {
if (event.key == Qt.Key_Tab) {
if (event.key === Qt.Key_Tab) {
event.accepted = true;
if (filterList.enabled) {
......@@ -766,7 +766,7 @@ Kicker.DashboardWindow {
} else {
systemFavoritesGrid.tryActivate(0, 0);
}
} else if (event.key == Qt.Key_Backtab) {
} else if (event.key === Qt.Key_Backtab) {
event.accepted = true;
if (searching) {
......@@ -851,8 +851,8 @@ Kicker.DashboardWindow {
property var m: model
property int textWidth: label.contentWidth
property int mouseCol
property bool hasActionList: ((model.favoriteId != null)
|| (("hasActionList" in model) && (model.hasActionList == true)))
property bool hasActionList: ((model.favoriteId !== null)
|| (("hasActionList" in model) && (model.hasActionList === true)))
property Item menu: actionMenu
width: parent.width
......@@ -876,7 +876,7 @@ Kicker.DashboardWindow {
onPositionChanged: { // Lazy menu implementation.
mouseCol = mouse.x;
if (justOpenedTimer.running || ListView.view.currentIndex == 0 || index == ListView.view.currentIndex) {
if (justOpenedTimer.running || ListView.view.currentIndex === 0 || index === ListView.view.currentIndex) {
updateCurrentItem();
} else if ((index == ListView.view.currentIndex - 1) && mouse.y < (height - 6)
|| (index == ListView.view.currentIndex + 1) && mouse.y > 5) {
......@@ -1021,7 +1021,7 @@ Kicker.DashboardWindow {
var model = rootModel.modelForRow(currentIndex);
if (model.description == "KICKER_ALL_MODEL") {
if (model.description === "KICKER_ALL_MODEL") {
allAppsGrid.model = model;
allApps = true;
funnelModel.sourceModel = null;
......@@ -1037,15 +1037,15 @@ Kicker.DashboardWindow {
}
Keys.onPressed: {
if (event.key == Qt.Key_Left) {
if (event.key === Qt.Key_Left) {
event.accepted = true;
var currentRow = Math.max(0, Math.ceil(currentItem.y / mainGrid.cellHeight) - 1);
mainColumn.tryActivate(currentRow, mainColumn.columns - 1);
} else if (event.key == Qt.Key_Tab) {
} else if (event.key === Qt.Key_Tab) {
event.accepted = true;
systemFavoritesGrid.tryActivate(0, 0);
} else if (event.key == Qt.Key_Backtab) {
} else if (event.key === Qt.Key_Backtab) {
event.accepted = true;
mainColumn.tryActivate(0, 0);
}
......
......@@ -71,7 +71,7 @@ Row {
}
Keys.onPressed: {
if (event.key == Qt.Key_Tab) {
if (event.key === Qt.Key_Tab) {
event.accepted = true;
if (searching) {
......@@ -79,7 +79,7 @@ Row {
} else {
mainColumn.tryActivate(0, 0);
}
} else if (event.key == Qt.Key_Backtab) {
} else if (event.key === Qt.Key_Backtab) {
event.accepted = true;
if (globalFavoritesGrid.enabled) {
......
......@@ -33,12 +33,12 @@ Item {
property bool showLabel: true
property int itemIndex: model.index
property string favoriteId: model.favoriteId != undefined ? model.favoriteId : ""
property url url: model.url != undefined ? model.url : ""
property variant icon: model.decoration != undefined ? model.decoration : ""
property string favoriteId: model.favoriteId !== undefined ? model.favoriteId : ""
property url url: model.url !== undefined ? model.url : ""
property variant icon: model.decoration !== undefined ? model.decoration : ""
property var m: model
property bool hasActionList: ((model.favoriteId != null)
|| (("hasActionList" in model) && (model.hasActionList == true)))
property bool hasActionList: ((model.favoriteId !== null)
|| (("hasActionList" in model) && (model.hasActionList === true)))
Accessible.role: Accessible.MenuItem
Accessible.name: model.display
......@@ -113,10 +113,10 @@ Item {
}
Keys.onPressed: {
if (event.key == Qt.Key_Menu && hasActionList) {
if (event.key === Qt.Key_Menu && hasActionList) {
event.accepted = true;
openActionMenu(item);
} else if ((event.key == Qt.Key_Enter || event.key == Qt.Key_Return)) {
} else if ((event.key === Qt.Key_Enter || event.key === Qt.Key_Return)) {
event.accepted = true;
if ("trigger" in GridView.view.model) {
......
......@@ -127,13 +127,13 @@ FocusScope {
var item = gridView.itemAt(cPos.x, cPos.y);
if (item) {
if (kicker.dragSource.parent == gridView.contentItem) {
if (item != kicker.dragSource) {
if (kicker.dragSource.parent === gridView.contentItem) {
if (item !== kicker.dragSource) {
item.GridView.view.model.moveRow(dragSource.itemIndex, item.itemIndex);
}
} else if (kicker.dragSource.view.model.favoritesModel == model
} else if (kicker.dragSource.view.model.favoritesModel === model
&& !model.isFavorite(kicker.dragSource.favoriteId)) {
var hasPlaceholder = (model.dropPlaceholderIndex != -1);
var hasPlaceholder = (model.dropPlaceholderIndex !== -1);
model.dropPlaceholderIndex = item.itemIndex;
......@@ -141,10 +141,10 @@ FocusScope {
gridView.currentIndex = (item.itemIndex - 1);
}
}
} else if (kicker.dragSource.parent != gridView.contentItem
&& kicker.dragSource.view.model.favoritesModel == model
} else if (kicker.dragSource.parent !== gridView.contentItem
&& kicker.dragSource.view.model.favoritesModel === model
&& !model.isFavorite(kicker.dragSource.favoriteId)) {
var hasPlaceholder = (model.dropPlaceholderIndex != -1);
var hasPlaceholder = (model.dropPlaceholderIndex !== -1);
model.dropPlaceholderIndex = hasPlaceholder ? model.count - 1 : model.count;
......@@ -165,7 +165,7 @@ FocusScope {
}
onDrop: {
if (kicker.dragSource && kicker.dragSource.parent != gridView.contentItem && kicker.dragSource.view.model.favoritesModel == model) {
if (kicker.dragSource && kicker.dragSource.parent !== gridView.contentItem && kicker.dragSource.view.model.favoritesModel === model) {
model.addFavorite(kicker.dragSource.favoriteId, model.dropPlaceholderIndex);
gridView.currentIndex = -1;
}
......@@ -245,7 +245,7 @@ FocusScope {
}
highlight: Item {
property bool isDropPlaceHolder: "dropPlaceholderIndex" in model && currentIndex == model.dropPlaceholderIndex
property bool isDropPlaceHolder: "dropPlaceholderIndex" in model && currentIndex === model.dropPlaceholderIndex
PlasmaComponents.Highlight {
visible: gridView.currentItem && !isDropPlaceHolder
......@@ -299,7 +299,7 @@ FocusScope {
}
Keys.onLeftPressed: {
if (currentCol() != 0) {
if (currentCol() !== 0) {
event.accepted = true;
moveCurrentIndexLeft();
} else {
......@@ -310,7 +310,7 @@ FocusScope {
Keys.onRightPressed: {
var columns = Math.floor(width / cellWidth);
if (currentCol() != columns - 1 && currentIndex != count -1) {
if (currentCol() !== columns - 1 && currentIndex != count -1) {
event.accepted = true;
moveCurrentIndexRight();
} else {
......@@ -319,7 +319,7 @@ FocusScope {
}
Keys.onUpPressed: {
if (currentRow() != 0) {
if (currentRow() !== 0) {
event.accepted = true;
moveCurrentIndexUp();
positionViewAtIndex(currentIndex, GridView.Contain);
......@@ -364,7 +364,7 @@ FocusScope {
// with keyboard navigation by ignoring repeated events with
// identical coordinates. As the work done here would be re-
// dundant in any case, these are safe to ignore.
if (lastX == x && lastY == y) {
if (lastX === x && lastY === y) {
return;
}
......
......@@ -36,10 +36,10 @@ Item {
signal aboutToShowActionMenu(variant actionMenu)
readonly property real fullTextWidth: Math.ceil(icon.width + label.implicitWidth + arrow.width + row.anchors.leftMargin + row.anchors.rightMargin + row.actualSpacing)
property bool isSeparator: (model.isSeparator == true)
property bool hasChildren: (model.hasChildren == true)
property bool hasActionList: ((model.favoriteId != null)
|| (("hasActionList" in model) && (model.hasActionList == true)))
property bool isSeparator: (model.isSeparator === true)
property bool hasChildren: (model.hasChildren === true)
property bool hasActionList: ((model.favoriteId !== null)
|| (("hasActionList" in model) && (model.hasActionList === true)))
property QtObject childDialog: null
property Item menu: actionMenu
......@@ -47,7 +47,7 @@ Item {
Accessible.name: label.text
onHasChildrenChanged: {
if (!hasChildren && ListView.view.currentItem == item) {
if (!hasChildren && ListView.view.currentItem === item) {
ListView.view.currentIndex = -1;
}
}
......@@ -135,7 +135,7 @@ Item {
} else {
mouseCol = mouse.x;
if (index == item.ListView.view.currentIndex) {
if (index === item.ListView.view.currentIndex) {
updateCurrentItem();
} else if ((index == item.ListView.view.currentIndex - 1) && mouse.y < (itemHeight - 6)
|| (index == item.ListView.view.currentIndex + 1) && mouse.y > 5) {
......@@ -235,7 +235,7 @@ Item {
height: width
visible: hasChildren
opacity: (item.ListView.view.currentIndex == index) ? 1.0 : 0.4
opacity: (item.ListView.view.currentIndex === index) ? 1.0 : 0.4
svg: arrows
elementId: (Qt.application.layoutDirection == Qt.RightToLeft) ? "left-arrow" : "right-arrow"
......@@ -270,10 +270,10 @@ Item {
}
Keys.onPressed: {
if (event.key == Qt.Key_Menu && hasActionList) {
if (event.key === Qt.Key_Menu && hasActionList) {
event.accepted = true;
openActionMenu(mouseArea);
} else if ((event.key == Qt.Key_Enter || event.key == Qt.Key_Return) && !hasChildren) {
} else if ((event.key === Qt.Key_Enter || event.key === Qt.Key_Return) && !hasChildren) {
if (!hasChildren) {
event.accepted = true;
item.ListView.view.model.trigger(index, "", null);
......
......@@ -48,7 +48,7 @@ Kicker.SubMenu {
mainItem: ItemListView {
id: itemListView
height: model != undefined ? Math.min(((Math.floor((itemDialog.availableScreenRectForItem(itemListView).height
height: model !== undefined ? Math.min(((Math.floor((itemDialog.availableScreenRectForItem(itemListView).height
- itemDialog.margins.top - itemDialog.margins.bottom) / itemHeight) - 1)
* itemHeight) - (model.separatorCount * itemHeight) + (model.separatorCount * separatorHeight),
((model.count - model.separatorCount) * itemHeight) + (model.separatorCount * separatorHeight)) : 0
......
......@@ -68,7 +68,7 @@ FocusScope {
repeat: false
onTriggered: {
if (!plasmoid.expanded || model == undefined || currentIndex == -1) {
if (!plasmoid.expanded || model === undefined || currentIndex == -1) {
return;
}
......@@ -200,7 +200,7 @@ FocusScope {
}
Keys.onPressed: {
if (event.key == Qt.Key_Up) {
if (event.key === Qt.Key_Up) {
event.accepted = true;
if (!keyNavigationWraps && currentIndex == 0) {
......@@ -217,7 +217,7 @@ FocusScope {
}
showChildDialogs = true;
} else if (event.key == Qt.Key_Down) {
} else if (event.key === Qt.Key_Down) {
event.accepted = true;
if (!keyNavigationWraps && currentIndex == count - 1) {
......@@ -234,21 +234,21 @@ FocusScope {
}
showChildDialogs = true;
} else if ((event.key == Qt.Key_Right || event.key == Qt.Key_Return || event.key == Qt.Key_Enter) && childDialog != null) {
} else if ((event.key === Qt.Key_Right || event.key === Qt.Key_Return || event.key === Qt.Key_Enter) && childDialog != null) {
windowSystem.forceActive(childDialog.mainItem);
childDialog.mainItem.focus = true;
childDialog.mainItem.currentIndex = 0;
} else if ((event.key == Qt.Key_Right || event.key == Qt.Key_Return || event.key == Qt.Key_Enter) && childDialog == null
} else if ((event.key === Qt.Key_Right || event.key === Qt.Key_Return || event.key === Qt.Key_Enter) && childDialog == null
&& currentItem != null && currentItem.hasChildren) {
dialogSpawnTimer.focusOnSpawn = true;
dialogSpawnTimer.restart();
} else if (event.key == Qt.Key_Left && dialog != null) {
} else if (event.key === Qt.Key_Left && dialog != null) {
dialog.destroy();
} else if (event.key == Qt.Key_Escape) {
} else if (event.key === Qt.Key_Escape) {
plasmoid.expanded = false;
} else if (event.key == Qt.Key_Tab) {
} else if (event.key === Qt.Key_Tab) {
//do nothing, and skip appending text
} else if (event.text != "") {
} else if (event.text !== "") {
appendSearchText(event.text);
}
}
......
......@@ -178,7 +178,7 @@ PlasmaExtras.ScrollArea {
return;
}
if (index == 0 && currentRow() == 0) {
if (index == 0 && currentRow() === 0) {
itemMultiGrid.flickableItem.contentY = 0;
return;
}
......
......@@ -56,8 +56,8 @@ FocusScope {
spacing: units.smallSpacing
LayoutMirroring.enabled: ((plasmoid.location == PlasmaCore.Types.RightEdge)
|| (Qt.application.layoutDirection == Qt.RightToLeft && plasmoid.location != PlasmaCore.Types.LeftEdge))
LayoutMirroring.enabled: ((plasmoid.location === PlasmaCore.Types.RightEdge)
|| (Qt.application.layoutDirection == Qt.RightToLeft && plasmoid.location !== PlasmaCore.Types.LeftEdge))
PlasmaCore.FrameSvgItem {
id: sideBar
......@@ -85,7 +85,7 @@ FocusScope {
states: [ State {
name: "top"
when: (plasmoid.location == PlasmaCore.Types.TopEdge)
when: (plasmoid.location === PlasmaCore.Types.TopEdge)
AnchorChanges {
target: favoriteApps
......@@ -125,7 +125,7 @@ FocusScope {
states: [ State {
name: "top"
when: (plasmoid.location == PlasmaCore.Types.TopEdge)
when: (plasmoid.location === PlasmaCore.Types.TopEdge)
AnchorChanges {
target: sidebarSeparator
......@@ -153,7 +153,7 @@ FocusScope {
states: [ State {
name: "top"
when: (plasmoid.location == PlasmaCore.Types.TopEdge)
when: (plasmoid.location === PlasmaCore.Types.TopEdge)
AnchorChanges {
target: favoriteSystemActions
......@@ -190,7 +190,7 @@ FocusScope {
states: [ State {
name: "top"
when: (plasmoid.location == PlasmaCore.Types.TopEdge)
when: (plasmoid.location === PlasmaCore.Types.TopEdge)
AnchorChanges {
target: rootList
......@@ -246,7 +246,7 @@ FocusScope {
Keys.onPressed: {
var target = null;
if (event.key == Qt.Key_Right) {
if (event.key === Qt.Key_Right) {
var targets = new Array();
for (var i = index + 1; i < runnerModel.count; ++i) {
......@@ -263,7 +263,7 @@ FocusScope {
break;
}
}
} else if (event.key == Qt.Key_Left) {
} else if (event.key === Qt.Key_Left) {
var targets = new Array();
for (var i = index - 1; i >= 0; --i) {
......@@ -338,7 +338,7 @@ FocusScope {
states: [ State {
name: "top"
when: plasmoid.location == PlasmaCore.Types.TopEdge
when: plasmoid.location === PlasmaCore.Types.TopEdge
AnchorChanges {
target: searchField
......@@ -356,8 +356,8 @@ FocusScope {
},
State {
name: "right"
when: (plasmoid.location == PlasmaCore.Types.RightEdge && Qt.application.layoutDirection == Qt.LeftToRight)
|| (plasmoid.location == PlasmaCore.Types.LeftEdge && Qt.application.layoutDirection == Qt.RightToLeft)
when: (plasmoid.location === PlasmaCore.Types.RightEdge && Qt.application.layoutDirection == Qt.LeftToRight)
|| (plasmoid.location === PlasmaCore.Types.LeftEdge && Qt.application.layoutDirection == Qt.RightToLeft)
AnchorChanges {
target: searchField
......@@ -375,7 +375,7 @@ FocusScope {
}]
Keys.onPressed: {
if (event.key == Qt.Key_Up) {
if (event.key === Qt.Key_Up) {
if (rootList.visible) {
rootList.showChildDialogs = false;
rootList.currentIndex = rootList.model.count - 1;
......@@ -393,7 +393,7 @@ FocusScope {
}
}
}
} else if (event.key == Qt.Key_Down) {
} else if (event.key === Qt.Key_Down) {
if (rootList.visible) {
rootList.showChildDialogs = false;
rootList.currentIndex = Math.min(1, rootList.count);
......@@ -411,7 +411,7 @@ FocusScope {
}
}
}
} else if (event.key == Qt.Key_Left && cursorPosition == 0) {
} else if (event.key === Qt.Key_Left && cursorPosition == 0) {
for (var i = runnerModel.count; i >= 0; --i) {
if (runnerModel.modelForRow(i).count) {
var targetList = runnerColumnsRepeater.itemAt(i);
......@@ -420,7 +420,7 @@ FocusScope {
break;
}
}
} else if (event.key == Qt.Key_Right && cursorPosition == length) {
} else if (event.key === Qt.Key_Right && cursorPosition == length) {
for (var i = 1; i < runnerModel.count; ++i) {
if (runnerModel.modelForRow(i).count) {
var targetList = runnerColumnsRepeater.itemAt(i);
......@@ -429,7 +429,7 @@ FocusScope {
break;
}
}
} else if (event.key == Qt.Key_Enter || event.key == Qt.Key_Return) {
} else if (event.key === Qt.Key_Enter || event.key === Qt.Key_Return) {
if (runnerColumns.visible && runnerModel.modelForRow(0).count) {
runnerModel.modelForRow(0).trigger(0, "", null);
plasmoid.expanded = false;
......@@ -444,7 +444,7 @@ FocusScope {
}
Keys.onPressed: {
if (event.key == Qt.Key_Escape) {
if (event.key === Qt.Key_Escape) {