History

Merge branch 'android' into android_new

Brad Davis committed 8 years ago

Commit 3e787262 parents 1fb125f d53b8b320 files · +261 −85Browse files

Showing the changes to interface/src/Application.cpp (1 of 20 files). Show all

Unified · Split

interface/src/Application.cpp+21−18
@@ -214,6 +214,7 @@ · 213 unmodified lines
214214 #include "commerce/QmlCommerce.h"
215215
216216 #include "webbrowser/WebBrowserSuggestionsEngine.h"
217+#include <DesktopPreviewProvider.h>
217218
218219 #if defined(Q_OS_WIN)
219220 #include <VersionHelpers.h>
@@ -631,6 +632,24 @@ bool setupEssentials(int& argc, char** argv, bool runningMarkerExisted) { · 411 unmodified lines
631632 qApp->setProperty(hifi::properties::APP_LOCAL_DATA_PATH, cacheDir);
632633 }
633634
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+
634653 Setting::init();
635654
636655 // Tell the plugin manager about our statically linked plugins
@@ -670,6 +689,7 @@ bool setupEssentials(int& argc, char** argv, bool runningMarkerExisted) { · 33 unmodified lines
670689 DependencyManager::set<PickScriptingInterface>();
671690 DependencyManager::set<Cursor::Manager>();
672691 DependencyManager::set<VirtualPad::Manager>();
692+ DependencyManager::set<DesktopPreviewProvider>();
673693 DependencyManager::set<AccountManager>(std::bind(&Application::getUserAgent, qApp));
674694 DependencyManager::set<StatTracker>();
675695 DependencyManager::set<ScriptEngines>(ScriptEngine::CLIENT_SCRIPT);
@@ -817,24 +837,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 141 unmodified lines
817837
818838 {
819839
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−
838840 auto steamClient = PluginManager::getInstance()->getSteamClientPlugin();
839841 setProperty(hifi::properties::STEAM, (steamClient && steamClient->isRunning()));
840842 setProperty(hifi::properties::CRASHED, _previousSessionCrashed);
@@ -5853,6 +5855,7 @@ void Application::registerScriptEngineWithApplicationServices(ScriptEnginePointe · 5012 unmodified lines
58535855 scriptEngine->registerFunction("OverlayWindow", QmlWindowClass::constructor);
58545856
58555857 scriptEngine->registerGlobalObject("Menu", MenuScriptingInterface::getInstance());
5858+ scriptEngine->registerGlobalObject("DesktopPreviewProvider", DependencyManager::get<DesktopPreviewProvider>().data());
58565859 scriptEngine->registerGlobalObject("Stats", Stats::getInstance());
58575860 scriptEngine->registerGlobalObject("Settings", SettingsScriptingInterface::getInstance());
58585861 scriptEngine->registerGlobalObject("Snapshot", DependencyManager::get<Snapshot>().data());