handling for leading slashes while loading mappings

This commit is contained in:
Stephen Birarda 2016-03-09 17:36:04 -08:00
parent 7b08ae3747
commit 6f044e1cd3

View file

@ -137,12 +137,13 @@ void AssetMappingModel::refresh() {
existingPaths.removeOne(mapping.first); existingPaths.removeOne(mapping.first);
QString fullPath = ""; QString fullPath = "/";
QStandardItem* lastItem = nullptr; QStandardItem* lastItem = nullptr;
for (int i = 0; i < length; ++i) { // start index at 1 to avoid empty string from leading slash
fullPath += (i == 0 ? "" : "/") + parts[i]; for (int i = 1; i < length; ++i) {
fullPath += (i == 1 ? "" : "/") + parts[i];
auto it = _pathToItemMap.find(fullPath); auto it = _pathToItemMap.find(fullPath);
if (it == _pathToItemMap.end()) { if (it == _pathToItemMap.end()) {