mirror of
https://github.com/lubosz/overte.git
synced 2025-04-08 14:42:19 +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) {
|
||||
qCDebug(interfaceapp) << "An image file has been dropped in";
|
||||
QString filepath(urlString);
|
||||
#if defined(Q_OS_WIN)
|
||||
filepath.remove("file:///");
|
||||
#else
|
||||
filepath.remove("file://");
|
||||
#endif
|
||||
addAssetToWorld(filepath, "", false, false);
|
||||
return true;
|
||||
}
|
||||
|
@ -9529,7 +9533,11 @@ void Application::openDirectory(const QString& path) {
|
|||
}
|
||||
|
||||
QString dirPath = path;
|
||||
#if defined(Q_OS_WIN)
|
||||
const QString FILE_SCHEME = "file:///";
|
||||
#else
|
||||
const QString FILE_SCHEME = "file://";
|
||||
#endif
|
||||
if (dirPath.startsWith(FILE_SCHEME)) {
|
||||
dirPath.remove(0, FILE_SCHEME.length());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue