mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 07:15:35 +08:00
Ref T348, util function to correct FSX/P3D model path
Related: Ref T317 Ref T247 Ref T335
This commit is contained in:
@@ -129,6 +129,14 @@ namespace BlackMisc
|
||||
return path.left(path.lastIndexOf('/'));
|
||||
}
|
||||
|
||||
QString CFileUtils::lastPathSegment(const QString &path)
|
||||
{
|
||||
if (path.isEmpty()) { return QStringLiteral(""); }
|
||||
if (path.endsWith('/')) { return CFileUtils::lastPathSegment(path.left(path.length() - 1)); }
|
||||
if (!path.contains('/')) { return path; }
|
||||
return path.mid(path.lastIndexOf('/') + 1);
|
||||
}
|
||||
|
||||
QString CFileUtils::appendFilePaths(const QString &path1, const QString &path2, const QString &path3)
|
||||
{
|
||||
return CFileUtils::appendFilePaths(CFileUtils::appendFilePaths(path1, path2), path3);
|
||||
|
||||
Reference in New Issue
Block a user