mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 18:23:54 +02:00
Make _acceptedExtensions static const
This commit is contained in:
parent
51fc43ea4c
commit
327154b0c0
2 changed files with 9 additions and 15 deletions
|
@ -322,6 +322,14 @@ bool setupEssentials(int& argc, char** argv) {
|
|||
return true;
|
||||
}
|
||||
|
||||
const QHash<QString, Application::AcceptURLMethod> Application::_acceptedExtensions{
|
||||
{SNAPSHOT_EXTENSION, &Application::acceptSnapshot},
|
||||
{SVO_EXTENSION, &Application::importSVOFromURL},
|
||||
{SVO_JSON_EXTENSION, &Application::importSVOFromURL},
|
||||
{JS_EXTENSION, &Application::askToLoadScript},
|
||||
{FST_EXTENSION, &Application::askToSetAvatarUrl}
|
||||
};
|
||||
|
||||
// FIXME move to header, or better yet, design some kind of UI manager
|
||||
// to take care of highlighting keyboard focused items, rather than
|
||||
// continuing to overburden Application.cpp
|
||||
|
@ -3954,19 +3962,7 @@ void Application::registerScriptEngineWithApplicationServices(ScriptEngine* scri
|
|||
#endif
|
||||
}
|
||||
|
||||
void Application::initializeAcceptedFiles() {
|
||||
if (_acceptedExtensions.size() == 0) {
|
||||
_acceptedExtensions[SNAPSHOT_EXTENSION] = &Application::acceptSnapshot;
|
||||
_acceptedExtensions[SVO_EXTENSION] = &Application::importSVOFromURL;
|
||||
_acceptedExtensions[SVO_JSON_EXTENSION] = &Application::importSVOFromURL;
|
||||
_acceptedExtensions[JS_EXTENSION] = &Application::askToLoadScript;
|
||||
_acceptedExtensions[FST_EXTENSION] = &Application::askToSetAvatarUrl;
|
||||
}
|
||||
}
|
||||
|
||||
bool Application::canAcceptURL(const QString& urlString) {
|
||||
initializeAcceptedFiles();
|
||||
|
||||
QUrl url(urlString);
|
||||
if (urlString.startsWith(HIFI_URL_SCHEME)) {
|
||||
return true;
|
||||
|
@ -3983,8 +3979,6 @@ bool Application::canAcceptURL(const QString& urlString) {
|
|||
}
|
||||
|
||||
bool Application::acceptURL(const QString& urlString) {
|
||||
initializeAcceptedFiles();
|
||||
|
||||
if (urlString.startsWith(HIFI_URL_SCHEME)) {
|
||||
// this is a hifi URL - have the AddressManager handle it
|
||||
QMetaObject::invokeMethod(DependencyManager::get<AddressManager>().data(), "handleLookupString",
|
||||
|
|
|
@ -500,7 +500,7 @@ private:
|
|||
GLCanvas* _glWidget{ nullptr };
|
||||
|
||||
typedef bool (Application::* AcceptURLMethod)(const QString &);
|
||||
QHash<QString, AcceptURLMethod> _acceptedExtensions;
|
||||
static const QHash<QString, AcceptURLMethod> _acceptedExtensions;
|
||||
|
||||
QList<QString> _domainConnectionRefusals;
|
||||
glm::uvec2 _renderResolution;
|
||||
|
|
Loading…
Reference in a new issue