diff options
author | Jarek Kobus <jaroslaw.kobus@qt.io> | 2023-08-02 08:09:26 +0200 |
---|---|---|
committer | Jarek Kobus <jaroslaw.kobus@qt.io> | 2023-08-02 08:19:23 +0000 |
commit | 8dd46d03998e41d86890bcb7daaa20c6425a89b4 (patch) | |
tree | 398679679795357c5095e3cf62012f6918c027af /src/libs | |
parent | 82712e12f857b9c1d69d29e7582533c7cb75af6e (diff) |
Various Plugins: Simplify return FilePath statements
Change-Id: Ia9efb86f722caca1492b577d51442f1f23b804b4
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/libs')
-rw-r--r-- | src/libs/languageserverprotocol/lsptypes.cpp | 2 | ||||
-rw-r--r-- | src/libs/qmljs/qmljsmodelmanagerinterface.cpp | 2 | ||||
-rw-r--r-- | src/libs/qmljs/qmljsplugindumper.cpp | 4 | ||||
-rw-r--r-- | src/libs/utils/fileinprojectfinder.cpp | 2 | ||||
-rw-r--r-- | src/libs/utils/filepath.cpp | 4 |
5 files changed, 7 insertions, 7 deletions
diff --git a/src/libs/languageserverprotocol/lsptypes.cpp b/src/libs/languageserverprotocol/lsptypes.cpp index 7f781f8e6df..d8f02e256fc 100644 --- a/src/libs/languageserverprotocol/lsptypes.cpp +++ b/src/libs/languageserverprotocol/lsptypes.cpp @@ -384,7 +384,7 @@ Utils::FilePath DocumentUri::toFilePath(const PathMapper &mapToHostPath) const QTC_ASSERT(mapToHostPath, return serverPath); return mapToHostPath(serverPath); } - return Utils::FilePath(); + return {}; } DocumentUri DocumentUri::fromProtocol(const QString &uri) diff --git a/src/libs/qmljs/qmljsmodelmanagerinterface.cpp b/src/libs/qmljs/qmljsmodelmanagerinterface.cpp index 26238807e0e..8cdcb1e886a 100644 --- a/src/libs/qmljs/qmljsmodelmanagerinterface.cpp +++ b/src/libs/qmljs/qmljsmodelmanagerinterface.cpp @@ -901,7 +901,7 @@ static bool findNewQmlLibraryInPath(const Utils::FilePath &path, static FilePath modulePath(const ImportInfo &import, const FilePaths &paths) { if (!import.version().isValid()) - return FilePath(); + return {}; const FilePaths modPaths = modulePaths(import.name(), import.version().toString(), paths); return modPaths.value(0); // first is best match diff --git a/src/libs/qmljs/qmljsplugindumper.cpp b/src/libs/qmljs/qmljsplugindumper.cpp index 761df90ddcd..04913de3ddc 100644 --- a/src/libs/qmljs/qmljsplugindumper.cpp +++ b/src/libs/qmljs/qmljsplugindumper.cpp @@ -387,14 +387,14 @@ Utils::FilePath PluginDumper::buildQmltypesPath(const QString &name) const m_modelManager->importPathsNames()); if (paths.isEmpty()) - return Utils::FilePath(); + return {}; for (const Utils::FilePath &path : paths) { auto qmltypes = path.dirEntries(FileFilter(QStringList{"*.qmltypes"}, QDir::Files)); if (!qmltypes.isEmpty()) return qmltypes.first(); } - return Utils::FilePath(); + return {}; } /*! diff --git a/src/libs/utils/fileinprojectfinder.cpp b/src/libs/utils/fileinprojectfinder.cpp index 957f694179b..29e0f6d7c2c 100644 --- a/src/libs/utils/fileinprojectfinder.cpp +++ b/src/libs/utils/fileinprojectfinder.cpp @@ -477,7 +477,7 @@ FilePath chooseFileFromList(const FilePaths &candidates) filesMenu.addAction(candidate.toUserOutput()); if (const QAction * const action = filesMenu.exec(QCursor::pos())) return FilePath::fromUserInput(action->text()); - return FilePath(); + return {}; } } // namespace Utils diff --git a/src/libs/utils/filepath.cpp b/src/libs/utils/filepath.cpp index e7697f1bc8f..e3ae97267dd 100644 --- a/src/libs/utils/filepath.cpp +++ b/src/libs/utils/filepath.cpp @@ -985,12 +985,12 @@ FilePath FilePath::parentDir() const { const QString basePath = path(); if (basePath.isEmpty()) - return FilePath(); + return {}; const QString path = basePath + QLatin1String("/.."); const QString parent = doCleanPath(path); if (parent == path) - return FilePath(); + return {}; return withNewPath(parent); } |