Browse Source

fix QString/QByteArray QML comparison

pull/2/head 1.1.2
Skycoder42 7 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_MAJOR = 1
MODULE_VERSION_MINOR = 1 MODULE_VERSION_MINOR = 1
MODULE_VERSION_PATCH = 1 MODULE_VERSION_PATCH = 2
MODULE_VERSION_IMPORT = $${MODULE_VERSION_MAJOR}.$${MODULE_VERSION_MINOR} MODULE_VERSION_IMPORT = $${MODULE_VERSION_MAJOR}.$${MODULE_VERSION_MINOR}
MODULE_VERSION = $${MODULE_VERSION_MAJOR}.$${MODULE_VERSION_MINOR}.$${MODULE_VERSION_PATCH} 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 * @sa QtMvvm::MessageConfig, QtMvvm::MessageResult, QtMvvmApp::showDialog
*/ */
function showDialog(config, result) { function showDialog(config, result) {
if(config.type === "msgbox") if(config.type == "msgbox")
return createMsgBox(config, result) return createMsgBox(config, result)
else if(config.type === "input") else if(config.type == "input")
return createInput(config, result) return createInput(config, result)
else if(config.type === "file") else if(config.type == "file")
return createFile(config, result) return createFile(config, result)
else if(config.type === "color") else if(config.type == "color")
return createColor(config, result) return createColor(config, result)
else if(config.type === "progress") else if(config.type == "progress")
return createProgress(config, result) return createProgress(config, result)
else else
return false; return false;
@ -267,7 +267,7 @@ QtObject {
props["msgConfig"] = config; props["msgConfig"] = config;
props["msgResult"] = result; props["msgResult"] = result;
var incubator = null; var incubator = null;
if(config.subType === "folder") if(config.subType == "folder")
incubator = _folderComponent.incubateObject(rootItem, props, Qt.Synchronous); incubator = _folderComponent.incubateObject(rootItem, props, Qt.Synchronous);
else else
incubator = _fileComponent.incubateObject(rootItem, props, Qt.Synchronous); incubator = _fileComponent.incubateObject(rootItem, props, Qt.Synchronous);
@ -287,7 +287,7 @@ QtObject {
* @sa DialogPresenter::showDialog * @sa DialogPresenter::showDialog
*/ */
function createColor(config, result) { function createColor(config, result) {
config.viewProperties["alpha"] = (config.subType === "argb"); config.viewProperties["alpha"] = (config.subType == "argb");
config.type = "input"; config.type = "input";
config.subType = "QColor"; config.subType = "QColor";
return createInput(config, result); return createInput(config, result);

8
src/imports/mvvmquick/FileDialog.qml

@ -69,11 +69,11 @@ Labs.FileDialog {
modality: Qt.WindowModal modality: Qt.WindowModal
folder: msgConfig.defaultValue folder: msgConfig.defaultValue
fileMode: { fileMode: {
if(msgConfig.subType === "open") if(msgConfig.subType == "open")
return Labs.FileDialog.OpenFile; return Labs.FileDialog.OpenFile;
else if(msgConfig.subType === "files") else if(msgConfig.subType == "files")
return Labs.FileDialog.OpenFiles; return Labs.FileDialog.OpenFiles;
else if(msgConfig.subType === "save") else if(msgConfig.subType == "save")
return Labs.FileDialog.SaveFile; return Labs.FileDialog.SaveFile;
else { else {
return Labs.FileDialog.OpenFile; //fallback return Labs.FileDialog.OpenFile; //fallback
@ -88,7 +88,7 @@ Labs.FileDialog {
onAccepted: { onAccepted: {
if(msgResult) { if(msgResult) {
if(msgConfig.subType === "files") if(msgConfig.subType == "files")
msgResult.result = _fileDialog.files; msgResult.result = _fileDialog.files;
else else
msgResult.result = _fileDialog.file; msgResult.result = _fileDialog.file;

2
src/imports/mvvmquick/MsgBoxBase.qml

@ -88,7 +88,7 @@ AlertDialog {
_msgBoxBase.buttonClicked(button); _msgBoxBase.buttonClicked(button);
if(msgResult && autoHandleBtns) { if(msgResult && autoHandleBtns) {
_allBtns.forEach(function(sBtn) { _allBtns.forEach(function(sBtn) {
if(button === standardButton(sBtn)) { if(button == standardButton(sBtn)) {
msgResult.complete(sBtn); msgResult.complete(sBtn);
msgResult = null; msgResult = null;
_msgBoxBase.done(sBtn); _msgBoxBase.done(sBtn);

2
src/imports/mvvmquick/ProgressDialog.qml

@ -37,7 +37,7 @@ MsgBoxBase {
} }
function tryCancel(button) { function tryCancel(button) {
if(_cancelAction === MessageConfig.NoButton) { if(_cancelAction == MessageConfig.NoButton) {
_cancelAction = button; _cancelAction = button;
footer.enabled = false; footer.enabled = false;
if(progressControl) if(progressControl)

Loading…
Cancel
Save