History

Fix paths for importing images and opening directories

Julian Groß committed 4 years ago

Commit 8ebc2851 parent b1012341 file · +8 −0Browse files

Showing the changes to interface/src/Application.cpp (1 of 1 file). Show all

Unified · Split

interface/src/Application.cpp+8−0
@@ -4168,7 +4168,11 @@ void Application::loadErrorDomain(QUrl domainURL) { · 4167 unmodified lines
41684168 bool Application::importImage(const QString& urlString) {
41694169 qCDebug(interfaceapp) << "An image file has been dropped in";
41704170 QString filepath(urlString);
4171+#if defined(Q_OS_WIN)
41714172 filepath.remove("file:///");
4173+#else
4174+ filepath.remove("file://");
4175+#endif
41724176 addAssetToWorld(filepath, "", false, false);
41734177 return true;
41744178 }
@@ -9530,7 +9534,11 @@ void Application::openDirectory(const QString& path) { · 5355 unmodified lines
95309534 }
95319535
95329536 QString dirPath = path;
9537+#if defined(Q_OS_WIN)
95339538 const QString FILE_SCHEME = "file:///";
9539+#else
9540+ const QString FILE_SCHEME = "file://";
9541+#endif
95349542 if (dirPath.startsWith(FILE_SCHEME)) {
95359543 dirPath.remove(0, FILE_SCHEME.length());
95369544 }