Skip to content

Commit

Permalink
Prevent a couple of warnings on Linux.
Browse files Browse the repository at this point in the history
  • Loading branch information
agarny committed May 26, 2018
1 parent 2a1feed commit 947b6a6
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
14 changes: 11 additions & 3 deletions src/plugins/editing/RawSEDMLView/src/rawsedmlviewwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -331,19 +331,27 @@ bool RawSedmlViewWidget::validate(const QString &pFileName, bool pOnlyErrors) co
EditorWidget::EditorListItem::Type issueType;

switch (sedmlFileIssue.type()) {
case SEDMLSupport::SedmlFileIssue::Unknown:
#ifdef QT_DEBUG
// We should never come here...

qFatal("FATAL ERROR | %s:%d: a SED-ML file issue cannot of unknown type.", __FILE__, __LINE__);
#endif

break;
case SEDMLSupport::SedmlFileIssue::Information:
issueType = EditorWidget::EditorListItem::Information;

break;
case SEDMLSupport::SedmlFileIssue::Error:
case SEDMLSupport::SedmlFileIssue::Error:
issueType = EditorWidget::EditorListItem::Error;

break;
case SEDMLSupport::SedmlFileIssue::Warning:
case SEDMLSupport::SedmlFileIssue::Warning:
issueType = EditorWidget::EditorListItem::Warning;

break;
case SEDMLSupport::SedmlFileIssue::Fatal:
case SEDMLSupport::SedmlFileIssue::Fatal:
issueType = EditorWidget::EditorListItem::Fatal;

break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -808,6 +808,14 @@ void SimulationExperimentViewSimulationWidget::initialize(bool pReloadingView)
QString issueType;

switch (sedmlFileIssue.type()) {
case SEDMLSupport::SedmlFileIssue::Unknown:
#ifdef QT_DEBUG
// We should never come here...

qFatal("FATAL ERROR | %s:%d: a SED-ML file issue cannot of unknown type.", __FILE__, __LINE__);
#endif

break;
case SEDMLSupport::SedmlFileIssue::Information:
issueType = tr("Information:");

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/support/SEDMLSupport/src/sedmlfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ bool SedmlFile::isValid(const QString &pFileContents, SedmlFileIssues &pIssues)

for (uint i = 0, iMax = errorLog->getNumErrors(); i < iMax; ++i) {
const libsedml::SedError *error = errorLog->getError(i);
SedmlFileIssue::Type issueType;
SedmlFileIssue::Type issueType = SedmlFileIssue::Unknown;

switch (error->getSeverity()) {
case LIBSBML_SEV_INFO:
Expand Down
1 change: 1 addition & 0 deletions src/plugins/support/SEDMLSupport/src/sedmlfileissue.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class SEDMLSUPPORT_EXPORT SedmlFileIssue
{
public:
enum Type {
Unknown,
Information,
Error,
Warning,
Expand Down

0 comments on commit 947b6a6

Please sign in to comment.