AppFwk : Add isFolderWritable()

This commit is contained in:
Magne Sjaastad 2017-08-25 14:52:35 +02:00
parent e4afb24421
commit 5f790273e9
2 changed files with 14 additions and 0 deletions

View File

@ -251,6 +251,19 @@ QString Utils::fileExtension(const QString & fileName)
return fi.suffix();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool Utils::isFolderWritable(const QString& folderName)
{
// See platform issues here
// http://doc.qt.io/qt-4.8/qfile.html#platform-specific-issues
QFileInfo dir(folderName);
return dir.isWritable();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -66,6 +66,7 @@ public:
static bool fileExists(const QString& fileName);
static QString fileExtension(const QString& fileName);
static bool isFolderWritable(const QString& folderName);
static bool isStringMatch(const QString& filterString, const QString& value);
};