Showing the changes to interface/src/Application.cpp (1 of 2 files). Show all
Unified · Split
| @@ -322,6 +322,14 @@ bool setupEssentials(int& argc, char** argv) { · 321 unmodified lines | ||
| 322 | 322 | return true; |
| 323 | 323 | } |
| 324 | 324 | |
| 325 | +const QHash<QString, Application::AcceptURLMethod> Application::_acceptedExtensions{ | |
| 326 | + {SNAPSHOT_EXTENSION, &Application::acceptSnapshot}, | |
| 327 | + {SVO_EXTENSION, &Application::importSVOFromURL}, | |
| 328 | + {SVO_JSON_EXTENSION, &Application::importSVOFromURL}, | |
| 329 | + {JS_EXTENSION, &Application::askToLoadScript}, | |
| 330 | + {FST_EXTENSION, &Application::askToSetAvatarUrl} | |
| 331 | +}; | |
| 332 | + | |
| 325 | 333 | // FIXME move to header, or better yet, design some kind of UI manager |
| 326 | 334 | // to take care of highlighting keyboard focused items, rather than |
| 327 | 335 | // continuing to overburden Application.cpp |
| @@ -3954,19 +3962,7 @@ void Application::registerScriptEngineWithApplicationServices(ScriptEngine* scri · 3626 unmodified lines | ||
| 3954 | 3962 | #endif |
| 3955 | 3963 | } |
| 3956 | 3964 | |
| 3957 | −void Application::initializeAcceptedFiles() { | |
| 3958 | − if (_acceptedExtensions.size() == 0) { | |
| 3959 | − _acceptedExtensions[SNAPSHOT_EXTENSION] = &Application::acceptSnapshot; | |
| 3960 | − _acceptedExtensions[SVO_EXTENSION] = &Application::importSVOFromURL; | |
| 3961 | − _acceptedExtensions[SVO_JSON_EXTENSION] = &Application::importSVOFromURL; | |
| 3962 | − _acceptedExtensions[JS_EXTENSION] = &Application::askToLoadScript; | |
| 3963 | − _acceptedExtensions[FST_EXTENSION] = &Application::askToSetAvatarUrl; | |
| 3964 | − } | |
| 3965 | −} | |
| 3966 | − | |
| 3967 | 3965 | bool Application::canAcceptURL(const QString& urlString) { |
| 3968 | − initializeAcceptedFiles(); | |
| 3969 | − | |
| 3970 | 3966 | QUrl url(urlString); |
| 3971 | 3967 | if (urlString.startsWith(HIFI_URL_SCHEME)) { |
| 3972 | 3968 | return true; |
| @@ -3983,8 +3979,6 @@ bool Application::canAcceptURL(const QString& urlString) { · 10 unmodified lines | ||
| 3983 | 3979 | } |
| 3984 | 3980 | |
| 3985 | 3981 | bool Application::acceptURL(const QString& urlString) { |
| 3986 | − initializeAcceptedFiles(); | |
| 3987 | − | |
| 3988 | 3982 | if (urlString.startsWith(HIFI_URL_SCHEME)) { |
| 3989 | 3983 | // this is a hifi URL - have the AddressManager handle it |
| 3990 | 3984 | QMetaObject::invokeMethod(DependencyManager::get<AddressManager>().data(), "handleLookupString", |