Showing the changes to interface/src/Application.cpp (1 of 20 files). Show all
Unified · Split
| @@ -214,6 +214,7 @@ · 213 unmodified lines | ||
| 214 | 214 | #include "commerce/QmlCommerce.h" |
| 215 | 215 | |
| 216 | 216 | #include "webbrowser/WebBrowserSuggestionsEngine.h" |
| 217 | +#include <DesktopPreviewProvider.h> | |
| 217 | 218 | |
| 218 | 219 | #if defined(Q_OS_WIN) |
| 219 | 220 | #include <VersionHelpers.h> |
| @@ -631,6 +632,24 @@ bool setupEssentials(int& argc, char** argv, bool runningMarkerExisted) { · 411 unmodified lines | ||
| 631 | 632 | qApp->setProperty(hifi::properties::APP_LOCAL_DATA_PATH, cacheDir); |
| 632 | 633 | } |
| 633 | 634 | |
| 635 | + // FIXME fix the OSX installer to install the resources.rcc binary instead of resource files and remove | |
| 636 | + // this conditional exclusion | |
| 637 | +#if !defined(Q_OS_OSX) | |
| 638 | + { | |
| 639 | +#if defined(Q_OS_ANDROID) | |
| 640 | + const QString resourcesBinaryFile = QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + "/resources.rcc"; | |
| 641 | +#else | |
| 642 | + const QString resourcesBinaryFile = QCoreApplication::applicationDirPath() + "/resources.rcc"; | |
| 643 | +#endif | |
| 644 | + if (!QFile::exists(resourcesBinaryFile)) { | |
| 645 | + throw std::runtime_error("Unable to find primary resources"); | |
| 646 | + } | |
| 647 | + if (!QResource::registerResource(resourcesBinaryFile)) { | |
| 648 | + throw std::runtime_error("Unable to load primary resources"); | |
| 649 | + } | |
| 650 | + } | |
| 651 | +#endif | |
| 652 | + | |
| 634 | 653 | Setting::init(); |
| 635 | 654 | |
| 636 | 655 | // Tell the plugin manager about our statically linked plugins |
| @@ -670,6 +689,7 @@ bool setupEssentials(int& argc, char** argv, bool runningMarkerExisted) { · 33 unmodified lines | ||
| 670 | 689 | DependencyManager::set<PickScriptingInterface>(); |
| 671 | 690 | DependencyManager::set<Cursor::Manager>(); |
| 672 | 691 | DependencyManager::set<VirtualPad::Manager>(); |
| 692 | + DependencyManager::set<DesktopPreviewProvider>(); | |
| 673 | 693 | DependencyManager::set<AccountManager>(std::bind(&Application::getUserAgent, qApp)); |
| 674 | 694 | DependencyManager::set<StatTracker>(); |
| 675 | 695 | DependencyManager::set<ScriptEngines>(ScriptEngine::CLIENT_SCRIPT); |
| @@ -817,24 +837,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 141 unmodified lines | ||
| 817 | 837 | |
| 818 | 838 | { |
| 819 | 839 | |
| 820 | − // FIXME fix the OSX installer to install the resources.rcc binary instead of resource files and remove | |
| 821 | − // this conditional exclusion | |
| 822 | −#if !defined(Q_OS_OSX) | |
| 823 | − { | |
| 824 | −#if defined(Q_OS_ANDROID) | |
| 825 | − const QString resourcesBinaryFile = QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + "/resources.rcc"; | |
| 826 | −#else | |
| 827 | − const QString resourcesBinaryFile = applicationDirPath() + "/resources.rcc"; | |
| 828 | −#endif | |
| 829 | − if (!QFile::exists(resourcesBinaryFile)) { | |
| 830 | − throw std::runtime_error("Unable to find primary resources"); | |
| 831 | − } | |
| 832 | − if (!QResource::registerResource(resourcesBinaryFile)) { | |
| 833 | − throw std::runtime_error("Unable to load primary resources"); | |
| 834 | − } | |
| 835 | − } | |
| 836 | −#endif | |
| 837 | − | |
| 838 | 840 | auto steamClient = PluginManager::getInstance()->getSteamClientPlugin(); |
| 839 | 841 | setProperty(hifi::properties::STEAM, (steamClient && steamClient->isRunning())); |
| 840 | 842 | setProperty(hifi::properties::CRASHED, _previousSessionCrashed); |
| @@ -5853,6 +5855,7 @@ void Application::registerScriptEngineWithApplicationServices(ScriptEnginePointe · 5012 unmodified lines | ||
| 5853 | 5855 | scriptEngine->registerFunction("OverlayWindow", QmlWindowClass::constructor); |
| 5854 | 5856 | |
| 5855 | 5857 | scriptEngine->registerGlobalObject("Menu", MenuScriptingInterface::getInstance()); |
| 5858 | + scriptEngine->registerGlobalObject("DesktopPreviewProvider", DependencyManager::get<DesktopPreviewProvider>().data()); | |
| 5856 | 5859 | scriptEngine->registerGlobalObject("Stats", Stats::getInstance()); |
| 5857 | 5860 | scriptEngine->registerGlobalObject("Settings", SettingsScriptingInterface::getInstance()); |
| 5858 | 5861 | scriptEngine->registerGlobalObject("Snapshot", DependencyManager::get<Snapshot>().data()); |