Skip to content

Commit

Permalink
review of bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
VitorVieiraZ committed May 6, 2024
1 parent 5914cab commit 4eb43f4
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions app/qml/form/editors/MMFormPhotoEditor.qml
Expand Up @@ -77,7 +77,7 @@ MMFormPhotoViewer {

title: _fieldShouldShowTitle ? _fieldTitle : ""

warningMsg: _fieldWarningMessage
warningMsg: photoState === "notAvailable" ? qsTr( "Photo is missing" ): _fieldWarningMessage
errorMsg: _fieldErrorMessage

readOnly: _fieldIsReadOnly
Expand Down Expand Up @@ -203,12 +203,7 @@ MMFormPhotoViewer {
function calculateAbsoluteImagePath() {
let absolutePath = __inputUtils.getAbsolutePath( root._fieldValue, internal.prefixToRelativePath )

if ( !__inputUtils.fileExists( absolutePath ) ) {
root.photoState = "notSet"
absoluteImagePath = ""
return
}
else if ( root.photoComponent.status === Image.Error ) {
if ( root.photoComponent.status === Image.Error ) {
root.photoState = "notAvailable"
absoluteImagePath = ""
return
Expand Down Expand Up @@ -284,6 +279,7 @@ MMFormPhotoViewer {
imageDeleteDialog.open()
}
else {
internal.absoluteImagePath = ""
root.editorValueChanged( "", true )
}
}
Expand Down

0 comments on commit 4eb43f4

Please sign in to comment.