History

Don't allow folder overwrite

Atlante45 committed 10 years ago

Commit 35f5ebb1 parent 2fb478f3 files · +23 −4Browse files

Showing the changes to interface/src/scripting/AssetMappingsScriptingInterface.cpp (1 of 3 files). Show all

Unified · Split

interface/src/scripting/AssetMappingsScriptingInterface.cpp+13−0
@@ -174,6 +174,19 @@ void AssetMappingsScriptingInterface::renameMapping(QString oldPath, QString new · 173 unmodified lines
174 request->start();174 request->start();
175}175}
176 176
177bool AssetMappingModel::isKnownFolder(QString path) const {
178 if (!path.endsWith("/")) {
179 return false;
180 }
181
182 auto existingPaths = _pathToItemMap.keys();
183 for (auto& entry : existingPaths) {
184 if (entry.startsWith(path)) {
185 return true;
186 }
187 }
188 return false;
189}
177 190
178AssetMappingItem::AssetMappingItem(const QString& name, const QString& fullPath, bool isFolder) :191AssetMappingItem::AssetMappingItem(const QString& name, const QString& fullPath, bool isFolder) :
179 name(name),192 name(name),