Skip to content

Commit

Permalink
call loadDocument in setDocumentViewerContent instead over a seperate…
Browse files Browse the repository at this point in the history
… method

updateDocumentViewer needs not to be called on Image before the laod of the document (because it's called after the document load (or unload))
  • Loading branch information
signedav committed Aug 24, 2020
1 parent 6fbeb47 commit c3cb69b
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 19 deletions.
6 changes: 0 additions & 6 deletions python/gui/auto_generated/qgsexternalresourcewidget.sip.in
Expand Up @@ -133,12 +133,6 @@ is set to QgsFileWidget.RelativeDefaultPath.
%Docstring
Configures the base path which should be used if the relativeStorage property
is set to QgsFileWidget.RelativeDefaultPath.
%End

void reloadDocument();
%Docstring
Reloads the document from the path of the filewidget
/since QGIS 3.16
%End

signals:
Expand Down
1 change: 0 additions & 1 deletion src/gui/editorwidgets/qgsexternalresourcewidgetwrapper.cpp
Expand Up @@ -112,7 +112,6 @@ void QgsExternalResourceWidgetWrapper::updateProperties( const QgsFeature &featu
dvc = QgsExternalResourceWidget::NoContent;
}
mQgsWidget->setDocumentViewerContent( dvc );
mQgsWidget->reloadDocument();
}
}
}
Expand Down
9 changes: 3 additions & 6 deletions src/gui/qgsexternalresourcewidget.cpp
Expand Up @@ -99,7 +99,9 @@ QgsExternalResourceWidget::DocumentViewerContent QgsExternalResourceWidget::docu
void QgsExternalResourceWidget::setDocumentViewerContent( QgsExternalResourceWidget::DocumentViewerContent content )
{
mDocumentViewerContent = content;
updateDocumentViewer();
if ( mDocumentViewerContent != Image )
updateDocumentViewer();
loadDocument( mFileWidget->filePath() );
}

int QgsExternalResourceWidget::documentViewerHeight() const
Expand Down Expand Up @@ -194,11 +196,6 @@ void QgsExternalResourceWidget::setDefaultRoot( const QString &defaultRoot )
mDefaultRoot = defaultRoot;
}

void QgsExternalResourceWidget::reloadDocument()
{
loadDocument( mFileWidget->filePath() );
}

QgsFileWidget::RelativeStorage QgsExternalResourceWidget::relativeStorage() const
{
return mRelativeStorage;
Expand Down
6 changes: 0 additions & 6 deletions src/gui/qgsexternalresourcewidget.h
Expand Up @@ -143,12 +143,6 @@ class GUI_EXPORT QgsExternalResourceWidget : public QWidget
*/
void setDefaultRoot( const QString &defaultRoot );

/**
* Reloads the document from the path of the filewidget
* /since QGIS 3.16
*/
void reloadDocument();

signals:
//! emitteed as soon as the current document changes
void valueChanged( const QString & );
Expand Down

0 comments on commit c3cb69b

Please sign in to comment.