use const QUrls rather than functions

This commit is contained in:
Seth Alves 2018-03-07 13:39:44 -08:00
parent 8a08039efe
commit 4505fce508
2 changed files with 3 additions and 11 deletions

View file

@ -13,21 +13,13 @@
#include "NetworkingConstants.h"
namespace NetworkingConstants {
QUrl METAVERSE_SERVER_URL_STABLE() {
return QUrl("https://metaverse.highfidelity.com");
}
QUrl METAVERSE_SERVER_URL_STAGING() {
return QUrl("https://staging.highfidelity.com");
}
// You can change the return of this function if you want to use a custom metaverse URL at compile time
// or you can pass a custom URL via the env variable
QUrl METAVERSE_SERVER_URL() {
static const QString HIFI_METAVERSE_URL_ENV = "HIFI_METAVERSE_URL";
static const QUrl serverURL = QProcessEnvironment::systemEnvironment().contains(HIFI_METAVERSE_URL_ENV)
? QUrl(QProcessEnvironment::systemEnvironment().value(HIFI_METAVERSE_URL_ENV))
: METAVERSE_SERVER_URL_STABLE();
: METAVERSE_SERVER_URL_STABLE;
return serverURL;
};
}

View file

@ -25,8 +25,8 @@ namespace NetworkingConstants {
// if you manually generate a personal access token for the domains scope
// at https://staging.highfidelity.com/user/tokens/new?for_domain_server=true
QUrl METAVERSE_SERVER_URL_STABLE();
QUrl METAVERSE_SERVER_URL_STAGING();
const QUrl METAVERSE_SERVER_URL_STABLE { "https://metaverse.highfidelity.com" };
const QUrl METAVERSE_SERVER_URL_STAGING { "https://staging.highfidelity.com" };
QUrl METAVERSE_SERVER_URL();
}