Skip to content

Commit

Permalink
Correctly set the save contents type when opening a class.
Browse files Browse the repository at this point in the history
  • Loading branch information
adeas31 committed Nov 25, 2015
1 parent 734e3df commit 1978c95
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions OMEdit/OMEditGUI/Modeling/LibraryTreeWidget.cpp
Expand Up @@ -341,11 +341,19 @@ LibraryTreeItem::LibraryTreeItem(LibraryType type, QString text, QString nameStr
setIsDocumentationClass(false);
if (isFilePathValid()) {
QFileInfo fileInfo(getFileName());
// if item has file name as package.mo then its save folder structure
if (fileInfo.fileName().compare("package.mo") == 0) {
// if item has file name as package.mo and is top level then its save folder structure
if (isTopLevel() && (fileInfo.fileName().compare("package.mo") == 0)) {
setSaveContentsType(LibraryTreeItem::SaveFolderStructure);
} else {
} else if (isTopLevel()) {
setSaveContentsType(LibraryTreeItem::SaveInOneFile);
} else {
if (mpParentLibraryTreeItem->getFileName().compare(getFileName()) == 0) {
setSaveContentsType(LibraryTreeItem::SaveInOneFile);
} else if (fileInfo.fileName().compare("package.mo") == 0) {
setSaveContentsType(LibraryTreeItem::SaveFolderStructure);
} else {
setSaveContentsType(LibraryTreeItem::SaveInOneFile);
}
}
}
setClassText("");
Expand Down

0 comments on commit 1978c95

Please sign in to comment.