mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-08-08 05:26:57 +02:00
Fix paths for importing images and opening directories
Co-authored-by: Steve Hocktail <MVboy39@gmail.com>
This commit is contained in:
parent
b10123400f
commit
8ebc285fea
1 changed files with 8 additions and 0 deletions
|
@ -4168,7 +4168,11 @@ void Application::loadErrorDomain(QUrl domainURL) {
|
||||||
bool Application::importImage(const QString& urlString) {
|
bool Application::importImage(const QString& urlString) {
|
||||||
qCDebug(interfaceapp) << "An image file has been dropped in";
|
qCDebug(interfaceapp) << "An image file has been dropped in";
|
||||||
QString filepath(urlString);
|
QString filepath(urlString);
|
||||||
|
#if defined(Q_OS_WIN)
|
||||||
filepath.remove("file:///");
|
filepath.remove("file:///");
|
||||||
|
#else
|
||||||
|
filepath.remove("file://");
|
||||||
|
#endif
|
||||||
addAssetToWorld(filepath, "", false, false);
|
addAssetToWorld(filepath, "", false, false);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -9530,7 +9534,11 @@ void Application::openDirectory(const QString& path) {
|
||||||
}
|
}
|
||||||
|
|
||||||
QString dirPath = path;
|
QString dirPath = path;
|
||||||
|
#if defined(Q_OS_WIN)
|
||||||
const QString FILE_SCHEME = "file:///";
|
const QString FILE_SCHEME = "file:///";
|
||||||
|
#else
|
||||||
|
const QString FILE_SCHEME = "file://";
|
||||||
|
#endif
|
||||||
if (dirPath.startsWith(FILE_SCHEME)) {
|
if (dirPath.startsWith(FILE_SCHEME)) {
|
||||||
dirPath.remove(0, FILE_SCHEME.length());
|
dirPath.remove(0, FILE_SCHEME.length());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue