int PartSet_DocumentDataModel::rowCount(const QModelIndex& theParent) const
{
- DocumentPtr aRootDoc = ModelAPI_Session::get()->moduleDocument();
+ SessionPtr aSession = ModelAPI_Session::get();
+ if (!aSession->hasModuleDocument())
+ return 0;
+ DocumentPtr aRootDoc = aSession->moduleDocument();
if (!theParent.isValid()) {
// Size of external models
int aVal = historyOffset();
} else if (anAnswer == QMessageBox::Cancel) {
return;
}
- aSession->closeAll();
myCurrentDir = "";
}
}
QApplication::setOverrideCursor(Qt::WaitCursor);
myIsLoadingData = true;
+ aSession->closeAll();
aSession->load(myCurrentDir.toLatin1().constData());
myObjectBrowser->rebuildDataTree();
displayAllResults();