X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FSession.cpp;h=9291ef1c2213bfcd974a4a992544446915bee8fe;hb=e01e14872d60935908ad42bc164bff1342277b22;hp=7fec7336d8a5332b4bc7ad64cfd775a61bcfe128;hpb=9abb7db46800e554f57e865a3e768602ffd9d6f1;p=lyx.git diff --git a/src/Session.cpp b/src/Session.cpp index 7fec7336d8..9291ef1c22 100644 --- a/src/Session.cpp +++ b/src/Session.cpp @@ -12,9 +12,10 @@ #include #include "Session.h" + #include "support/debug.h" -#include "support/Package.h" #include "support/filetools.h" +#include "support/Package.h" #include #include @@ -22,6 +23,7 @@ #include using namespace std; +using namespace lyx::support; namespace { @@ -37,10 +39,6 @@ string const sec_toolbars = "[toolbars]"; namespace lyx { -using support::absolutePath; -using support::addName; -using support::FileName; -using support::package; LastFilesSection::LastFilesSection(unsigned int num) : default_num_last_files(4), @@ -58,11 +56,11 @@ void LastFilesSection::read(istream & is) if (c == '[') break; getline(is, tmp); - if (tmp == "" || tmp[0] == '#' || tmp[0] == ' ' || !absolutePath(tmp)) + FileName const file(tmp); + if (tmp == "" || tmp[0] == '#' || tmp[0] == ' ' || !file.isAbsolute()) continue; // read lastfiles - FileName const file(tmp); if (file.exists() && !file.isDirectory() && lastfiles.size() < num_lastfiles) lastfiles.push_back(file); @@ -112,10 +110,10 @@ void LastOpenedSection::read(istream & is) if (c == '[') break; getline(is, tmp); - if (tmp == "" || tmp[0] == '#' || tmp[0] == ' ' || !absolutePath(tmp)) + FileName const file(tmp); + if (tmp == "" || tmp[0] == '#' || tmp[0] == ' ' || !file.isAbsolute()) continue; - FileName const file(tmp); if (file.exists() && !file.isDirectory()) lastopened.push_back(file); else @@ -166,9 +164,9 @@ void LastFilePosSection::read(istream & is) itmp >> filepos.pos; itmp.ignore(2); // ignore ", " getline(itmp, fname); - if (!absolutePath(fname)) - continue; FileName const file(fname); + if (!file.isAbsolute()) + continue; if (file.exists() && !file.isDirectory() && lastfilepos.size() < num_lastfilepos) lastfilepos[file] = filepos; @@ -243,9 +241,9 @@ void BookmarksSection::read(istream & is) itmp >> pos; itmp.ignore(2); // ignore ", " getline(itmp, fname); - if (!absolutePath(fname)) - continue; FileName const file(fname); + if (!file.isAbsolute()) + continue; // only load valid bookmarks if (file.exists() && !file.isDirectory() && idx <= max_bookmarks) bookmarks[idx] = Bookmark(file, pit, pos, 0, 0);