From 414571cf6861ce6f3feeaa2151c99290e04751c9 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Wed, 23 Sep 2009 09:17:11 +0000 Subject: [PATCH] Get rid of LyXView::hasFocus(). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31452 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/LyXView.h | 2 -- src/frontends/qt4/GuiApplication.cpp | 2 +- src/frontends/qt4/GuiView.cpp | 6 ------ src/frontends/qt4/GuiView.h | 1 - 4 files changed, 1 insertion(+), 10 deletions(-) diff --git a/src/frontends/LyXView.h b/src/frontends/LyXView.h index 3c69aef129..2b1d3d8e92 100644 --- a/src/frontends/LyXView.h +++ b/src/frontends/LyXView.h @@ -65,8 +65,6 @@ public: /// set a buffer to the current workarea. virtual void setBuffer(Buffer * b) = 0; ///< \c Buffer to set. - /// - virtual bool hasFocus() const = 0; /// load a document into the current workarea. virtual Buffer * loadDocument( diff --git a/src/frontends/qt4/GuiApplication.cpp b/src/frontends/qt4/GuiApplication.cpp index 458ab789a3..982d16a7b5 100644 --- a/src/frontends/qt4/GuiApplication.cpp +++ b/src/frontends/qt4/GuiApplication.cpp @@ -808,7 +808,7 @@ LyXView * GuiApplication::currentWindow() the main window. In this case, we want to disable the menu entries that are buffer or view-related. */ - if (current_view_ && !current_view_->hasFocus()) + if (current_view_ && current_view_->activeWindow() != this) return 0; #endif return current_view_; diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 9dcc95429d..b1bfd73d42 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -734,12 +734,6 @@ void GuiView::updateStatusBar() } -bool GuiView::hasFocus() const -{ - return qApp->activeWindow() == this; -} - - bool GuiView::event(QEvent * e) { switch (e->type()) diff --git a/src/frontends/qt4/GuiView.h b/src/frontends/qt4/GuiView.h index 65059c63b2..06449a9174 100644 --- a/src/frontends/qt4/GuiView.h +++ b/src/frontends/qt4/GuiView.h @@ -71,7 +71,6 @@ public: BufferView * documentBufferView(); BufferView const * documentBufferView() const; void setBuffer(Buffer * b); - bool hasFocus() const; Buffer * loadDocument(support::FileName const & name, bool tolastfiles = true); void newDocument(std::string const & filename, -- 2.39.2