mirror of
https://github.com/overte-org/overte.git
synced 2025-04-26 00:16:39 +02:00
expandToLocalDataAbsolutePath now expands to a file:// url rather than a qrc:// url
This commit is contained in:
parent
af42b5e93f
commit
a623ba7499
1 changed files with 19 additions and 1 deletions
|
@ -122,9 +122,27 @@ QUrl PathUtils::resourcesUrl(const QString& relativeUrl) {
|
|||
|
||||
QUrl PathUtils::expandToLocalDataAbsolutePath(const QUrl& fileUrl) {
|
||||
QString path = fileUrl.path();
|
||||
|
||||
if (path.startsWith("/~/")) {
|
||||
return resourcesUrl(path.mid(3));
|
||||
// this results in a qrc:// url...
|
||||
// return resourcesUrl(path.mid(3));
|
||||
|
||||
// find Resources/ directory relative to executable path, but don't convert to qrc:// url
|
||||
#if defined(Q_OS_OSX)
|
||||
char buffer[8192];
|
||||
uint32_t bufferSize = sizeof(buffer);
|
||||
_NSGetExecutablePath(buffer, &bufferSize);
|
||||
QString resourcesDir = QDir::cleanPath(QFileInfo(buffer).dir().absoluteFilePath("../Resources")) + "/";
|
||||
#else
|
||||
QString resourcesDir = projectRootPath() + "/interface/resources/";
|
||||
#endif
|
||||
path.replace(0, 3, resourcesDir);
|
||||
QUrl expandedURL = QUrl::fromLocalFile(path);
|
||||
return expandedURL;
|
||||
}
|
||||
|
||||
QUrl::fromLocalFile(resourcesPath()).toString();
|
||||
|
||||
return fileUrl;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue