diff --git a/src/LyX.cpp b/src/LyX.cpp index 40d76173a2..9a60901d84 100644 --- a/src/LyX.cpp +++ b/src/LyX.cpp @@ -83,8 +83,6 @@ namespace os = support::os; bool use_gui = true; -bool quitting; // flag, that we are quitting the program - namespace { // Filled with the command line arguments "foo" of "-sysdir foo" or @@ -458,10 +456,6 @@ void LyX::prepareExit() cap::clearCutStack(); cap::clearSelection(); - // Set a flag that we do quitting from the program, - // so no refreshes are necessary. - quitting = true; - // close buffers first pimpl_->buffer_list_.closeAll(); diff --git a/src/LyX.h b/src/LyX.h index 982301a4e1..0d8616eff9 100644 --- a/src/LyX.h +++ b/src/LyX.h @@ -38,7 +38,6 @@ class KeyMap; class CmdDef; extern bool use_gui; -extern bool quitting; namespace frontend { class Application; diff --git a/src/LyXFunc.cpp b/src/LyXFunc.cpp index 986d7de426..717d686f1c 100644 --- a/src/LyXFunc.cpp +++ b/src/LyXFunc.cpp @@ -206,7 +206,7 @@ void LyXFunc::initKeySequences(KeyMap * kb) void LyXFunc::setLyXView(LyXView * lv) { - if (!quitting && lyx_view_ && lyx_view_->view() && lyx_view_ != lv) + if (lyx_view_ && lyx_view_->view() && lyx_view_ != lv) // save current selection to the selection buffer to allow // middle-button paste in another window cap::saveSelection(lyx_view_->view()->cursor()); @@ -1742,7 +1742,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd) theSelection().haveSelection(view()->cursor().selection()); } } - if (!quitting && lyx_view_) { + if (lyx_view_) { // Some messages may already be translated, so we cannot use _() sendDispatchMessage(translateIfPossible(getMessage()), cmd); } diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index d0ed739181..f003951cf3 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -433,20 +433,7 @@ void GuiView::closeEvent(QCloseEvent * close_event) } guiApp->unregisterView(id_); - if (guiApp->viewCount() > 0) { - // Just close the window and do nothing else if this is not the - // last window. - close_event->accept(); - return; - } - - quitting = true; - - // this is the place where we leave the frontend. - // it is the only point at which we start quitting. close_event->accept(); - // quit the event loop - qApp->quit(); } @@ -1783,8 +1770,6 @@ bool GuiView::dispatch(FuncRequest const & cmd) break; case LFUN_DIALOG_HIDE: { - if (quitting) - break; guiApp->hideDialogs(to_utf8(cmd.argument()), 0); break; } @@ -2094,13 +2079,6 @@ bool GuiView::isDialogVisible(string const & name) const void GuiView::hideDialog(string const & name, Inset * inset) { - // Don't send the signal if we are quitting, because on MSVC it is - // destructed before the cut stack in CutAndPaste.cpp, and this method - // is called from some inset destructor if the cut stack is not empty - // on exit. - if (quitting) - return; - map::const_iterator it = d.dialogs_.find(name); if (it == d.dialogs_.end()) return; diff --git a/src/insets/Inset.cpp b/src/insets/Inset.cpp index ed94df8ae3..3bfd0a4aed 100644 --- a/src/insets/Inset.cpp +++ b/src/insets/Inset.cpp @@ -25,7 +25,6 @@ #include "DispatchResult.h" #include "FuncRequest.h" #include "FuncStatus.h" -#include "LyX.h" // quitting #include "MetricsInfo.h" #include "Text.h" #include "TextClass.h" @@ -393,9 +392,7 @@ void Inset::setDimCache(MetricsInfo const & mi, Dimension const & dim) const Buffer const * Inset::updateFrontend() const { - if (quitting) - return 0; - return theApp()->updateInset(this); + return theApp()? theApp()->updateInset(this) : 0; } } // namespace lyx