diff --git a/src/support/FileName.cpp b/src/support/FileName.cpp index 606299ec11..18a910284d 100644 --- a/src/support/FileName.cpp +++ b/src/support/FileName.cpp @@ -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_)); diff --git a/src/support/FileName.h b/src/support/FileName.h index e5059b24e4..77f5c32d87 100644 --- a/src/support/FileName.h +++ b/src/support/FileName.h @@ -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.