History

gather together the url scheme constants, name them consistently

Seth Alves committed 8 years ago

Commit 606face1 parent fdb53b611 files · +44 −38Browse files

Showing the changes to interface/src/Application.cpp (1 of 11 files). Show all

Unified · Split

interface/src/Application.cpp+9−10
@@ -513,12 +513,12 @@ bool isDomainURL(QUrl url) { · 512 unmodified lines
513513 if (!url.isValid()) {
514514 return false;
515515 }
516− if (url.scheme() == HIFI_URL_SCHEME) {
516+ if (url.scheme() == URL_SCHEME_HIFI) {
517517 return true;
518518 }
519− if (url.scheme() != "file" &&
520− url.scheme() != "http" &&
521− url.scheme() != "https") {
519+ if (url.scheme() != URL_SCHEME_FILE &&
520+ url.scheme() != URL_SCHEME_HTTP &&
521+ url.scheme() != URL_SCHEME_HTTPS) {
522522 return false;
523523 }
524524 if (url.path().endsWith(".json", Qt::CaseInsensitive) ||
@@ -3109,16 +3109,15 @@ bool Application::importFromZIP(const QString& filePath) { · 2584 unmodified lines
31093109 }
31103110
31113111 bool Application::isServerlessMode() const {
3112− auto& tree = getEntities()->getTree();
3112+ auto tree = getEntities()->getTree();
31133113 if (tree) {
31143114 return tree->isServerlessMode();
3115− } else {
3116− return false;
31173115 }
3116+ return false;
31183117 }
31193118
31203119 void Application::setServerlessDomain(bool serverlessDomain) {
3121− auto& tree = getEntities()->getTree();
3120+ auto tree = getEntities()->getTree();
31223121 if (tree) {
31233122 tree->setIsServerlessMode(serverlessDomain);
31243123 }
@@ -5885,7 +5884,7 @@ void Application::domainURLChanged(QUrl domainURL) { · 2760 unmodified lines
58855884 updateWindowTitle();
58865885 // disable physics until we have enough information about our new location to not cause craziness.
58875886 resetPhysicsReadyInformation();
5888− if (domainURL.scheme() != HIFI_URL_SCHEME) {
5887+ if (domainURL.scheme() != URL_SCHEME_HIFI) {
58895888 loadServerlessDomain(domainURL);
58905889 }
58915890 }
@@ -6257,7 +6256,7 @@ bool Application::canAcceptURL(const QString& urlString) const { · 365 unmodified lines
62576256 QUrl url(urlString);
62586257 if (url.query().contains(WEB_VIEW_TAG)) {
62596258 return false;
6260− } else if (urlString.startsWith(HIFI_URL_SCHEME)) {
6259+ } else if (urlString.startsWith(URL_SCHEME_HIFI)) {
62616260 return true;
62626261 }
62636262 QHashIterator<QString, AcceptURLMethod> i(_acceptedExtensions);