forked from qt-creator/qt-creator
Utils: Add a FilePath::isDir() convenience function
Change-Id: I1df0ee1b136299ae6e4f2e5bd0bdc24bfeca33dd Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user