Skip to content

Commit

Permalink
Merge f1061b7 into fa9d859
Browse files Browse the repository at this point in the history
  • Loading branch information
agarny committed Jun 29, 2018
2 parents fa9d859 + f1061b7 commit 8506c2f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -273,10 +273,17 @@ QString CellMLAnnotationViewPlugin::viewDefaultFileExtension() const

QWidget * CellMLAnnotationViewPlugin::viewWidget(const QString &pFileName)
{
// Make sure that we are dealing with a CellML file
// Make sure that we are dealing with a CellML 1.0/1.1 file

if (!CellMLSupport::CellmlFileManager::instance()->cellmlFile(pFileName))
CellMLSupport::CellmlFile *cellmlFile = CellMLSupport::CellmlFileManager::instance()->cellmlFile(pFileName);
CellMLSupport::CellmlFile::Version cellmlVersion = cellmlFile?
cellmlFile->version():
CellMLSupport::CellmlFile::Unknown;

if ( (cellmlVersion != CellMLSupport::CellmlFile::Cellml_1_0)
&& (cellmlVersion != CellMLSupport::CellmlFile::Cellml_1_1)) {
return 0;
}

// Update and return our CellML Annotation view widget using the given
// CellML file
Expand Down
11 changes: 9 additions & 2 deletions src/plugins/editing/RawCellMLView/src/rawcellmlviewplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -335,10 +335,17 @@ QString RawCellMLViewPlugin::viewDefaultFileExtension() const

QWidget * RawCellMLViewPlugin::viewWidget(const QString &pFileName)
{
// Make sure that we are dealing with a CellML file
// Make sure that we are dealing with a CellML 1.0/1.1 file

if (!CellMLSupport::CellmlFileManager::instance()->cellmlFile(pFileName))
CellMLSupport::CellmlFile *cellmlFile = CellMLSupport::CellmlFileManager::instance()->cellmlFile(pFileName);
CellMLSupport::CellmlFile::Version cellmlVersion = cellmlFile?
cellmlFile->version():
CellMLSupport::CellmlFile::Unknown;

if ( (cellmlVersion != CellMLSupport::CellmlFile::Cellml_1_0)
&& (cellmlVersion != CellMLSupport::CellmlFile::Cellml_1_1)) {
return 0;
}

// Update and return our Raw CellML view widget using the given CellML file

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,10 +313,16 @@ QString SimulationExperimentViewPlugin::viewDefaultFileExtension() const

QWidget * SimulationExperimentViewPlugin::viewWidget(const QString &pFileName)
{
// Make sure that we are dealing with a CellML file, a SED-ML file or a
// COMBINE archive
// Make sure that we are dealing with a CellML 1.0/1.1 file, a SED-ML file
// or a COMBINE archive

if ( !CellMLSupport::CellmlFileManager::instance()->cellmlFile(pFileName)
CellMLSupport::CellmlFile *cellmlFile = CellMLSupport::CellmlFileManager::instance()->cellmlFile(pFileName);
CellMLSupport::CellmlFile::Version cellmlVersion = cellmlFile?
cellmlFile->version():
CellMLSupport::CellmlFile::Unknown;

if ( (cellmlVersion != CellMLSupport::CellmlFile::Cellml_1_0)
&& (cellmlVersion != CellMLSupport::CellmlFile::Cellml_1_1)
&& !SEDMLSupport::SedmlFileManager::instance()->sedmlFile(pFileName)
&& !COMBINESupport::CombineFileManager::instance()->combineArchive(pFileName)) {
return 0;
Expand Down

0 comments on commit 8506c2f

Please sign in to comment.