Skip to content

Commit

Permalink
Check the LibraryTreeItem type before showing the documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
adeas31 committed Dec 20, 2017
1 parent 32af475 commit 8e2f487
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions OMEdit/OMEditGUI/Modeling/LibraryTreeWidget.cpp
Expand Up @@ -1662,11 +1662,12 @@ LibraryTreeItem* LibraryTreeModel::getLibraryTreeItemFromFile(QString fileName,
void LibraryTreeModel::showModelWidget(LibraryTreeItem *pLibraryTreeItem, bool show, StringHandler::ViewType viewType)
{
QApplication::setOverrideCursor(Qt::WaitCursor);
if (show && ((viewType == StringHandler::NoView && pLibraryTreeItem->mClassInformation.preferredView.compare("info") == 0) ||
(viewType == StringHandler::NoView && pLibraryTreeItem->mClassInformation.preferredView.isEmpty() &&
pLibraryTreeItem->isDocumentationClass()) ||
(viewType == StringHandler::NoView && pLibraryTreeItem->mClassInformation.preferredView.isEmpty() &&
OptionsDialog::instance()->getGeneralSettingsPage()->getDefaultView().compare(Helper::documentationView) == 0))) {
if (show && pLibraryTreeItem->getLibraryType() == LibraryTreeItem::Modelica
&& ((viewType == StringHandler::NoView && pLibraryTreeItem->mClassInformation.preferredView.compare("info") == 0) ||
(viewType == StringHandler::NoView && pLibraryTreeItem->mClassInformation.preferredView.isEmpty() &&
pLibraryTreeItem->isDocumentationClass()) ||
(viewType == StringHandler::NoView && pLibraryTreeItem->mClassInformation.preferredView.isEmpty() &&
OptionsDialog::instance()->getGeneralSettingsPage()->getDefaultView().compare(Helper::documentationView) == 0))) {
MainWindow::instance()->getDocumentationWidget()->showDocumentation(pLibraryTreeItem);
bool state = MainWindow::instance()->getDocumentationDockWidget()->blockSignals(true);
MainWindow::instance()->getDocumentationDockWidget()->show();
Expand Down

0 comments on commit 8e2f487

Please sign in to comment.