Skip to content

Commit 95964d8

Browse files
Move VirtualPaths::normalizedPath into the class as a private static
Robosturm review feedback on PR #1959: relocate the helper out of the anonymous namespace so it matches the existing private-static convention used by processName, createSearchPathInternal, and findAllInternal.
1 parent f126f64 commit 95964d8

2 files changed

Lines changed: 9 additions & 11 deletions

File tree

coreengine/virtualpaths.cpp

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,18 @@
99

1010
QList<VirtualPaths::SearchPathInfo> VirtualPaths::m_searchPath;
1111

12-
namespace
12+
QString VirtualPaths::normalizedPath(const QFileInfo& info)
1313
{
14-
QString normalizedPath(const QFileInfo& info)
14+
QString path = info.canonicalFilePath();
15+
if (path.isEmpty())
1516
{
16-
QString path = info.canonicalFilePath();
17-
if (path.isEmpty())
18-
{
19-
path = info.absoluteFilePath();
20-
}
21-
path = QDir::cleanPath(path);
17+
path = info.absoluteFilePath();
18+
}
19+
path = QDir::cleanPath(path);
2220
#ifdef _WIN32
23-
path = path.toLower();
21+
path = path.toLower();
2422
#endif
25-
return path;
26-
}
23+
return path;
2724
}
2825

2926
void VirtualPaths::setSearchPath(const QString& userPath, const QStringList& mods)

coreengine/virtualpaths.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ class VirtualPaths final
7070
static QStringList createSearchPathInternal(const QString& name, bool checkMods = true, bool firstPriority = false);
7171
static QStringList findAllInternal(const QString& name, bool checkMods = true, bool firstPriority = false);
7272
static VirtualPaths::ProcessedName processName(const QString& pName);
73+
static QString normalizedPath(const QFileInfo& info);
7374

7475
private:
7576
static QList<SearchPathInfo> m_searchPath;

0 commit comments

Comments
 (0)