]> git.lyx.org Git - lyx.git/blobdiff - src/support/FileName.cpp
rename assert.h to lassert.h
[lyx.git] / src / support / FileName.cpp
index e847ecc5a2ace72d7073febeb51644fb4e69e23d..0a495dbfd4ec3752133b38b656074ec2dcdb1090 100644 (file)
@@ -28,7 +28,7 @@
 #include <QList>
 #include <QTime>
 
-#include <boost/assert.hpp>
+#include "support/lassert.h"
 #include <boost/scoped_array.hpp>
 
 #include <map>
@@ -265,6 +265,12 @@ string FileName::onlyFileName() const
 }
 
 
+string FileName::onlyFileNameWithoutExt() const
+{
+       return fromqstr(d->fi.baseName());
+}
+
+
 FileName FileName::onlyPath() const
 {
        FileName path;
@@ -523,14 +529,14 @@ static int mymkdir(char const * pathname, unsigned long int mode)
 
 bool FileName::createDirectory(int permission) const
 {
-       BOOST_ASSERT(!empty());
+       LASSERT(!empty(), /**/);
        return mymkdir(toFilesystemEncoding().c_str(), permission) == 0;
 }
 
 
 bool FileName::createPath() const
 {
-       BOOST_ASSERT(!empty());
+       LASSERT(!empty(), /**/);
        if (isDirectory())
                return true;
 
@@ -854,7 +860,9 @@ DocFileName::DocFileName(FileName const & abs_filename, bool save_abs)
 void DocFileName::set(string const & name, string const & buffer_path)
 {
        FileName::set(name);
-       if (!isAbsolute())
+       bool const nameIsAbsolute = isAbsolute();
+       save_abs_path_ = nameIsAbsolute;
+       if (!nameIsAbsolute)
                FileName::set(makeAbsPath(name, buffer_path).absFilename());
        zipped_valid_ = false;
 }