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

@@ -513,7 +513,7 @@ void FolderNavigationWidget::addNewItem()
if (!current.isValid())
return;
const auto filePath = Utils::FilePath::fromString(m_fileSystemModel->filePath(current));
const Utils::FilePath path = filePath.toFileInfo().isDir() ? filePath : filePath.parentDir();
const Utils::FilePath path = filePath.isDir() ? filePath : filePath.parentDir();
Core::ICore::showNewItemDialog(ProjectExplorerPlugin::tr("New File", "Title of dialog"),
Utils::filtered(Core::IWizardFactory::allWizardFactories(),
Utils::equal(&Core::IWizardFactory::kind,