mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 08:17:35 +02:00
Merge branch 'atp' of https://github.com/birarda/hifi into protocol
This commit is contained in:
commit
a7754ad085
2 changed files with 20 additions and 20 deletions
|
@ -30,10 +30,7 @@ const QString SETTINGS_CURRENT_ADDRESS_KEY = "address";
|
||||||
Setting::Handle<QUrl> currentAddressHandle(QStringList() << ADDRESS_MANAGER_SETTINGS_GROUP << "address", DEFAULT_HIFI_ADDRESS);
|
Setting::Handle<QUrl> currentAddressHandle(QStringList() << ADDRESS_MANAGER_SETTINGS_GROUP << "address", DEFAULT_HIFI_ADDRESS);
|
||||||
|
|
||||||
AddressManager::AddressManager() :
|
AddressManager::AddressManager() :
|
||||||
_host(),
|
_port(0)
|
||||||
_rootPlaceID(),
|
|
||||||
_positionGetter(NULL),
|
|
||||||
_orientationGetter(NULL)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -47,6 +44,11 @@ const QUrl AddressManager::currentAddress() const {
|
||||||
|
|
||||||
hifiURL.setScheme(HIFI_URL_SCHEME);
|
hifiURL.setScheme(HIFI_URL_SCHEME);
|
||||||
hifiURL.setHost(_host);
|
hifiURL.setHost(_host);
|
||||||
|
|
||||||
|
if (_port != 0 && _port != DEFAULT_DOMAIN_SERVER_PORT) {
|
||||||
|
hifiURL.setPort(_port);
|
||||||
|
}
|
||||||
|
|
||||||
hifiURL.setPath(currentPath());
|
hifiURL.setPath(currentPath());
|
||||||
|
|
||||||
return hifiURL;
|
return hifiURL;
|
||||||
|
@ -535,26 +537,24 @@ bool AddressManager::handleUsername(const QString& lookupString) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddressManager::setHost(const QString& host, LookupTrigger trigger) {
|
void AddressManager::setHost(const QString& host, LookupTrigger trigger, quint16 port) {
|
||||||
if (host != _host) {
|
if (host != _host || port != _port) {
|
||||||
|
|
||||||
|
_port = port;
|
||||||
|
|
||||||
// if the host is being changed we should store current address in the history
|
// if the host is being changed we should store current address in the history
|
||||||
addCurrentAddressToHistory(trigger);
|
addCurrentAddressToHistory(trigger);
|
||||||
|
|
||||||
_host = host;
|
if (host != _host) {
|
||||||
emit hostChanged(_host);
|
_host = host;
|
||||||
|
emit hostChanged(_host);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void AddressManager::setDomainInfo(const QString& hostname, quint16 port, LookupTrigger trigger) {
|
void AddressManager::setDomainInfo(const QString& hostname, quint16 port, LookupTrigger trigger) {
|
||||||
|
setHost(hostname, trigger, port);
|
||||||
QString domainHostString = hostname;
|
|
||||||
if (port != DEFAULT_DOMAIN_SERVER_PORT) {
|
|
||||||
domainHostString.append(QString(":%1").arg(port));
|
|
||||||
}
|
|
||||||
|
|
||||||
setHost(domainHostString, trigger);
|
|
||||||
|
|
||||||
_rootPlaceID = QUuid();
|
_rootPlaceID = QUuid();
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,6 @@ public:
|
||||||
|
|
||||||
const QString& getHost() const { return _host; }
|
const QString& getHost() const { return _host; }
|
||||||
|
|
||||||
|
|
||||||
void setPositionGetter(PositionGetter positionGetter) { _positionGetter = positionGetter; }
|
void setPositionGetter(PositionGetter positionGetter) { _positionGetter = positionGetter; }
|
||||||
void setOrientationGetter(OrientationGetter orientationGetter) { _orientationGetter = orientationGetter; }
|
void setOrientationGetter(OrientationGetter orientationGetter) { _orientationGetter = orientationGetter; }
|
||||||
|
|
||||||
|
@ -109,7 +108,7 @@ private slots:
|
||||||
|
|
||||||
void goToAddressFromObject(const QVariantMap& addressMap, const QNetworkReply& reply);
|
void goToAddressFromObject(const QVariantMap& addressMap, const QNetworkReply& reply);
|
||||||
private:
|
private:
|
||||||
void setHost(const QString& host, LookupTrigger trigger);
|
void setHost(const QString& host, LookupTrigger trigger, quint16 port = 0);
|
||||||
void setDomainInfo(const QString& hostname, quint16 port, LookupTrigger trigger);
|
void setDomainInfo(const QString& hostname, quint16 port, LookupTrigger trigger);
|
||||||
|
|
||||||
const JSONCallbackParameters& apiCallbackParameters();
|
const JSONCallbackParameters& apiCallbackParameters();
|
||||||
|
@ -129,9 +128,10 @@ private:
|
||||||
void addCurrentAddressToHistory(LookupTrigger trigger);
|
void addCurrentAddressToHistory(LookupTrigger trigger);
|
||||||
|
|
||||||
QString _host;
|
QString _host;
|
||||||
|
quint16 _port;
|
||||||
QUuid _rootPlaceID;
|
QUuid _rootPlaceID;
|
||||||
PositionGetter _positionGetter;
|
PositionGetter _positionGetter { nullptr };
|
||||||
OrientationGetter _orientationGetter;
|
OrientationGetter _orientationGetter { nullptr };
|
||||||
|
|
||||||
QStack<QUrl> _backStack;
|
QStack<QUrl> _backStack;
|
||||||
QStack<QUrl> _forwardStack;
|
QStack<QUrl> _forwardStack;
|
||||||
|
|
Loading…
Reference in a new issue