fix sitting points on domain switch

This commit is contained in:
Atlante45 2014-08-25 18:02:30 -07:00
parent 63df2b2372
commit 1acce5c725
3 changed files with 7 additions and 2 deletions

View file

@ -269,8 +269,7 @@ function update(deltaTime){
}
var locationChanged = false;
if (location.hostname != oldHost) {
print("Changed domain");
if (location.hostname != oldHost || !location.isConnected) {
for (model in models) {
removeIndicators(models[model]);
}

View file

@ -20,6 +20,10 @@ LocationScriptingInterface* LocationScriptingInterface::getInstance() {
return &sharedInstance;
}
bool LocationScriptingInterface::isConnected() {
return NodeList::getInstance()->getDomainHandler().isConnected();
}
QString LocationScriptingInterface::getHref() {
return getProtocol() + "//" + getHostname() + getPathname();
}

View file

@ -22,6 +22,7 @@
class LocationScriptingInterface : public QObject {
Q_OBJECT
Q_PROPERTY(bool isConnected READ isConnected)
Q_PROPERTY(QString href READ getHref)
Q_PROPERTY(QString protocol READ getProtocol)
Q_PROPERTY(QString hostname READ getHostname)
@ -30,6 +31,7 @@ class LocationScriptingInterface : public QObject {
public:
static LocationScriptingInterface* getInstance();
bool isConnected();
QString getHref();
QString getProtocol() { return CUSTOM_URL_SCHEME; };
QString getPathname();