Showing the changes to interface/src/Application.cpp (1 of 20 files). Show all
Unified · Split
| @@ -214,6 +214,7 @@ · 213 unmodified lines | |||
| 214 | #include "commerce/QmlCommerce.h" | 214 | #include "commerce/QmlCommerce.h" |
| 215 | 215 | ||
| 216 | #include "webbrowser/WebBrowserSuggestionsEngine.h" | 216 | #include "webbrowser/WebBrowserSuggestionsEngine.h" |
| 217 | #include <DesktopPreviewProvider.h> | ||
| 217 | 218 | ||
| 218 | #if defined(Q_OS_WIN) | 219 | #if defined(Q_OS_WIN) |
| 219 | #include <VersionHelpers.h> | 220 | #include <VersionHelpers.h> |
| @@ -631,6 +632,24 @@ bool setupEssentials(int& argc, char** argv, bool runningMarkerExisted) { · 411 unmodified lines | |||
| 631 | qApp->setProperty(hifi::properties::APP_LOCAL_DATA_PATH, cacheDir); | 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 | Setting::init(); | 653 | Setting::init(); |
| 635 | 654 | ||
| 636 | // Tell the plugin manager about our statically linked plugins | 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 | DependencyManager::set<PickScriptingInterface>(); | 689 | DependencyManager::set<PickScriptingInterface>(); |
| 671 | DependencyManager::set<Cursor::Manager>(); | 690 | DependencyManager::set<Cursor::Manager>(); |
| 672 | DependencyManager::set<VirtualPad::Manager>(); | 691 | DependencyManager::set<VirtualPad::Manager>(); |
| 692 | DependencyManager::set<DesktopPreviewProvider>(); | ||
| 673 | DependencyManager::set<AccountManager>(std::bind(&Application::getUserAgent, qApp)); | 693 | DependencyManager::set<AccountManager>(std::bind(&Application::getUserAgent, qApp)); |
| 674 | DependencyManager::set<StatTracker>(); | 694 | DependencyManager::set<StatTracker>(); |
| 675 | DependencyManager::set<ScriptEngines>(ScriptEngine::CLIENT_SCRIPT); | 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 | auto steamClient = PluginManager::getInstance()->getSteamClientPlugin(); | 840 | auto steamClient = PluginManager::getInstance()->getSteamClientPlugin(); |
| 839 | setProperty(hifi::properties::STEAM, (steamClient && steamClient->isRunning())); | 841 | setProperty(hifi::properties::STEAM, (steamClient && steamClient->isRunning())); |
| 840 | setProperty(hifi::properties::CRASHED, _previousSessionCrashed); | 842 | setProperty(hifi::properties::CRASHED, _previousSessionCrashed); |
| @@ -5853,6 +5855,7 @@ void Application::registerScriptEngineWithApplicationServices(ScriptEnginePointe · 5012 unmodified lines | |||
| 5853 | scriptEngine->registerFunction("OverlayWindow", QmlWindowClass::constructor); | 5855 | scriptEngine->registerFunction("OverlayWindow", QmlWindowClass::constructor); |
| 5854 | 5856 | ||
| 5855 | scriptEngine->registerGlobalObject("Menu", MenuScriptingInterface::getInstance()); | 5857 | scriptEngine->registerGlobalObject("Menu", MenuScriptingInterface::getInstance()); |
| 5858 | scriptEngine->registerGlobalObject("DesktopPreviewProvider", DependencyManager::get<DesktopPreviewProvider>().data()); | ||
| 5856 | scriptEngine->registerGlobalObject("Stats", Stats::getInstance()); | 5859 | scriptEngine->registerGlobalObject("Stats", Stats::getInstance()); |
| 5857 | scriptEngine->registerGlobalObject("Settings", SettingsScriptingInterface::getInstance()); | 5860 | scriptEngine->registerGlobalObject("Settings", SettingsScriptingInterface::getInstance()); |
| 5858 | scriptEngine->registerGlobalObject("Snapshot", DependencyManager::get<Snapshot>().data()); | 5861 | scriptEngine->registerGlobalObject("Snapshot", DependencyManager::get<Snapshot>().data()); |