FilePath: Remove ::toDir() and deprecation hints

Change-Id: Ib561c019e3fd44cd85504ad4286eb3759ce19516
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Marcus Tillmanns
2022-07-28 15:59:52 +02:00
parent 783f0e1205
commit 451d02c88d
14 changed files with 101 additions and 106 deletions

View File

@@ -632,12 +632,15 @@ void ExternalToolConfig::showInfoForItem(const QModelIndex &index)
static FilePath getUserFilePath(const QString &proposalFileName)
{
const QDir resourceDir(ICore::userResourcePath().toDir());
if (!resourceDir.exists(QLatin1String("externaltools")))
resourceDir.mkpath(QLatin1String("externaltools"));
const QFileInfo fi(proposalFileName);
const QString &suffix = QLatin1Char('.') + fi.completeSuffix();
const FilePath newFilePath = ICore::userResourcePath("externaltools") / fi.baseName();
const FilePath resourceDir(ICore::userResourcePath());
const FilePath externalToolsDir = resourceDir / "externalTools";
if (!externalToolsDir.isDir())
externalToolsDir.createDir();
const FilePath proposal = FilePath::fromString(proposalFileName);
const QString suffix = QLatin1Char('.') + proposal.suffix();
const FilePath newFilePath = externalToolsDir / proposal.baseName();
int count = 0;
FilePath tryPath = newFilePath + suffix;
while (tryPath.exists()) {