Utils: Add a FilePath::isDir() convenience function

Change-Id: I1df0ee1b136299ae6e4f2e5bd0bdc24bfeca33dd
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
hjk
2019-05-28 16:55:43 +02:00
parent bf6fd00163
commit ddf0dd8734
14 changed files with 21 additions and 15 deletions

View File

@@ -369,7 +369,7 @@ QString GitEditorWidget::fileNameForLine(int line) const
QString GitEditorWidget::sourceWorkingDirectory() const
{
Utils::FilePath path = Utils::FilePath::fromString(source());
if (!path.isEmpty() && !path.toFileInfo().isDir())
if (!path.isEmpty() && !path.isDir())
path = path.parentDir();
while (!path.isEmpty() && !path.exists())
path = path.parentDir();

View File

@@ -80,7 +80,7 @@ bool GitVersionControl::isVcsFileOrDirectory(const Utils::FilePath &fileName) co
{
if (fileName.fileName().compare(".git", Utils::HostOsInfo::fileNameCaseSensitivity()))
return false;
if (fileName.toFileInfo().isDir())
if (fileName.isDir())
return true;
QFile file(fileName.toString());
if (!file.open(QFile::ReadOnly))