mirror of
https://github.com/lubosz/overte.git
synced 2025-04-19 12:24:01 +02:00
Merge pull request #23 from druiz17/serverless-domains
use resource path
This commit is contained in:
commit
d7b4eda5cd
1 changed files with 2 additions and 21 deletions
|
@ -116,19 +116,6 @@ const QString& PathUtils::resourcesUrl() {
|
|||
return staticResourcePath;
|
||||
}
|
||||
|
||||
QString applicationAbsolutePath() {
|
||||
QString path;
|
||||
#if defined(Q_OS_OSX)
|
||||
path = QCoreApplication::applicationDirPath() + "/../";
|
||||
#elif defined(Q_OS_ANDROID)
|
||||
path = QStandardPaths::writableLocation(QStandardPaths::CacheLocation);
|
||||
#else
|
||||
path = QCoreApplication::applicationDirPath() + "/";
|
||||
#endif
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
QUrl PathUtils::resourcesUrl(const QString& relativeUrl) {
|
||||
return QUrl(resourcesUrl() + relativeUrl);
|
||||
}
|
||||
|
@ -137,14 +124,8 @@ QUrl PathUtils::expandToAppAbsolutePath(const QUrl& fileUrl) {
|
|||
QUrl url = fileUrl;
|
||||
QString path = fileUrl.path();
|
||||
if (path.startsWith("/~/")) {
|
||||
QString absolutePath = applicationAbsolutePath();
|
||||
path.replace(0, 3, absolutePath);
|
||||
#if defined(Q_OS_OSX)
|
||||
url = QUrl("file://" + path);
|
||||
#else
|
||||
url = QUrl("file:///" + path);
|
||||
#endif
|
||||
qDebug() << "QQQQ expandToAppAbsolutePath " << fileUrl << url;
|
||||
path.replace(0, 3, resourcesUrl());
|
||||
url = QUrl(path);
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue