Browse Source

fix QString/QByteArray QML comparison

pull/2/head 1.1.2
Skycoder42 6 years ago
parent
commit
61a404e08a
No known key found for this signature in database GPG Key ID: 8E01AD9EF0578D2B
  1. 2
      .qmake.conf
  2. 14
      src/imports/mvvmquick/DialogPresenter.qml
  3. 8
      src/imports/mvvmquick/FileDialog.qml
  4. 2
      src/imports/mvvmquick/MsgBoxBase.qml
  5. 2
      src/imports/mvvmquick/ProgressDialog.qml

2
.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}

14
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);

8
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;

2
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);

2
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)

Loading…
Cancel
Save