]> git.lyx.org Git - lyx.git/blobdiff - src/Session.cpp
Move editing, shortcuts, keyboard/mouse and completion to a separate category in...
[lyx.git] / src / Session.cpp
index 7fec7336d8a5332b4bc7ad64cfd775a61bcfe128..9291ef1c2213bfcd974a4a992544446915bee8fe 100644 (file)
 #include <config.h>
 
 #include "Session.h"
+
 #include "support/debug.h"
-#include "support/Package.h"
 #include "support/filetools.h"
+#include "support/Package.h"
 
 #include <fstream>
 #include <sstream>
@@ -22,6 +23,7 @@
 #include <iterator>
 
 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);