Skip to content

Instantly share code, notes, and snippets.

@rafaelbrandao
Created February 4, 2013 21:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rafaelbrandao/4709929 to your computer and use it in GitHub Desktop.
Save rafaelbrandao/4709929 to your computer and use it in GitHub Desktop.
snowshoe needs to explicitly add an import path
diff --git a/src/desktop/BrowserWindow.cpp b/src/desktop/BrowserWindow.cpp
index ccf284e..f91a854 100644
--- a/src/desktop/BrowserWindow.cpp
+++ b/src/desktop/BrowserWindow.cpp
@@ -33,6 +33,7 @@
#include <QtQml/QQmlProperty>
#include <QtQuick/QQuickItem>
#include <QtGui/private/qguiapplication_p.h>
+#include <QDebug>
BrowserWindow::BrowserWindow(const QStringList& arguments)
: m_urlsFromCommandLine(arguments)
@@ -151,6 +152,9 @@ void BrowserWindow::setupDeclarativeEnvironment()
context->setContextProperty("UrlTools", new UrlTools(this));
context->setContextProperty("StateTracker", &m_stateTracker);
+ QString importPath = qgetenv("QML_IMPORT_PATH");
+ qDebug() << "Snowshoe desktop version is using the import path version: " << importPath;
+ engine()->addImportPath(importPath);
QObject::connect(engine(), SIGNAL(quit()), qApp, SLOT(quit()));
setResizeMode(QQuickView::SizeRootObjectToView);
diff --git a/src/mobile/BrowserWindowMobile.cpp b/src/mobile/BrowserWindowMobile.cpp
index 82f36aa..ba8319d 100644
--- a/src/mobile/BrowserWindowMobile.cpp
+++ b/src/mobile/BrowserWindowMobile.cpp
@@ -26,6 +26,7 @@
#include <QtQml/QQmlContext>
#include <QtQml/QQmlEngine>
#include <QtQuick/QQuickItem>
+#include <QDebug>
BrowserWindowMobile::BrowserWindowMobile()
: m_browserView(0)
@@ -47,6 +48,10 @@ void BrowserWindowMobile::setupDeclarativeEnvironment()
context->setContextProperty("TabsModel", new TabsModel(this));
context->setContextProperty("UrlTools", new UrlTools(this));
+ QString importPath = qgetenv("QML_IMPORT_PATH");
+ qDebug() << "Snowshoe mobile version is using the import path version: " << importPath;
+ engine()->addImportPath(importPath);
+
QObject::connect(engine(), SIGNAL(quit()), qApp, SLOT(quit()));
setResizeMode(QQuickView::SizeRootObjectToView);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment