]> git.lyx.org Git - lyx.git/blobdiff - src/support/FileName.cpp
zipunzip.cpp: Replace makedir etc with versions in support::FileName, fix a bug in...
[lyx.git] / src / support / FileName.cpp
index 780a4610fac618925fe75eb5ac8e79a3565d7084..e847ecc5a2ace72d7073febeb51644fb4e69e23d 100644 (file)
@@ -155,7 +155,6 @@ string FileName::absFilename() const
 void FileName::set(string const & name)
 {
        d->fi.setFile(toqstr(name));
-       BOOST_ASSERT(d->fi.isAbsolute());
 }
 
 
@@ -199,11 +198,6 @@ bool FileName::moveTo(FileName const & name) const
 
 bool FileName::changePermission(unsigned long int mode) const
 {
-       if (!isWritable()) {
-               LYXERR0("File " << *this << " is not writable!");
-               return false;
-       }
-
 #if defined (HAVE_CHMOD) && defined (HAVE_MODE_T)
        if (::chmod(toFilesystemEncoding().c_str(), mode_t(mode)) != 0) {
                LYXERR0("File " << *this << ": cannot change permission to "
@@ -267,13 +261,15 @@ bool FileName::isReadableDirectory() const
 
 string FileName::onlyFileName() const
 {
-       return support::onlyFilename(absFilename());
+       return fromqstr(d->fi.fileName());
 }
 
 
 FileName FileName::onlyPath() const
 {
-       return FileName(support::onlyPath(absFilename()));
+       FileName path;
+       path.d->fi.setFile(d->fi.path());
+       return path;
 }