]> git.lyx.org Git - lyx.git/blobdiff - src/Session.cpp
* src/LyXRC.{cpp,h}:
[lyx.git] / src / Session.cpp
index 53e3c663d43a53bdec58d5e572745763506df4fb..dc6d0a1c0bc27c16a2c180b40e8b6f0c6f6f89e3 100644 (file)
@@ -16,8 +16,6 @@
 #include "support/Package.h"
 #include "support/filetools.h"
 
-#include <boost/filesystem/operations.hpp>
-
 #include <fstream>
 #include <sstream>
 #include <algorithm>
@@ -28,8 +26,6 @@ using lyx::support::addName;
 using lyx::support::FileName;
 using lyx::support::package;
 
-namespace fs = boost::filesystem;
-
 using std::vector;
 using std::getline;
 using std::string;
@@ -75,14 +71,13 @@ void LastFilesSection::read(istream & is)
                getline(is, tmp);
                if (tmp == "" || tmp[0] == '#' || tmp[0] == ' ' || !absolutePath(tmp))
                        continue;
-               
+
                // read lastfiles
                FileName const file(tmp);
-               if (fs::exists(file.toFilesystemEncoding()) &&
-                   !fs::is_directory(file.toFilesystemEncoding()) &&
-                   lastfiles.size() < num_lastfiles)
+               if (file.exists() && !file.isDirectory()
+                   && lastfiles.size() < num_lastfiles)
                        lastfiles.push_back(file);
-               else 
+               else
                        LYXERR(Debug::INIT) << "LyX: Warning: Ignore last file: " << tmp << endl;
        } while (is.good());
 }
@@ -133,8 +128,7 @@ void LastOpenedSection::read(istream & is)
                        continue;
 
                FileName const file(tmp);
-               if (fs::exists(file.toFilesystemEncoding()) &&
-                   !fs::is_directory(file.toFilesystemEncoding()))
+               if (file.exists() && !file.isDirectory())
                        lastopened.push_back(file);
                else
                        LYXERR(Debug::INIT) << "LyX: Warning: Ignore last opened file: " << tmp << endl;
@@ -188,9 +182,8 @@ void LastFilePosSection::read(istream & is)
                        if (!absolutePath(fname))
                                continue;
                        FileName const file(fname);
-                       if (fs::exists(file.toFilesystemEncoding()) &&
-                           !fs::is_directory(file.toFilesystemEncoding()) &&
-                           lastfilepos.size() < num_lastfilepos)
+                       if (file.exists() && !file.isDirectory()
+                           && lastfilepos.size() < num_lastfilepos)
                                lastfilepos[file] = boost::tie(pit, pos);
                        else
                                LYXERR(Debug::INIT) << "LyX: Warning: Ignore pos of last file: " << fname << endl;
@@ -269,9 +262,7 @@ void BookmarksSection::read(istream & is)
                                continue;
                        FileName const file(fname);
                        // only load valid bookmarks
-                       if (fs::exists(file.toFilesystemEncoding()) &&
-                           !fs::is_directory(file.toFilesystemEncoding()) &&
-                           idx <= max_bookmarks)
+                       if (file.exists() && !file.isDirectory() && idx <= max_bookmarks)
                                bookmarks[idx] = Bookmark(file, pit, pos, 0, 0);
                        else
                                LYXERR(Debug::INIT) << "LyX: Warning: Ignore bookmark of file: " << fname << endl;
@@ -344,7 +335,7 @@ void ToolbarSection::read(istream & is)
                                value >> posx;
                                value >> posy;
                                toolbars.push_back(boost::make_tuple(key, ToolbarInfo(state, location, posx, posy)));
-                       } else 
+                       } else
                                LYXERR(Debug::INIT) << "LyX: Warning: Ignore toolbar info: " << tmp << endl;
                } catch (...) {
                        LYXERR(Debug::INIT) << "LyX: Warning: unknown Toolbar info: " << tmp << endl;