tycho: fix activeProject returning the wrong object

master
an 2019-06-13 23:14:39 -04:00
parent 82d0d378b0
commit cb9d844404
2 changed files with 4 additions and 3 deletions

View File

@ -81,6 +81,8 @@ void Menu::updateActions()
bool active = view != nullptr;
ui->actionMapProps->setEnabled(active);
dbgPrintFunc();
}
void Menu::closeEvent(QCloseEvent *event)
@ -97,8 +99,7 @@ void Menu::closeEvent(QCloseEvent *event)
ProjectView *Menu::activeProject() const
{
auto win = activeSubWindow();
return win ? qobject_cast<ProjectView *>(win->widget()) : nullptr;
return qobject_cast<ProjectView *>(activeSubWindow());
}
QMdiSubWindow *Menu::activeSubWindow() const

View File

@ -13,7 +13,7 @@ ProjectModel::~ProjectModel()
bool ProjectModel::isDirty() const
{
return true;
return false;
}
bool ProjectModel::open(const QString &fname)