Merge branch 'serverless-domains' of github.com:sethalves/hifi into serverless-domains

This commit is contained in:
Dante Ruiz 2018-02-23 14:28:04 -08:00
commit 2d9b4c496c
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") { } else if (lookupUrl.scheme() == "http" || lookupUrl.scheme() == "https" || lookupUrl.scheme() == "file") {
_previousLookup.clear(); _previousLookup.clear();
QUrl domainUrl = PathUtils::expandToAppAbsolutePath(lookupUrl); QUrl domainUrl = PathUtils::expandToLocalDataAbsolutePath(lookupUrl);
emit setServersEnabled(false); emit setServersEnabled(false);
setDomainInfo(domainUrl, QString(), 0, trigger); setDomainInfo(domainUrl, QString(), 0, trigger);
DependencyManager::get<NodeList>()->getDomainHandler().setIsConnected(true); DependencyManager::get<NodeList>()->getDomainHandler().setIsConnected(true);

View file

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

View file

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

View file

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