]> git.lyx.org Git - features.git/commitdiff
Some boost::filesystem fixes.
authorAngus Leeming <leeming@lyx.org>
Tue, 1 Feb 2005 16:41:24 +0000 (16:41 +0000)
committerAngus Leeming <leeming@lyx.org>
Tue, 1 Feb 2005 16:41:24 +0000 (16:41 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9564 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/frontends/xforms/ChangeLog
src/frontends/xforms/FormFiledialog.C
src/lyx_main.C
src/support/ChangeLog
src/support/filetools.C
src/support/fs_extras.C

index b18132a27edca722efda58f83fb5517c223b552c..b1115282383227b7a2ff513152140b806c62a7a3 100644 (file)
@@ -1,3 +1,8 @@
+2005-02-01  Angus Leeming  <leeming@lyx.org>
+
+       * lyx_main.C (init, queryUserLyXDir): use fs::exists() before
+       calling fs::is_directory().
+
 2005-01-31  Angus Leeming  <leeming@lyx.org>
 
        * lyx_main.C (priv_exec): specify explicitly the relative location
index 92567e5023d947d2a01e415499f7dd1e5d51d9bb..ab900e5fd347529f18417091f6f019d70b5f8aa6 100644 (file)
@@ -1,3 +1,8 @@
+2005-02-01  Angus Leeming  <leeming@lyx.org>
+
+       * FormFiledialog.C (Reread): use fs::exists() before
+       calling fs::is_directory().
+
 2005-01-31  Lars Gullik Bjonnes  <larsbj@gullik.net>
 
        * xforms_helpers.C: rewrite to use boost.filesystem
index dc796c56bfa8108db28197529d286802d4d5713a..5bbc9fc37c553bbcf71d5ea44a89a8caeed3c680 100644 (file)
@@ -184,7 +184,7 @@ void FileDialog::Private::Reread()
                if (!mask_.empty() && mask_[0] != '.' && fname[0] == '.')
                        continue;
 
-               bool const isDir = fs::is_directory(*beg);
+               bool const isDir = fs::exists(*beg) && fs::is_directory(*beg);
 
                // filters files according to pattern and type
                        typedef vector<string>::const_iterator viterator;
index fea5a59702d04b453e6817e0235d23293c655edf..e356ffa7aafdf826e68c86ab8aabac29f520008a 100644 (file)
@@ -484,7 +484,8 @@ void LyX::init(bool gui)
        if (reconfigure)
                reconfigureUserLyXDir();
 
-       if (fs::is_directory(lyxrc.document_path))
+       if (fs::exists(lyxrc.document_path) &&
+           fs::is_directory(lyxrc.document_path))
                package().document_dir() = lyxrc.document_path;
 
        package().temp_dir() = createLyXTmpDir(lyxrc.tempdir_path);
@@ -612,7 +613,8 @@ bool LyX::queryUserLyXDir(bool explicit_userdir)
        bool reconfigure = false;
 
        // Does user directory exist?
-       if (fs::is_directory(package().user_support())) {
+       if (fs::exists(package().user_support()) &&
+           fs::is_directory(package().user_support())) {
                first_start = false;
                string const configure_script =
                        AddName(package().system_support(), "configure");
index 1649f11cbe28767b4da4945fab79ecdc5b512ef3..fd7759a8f9d3484fc92e00d8d508ec92d41fe821 100644 (file)
@@ -1,3 +1,7 @@
+2005-02-01  Angus Leeming  <leeming@lyx.org>
+
+       * fs_extras.C: #include <windows.h>
+
 2005-01-31  Angus Leeming  <leeming@lyx.org>
 
        * package.[Ch] (init_package, c-tor): define and use an enum to
index bd28c0514425827a0ccc1d0f492fa6ec153553c7..45cce5bb3ac8ac692aa61f54e9c62cff4834705c 100644 (file)
@@ -106,7 +106,6 @@ string const MakeLatexName(string const & file)
 }
 
 
-// Substitutes spaces with underscores in filename (and path)
 string const QuoteName(string const & name)
 {
        return (os::shell() == os::UNIX) ?
@@ -307,8 +306,8 @@ string const LibScriptSearch(string const & command_in)
        string::size_type const pos1 = command.find(token_scriptpath);
        if (pos1 == string::npos)
                return command;
-       // Find the end of the "$$s/some_script" word within command.
-       // Assumes that the script name does not contain spaces.
+       // Find the end of the "$$s/some_subdir/some_script" word within
+       // command. Assumes that the script name does not contain spaces.
        string::size_type const start_script = pos1 + 4;
        string::size_type const pos2 = command.find(' ', start_script);
        string::size_type const size_script = pos2 == string::npos?
index 5872134bb360a6197fd5b84d766af964f0d4894e..d7bd1b3ec2bae6e4d1b55498c10486d6f2b5e82a 100644 (file)
 #   endif
 # endif
 
+#if defined (BOOST_WINDOWS)
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+#endif
+
 namespace fs = boost::filesystem;
 
 namespace boost {