From ced60a47680eb361fa6023853733b71d1ae711d8 Mon Sep 17 00:00:00 2001 From: Mat Sutcliffe Date: Fri, 21 Aug 2020 18:27:04 +0100 Subject: [PATCH] Issue #79 Path elements below the root are no longer salient in xpmp2 --- .../simulation/xplane/aircraftmodelloaderxplane.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/blackmisc/simulation/xplane/aircraftmodelloaderxplane.cpp b/src/blackmisc/simulation/xplane/aircraftmodelloaderxplane.cpp index a64058bef..7ae47954b 100644 --- a/src/blackmisc/simulation/xplane/aircraftmodelloaderxplane.cpp +++ b/src/blackmisc/simulation/xplane/aircraftmodelloaderxplane.cpp @@ -461,15 +461,10 @@ namespace BlackMisc return false; } - QStringList dirNames; - dirNames.append(relativePath.split('/', Qt::SkipEmptyParts)); - // Replace the first one being the package name with the package root dir + // just the name of the dir containing xsbaircraft.txt QString packageRootDir = package.path.mid(package.path.lastIndexOf('/') + 1); - dirNames.replace(0, packageRootDir); - // Remove the last one being the obj itself - dirNames.removeLast(); + package.planes.back().dirNames = QStringList { packageRootDir }; - package.planes.back().dirNames = dirNames; package.planes.back().filePath = fullPath; return true; }