Skip to content

Commit

Permalink
Raw SED-ML view plugin: reworked our approach to the saving/reloading…
Browse files Browse the repository at this point in the history
… of a file (#1491).
  • Loading branch information
agarny committed Dec 18, 2017
1 parent 5021bcc commit cdae6d7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/plugins/editing/RawSEDMLView/src/rawsedmlviewplugin.cpp
Expand Up @@ -139,8 +139,9 @@ void RawSEDMLViewPlugin::fileModified(const QString &pFileName)

void RawSEDMLViewPlugin::fileSaved(const QString &pFileName)
{
//---ISSUE1491---
Q_UNUSED(pFileName);
// The given file has been saved, so let our view widget know about it

mViewWidget->fileSaved(pFileName);
}

//==============================================================================
Expand Down
13 changes: 13 additions & 0 deletions src/plugins/editing/RawSEDMLView/src/rawsedmlviewwidget.cpp
Expand Up @@ -199,6 +199,19 @@ void RawSedmlViewWidget::finalize(const QString &pFileName)

//==============================================================================

void RawSedmlViewWidget::fileSaved(const QString &pFileName)
{
// The given file has been saved, so consider it reloaded, but only if it
// has a corresponing widget and that it is invisible

QWidget *crtWidget = widget(pFileName);

if (crtWidget && !crtWidget->isVisible())
fileReloaded(pFileName);
}

//==============================================================================

void RawSedmlViewWidget::fileReloaded(const QString &pFileName)
{
// The given file has been reloaded, so reload it, should it be managed
Expand Down
1 change: 1 addition & 0 deletions src/plugins/editing/RawSEDMLView/src/rawsedmlviewwidget.h
Expand Up @@ -71,6 +71,7 @@ class RawSedmlViewWidget : public Core::ViewWidget
void initialize(const QString &pFileName, const bool &pUpdate = true);
void finalize(const QString &pFileName);

void fileSaved(const QString &pFileName);
void fileReloaded(const QString &pFileName);
void fileRenamed(const QString &pOldFileName, const QString &pNewFileName);

Expand Down

0 comments on commit cdae6d7

Please sign in to comment.