mirror of
https://github.com/overte-org/overte.git
synced 2025-06-15 05:26:04 +02:00
Add Window.protocolVersion() as a replacement for location's
This commit is contained in:
parent
d356f4faf9
commit
2883e24285
7 changed files with 16 additions and 5 deletions
|
@ -573,8 +573,7 @@ bool setupEssentials(int& argc, char** argv, bool runningMarkerExisted) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
reportAndQuit("--protocolVersion", [&](FILE* fp) {
|
reportAndQuit("--protocolVersion", [&](FILE* fp) {
|
||||||
DependencyManager::set<AddressManager>();
|
auto version = protocolVersionsSignatureBase64();
|
||||||
auto version = DependencyManager::get<AddressManager>()->protocolVersion();
|
|
||||||
fputs(version.toLatin1().data(), fp);
|
fputs(version.toLatin1().data(), fp);
|
||||||
});
|
});
|
||||||
reportAndQuit("--version", [&](FILE* fp) {
|
reportAndQuit("--version", [&](FILE* fp) {
|
||||||
|
|
|
@ -390,6 +390,10 @@ QString WindowScriptingInterface::checkVersion() {
|
||||||
return QCoreApplication::applicationVersion();
|
return QCoreApplication::applicationVersion();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString WindowScriptingInterface::protocolVersion() {
|
||||||
|
return protocolVersionsSignatureBase64();
|
||||||
|
}
|
||||||
|
|
||||||
int WindowScriptingInterface::getInnerWidth() {
|
int WindowScriptingInterface::getInnerWidth() {
|
||||||
return qApp->getDeviceSize().x;
|
return qApp->getDeviceSize().x;
|
||||||
}
|
}
|
||||||
|
|
|
@ -305,6 +305,13 @@ public slots:
|
||||||
*/
|
*/
|
||||||
QString checkVersion();
|
QString checkVersion();
|
||||||
|
|
||||||
|
/**jsdoc
|
||||||
|
* Get Interface's protocol version.
|
||||||
|
* @function Window.protocolVersion
|
||||||
|
* @returns {string} A string uniquely identifying the version of the metaverse protocol that Interface is using.
|
||||||
|
*/
|
||||||
|
QString protocolVersion();
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Copies text to the operating system's clipboard.
|
* Copies text to the operating system's clipboard.
|
||||||
* @function Window.copyToClipboard
|
* @function Window.copyToClipboard
|
||||||
|
|
|
@ -73,6 +73,7 @@ public:
|
||||||
* Get Interface's protocol version.
|
* Get Interface's protocol version.
|
||||||
* @function location.protocolVersion
|
* @function location.protocolVersion
|
||||||
* @returns {string} A string uniquely identifying the version of the metaverse protocol that Interface is using.
|
* @returns {string} A string uniquely identifying the version of the metaverse protocol that Interface is using.
|
||||||
|
* @deprecated This function is deprecated and will removed. Use {@link Window.protocolVersion} instead.
|
||||||
*/
|
*/
|
||||||
Q_INVOKABLE QString protocolVersion();
|
Q_INVOKABLE QString protocolVersion();
|
||||||
|
|
||||||
|
|
|
@ -136,7 +136,7 @@
|
||||||
'include_actions=' + actions,
|
'include_actions=' + actions,
|
||||||
'restriction=' + (Account.isLoggedIn() ? 'open,hifi' : 'open'),
|
'restriction=' + (Account.isLoggedIn() ? 'open,hifi' : 'open'),
|
||||||
'require_online=true',
|
'require_online=true',
|
||||||
'protocol=' + encodeURIComponent(location.protocolVersion()),
|
'protocol=' + encodeURIComponent(Window.protocolVersion()),
|
||||||
'per_page=' + count
|
'per_page=' + count
|
||||||
];
|
];
|
||||||
var url = Account.metaverseServerURL + '/api/v1/user_stories?' + options.join('&');
|
var url = Account.metaverseServerURL + '/api/v1/user_stories?' + options.join('&');
|
||||||
|
|
|
@ -133,7 +133,7 @@ var DEBUG_INFO = {
|
||||||
Reticle: {
|
Reticle: {
|
||||||
supportsScale: 'scale' in Reticle,
|
supportsScale: 'scale' in Reticle,
|
||||||
},
|
},
|
||||||
protocolVersion: location.protocolVersion,
|
protocolVersion: Window.protocolVersion(),
|
||||||
};
|
};
|
||||||
|
|
||||||
var globalState = {
|
var globalState = {
|
||||||
|
|
|
@ -52,7 +52,7 @@ function CustomSettingsApp(options) {
|
||||||
|
|
||||||
this.extraParams = Object.assign(options.extraParams || {}, {
|
this.extraParams = Object.assign(options.extraParams || {}, {
|
||||||
customSettingsVersion: CustomSettingsApp.version+'',
|
customSettingsVersion: CustomSettingsApp.version+'',
|
||||||
protocolVersion: location.protocolVersion && location.protocolVersion()
|
protocolVersion: Window.protocolVersion && Window.protocolVersion()
|
||||||
});
|
});
|
||||||
|
|
||||||
var params = {
|
var params = {
|
||||||
|
|
Loading…
Reference in a new issue