mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-07 12:32:26 +00:00
Get rid of GuiApplication::viewCount().
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24906 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
26e8409172
commit
85d944702f
@ -561,7 +561,7 @@ bool GuiApplication::dispatch(FuncRequest const & cmd)
|
||||
}
|
||||
|
||||
case LFUN_BUFFER_NEW:
|
||||
if (viewCount() == 0
|
||||
if (d->views_.empty()
|
||||
|| (!lyxrc.open_buffers_in_tabs && current_view_->buffer() != 0)) {
|
||||
createView(QString(), false); // keep hidden
|
||||
current_view_->newDocument(to_utf8(cmd.argument()), false);
|
||||
@ -572,7 +572,7 @@ bool GuiApplication::dispatch(FuncRequest const & cmd)
|
||||
break;
|
||||
|
||||
case LFUN_BUFFER_NEW_TEMPLATE:
|
||||
if (viewCount() == 0
|
||||
if (d->views_.empty()
|
||||
|| (!lyxrc.open_buffers_in_tabs && current_view_->buffer() != 0)) {
|
||||
createView();
|
||||
current_view_->newDocument(to_utf8(cmd.argument()), true);
|
||||
@ -583,7 +583,7 @@ bool GuiApplication::dispatch(FuncRequest const & cmd)
|
||||
break;
|
||||
|
||||
case LFUN_FILE_OPEN:
|
||||
if (viewCount() == 0
|
||||
if (d->views_.empty()
|
||||
|| (!lyxrc.open_buffers_in_tabs && current_view_->buffer() != 0)) {
|
||||
createView();
|
||||
current_view_->openDocument(to_utf8(cmd.argument()));
|
||||
@ -659,7 +659,7 @@ void GuiApplication::createView(QString const & geometry_arg, bool autoShow)
|
||||
GuiView * view = new GuiView(id);
|
||||
|
||||
// copy the icon size from old view
|
||||
if (viewCount() > 0)
|
||||
if (current_view_)
|
||||
view->setIconSize(current_view_->iconSize());
|
||||
|
||||
// register view
|
||||
@ -718,12 +718,6 @@ Menus & GuiApplication::menus()
|
||||
}
|
||||
|
||||
|
||||
size_t GuiApplication::viewCount() const
|
||||
{
|
||||
return d->views_.size();
|
||||
}
|
||||
|
||||
|
||||
QVector<int> GuiApplication::viewIds()
|
||||
{
|
||||
QVector<int> ids;
|
||||
@ -986,6 +980,8 @@ void GuiApplication::unregisterView(GuiView * gv)
|
||||
{
|
||||
LASSERT(d->views_[gv->id()] == gv, /**/);
|
||||
d->views_.erase(gv->id());
|
||||
if (current_view_ == gv)
|
||||
current_view_ = 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -94,8 +94,6 @@ public:
|
||||
///
|
||||
void setCurrentView(GuiView * view) { current_view_ = view; }
|
||||
///
|
||||
size_t viewCount() const;
|
||||
///
|
||||
QVector<int> viewIds();
|
||||
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user