]> git.lyx.org Git - lyx.git/blobdiff - src/session.C
* remove various xforms relicts, in particular:
[lyx.git] / src / session.C
index a1781e4d019f2c2efa5d9746f8d565617c60e82d..1d1b92e0dd3e55b2c978b8047fd0f334ef305224 100644 (file)
@@ -23,8 +23,8 @@
 #include <algorithm>
 #include <iterator>
 
-using lyx::support::AddName; 
-using lyx::support::package;  
+using lyx::support::addName;
+using lyx::support::package;
 
 namespace fs = boost::filesystem;
 
@@ -65,7 +65,7 @@ Session::Session(unsigned int num) :
        setNumberOfLastFiles(num);
        // locate the session file
        // note that the session file name 'session' is hard-coded
-       session_file = AddName(package().user_support(), "session");
+       session_file = addName(package().user_support(), "session");
        //
        readFile();
 }
@@ -94,7 +94,7 @@ void Session::readFile()
 
        // the following is currently not implemented very
        // robustly. (Manually editing of the session file may crash lyx)
-       // 
+       //
        while (getline(ifs, tmp)) {
                // Ignore comments, empty line or line stats with ' '
                if (tmp == "" || tmp[0] == '#' || tmp[0] == ' ')
@@ -138,7 +138,7 @@ void Session::readFile()
                                continue;
                        lastopened.push_back(tmp);
                } else if (section == id_bookmarks) {
-                       // read bookmarks 
+                       // read bookmarks
                        // bookmarkid, id, pos, file\n
                        unsigned int num;
                        unsigned int id;
@@ -179,9 +179,9 @@ void Session::writeFile() const
                     ostream_iterator<string>(ofs, "\n"));
                // second section
                ofs << '\n' << sec_lastfilepos << '\n';
-               for (FilePosMap::const_iterator file = lastfilepos.begin(); 
+               for (FilePosMap::const_iterator file = lastfilepos.begin();
                        file != lastfilepos.end(); ++file) {
-                       ofs << file->second.get<0>() << ", " 
+                       ofs << file->second.get<0>() << ", "
                            << file->second.get<1>() << ", "
                            << file->first << '\n';
                }
@@ -191,11 +191,11 @@ void Session::writeFile() const
                     ostream_iterator<string>(ofs, "\n"));
                // fourth section
                ofs << '\n' << sec_bookmarks << '\n';
-               for (BookmarkList::const_iterator bm = bookmarks.begin(); 
+               for (BookmarkList::const_iterator bm = bookmarks.begin();
                        bm != bookmarks.end(); ++bm) {
                        // save bookmark number, id, pos, fname
                        ofs << bm->get<0>() << ", "
-                               << bm->get<2>() << ", " 
+                               << bm->get<2>() << ", "
                                << bm->get<3>() << ", "
                                << bm->get<1>() << '\n';
                }
@@ -236,7 +236,7 @@ Session::FilePos Session::loadFilePosition(string const & fname) const
        if (entry != lastfilepos.end())
                return entry->second;
        // Not found, return the first paragraph
-       else 
+       else
                return 0;
 }
 
@@ -247,9 +247,9 @@ void Session::clearLastOpenedFiles()
 }
 
 
-void Session::setLastOpenedFiles(vector<string> const & files)
+void Session::addLastOpenedFile(string const & file)
 {
-       lastopened = files;
+       lastopened.push_back(file);
 }