forked from qt-creator/qt-creator
FilePath: Remove ::toDir() and deprecation hints
Change-Id: Ib561c019e3fd44cd85504ad4286eb3759ce19516 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user