on xenial help sign in
move screenshots out of the Dash dir

This was consuming 2.5 megs of installed size while they really are only used for testing. Approved by: Albert Astals Cid

commit6d6a46e37b79a1c1948a4add0ef6507f7b0df4a8 authorMichael Zanetti <michael.zanetti@canonical.com> dateThu 26 Nov 2015, 13:49 (11 years ago) parentcb2aab96496d79
19 files changed+32−18
po/shn.po+6−5 tests/mocks/Unity/Application/ApplicationInfo.cpp+4−8 tests/mocks/Unity/Application/ApplicationScreenshotProvider.cpp+6−2 tests/mocks/Unity/Application/ApplicationTestInterface.cpp+2−2 qml/Dash/graphics/phone/screenshots/browser@12.png → tests/mocks/Unity/Application/resources/screenshots/browser@12.png qml/Dash/graphics/phone/screenshots/camera@12.png → tests/mocks/Unity/Application/resources/screenshots/camera@12.png qml/Dash/graphics/phone/screenshots/dialer@12.png → tests/mocks/Unity/Application/resources/screenshots/dialer@12.png qml/Dash/graphics/phone/screenshots/facebook@12.png → tests/mocks/Unity/Application/resources/screenshots/facebook@12.png qml/Dash/graphics/phone/screenshots/gallery@12.png → tests/mocks/Unity/Application/resources/screenshots/gallery@12.png qml/Dash/graphics/phone/screenshots/gmail-webapp.svg → tests/mocks/Unity/Application/resources/screenshots/gmail-webapp.svg qml/Dash/graphics/phone/screenshots/libreoffice@12.png → tests/mocks/Unity/Application/resources/screenshots/libreoffice@12.png qml/Dash/graphics/phone/screenshots/map@12.png → tests/mocks/Unity/Application/resources/screenshots/map@12.png qml/Dash/graphics/phone/screenshots/music@12.png → tests/mocks/Unity/Application/resources/screenshots/music@12.png qml/Dash/graphics/phone/screenshots/twitter@12.png → tests/mocks/Unity/Application/resources/screenshots/twitter@12.png qml/Dash/graphics/phone/screenshots/ubuntu-weather-app.svg → tests/mocks/Unity/Application/resources/screenshots/ubuntu-weather-app.svg qml/Dash/graphics/phone/screenshots/unity8-dash@12.png → tests/mocks/Unity/Application/resources/screenshots/unity8-dash@12.png qml/Dash/graphics/phone/screenshots/vkb_portrait.png → tests/mocks/Unity/Application/resources/screenshots/vkb_portrait.png tests/mocks/Unity/Application/resources/surfaces.qrc+13 tests/qmltests/Components/tst_ZoomableImage.qml+1−1
po/shn.po+6−5
@@ -6,17 +6,18 @@
66msgid ""
77msgstr ""
88"Project-Id-Version: unity8\n"
9−"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
9+"Report-Msgid-Bugs-To: \n"
1010"POT-Creation-Date: 2015-11-04 15:02+0000\n"
11−"PO-Revision-Date: 2015-11-10 12:09+0000\n"
12−"Last-Translator: Rockworld <sumoisrock@gmail.com>\n"
11+"PO-Revision-Date: 2013-10-07 11:46+0000\n"
12+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1313"Language-Team: Shan <shn@li.org>\n"
14+"Language: shn\n"
1415"MIME-Version: 1.0\n"
1516"Content-Type: text/plain; charset=UTF-8\n"
1617"Content-Transfer-Encoding: 8bit\n"
1718"Plural-Forms: nplurals=2; plural=(n == 1) ? 0 : 1;\n"
18−"X-Launchpad-Export-Date: 2015-11-21 05:34+0000\n"
19−"X-Generator: Launchpad (build 17850)\n"
19+"X-Launchpad-Export-Date: 2015-11-07 05:13+0000\n"
20+"X-Generator: Launchpad (build 17838)\n"
2021
2122#: plugins/IntegratedLightDM/Greeter.cpp:112
2223msgid "Password: "
tests/mocks/Unity/Application/ApplicationInfo.cpp+4−8
@@ -73,8 +73,7 @@ void ApplicationInfo::createSession()
7373{
7474 if (m_session || state() == ApplicationInfo::Stopped) { return; }
7575
76− QUrl screenshotUrl = QString("file://%1").arg(m_screenshotFileName);
77− setSession(SessionManager::singleton()->createSession(appId(), screenshotUrl));
76+ setSession(SessionManager::singleton()->createSession(appId(), m_screenshotFileName));
7877}
7978
8079void ApplicationInfo::destroySession()
@@ -125,21 +124,18 @@ void ApplicationInfo::setScreenshotId(const QString &screenshotId)
125124 QString screenshotFileName;
126125
127126 if (screenshotId.endsWith(".svg")) {
128− screenshotFileName = QString("%1/Dash/graphics/phone/screenshots/%2")
129− .arg(qmlDirectory())
127+ screenshotFileName = QString("qrc:///Unity/Application/screenshots/%2")
130128 .arg(screenshotId);
131129 } else {
132− screenshotFileName = QString("%1/Dash/graphics/phone/screenshots/%2@12.png")
133− .arg(qmlDirectory())
130+ screenshotFileName = QString("qrc:///Unity/Application/screenshots/%2@12.png")
134131 .arg(screenshotId);
135132 }
136133
137134 if (screenshotFileName != m_screenshotFileName) {
138135 m_screenshotFileName = screenshotFileName;
139136
140− QUrl screenshotUrl = QString("file://%1").arg(m_screenshotFileName);
141137 if (m_session) {
142− m_session->setScreenshot(screenshotUrl);
138+ m_session->setScreenshot(screenshotFileName);
143139 }
144140 }
145141}
tests/mocks/Unity/Application/ApplicationScreenshotProvider.cpp+6−2
@@ -44,9 +44,13 @@ QImage ApplicationScreenshotProvider::requestImage(const QString &imageId, QSize
4444 return QImage();
4545 }
4646
47+ QString screenshot = app->screenshot();
48+ // QImage doesn't understand qrc:/// but we have QUrls in use which don't like the empty protcol ":/"
49+ screenshot.replace("qrc:///", ":/");
50+
4751 QImage image;
48− if (!image.load(app->screenshot())) {
49− qWarning() << "failed loading app image" << app->screenshot();
52+ if (!image.load(screenshot)) {
53+ qWarning() << "failed loading app image" << screenshot;
5054 }
5155
5256
tests/mocks/Unity/Application/ApplicationTestInterface.cpp+2−2
@@ -40,7 +40,7 @@ Session* ApplicationTestInterface::addChildSession(Session* existingSession, con
4040{
4141 if (!existingSession) return nullptr;
4242
43− QUrl screenshotUrl = QString("file://%1/Dash/graphics/phone/screenshots/%2@12.png")
43+ QUrl screenshotUrl = QString("qrc:///Unity/Application/screenshots/%2@12.png")
4444 .arg(qmlDirectory())
4545 .arg(surfaceImage);
4646
@@ -90,7 +90,7 @@ quint32 ApplicationTestInterface::addChildSession(const QString& appId, quint32
9090 return 0;
9191 }
9292
93− QUrl screenshotUrl = QString("file://%1/Dash/graphics/phone/screenshots/%2@12.png")
93+ QUrl screenshotUrl = QString("qrc:///Unity/Application/screenshots/%2@12.png")
9494 .arg(qmlDirectory())
9595 .arg(surfaceImage);
9696
qml/Dash/graphics/phone/screenshots/browser@12.png → tests/mocks/Unity/Application/resources/screenshots/browser@12.pngrenamed

Binary file not shown.

qml/Dash/graphics/phone/screenshots/camera@12.png → tests/mocks/Unity/Application/resources/screenshots/camera@12.pngrenamed

Binary file not shown.

qml/Dash/graphics/phone/screenshots/dialer@12.png → tests/mocks/Unity/Application/resources/screenshots/dialer@12.pngrenamed

Binary file not shown.

qml/Dash/graphics/phone/screenshots/facebook@12.png → tests/mocks/Unity/Application/resources/screenshots/facebook@12.pngrenamed

Binary file not shown.

qml/Dash/graphics/phone/screenshots/gallery@12.png → tests/mocks/Unity/Application/resources/screenshots/gallery@12.pngrenamed

Binary file not shown.

qml/Dash/graphics/phone/screenshots/gmail-webapp.svg → tests/mocks/Unity/Application/resources/screenshots/gmail-webapp.svgrenamed

The content is the same.

qml/Dash/graphics/phone/screenshots/libreoffice@12.png → tests/mocks/Unity/Application/resources/screenshots/libreoffice@12.pngrenamed

Binary file not shown.

qml/Dash/graphics/phone/screenshots/map@12.png → tests/mocks/Unity/Application/resources/screenshots/map@12.pngrenamed

Binary file not shown.

qml/Dash/graphics/phone/screenshots/music@12.png → tests/mocks/Unity/Application/resources/screenshots/music@12.pngrenamed

Binary file not shown.

qml/Dash/graphics/phone/screenshots/twitter@12.png → tests/mocks/Unity/Application/resources/screenshots/twitter@12.pngrenamed

Binary file not shown.

qml/Dash/graphics/phone/screenshots/ubuntu-weather-app.svg → tests/mocks/Unity/Application/resources/screenshots/ubuntu-weather-app.svgrenamed

The content is the same.

qml/Dash/graphics/phone/screenshots/unity8-dash@12.png → tests/mocks/Unity/Application/resources/screenshots/unity8-dash@12.pngrenamed

Binary file not shown.

qml/Dash/graphics/phone/screenshots/vkb_portrait.png → tests/mocks/Unity/Application/resources/screenshots/vkb_portrait.pngrenamed

Binary file not shown.

tests/mocks/Unity/Application/resources/surfaces.qrc+13
@@ -3,5 +3,18 @@
33 <file>VirtualKeyboard.qml</file>
44 <file>MirSurfaceItem.qml</file>
55 <file>vkb_portrait.png</file>
6+ <file>screenshots/browser@12.png</file>
7+ <file>screenshots/camera@12.png</file>
8+ <file>screenshots/dialer@12.png</file>
9+ <file>screenshots/facebook@12.png</file>
10+ <file>screenshots/gallery@12.png</file>
11+ <file>screenshots/gmail-webapp.svg</file>
12+ <file>screenshots/map@12.png</file>
13+ <file>screenshots/music@12.png</file>
14+ <file>screenshots/twitter@12.png</file>
15+ <file>screenshots/ubuntu-weather-app.svg</file>
16+ <file>screenshots/unity8-dash@12.png</file>
17+ <file>screenshots/vkb_portrait.png</file>
18+ <file>screenshots/libreoffice@12.png</file>
619 </qresource>
720</RCC>
tests/qmltests/Components/tst_ZoomableImage.qml+1−1
@@ -36,7 +36,7 @@ Rectangle {
3636 }
3737
3838 property var widgetData2: {
39− "source": "../../../qml/Dash/graphics/phone/screenshots/gallery@12.png",
39+ "source": "../../mocks/Unity/Application/resources/screenshots/gallery@12.png",
4040 "zoomable": true
4141 }
4242