]> git.lyx.org Git - lyx.git/blobdiff - src/LyXFunc.cpp
Fix copy&paste bug.
[lyx.git] / src / LyXFunc.cpp
index cb4c476062720dc257d26f8f57c5e376e73a387e..4039cb35ce971b5fc97a40fde0dc70c32a2eb16f 100644 (file)
@@ -124,11 +124,8 @@ using support::FileFilterList;
 using support::FileName;
 using support::fileSearch;
 using support::i18nLibFileSearch;
-using support::isDirWriteable;
-using support::isFileReadable;
-using support::isStrInt;
-using support::makeAbsPath;
 using support::makeDisplayPath;
+using support::makeAbsPath;
 using support::package;
 using support::quoteName;
 using support::rtrim;
@@ -586,7 +583,7 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
                        }
                }
                else if (name == "latexlog")
-                       enable = isFileReadable(FileName(buf->getLogName().second));
+                       enable = FileName(buf->getLogName().second).isFileReadable();
                else if (name == "spellchecker")
 #if defined (USE_ASPELL) || defined (USE_ISPELL) || defined (USE_PSPELL)
                        enable = !buf->isReadonly();
@@ -2067,7 +2064,7 @@ void LyXFunc::menuNew(string const & name, bool fromTemplate)
        if (lyx_view_->buffer()) {
                string const trypath = lyx_view_->buffer()->filePath();
                // If directory is writeable, use this as default.
-               if (isDirWriteable(FileName(trypath)))
+               if (FileName(trypath).isDirWritable())
                        initpath = trypath;
        }
 
@@ -2077,7 +2074,7 @@ void LyXFunc::menuNew(string const & name, bool fromTemplate)
                filename = addName(lyxrc.document_path,
                            "newfile" + convert<string>(++newfile_number) + ".lyx");
                while (theBufferList().exists(filename) ||
-                      fs::is_readable(FileName(filename).toFilesystemEncoding())) {
+                      FileName(filename).isReadable()) {
                        ++newfile_number;
                        filename = addName(lyxrc.document_path,
                                           "newfile" +  convert<string>(newfile_number) +
@@ -2118,7 +2115,7 @@ void LyXFunc::open(string const & fname)
        if (lyx_view_->buffer()) {
                string const trypath = lyx_view_->buffer()->filePath();
                // If directory is writeable, use this as default.
-               if (isDirWriteable(FileName(trypath)))
+               if (FileName(trypath).isDirWritable())
                        initpath = trypath;
        }
 
@@ -2195,7 +2192,7 @@ void LyXFunc::doImport(string const & argument)
                if (lyx_view_->buffer()) {
                        string const trypath = lyx_view_->buffer()->filePath();
                        // If directory is writeable, use this as default.
-                       if (isDirWriteable(FileName(trypath)))
+                       if (FileName(trypath).isDirWritable())
                                initpath = trypath;
                }
 
@@ -2403,9 +2400,8 @@ void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
        case LyXRC::RC_DISPLAY_GRAPHICS:
        case LyXRC::RC_DOCUMENTPATH:
                if (lyxrc_orig.document_path != lyxrc_new.document_path) {
-                       string const encoded = FileName(
-                               lyxrc_new.document_path).toFilesystemEncoding();
-                       if (fs::exists(encoded) && fs::is_directory(encoded))
+                       FileName path(lyxrc_new.document_path);
+                       if (path.exists() && path.isDirectory())
                                support::package().document_dir() = FileName(lyxrc.document_path);
                }
        case LyXRC::RC_ESC_CHARS: