]> git.lyx.org Git - lyx.git/blobdiff - src/EmbeddedFiles.cpp
* support/FileName:
[lyx.git] / src / EmbeddedFiles.cpp
index 446d4d59c4d53303d4f157ca3d2b1a847aeec2c9..2d2aef8c37b842a1c93d4f2340528fc9191529d2 100644 (file)
@@ -25,8 +25,6 @@
 
 #include "frontends/alert.h"
 
-#include <boost/filesystem/operations.hpp>
-
 #include "support/filetools.h"
 #include "support/convert.h"
 #include "support/lyxlib.h"
@@ -52,7 +50,6 @@ using std::istringstream;
 
 namespace lyx {
 
-namespace fs = boost::filesystem;
 namespace Alert = frontend::Alert;
 
 using support::FileName;
@@ -156,16 +153,16 @@ bool EmbeddedFile::extract(Buffer const * buf) const
        // copy file
 
        // need to make directory?
-       string path = support::onlyPath(ext_file);
-       if (!fs::is_directory(path))
-               makedir(const_cast<char*>(path.c_str()), 0755);
-       if (emb.copyTo(ext, false))
+       FileName path = ext.onlyPath();
+       if (!path.isDirectory())
+               makedir(const_cast<char*>(path.absFilename().c_str()), 0755);
+       if (emb.copyTo(ext))
                return true;
        Alert::error(_("Copy file failure"),
                 bformat(_("Cannot copy file %1$s to %2$s.\n"
                                 "Please check whether the directory exists and is writeable."),
                                from_utf8(emb_file), from_utf8(ext_file)));
-       //LYXERR(Debug::DEBUG) << "Fs error: " << fe.what() << endl;
+       //LYXERR(Debug::DEBUG, "Fs error: " << fe.what());
        return false;
 }
 
@@ -198,16 +195,16 @@ bool EmbeddedFile::updateFromExternalFile(Buffer const * buf) const
        }
        // copy file
        // need to make directory?
-       string path = support::onlyPath(emb_file);
-       if (!fs::is_directory(path))
-               makedir(const_cast<char*>(path.c_str()), 0755);
-       if (ext.copyTo(emb, false))
+       FileName path = emb.onlyPath();
+       if (!path.isDirectory())
+               makedir(const_cast<char*>(path.absFilename().c_str()), 0755);
+       if (ext.copyTo(emb))
                return true;
        Alert::error(_("Copy file failure"),
                 bformat(_("Cannot copy file %1$s to %2$s.\n"
                           "Please check whether the directory exists and is writeable."),
                                from_utf8(ext_file), from_utf8(emb_file)));
-       //LYXERR(Debug::DEBUG) << "Fs error: " << fe.what() << endl;
+       //LYXERR(Debug::DEBUG, "Fs error: " << fe.what());
        return false;
 }
 
@@ -304,12 +301,12 @@ bool EmbeddedFiles::writeFile(DocFileName const & filename)
 
        ::zipFiles(zipfile.toFilesystemEncoding(), filenames);
        // copy file back
-       if (!zipfile.copyTo(filename, false)) {
+       if (!zipfile.copyTo(filename)) {
                Alert::error(_("Save failure"),
                                 bformat(_("Cannot create file %1$s.\n"
                                           "Please check whether the directory exists and is writeable."),
                                         from_utf8(filename.absFilename())));
-               //LYXERR(Debug::DEBUG) << "Fs error: " << fe.what() << endl;
+               //LYXERR(Debug::DEBUG, "Fs error: " << fe.what());
        }
        return true;
 }