mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 05:17:24 +02:00
Merge pull request #158 from JulianGro/fix_paths
Fix paths for importing images and opening directories
This commit is contained in:
commit
232bbce940
1 changed files with 8 additions and 0 deletions
|
@ -4167,7 +4167,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;
|
||||||
}
|
}
|
||||||
|
@ -9529,7 +9533,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