]> git.lyx.org Git - features.git/commitdiff
create FileName::isDir function
authorAndré Pönitz <poenitz@gmx.net>
Thu, 18 Oct 2007 19:38:24 +0000 (19:38 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Thu, 18 Oct 2007 19:38:24 +0000 (19:38 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21046 a592a061-630c-0410-9148-cb99ea01b6c8

src/support/FileName.cpp
src/support/FileName.h

index 606299ec11273e585cec782ad3e431ec5691372a..18a910284d51480e1f2f06147223545735f32f31 100644 (file)
@@ -87,6 +87,12 @@ bool FileName::exists() const
 }
 
 
+bool FileName::isDir() const
+{
+       return QFileInfo(toqstr(name_)).isDir();
+}
+
+
 bool FileName::isReadOnly() const
 {
        QFileInfo const fi(toqstr(name_));
index e5059b24e4407978ead51761616ccb278ea47d0c..77f5c32d8798a66ed0e4f18ebc48f77563d65e31 100644 (file)
@@ -59,6 +59,8 @@ public:
        std::time_t lastModified() const;
        /// return true when file is readable but not writabel
        bool isReadOnly() const;
+       /// return true when it names a directory
+       bool isDir() const;
 
        /**
         * Get a FileName from \p name in the encoding used by the file system.