mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 21:21:32 +00:00
simplify GuiApplication::unregisterView().
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24905 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
d2a96bcdc3
commit
26e8409172
@ -982,20 +982,10 @@ void GuiApplication::commitData(QSessionManager & sm)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool GuiApplication::unregisterView(int id)
|
void GuiApplication::unregisterView(GuiView * gv)
|
||||||
{
|
{
|
||||||
LASSERT(d->views_.find(id) != d->views_.end(), /**/);
|
LASSERT(d->views_[gv->id()] == gv, /**/);
|
||||||
LASSERT(d->views_[id], /**/);
|
d->views_.erase(gv->id());
|
||||||
|
|
||||||
map<int, GuiView *>::iterator it;
|
|
||||||
for (it = d->views_.begin(); it != d->views_.end(); ++it) {
|
|
||||||
if (it->first == id) {
|
|
||||||
d->views_.erase(id);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -112,7 +112,7 @@ public:
|
|||||||
/// return a suitable monospaced font name.
|
/// return a suitable monospaced font name.
|
||||||
QString const typewriterFontName();
|
QString const typewriterFontName();
|
||||||
///
|
///
|
||||||
bool unregisterView(int id);
|
void unregisterView(GuiView * gv);
|
||||||
///
|
///
|
||||||
GuiView & view(int id) const;
|
GuiView & view(int id) const;
|
||||||
|
|
||||||
|
@ -458,7 +458,7 @@ void GuiView::closeEvent(QCloseEvent * close_event)
|
|||||||
it->second->saveSession();
|
it->second->saveSession();
|
||||||
}
|
}
|
||||||
|
|
||||||
guiApp->unregisterView(id_);
|
guiApp->unregisterView(this);
|
||||||
close_event->accept();
|
close_event->accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user