on xenial help sign in
Bring back qrc use
e662036Albert Astals Cid
tests/mocks/Unity/Application/MirSurface.cpp+2−2
@@ -22,7 +22,7 @@ MirSurface::MirSurface(const QString& name,
22 Mir::Type type,
22 Mir::Type type,
23 Mir::State state,
23 Mir::State state,
24 const QUrl& screenshot,
24 const QUrl& screenshot,
25− const QString &qmlFilePath)
25+ const QUrl &qmlFilePath)
26 : unity::shell::application::MirSurfaceInterface(nullptr)
26 : unity::shell::application::MirSurfaceInterface(nullptr)
27 , m_name(name)
27 , m_name(name)
28 , m_type(type)
28 , m_type(type)
@@ -87,7 +87,7 @@ void MirSurface::setLive(bool live)
87 }
87 }
88}
88}
89
89
90−QString MirSurface::qmlFilePath() const
90+QUrl MirSurface::qmlFilePath() const
91{
91{
92 return m_qmlFilePath;
92 return m_qmlFilePath;
93}
93}
tests/mocks/Unity/Application/MirSurface.h+3−3
@@ -38,7 +38,7 @@ public:
38 Mir::Type type,
38 Mir::Type type,
39 Mir::State state,
39 Mir::State state,
40 const QUrl& screenshot,
40 const QUrl& screenshot,
41− const QString &qmlFilePath = QString());
41+ const QUrl &qmlFilePath = QUrl());
42 virtual ~MirSurface();
42 virtual ~MirSurface();
43
43
44 ////
44 ////
@@ -76,7 +76,7 @@ public:
76 /////
76 /////
77 // internal mock stuff
77 // internal mock stuff
78
78
79− QString qmlFilePath() const;
79+ QUrl qmlFilePath() const;
80
80
81 QUrl screenshotUrl() const;
81 QUrl screenshotUrl() const;
82 void setScreenshotUrl(QUrl);
82 void setScreenshotUrl(QUrl);
@@ -102,7 +102,7 @@ private:
102 Mir::State m_state;
102 Mir::State m_state;
103 Mir::OrientationAngle m_orientationAngle;
103 Mir::OrientationAngle m_orientationAngle;
104 QUrl m_screenshotUrl;
104 QUrl m_screenshotUrl;
105− QString m_qmlFilePath;
105+ QUrl m_qmlFilePath;
106 bool m_live;
106 bool m_live;
107 int m_viewCount;
107 int m_viewCount;
108 bool m_activeFocus;
108 bool m_activeFocus;
tests/mocks/Unity/Application/MirSurfaceItem.cpp+3−4
@@ -200,12 +200,11 @@ void MirSurfaceItem::setSurface(MirSurfaceInterface* surface)
200 QQuickView *quickView =
200 QQuickView *quickView =
201 qobject_cast<QQuickView*>(QGuiApplication::topLevelWindows()[0]);
201 qobject_cast<QQuickView*>(QGuiApplication::topLevelWindows()[0]);
202
202
203− QString qmlComponentFilePath;
203+ QUrl qmlComponentFilePath;
204 if (!m_qmlSurface->qmlFilePath().isEmpty()) {
204 if (!m_qmlSurface->qmlFilePath().isEmpty()) {
205− qmlComponentFilePath.append(m_qmlSurface->qmlFilePath());
205+ qmlComponentFilePath = m_qmlSurface->qmlFilePath();
206 } else {
206 } else {
207− qmlComponentFilePath = QString("%1/Unity/Application/MirSurfaceItem.qml")
207+ qmlComponentFilePath = QUrl("qrc:///Unity/Application/MirSurfaceItem.qml");
208− .arg(mockPluginsDir());
209 }
208 }
210
209
211 m_qmlContentComponent = new QQmlComponent(quickView->engine(), qmlComponentFilePath);
210 m_qmlContentComponent = new QQmlComponent(quickView->engine(), qmlComponentFilePath);
tests/mocks/Unity/Application/VirtualKeyboard.cpp+2−4
@@ -26,10 +26,8 @@ VirtualKeyboard::VirtualKeyboard()
26 : MirSurface("input-method",
26 : MirSurface("input-method",
27 Mir::InputMethodType,
27 Mir::InputMethodType,
28 Mir::MinimizedState,
28 Mir::MinimizedState,
29− QString("file://%1/Dash/graphics/phone/screenshots/vkb_portrait.png")
29+ QUrl("qrc:///Unity/Application/vkb_portrait.png"),
30− .arg(qmlDirectory()),
31− QString("%1/Unity/Application/VirtualKeyboard.qml")
30+ QUrl("qrc:///Unity/Application/VirtualKeyboard.qml"))
32− .arg(mockPluginsDir()))
33{
31{
34}
32}
35
33