on xenial help sign in
Bring back qrc use
commite6620361a1473906a2de669b40ff7082e37b0f81 authorAlbert Astals Cid <albert.astals@canonical.com> dateWed 2 Sep 2015, 12:35 (11 years ago) parenteb2faee
4 files changed+10−13
tests/mocks/Unity/Application/MirSurface.cpp+2−2 tests/mocks/Unity/Application/MirSurface.h+3−3 tests/mocks/Unity/Application/MirSurfaceItem.cpp+3−4 tests/mocks/Unity/Application/VirtualKeyboard.cpp+2−4
tests/mocks/Unity/Application/MirSurface.cpp+2−2
@@ -22,7 +22,7 @@ MirSurface::MirSurface(const QString& name,
2222 Mir::Type type,
2323 Mir::State state,
2424 const QUrl& screenshot,
25− const QString &qmlFilePath)
25+ const QUrl &qmlFilePath)
2626 : unity::shell::application::MirSurfaceInterface(nullptr)
2727 , m_name(name)
2828 , m_type(type)
@@ -87,7 +87,7 @@ void MirSurface::setLive(bool live)
8787 }
8888}
8989
90−QString MirSurface::qmlFilePath() const
90+QUrl MirSurface::qmlFilePath() const
9191{
9292 return m_qmlFilePath;
9393}
tests/mocks/Unity/Application/MirSurface.h+3−3
@@ -38,7 +38,7 @@ public:
3838 Mir::Type type,
3939 Mir::State state,
4040 const QUrl& screenshot,
41− const QString &qmlFilePath = QString());
41+ const QUrl &qmlFilePath = QUrl());
4242 virtual ~MirSurface();
4343
4444 ////
@@ -76,7 +76,7 @@ public:
7676 /////
7777 // internal mock stuff
7878
79− QString qmlFilePath() const;
79+ QUrl qmlFilePath() const;
8080
8181 QUrl screenshotUrl() const;
8282 void setScreenshotUrl(QUrl);
@@ -102,7 +102,7 @@ private:
102102 Mir::State m_state;
103103 Mir::OrientationAngle m_orientationAngle;
104104 QUrl m_screenshotUrl;
105− QString m_qmlFilePath;
105+ QUrl m_qmlFilePath;
106106 bool m_live;
107107 int m_viewCount;
108108 bool m_activeFocus;
tests/mocks/Unity/Application/MirSurfaceItem.cpp+3−4
@@ -200,12 +200,11 @@ void MirSurfaceItem::setSurface(MirSurfaceInterface* surface)
200200 QQuickView *quickView =
201201 qobject_cast<QQuickView*>(QGuiApplication::topLevelWindows()[0]);
202202
203− QString qmlComponentFilePath;
203+ QUrl qmlComponentFilePath;
204204 if (!m_qmlSurface->qmlFilePath().isEmpty()) {
205− qmlComponentFilePath.append(m_qmlSurface->qmlFilePath());
205+ qmlComponentFilePath = m_qmlSurface->qmlFilePath();
206206 } else {
207− qmlComponentFilePath = QString("%1/Unity/Application/MirSurfaceItem.qml")
208− .arg(mockPluginsDir());
207+ qmlComponentFilePath = QUrl("qrc:///Unity/Application/MirSurfaceItem.qml");
209208 }
210209
211210 m_qmlContentComponent = new QQmlComponent(quickView->engine(), qmlComponentFilePath);
tests/mocks/Unity/Application/VirtualKeyboard.cpp+2−4
@@ -26,10 +26,8 @@ VirtualKeyboard::VirtualKeyboard()
2626 : MirSurface("input-method",
2727 Mir::InputMethodType,
2828 Mir::MinimizedState,
29− QString("file://%1/Dash/graphics/phone/screenshots/vkb_portrait.png")
30− .arg(qmlDirectory()),
31− QString("%1/Unity/Application/VirtualKeyboard.qml")
32− .arg(mockPluginsDir()))
29+ QUrl("qrc:///Unity/Application/vkb_portrait.png"),
30+ QUrl("qrc:///Unity/Application/VirtualKeyboard.qml"))
3331{
3432}
3533