Showing the changes to interface/src/scripting/WindowScriptingInterface.cpp (1 of 4 files). Show all
Unified · Split
| @@ -224,6 +224,12 @@ QScriptValue WindowScriptingInterface::browseAssets(const QString& title, const · 223 unmodified lines | ||
| 224 | 224 | if (path.isEmpty()) { |
| 225 | 225 | path = getPreviousBrowseAssetLocation(); |
| 226 | 226 | } |
| 227 | + if (path.left(1) != "/") { | |
| 228 | + path = "/" + path; | |
| 229 | + } | |
| 230 | + if (path.right(1) != "/") { | |
| 231 | + path = path + "/"; | |
| 232 | + } | |
| 227 | 233 | QString result = OffscreenUi::getOpenAssetName(nullptr, title, path, nameFilter); |
| 228 | 234 | if (!result.isEmpty()) { |
| 229 | 235 | setPreviousBrowseAssetLocation(QFileInfo(result).absolutePath()); |