fix expandToLocalDataAbsolutePath

This commit is contained in:
Seth Alves 2018-02-23 14:27:28 -08:00
parent 1e49dc5ca2
commit 3be1988260
4 changed files with 6 additions and 6 deletions

View file

@ -302,7 +302,7 @@ bool AddressManager::handleUrl(const QUrl& lookupUrl, LookupTrigger trigger) {
} else if (lookupUrl.scheme() == "http" || lookupUrl.scheme() == "https" || lookupUrl.scheme() == "file") {
_previousLookup.clear();
QUrl domainUrl = PathUtils::expandToAppAbsolutePath(lookupUrl);
QUrl domainUrl = PathUtils::expandToLocalDataAbsolutePath(lookupUrl);
emit setServersEnabled(false);
setDomainInfo(domainUrl, QString(), 0, trigger);
DependencyManager::get<NodeList>()->getDomainHandler().setIsConnected(true);

View file

@ -29,7 +29,7 @@ void FileResourceRequest::doSend() {
if (_url.scheme() == URL_SCHEME_QRC) {
filename = ":/" + _url.path();
} else {
filename = PathUtils::expandToAppAbsolutePath(_url).toLocalFile();
filename = PathUtils::expandToLocalDataAbsolutePath(_url).toLocalFile();
// sometimes on windows, we see the toLocalFile() return null,
// in this case we will attempt to simply use the url as a string
if (filename.isEmpty()) {

View file

@ -120,13 +120,13 @@ QUrl PathUtils::resourcesUrl(const QString& relativeUrl) {
return QUrl(resourcesUrl() + relativeUrl);
}
QUrl PathUtils::expandToAppAbsolutePath(const QUrl& fileUrl) {
QUrl PathUtils::expandToLocalDataAbsolutePath(const QUrl& fileUrl) {
QUrl url = fileUrl;
QString path = fileUrl.path();
if (path.startsWith("/~/")) {
path.replace(0, 3, getAppLocalDataPath());
url = QUrl(path);
qDebug() << "QQQQ expandToAppAbsolutePath: " << fileUrl << url;
url = QUrl::fromLocalFile(path);
qDebug() << "QQQQ expandToLocalDataAbsolutePath: " << fileUrl << url;
}
return url;
}

View file

@ -37,7 +37,7 @@ public:
static QUrl resourcesUrl(const QString& relative);
static const QString& resourcesPath();
static const QString& qmlBaseUrl();
static QUrl expandToAppAbsolutePath(const QUrl& fileUrl);
static QUrl expandToLocalDataAbsolutePath(const QUrl& fileUrl);
static QUrl qmlUrl(const QString& relative);
#ifdef DEV_BUILD
static const QString& projectRootPath();