From 61a404e08a82f2547294af43a531803793075966 Mon Sep 17 00:00:00 2001 From: Skycoder42 Date: Tue, 14 Aug 2018 18:59:14 +0200 Subject: [PATCH] fix QString/QByteArray QML comparison --- .qmake.conf | 2 +- src/imports/mvvmquick/DialogPresenter.qml | 14 +++++++------- src/imports/mvvmquick/FileDialog.qml | 8 ++++---- src/imports/mvvmquick/MsgBoxBase.qml | 2 +- src/imports/mvvmquick/ProgressDialog.qml | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.qmake.conf b/.qmake.conf index d19f33b..a576b29 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -9,6 +9,6 @@ DEFINES += QT_DEPRECATED_WARNINGS QT_ASCII_CAST_WARNINGS MODULE_VERSION_MAJOR = 1 MODULE_VERSION_MINOR = 1 -MODULE_VERSION_PATCH = 1 +MODULE_VERSION_PATCH = 2 MODULE_VERSION_IMPORT = $${MODULE_VERSION_MAJOR}.$${MODULE_VERSION_MINOR} MODULE_VERSION = $${MODULE_VERSION_MAJOR}.$${MODULE_VERSION_MINOR}.$${MODULE_VERSION_PATCH} diff --git a/src/imports/mvvmquick/DialogPresenter.qml b/src/imports/mvvmquick/DialogPresenter.qml index 126e5c0..270b89b 100644 --- a/src/imports/mvvmquick/DialogPresenter.qml +++ b/src/imports/mvvmquick/DialogPresenter.qml @@ -83,15 +83,15 @@ QtObject { * @sa QtMvvm::MessageConfig, QtMvvm::MessageResult, QtMvvmApp::showDialog */ function showDialog(config, result) { - if(config.type === "msgbox") + if(config.type == "msgbox") return createMsgBox(config, result) - else if(config.type === "input") + else if(config.type == "input") return createInput(config, result) - else if(config.type === "file") + else if(config.type == "file") return createFile(config, result) - else if(config.type === "color") + else if(config.type == "color") return createColor(config, result) - else if(config.type === "progress") + else if(config.type == "progress") return createProgress(config, result) else return false; @@ -267,7 +267,7 @@ QtObject { props["msgConfig"] = config; props["msgResult"] = result; var incubator = null; - if(config.subType === "folder") + if(config.subType == "folder") incubator = _folderComponent.incubateObject(rootItem, props, Qt.Synchronous); else incubator = _fileComponent.incubateObject(rootItem, props, Qt.Synchronous); @@ -287,7 +287,7 @@ QtObject { * @sa DialogPresenter::showDialog */ function createColor(config, result) { - config.viewProperties["alpha"] = (config.subType === "argb"); + config.viewProperties["alpha"] = (config.subType == "argb"); config.type = "input"; config.subType = "QColor"; return createInput(config, result); diff --git a/src/imports/mvvmquick/FileDialog.qml b/src/imports/mvvmquick/FileDialog.qml index 1c24d33..efd2b12 100644 --- a/src/imports/mvvmquick/FileDialog.qml +++ b/src/imports/mvvmquick/FileDialog.qml @@ -69,11 +69,11 @@ Labs.FileDialog { modality: Qt.WindowModal folder: msgConfig.defaultValue fileMode: { - if(msgConfig.subType === "open") + if(msgConfig.subType == "open") return Labs.FileDialog.OpenFile; - else if(msgConfig.subType === "files") + else if(msgConfig.subType == "files") return Labs.FileDialog.OpenFiles; - else if(msgConfig.subType === "save") + else if(msgConfig.subType == "save") return Labs.FileDialog.SaveFile; else { return Labs.FileDialog.OpenFile; //fallback @@ -88,7 +88,7 @@ Labs.FileDialog { onAccepted: { if(msgResult) { - if(msgConfig.subType === "files") + if(msgConfig.subType == "files") msgResult.result = _fileDialog.files; else msgResult.result = _fileDialog.file; diff --git a/src/imports/mvvmquick/MsgBoxBase.qml b/src/imports/mvvmquick/MsgBoxBase.qml index 6093a7d..b03b076 100644 --- a/src/imports/mvvmquick/MsgBoxBase.qml +++ b/src/imports/mvvmquick/MsgBoxBase.qml @@ -88,7 +88,7 @@ AlertDialog { _msgBoxBase.buttonClicked(button); if(msgResult && autoHandleBtns) { _allBtns.forEach(function(sBtn) { - if(button === standardButton(sBtn)) { + if(button == standardButton(sBtn)) { msgResult.complete(sBtn); msgResult = null; _msgBoxBase.done(sBtn); diff --git a/src/imports/mvvmquick/ProgressDialog.qml b/src/imports/mvvmquick/ProgressDialog.qml index 6e6b625..eaed8c9 100644 --- a/src/imports/mvvmquick/ProgressDialog.qml +++ b/src/imports/mvvmquick/ProgressDialog.qml @@ -37,7 +37,7 @@ MsgBoxBase { } function tryCancel(button) { - if(_cancelAction === MessageConfig.NoButton) { + if(_cancelAction == MessageConfig.NoButton) { _cancelAction = button; footer.enabled = false; if(progressControl)