]> git.lyx.org Git - lyx.git/blobdiff - src/lyx_main.C
* lyx_main.C: remove duplicate function assertion_failed
[lyx.git] / src / lyx_main.C
index edf7031b048429747e518f8d7fb5349a70502ac6..cc856fb70a4e3a8aaca7f0a644e1d1af14e227e5 100644 (file)
@@ -393,27 +393,14 @@ void LyX::earlyExit(int status)
 }
 
 
-void LyX::quit(bool noask)
+void LyX::quit()
 {
        lyxerr[Debug::INFO] << "Running QuitLyX." << endl;
 
-       if (use_gui) {
-               if (!noask && !pimpl_->buffer_list_.quitWriteAll())
-                       return;
-
-               // The LyXView Geometry settings are stored when LyXView::close
-               // is called explicitely but a straight quit() command would not
-               // guarante that. So we make sure this is done here:
-               vector<int> const & view_ids = pimpl_->application_->gui().viewIds();
-               for (size_t i = 0; i < view_ids.size(); ++i)
-                       pimpl_->application_->gui().view(view_ids[i]).saveGeometry();
-
-               pimpl_->session_->writeFile();
-       }
-
        prepareExit();
 
        if (use_gui) {
+               pimpl_->session_->writeFile();
                pimpl_->lyx_server_.reset();
                pimpl_->lyx_socket_.reset();
                pimpl_->application_->exit(0);
@@ -506,7 +493,7 @@ void LyX::restoreGuiSession(vector<string> const & files)
 
        // if a file is specified, I assume that user wants to edit *that* file
        if (files.empty() && lyxrc.load_session) {
-               vector<string> const & lastopened = pimpl_->session_->lastOpenedFiles();
+               vector<string> const & lastopened = pimpl_->session_->lastOpened().getfiles();
                // do not add to the lastfile list since these files are restored from
                // last seesion, and should be already there (regular files), or should
                // not be added at all (help files).
@@ -514,7 +501,7 @@ void LyX::restoreGuiSession(vector<string> const & files)
                        bind(&LyXView::loadLyXFile, view, _1, false));
        }
        // clear this list to save a few bytes of RAM
-       pimpl_->session_->clearLastOpenedFiles();
+       pimpl_->session_->lastOpened().clear();
 }
 
 
@@ -535,13 +522,13 @@ LyXView * LyX::newLyXView()
        }
        // if lyxrc returns (0,0), then use session info
        else {
-               string val = session().loadSessionInfo("WindowWidth");
+               string val = session().sessionInfo().load("WindowWidth");
                if (!val.empty())
                        width = convert<unsigned int>(val);
-               val = session().loadSessionInfo("WindowHeight");
+               val = session().sessionInfo().load("WindowHeight");
                if (!val.empty())
                        height = convert<unsigned int>(val);
-               if (session().loadSessionInfo("WindowIsMaximized") == "yes")
+               if (session().sessionInfo().load("WindowIsMaximized") == "yes")
                        maximize = true;
        }
 
@@ -549,10 +536,10 @@ LyXView * LyX::newLyXView()
        int posx = -1;
        int posy = -1;
        if (lyxrc.geometry_xysaved) {
-               string val = session().loadSessionInfo("WindowPosX");
+               string val = session().sessionInfo().load("WindowPosX");
                if (!val.empty())
                        posx = convert<int>(val);
-               val = session().loadSessionInfo("WindowPosY");
+               val = session().sessionInfo().load("WindowPosY");
                if (!val.empty())
                        posy = convert<int>(val);
        }
@@ -1319,15 +1306,3 @@ kb_keymap & theTopLevelKeymap()
 }
 
 } // namespace lyx
-
-
-namespace boost {
-
-void assertion_failed(char const* a, char const* b, char const* c, long d)
-{
-       lyx::lyxerr << "Assertion failed: " << a << ' ' << b << ' ' << c << ' '
-               << d << '\n';
-}
-
-} // boost
-