forked from qt-creator/qt-creator
Utils: Differentiate between WritableDir and ReadableFile
Brown paperbag. Change-Id: Ice4e3760bbfc5699f7efef49919505657d731867 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -782,14 +782,12 @@ bool FilePath::exists() const
|
|||||||
return !isEmpty() && QFileInfo::exists(m_data);
|
return !isEmpty() && QFileInfo::exists(m_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// \returns a bool indicating whether a path is writable.
|
/// \returns a bool indicating whether a path is writable.
|
||||||
bool FilePath::isWritableDir() const
|
bool FilePath::isWritableDir() const
|
||||||
{
|
{
|
||||||
if (needsDevice()) {
|
if (needsDevice()) {
|
||||||
QTC_ASSERT(s_deviceHooks.isWritableDir, return false);
|
QTC_ASSERT(s_deviceHooks.isWritableDir, return false);
|
||||||
return s_deviceHooks.isReadableFile(*this);
|
return s_deviceHooks.isWritableDir(*this);
|
||||||
}
|
}
|
||||||
const QFileInfo fi{m_data};
|
const QFileInfo fi{m_data};
|
||||||
return exists() && fi.isDir() && fi.isWritable();
|
return exists() && fi.isDir() && fi.isWritable();
|
||||||
|
|||||||
Reference in New Issue
Block a user