]> git.lyx.org Git - lyx.git/blobdiff - src/support/filename.C
Provide do_put methods for inserting all remaining basic type values
[lyx.git] / src / support / filename.C
index 330df317a1dd70904da45f327ab0121742b3ad9b..8b8a4aee57b8b5d0a0185a8c22f3cf56f338f596 100644 (file)
@@ -14,6 +14,9 @@
 #include "support/filetools.h"
 #include "support/lstrings.h"
 #include "support/os.h"
+#include "support/qstring_helpers.h"
+
+#include <QFile>
 
 #include <boost/assert.hpp>
 
@@ -41,7 +44,7 @@ FileName::~FileName()
 FileName::FileName(string const & abs_filename)
        : name_(abs_filename)
 {
-       BOOST_ASSERT(absolutePath(name_));
+       BOOST_ASSERT(empty() || absolutePath(name_));
        BOOST_ASSERT(!contains(name_, '\\'));
 }
 
@@ -62,8 +65,8 @@ void FileName::erase()
 
 string const FileName::toFilesystemEncoding() const
 {
-       // FIXME UNICODE: correct encoding not implemented yet
-       return name_;
+       QByteArray const encoded = QFile::encodeName(toqstr(name_));
+       return string(encoded.begin(), encoded.end());
 }