on xenial help sign in
merge trunk
349587aMichael Zanetti
Components/Carousel.qml+5−4
@@ -78,7 +78,7 @@ Item {
78 id: listView
78 id: listView
79
79
80 property real minimumTileWidth: 0
80 property real minimumTileWidth: 0
81− property real newContentX: -1
81+ property real newContentX: disabledNewContentX
82 property real pathItemCount: referenceWidth / referenceTileWidth
82 property real pathItemCount: referenceWidth / referenceTileWidth
83 property real tileAspectRatio: 1
83 property real tileAspectRatio: 1
84 property int highlightIndex: -1
84 property int highlightIndex: -1
@@ -107,6 +107,7 @@ Item {
107 readonly property real kMiddleIndex: (realWidth / 2) / tileWidth - 0.5
107 readonly property real kMiddleIndex: (realWidth / 2) / tileWidth - 0.5
108 readonly property real kXBeginningEnd: 1 / tileWidth + kMiddleIndex / gapToMiddlePhase
108 readonly property real kXBeginningEnd: 1 / tileWidth + kMiddleIndex / gapToMiddlePhase
109 readonly property real maximumItemTranslation: (listView.tileWidth * 3) / listView.scaleFactor
109 readonly property real maximumItemTranslation: (listView.tileWidth * 3) / listView.scaleFactor
110+ readonly property real disabledNewContentX: -carousel.drawBuffer - 1
110 readonly property real realContentWidth: contentWidth - 2 * carousel.drawBuffer
111 readonly property real realContentWidth: contentWidth - 2 * carousel.drawBuffer
111 readonly property real realContentX: contentX + carousel.drawBuffer
112 readonly property real realContentX: contentX + carousel.drawBuffer
112 readonly property real realPathItemCount: Math.min(realWidth / tileWidth, pathItemCount)
113 readonly property real realPathItemCount: Math.min(realWidth / tileWidth, pathItemCount)
@@ -206,7 +207,7 @@ Item {
206 onMovementStarted: {
207 onMovementStarted: {
207 stepAnimation.stop()
208 stepAnimation.stop()
208 newContentXAnimation.stop()
209 newContentXAnimation.stop()
209− newContentX = -1
210+ newContentX = disabledNewContentX
210 }
211 }
211 onMovementEnded: {
212 onMovementEnded: {
212 if (realContentX > 0 && realContentX < realContentWidth - realWidth)
213 if (realContentX > 0 && realContentX < realContentWidth - realWidth)
@@ -242,7 +243,7 @@ Item {
242 easing.type: Easing.InOutQuad
243 easing.type: Easing.InOutQuad
243 }
244 }
244 ScriptAction {
245 ScriptAction {
245− script: listView.newContentX = -1
246+ script: listView.newContentX = listView.disabledNewContentX
246 }
247 }
247 }
248 }
248
249
@@ -267,7 +268,7 @@ Item {
267 readonly property bool explicitScale: (!listView.moving ||
268 readonly property bool explicitScale: (!listView.moving ||
268 listView.realContentX <= 0 ||
269 listView.realContentX <= 0 ||
269 listView.realContentX >= listView.realContentWidth - listView.realWidth) &&
270 listView.realContentX >= listView.realContentWidth - listView.realWidth) &&
270− listView.newContentX < 0 &&
271+ listView.newContentX === listView.disabledNewContentX &&
271 index === listView.selectedIndex
272 index === listView.selectedIndex
272 readonly property real cachedTiles: listView.realPathItemCount + carousel.drawBuffer / listView.tileWidth
273 readonly property real cachedTiles: listView.realPathItemCount + carousel.drawBuffer / listView.tileWidth
273 readonly property real distance: listView.continuousIndex - index
274 readonly property real distance: listView.continuousIndex - index
Dash/Apps/FrequentlyUsedAppsModel.qml+16−16
@@ -18,54 +18,54 @@ import QtQuick 2.0
18
18
19ListModel {
19ListModel {
20 ListElement {
20 ListElement {
21− uri: "application:///usr/share/applications/dialer-app.desktop"
21+ uri: "application://dialer-app.desktop"
22 icon: "../../graphics/applicationIcons/phone-app.png"
22 icon: "../../graphics/applicationIcons/phone-app.png"
23 category: 0
23 category: 0
24 mimetype: "application/x-desktop"
24 mimetype: "application/x-desktop"
25 title: "Dialer"
25 title: "Dialer"
26 comment: ""
26 comment: ""
27 dndUri: "file:///usr/share/applications/dialer-app.desktop"
27 dndUri: "file:///usr/share/applications/dialer-app.desktop"
28− metadata: ""
28+ metadata: "subscope:applications.scope/applications-non-click.scope"
29 }
29 }
30 ListElement {
30 ListElement {
31− uri: "application:///usr/share/applications/messaging-app.desktop"
31+ uri: "application://messaging-app.desktop"
32 icon: "../../graphics/applicationIcons/messages-app.png"
32 icon: "../../graphics/applicationIcons/messages-app.png"
33 category: 0
33 category: 0
34 mimetype: "application/x-desktop"
34 mimetype: "application/x-desktop"
35 title: "Messaging"
35 title: "Messaging"
36 comment: ""
36 comment: ""
37 dndUri: "file:///usr/share/applications/messaging-app.desktop"
37 dndUri: "file:///usr/share/applications/messaging-app.desktop"
38− metadata: ""
38+ metadata: "subscope:applications.scope/applications-non-click.scope"
39 }
39 }
40 ListElement {
40 ListElement {
41− uri: "application:///usr/share/applications/address-book-app.desktop"
41+ uri: "application://address-book-app.desktop"
42 icon: "../../graphics/applicationIcons/contacts-app.png"
42 icon: "../../graphics/applicationIcons/contacts-app.png"
43 category: 0
43 category: 0
44 mimetype: "application/x-desktop"
44 mimetype: "application/x-desktop"
45 title: "Contacts"
45 title: "Contacts"
46 comment: ""
46 comment: ""
47 dndUri: "file:///usr/share/applications/address-book-app.desktop"
47 dndUri: "file:///usr/share/applications/address-book-app.desktop"
48− metadata: ""
48+ metadata: "subscope:applications.scope/applications-non-click.scope"
49 }
49 }
50 ListElement {
50 ListElement {
51− uri: "application:///usr/share/applications/camera-app.desktop"
51+ uri: "application://camera-app.desktop"
52 icon: "../../graphics/applicationIcons/camera.png"
52 icon: "../../graphics/applicationIcons/camera.png"
53 category: 0
53 category: 0
54 mimetype: "application/x-desktop"
54 mimetype: "application/x-desktop"
55 title: "Camera"
55 title: "Camera"
56 comment: ""
56 comment: ""
57 dndUri: "file:///usr/share/applications/camera-app.desktop"
57 dndUri: "file:///usr/share/applications/camera-app.desktop"
58− metadata: ""
58+ metadata: "subscope:applications.scope/applications-non-click.scope"
59 }
59 }
60 ListElement {
60 ListElement {
61− uri: "application:///usr/share/applications/gallery-app.desktop"
61+ uri: "application://gallery-app.desktop"
62 icon: "../../graphics/applicationIcons/gallery.png"
62 icon: "../../graphics/applicationIcons/gallery.png"
63 category: 0
63 category: 0
64 mimetype: "application/x-desktop"
64 mimetype: "application/x-desktop"
65 title: "Gallery"
65 title: "Gallery"
66 comment: ""
66 comment: ""
67 dndUri: "file:///usr/share/applications/gallery.desktop"
67 dndUri: "file:///usr/share/applications/gallery.desktop"
68− metadata: ""
68+ metadata: "subscope:applications.scope/applications-non-click.scope"
69 }
69 }
70 ListElement {
70 ListElement {
71 uri: "appid://com.ubuntu.developer.webapps.webapp-facebook/webapp-facebook/current-user-version"
71 uri: "appid://com.ubuntu.developer.webapps.webapp-facebook/webapp-facebook/current-user-version"
@@ -75,17 +75,17 @@ ListModel {
75 title: "Facebook"
75 title: "Facebook"
76 comment: ""
76 comment: ""
77 dndUri: "appid://com.ubuntu.developer.webapps.webapp-facebook/webapp-facebook/current-user-version"
77 dndUri: "appid://com.ubuntu.developer.webapps.webapp-facebook/webapp-facebook/current-user-version"
78− metadata: ""
78+ metadata: "subscope:applications.scope/applications-click.scope?app_id=com.ubuntu.developer.webapps.webapp-facebook"
79 }
79 }
80 ListElement {
80 ListElement {
81− uri: "application:///usr/share/applications/webbrowser-app.desktop"
81+ uri: "application://webbrowser-app.desktop"
82 icon: "../../graphics/applicationIcons/browser.png"
82 icon: "../../graphics/applicationIcons/browser.png"
83 category: 0
83 category: 0
84 mimetype: "application/x-desktop"
84 mimetype: "application/x-desktop"
85 title: "Browser"
85 title: "Browser"
86 comment: ""
86 comment: ""
87 dndUri: "file:///usr/share/applications/webbrowser-app.desktop"
87 dndUri: "file:///usr/share/applications/webbrowser-app.desktop"
88− metadata: ""
88+ metadata: "subscope:applications.scope/applications-non-click.scope"
89 }
89 }
90 ListElement {
90 ListElement {
91 uri: "appid://com.ubuntu.developer.webapps.webapp-gmail/webapp-gmail/current-user-version"
91 uri: "appid://com.ubuntu.developer.webapps.webapp-gmail/webapp-gmail/current-user-version"
@@ -95,16 +95,16 @@ ListModel {
95 title: "GMail"
95 title: "GMail"
96 comment: ""
96 comment: ""
97 dndUri: "appid://com.ubuntu.developer.webapps.webapp-gmail/webapp-gmail/current-user-version"
97 dndUri: "appid://com.ubuntu.developer.webapps.webapp-gmail/webapp-gmail/current-user-version"
98− metadata: ""
98+ metadata: "subscope:applications.scope/applications-click.scope?app_id=com.ubuntu.developer.webapps.webapp-gmail"
99 }
99 }
100 ListElement {
100 ListElement {
101− uri: "application:///usr/share/applications/ubuntu-system-settings.desktop"
101+ uri: "application://ubuntu-system-settings.desktop"
102 icon: "../../graphics/applicationIcons/system-settings.png"
102 icon: "../../graphics/applicationIcons/system-settings.png"
103 category: 0
103 category: 0
104 mimetype: "application/x-desktop"
104 mimetype: "application/x-desktop"
105 title: "System Settings"
105 title: "System Settings"
106 comment: ""
106 comment: ""
107 dndUri: "file:///usr/share/applications/ubuntu-system-settings.desktop"
107 dndUri: "file:///usr/share/applications/ubuntu-system-settings.desktop"
108− metadata: ""
108+ metadata: "subscope:applications.scope/applications-non-click.scope"
109 }
109 }
110}
110}
Dash/DashPreview.qml+8
@@ -22,6 +22,7 @@ Item {
22
22
23 property int keyboardSize: Qt.inputMethod.visible ? Qt.inputMethod.keyboardRectangle.height : 0
23 property int keyboardSize: Qt.inputMethod.visible ? Qt.inputMethod.keyboardRectangle.height : 0
24 property var previewData
24 property var previewData
25+ property alias showProcessingAction: waitingForActionMouseArea.enabled
25
26
26 property real previewWidthRatio: 0.5
27 property real previewWidthRatio: 0.5
27
28
@@ -194,4 +195,11 @@ Item {
194 }
195 }
195 sourceComponent: root.header
196 sourceComponent: root.header
196 }
197 }
198+
199+ MouseArea {
200+ id: waitingForActionMouseArea
201+ objectName: "waitingForActionMouseArea"
202+ anchors.fill: parent
203+ enabled: false
204+ }
197}
205}
Dash/Generic/GenericPreview.qml+4−1
@@ -71,7 +71,10 @@ DashPreview {
71 text: modelData.displayName
71 text: modelData.displayName
72 iconSource: modelData.iconHint
72 iconSource: modelData.iconHint
73 iconPosition: "right"
73 iconPosition: "right"
74+ onClicked: {
74− onClicked: previewData.execute(modelData.id, { })
75+ previewData.execute(modelData.id, { })
76+ genericPreview.showProcessingAction = true;
77+ }
75 }
78 }
76 }
79 }
77 }
80 }
Dash/GenericScopeView.qml+7
@@ -59,6 +59,7 @@ ScopeView {
59 target: scopeView.scope
59 target: scopeView.scope
60 onShowDash: previewListView.open = false;
60 onShowDash: previewListView.open = false;
61 onHideDash: previewListView.open = false;
61 onHideDash: previewListView.open = false;
62+ onActivated: previewLoader.closePreviewSpinner();
62 }
63 }
63
64
64 ScopeListView {
65 ScopeListView {
@@ -484,6 +485,12 @@ ScopeView {
484 previewListView.open = false
485 previewListView.open = false
485 }
486 }
486 }
487 }
488+
489+ function closePreviewSpinner() {
490+ if(item) {
491+ item.showProcessingAction = false;
492+ }
493+ }
487 }
494 }
488 }
495 }
489
496
Notifications/Notification.qml+2−1
@@ -34,12 +34,13 @@ UbuntuShape {
34 property var notification
34 property var notification
35
35
36 objectName: "background"
36 objectName: "background"
37− implicitHeight: contentColumn.height + contentColumn.spacing * 2
37+ implicitHeight: type != Notification.PlaceHolder ? contentColumn.height + contentColumn.spacing * 2 : 0
38 color: Qt.rgba(0.132, 0.117, 0.109, 0.97)
38 color: Qt.rgba(0.132, 0.117, 0.109, 0.97)
39 opacity: 0
39 opacity: 0
40 radius: "medium"
40 radius: "medium"
41
41
42 clip: true
42 clip: true
43+ visible: type != Notification.PlaceHolder
43
44
44 UnityMenuModelPaths {
45 UnityMenuModelPaths {
45 id: paths
46 id: paths
debian/changelog+90−2
@@ -1,8 +1,96 @@
1−unity8 (7.83) UNRELEASED; urgency=low
1+unity8 (7.83+13.10.20131016.2-0ubuntu1) saucy; urgency=low
2
2
3+ [ Loïc Minier ]
4+ * Merge ~lool/unity8/drop-setcap-conf. Drop unity8-setcap.conf as this
5+ breaks desktop installs (no boot-hook event is emitted, boot
6+ stalls); add maintscript snippet to rm_conffile on upgrades; this
7+ boot-hook is now shipped under a different name in lxc-android-
8+ config.
9+
10+ [ Michał Sawicz ]
11+ * Ship a camera-app.desktop file and use a custom XDG_DATA_DIRS for
12+ testing.
13+
14+ [ Ubuntu daily release ]
15+ * Automatic snapshot from revision 472
16+
17+ -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Wed, 16 Oct 2013 23:15:48 +0000
18+
19+unity8 (7.83+13.10.20131016.1-0ubuntu1) saucy; urgency=low
20+
21+ [ Diego Sarmentero ]
22+ * Disable Preview interaction until the scope responds.
23+
24+ [ Albert Astals ]
25+ * Hide placeholder notification.
26+
27+ [ Ubuntu daily release ]
28+ * Automatic snapshot from revision 469
29+
30+ -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Wed, 16 Oct 2013 17:29:36 +0000
31+
32+unity8 (7.83+13.10.20131016-0ubuntu1) saucy; urgency=low
33+
34+ [ Loïc Minier ]
35+ * Add upstart job to copy unity8 to a new tmpfs, setcap it, and bind-
36+ mount it back; this is an ugly hack to set CAP_SYS_RESOURCE until we
37+ have a root-helper for it.
38+
39+ [ Michal Hruby ]
40+ * Enable definition of scope back references in overridden results.
41+
42+ [ Ubuntu daily release ]
43+ * Automatic snapshot from revision 466
44+
45+ -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Wed, 16 Oct 2013 11:29:52 +0000
46+
47+unity8 (7.83+13.10.20131015.4-0ubuntu1) saucy; urgency=low
48+
49+ [ Michał Sawicz ]
3 * Replace ubuntu-touch-session's unity8.conf upstart job.
50 * Replace ubuntu-touch-session's unity8.conf upstart job.
51+ * Revert r440 that made the dash collapse animation worse, rather than
52+ better.
53+
54+ [ om26er@ubuntu.com ]
55+ * close the app only when the close button is tapped, not the entire
56+ thumbnail
57+
58+ [ Nick Dedekind ]
59+ * Added missing Unity.Indicator mock objects causing qmltests to fail.
60+ Approved by: Michał Sawicz.
61+
62+ [ Christopher Lee ]
63+ * Launch unity8 for autopilot with upstart, and bring unity8 session
64+ over from session-manager-touch.
65+
66+ [ Pawel Stolowski ]
67+ * Temporarily disable category_order changed signal handling.
68+
69+ [ Daniel d'Andrada ]
70+ * OSKController area shouldn't cover the indicators' bar Since ubuntu-
71+ keyboard surface area doesn't cover the indicators' bar,
72+ OSKController should follow suit. Otherwise the OSKContoller's
73+ internal InputFilterArea (and others) wouldn't perfectly overlap the
74+ graphical keyboard rendered by ubuntu-keyboard (i.e. the opaque part
75+ of ubuntu-keyboard's surface).
76+
77+ [ Michael Zanetti ]
78+ * Initialize initialHeight/Width to height/width depending on scaleTo
79+ add checks for initialWidth/Height in the tests change sizes in
80+ tests to something else than the default for initialWidth/Height in
81+ order to catch failures there more easily
82+
83+ [ Omer Akram ]
84+ * Only show search indicator while the Dash is focued.
85+ * Add 2dp left margin for music and video tiles' title.
86+
87+ [ Nicolas d'Offay ]
88+ * Changed Infographics to use Ubuntu font.
89+
90+ [ Ubuntu daily release ]
91+ * Automatic snapshot from revision 463
4
92
5− -- Michał Sawicz <michal.sawicz@canonical.com> Tue, 15 Oct 2013 01:12:45 +0200
93+ -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Tue, 15 Oct 2013 11:05:04 +0000
6
94
7unity8 (7.82+13.10.20131011.2-0ubuntu1) saucy; urgency=low
95unity8 (7.82+13.10.20131011.2-0ubuntu1) saucy; urgency=low
8
96
debian/control+2
@@ -78,6 +78,8 @@ Depends: gsettings-desktop-schemas,
78 unity8-fake-env | qtubuntu-shell,
78 unity8-fake-env | qtubuntu-shell,
79 unity8-private (= ${binary:Version}),
79 unity8-private (= ${binary:Version}),
80 unity8-private | unity-launcher-impl,
80 unity8-private | unity-launcher-impl,
81+# for setcap:
82+ libcap2-bin,
81 ${misc:Depends},
83 ${misc:Depends},
82 ${shlibs:Depends},
84 ${shlibs:Depends},
83Recommends: ${unity-default-masterscopes},
85Recommends: ${unity-default-masterscopes},
debian/unity8-fake-env.install+1
@@ -1 +1,2 @@
1usr/lib/*/unity8/qml/mocks
1usr/lib/*/unity8/qml/mocks
2+usr/share/unity8/mocks
debian/unity8.maintscriptnew file+1
@@ -0,0 +1 @@
1+rm_conffile /etc/init/boot-hooks/unity8-setcap.conf
plugins/Unity/scope.cpp+10−1
@@ -28,6 +28,7 @@
28
28
29// Qt
29// Qt
30#include <QUrl>
30#include <QUrl>
31+#include <QUrlQuery>
31#include <QDebug>
32#include <QDebug>
32#include <QtGui/QDesktopServices>
33#include <QtGui/QDesktopServices>
33#include <QQmlEngine>
34#include <QQmlEngine>
@@ -203,7 +204,13 @@ void Scope::preview(const QVariant &uri, const QVariant &icon_hint, const QVaria
203 const QVariant &result_type, const QVariant &mimetype, const QVariant &title,
204 const QVariant &result_type, const QVariant &mimetype, const QVariant &title,
204 const QVariant &comment, const QVariant &dnd_uri, const QVariant &metadata)
205 const QVariant &comment, const QVariant &dnd_uri, const QVariant &metadata)
205{
206{
207+ QVariant real_metadata(metadata);
208+ // handle overridden results, since QML doesn't support defining maps
209+ if (metadata.type() == QVariant::String) {
210+ real_metadata = QVariant::fromValue(subscopeUriToMetadataHash(metadata.toString()));
211+ }
212+
206− auto res = createLocalResult(uri, icon_hint, category, result_type, mimetype, title, comment, dnd_uri, metadata);
213+ auto res = createLocalResult(uri, icon_hint, category, result_type, mimetype, title, comment, dnd_uri, real_metadata);
207 m_previewCancellable.Renew();
214 m_previewCancellable.Renew();
208
215
209 // canned queries don't have previews, must be activated
216 // canned queries don't have previews, must be activated
@@ -221,6 +228,7 @@ void Scope::cancelActivation()
221
228
222void Scope::onActivated(unity::dash::LocalResult const& result, unity::dash::ScopeHandledType type, unity::glib::HintsMap const& hints)
229void Scope::onActivated(unity::dash::LocalResult const& result, unity::dash::ScopeHandledType type, unity::glib::HintsMap const& hints)
223{
230{
231+ Q_EMIT activated();
224 // note: we will not get called on SHOW_PREVIEW, instead UnityCore will signal preview_ready.
232 // note: we will not get called on SHOW_PREVIEW, instead UnityCore will signal preview_ready.
225 switch (type)
233 switch (type)
226 {
234 {
@@ -254,6 +262,7 @@ void Scope::onActivated(unity::dash::LocalResult const& result, unity::dash::Sco
254
262
255void Scope::onPreviewReady(unity::dash::LocalResult const& /* result */, unity::dash::Preview::Ptr const& preview)
263void Scope::onPreviewReady(unity::dash::LocalResult const& /* result */, unity::dash::Preview::Ptr const& preview)
256{
264{
265+ Q_EMIT activated();
257 auto prv = Preview::newFromUnityPreview(preview);
266 auto prv = Preview::newFromUnityPreview(preview);
258 // is this the best solution? QML may need to keep more than one preview instance around, so we can't own it.
267 // is this the best solution? QML may need to keep more than one preview instance around, so we can't own it.
259 // passing it by value is not possible.
268 // passing it by value is not possible.
plugins/Unity/scope.h+1
@@ -117,6 +117,7 @@ Q_SIGNALS:
117 void showDash();
117 void showDash();
118 void hideDash();
118 void hideDash();
119 void gotoUri(const QString &uri);
119 void gotoUri(const QString &uri);
120+ void activated();
120
121
121 void activateApplication(const QString &desktop);
122 void activateApplication(const QString &desktop);
122
123
plugins/Unity/variantutils.cpp+31
@@ -17,6 +17,10 @@
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
18 */
19
19
20+#include <QUrl>
21+#include <QUrlQuery>
22+#include <QStringList>
23+
20#include <deelistmodel.h>
24#include <deelistmodel.h>
21#include "variantutils.h"
25#include "variantutils.h"
22
26
@@ -49,3 +53,30 @@ QVariantHash convertToQVariantHash(const unity::glib::HintsMap& var)
49 }
53 }
50 return hash;
54 return hash;
51}
55}
56+
57+/* This will translate uris in the form of:
58+ * "subscope:master.scope/sub.scope?foo=bar"
59+ * into a QVariantHash that can be passed as a metadata field to scope.
60+ */
61+QVariantHash subscopeUriToMetadataHash(const QString &metadata_string)
62+{
63+ QUrl metadata_url(metadata_string);
64+ if (metadata_url.scheme() == QLatin1String("subscope")) {
65+ QString subscope_uri(metadata_url.toString(QUrl::RemoveScheme | QUrl::RemoveQuery));
66+ QVariantHash new_metadata;
67+ QUrlQuery query(metadata_url.query());
68+ QList<QPair<QString,QString>> queryItems(query.queryItems());
69+ for (auto it = queryItems.begin(); it != queryItems.end(); ++it) {
70+ new_metadata[it->first] = QVariant::fromValue(it->second);
71+ }
72+ QStringList parts(subscope_uri.split(QChar('/')));
73+ for (int i = parts.size() - 1; i >= 0; i--) {
74+ QVariantHash inner;
75+ inner["scope-id"] = QVariant::fromValue(parts[i]);
76+ inner["content"] = QVariant::fromValue(new_metadata);
77+ new_metadata = inner;
78+ }
79+ return new_metadata;
80+ }
81+ return QVariantHash();
82+}
plugins/Unity/variantutils.h+3−1
@@ -28,6 +28,8 @@
28
28
29unity::glib::HintsMap convertToHintsMap(const QHash<QString, QVariant> &val);
29unity::glib::HintsMap convertToHintsMap(const QHash<QString, QVariant> &val);
30unity::glib::HintsMap convertToHintsMap(const QVariant &var);
30unity::glib::HintsMap convertToHintsMap(const QVariant &var);
31−QVariantHash convertToQVariantHash(const unity::glib::HintsMap& var);
31+QVariantHash convertToQVariantHash(const unity::glib::HintsMap &var);
32+/* used in tests, so we have to export it */
33+Q_DECL_EXPORT QVariantHash subscopeUriToMetadataHash(const QString &metadata_string);
32
34
33#endif
35#endif
po/ar.po+33−44
@@ -8,7 +8,7 @@ msgstr ""
8"Project-Id-Version: unity\n"
8"Project-Id-Version: unity\n"
9"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
9"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
10"POT-Creation-Date: 2013-10-11 12:12+0200\n"
10"POT-Creation-Date: 2013-10-11 12:12+0200\n"
11−"PO-Revision-Date: 2013-06-26 23:26+0000\n"
11+"PO-Revision-Date: 2013-10-20 19:41+0000\n"
12"Last-Translator: Ibrahim Saed <ibraheem5000@gmail.com>\n"
12"Last-Translator: Ibrahim Saed <ibraheem5000@gmail.com>\n"
13"Language-Team: Arabic <ar@li.org>\n"
13"Language-Team: Arabic <ar@li.org>\n"
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
@@ -16,8 +16,8 @@ msgstr ""
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n % 100 >= "
17"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n % 100 >= "
18"3 && n % 100 <= 10 ? 3 : n % 100 >= 11 && n % 100 <= 99 ? 4 : 5;\n"
18"3 && n % 100 <= 10 ? 3 : n % 100 >= 11 && n % 100 <= 99 ? 4 : 5;\n"
19−"X-Launchpad-Export-Date: 2013-10-13 05:43+0000\n"
19+"X-Launchpad-Export-Date: 2013-10-21 05:04+0000\n"
20−"X-Generator: Launchpad (build 16799)\n"
20+"X-Generator: Launchpad (build 16807)\n"
21
21
22#: Applications/applications.js:23
22#: Applications/applications.js:23
23msgid "Phone"
23msgid "Phone"
@@ -65,7 +65,7 @@ msgstr "مشغّل الوسائط"
65
65
66#: Applications/applications.js:86
66#: Applications/applications.js:86
67msgid "Evernote"
67msgid "Evernote"
68−msgstr ""
68+msgstr "Evernote"
69
69
70#: Applications/applications.js:91
70#: Applications/applications.js:91
71msgid "Map"
71msgid "Map"
@@ -73,11 +73,11 @@ msgstr "الخريطة"
73
73
74#: Applications/applications.js:96
74#: Applications/applications.js:96
75msgid "Pinterest"
75msgid "Pinterest"
76−msgstr ""
76+msgstr "Pinterest"
77
77
78#: Applications/applications.js:101
78#: Applications/applications.js:101
79msgid "SoundCloud"
79msgid "SoundCloud"
80−msgstr ""
80+msgstr "SoundCloud"
81
81
82#: Applications/applications.js:106
82#: Applications/applications.js:106
83msgid "Wikipedia"
83msgid "Wikipedia"
@@ -89,49 +89,52 @@ msgstr "يوتيوب"
89
89
90#: Components/EdgeDemoOverlay.qml:149
90#: Components/EdgeDemoOverlay.qml:149
91msgid "Skip intro"
91msgid "Skip intro"
92−msgstr ""
92+msgstr "تخطي المقدمة"
93
93
94#: Components/EdgeDemo.qml:112
94#: Components/EdgeDemo.qml:112
95msgid "Right edge"
95msgid "Right edge"
96−msgstr ""
96+msgstr "الحافة اليمنى"
97
97
98#: Components/EdgeDemo.qml:113
98#: Components/EdgeDemo.qml:113
99msgid "Try swiping from the right edge to unlock the phone"
99msgid "Try swiping from the right edge to unlock the phone"
100−msgstr ""
100+msgstr "اسحب اصبعك من الحافة اليمنى لفتح قفل الهاتف"
101
101
102#: Components/EdgeDemo.qml:144
102#: Components/EdgeDemo.qml:144
103msgid "Top edge"
103msgid "Top edge"
104−msgstr ""
104+msgstr "الحافة العلوية"
105
105
106#: Components/EdgeDemo.qml:145
106#: Components/EdgeDemo.qml:145
107msgid "Try swiping from the top edge to access the indicators"
107msgid "Try swiping from the top edge to access the indicators"
108−msgstr ""
108+msgstr "اسحب اصبعك من الحافة العلوية للوصول إلى المؤشرات"
109
109
110#: Components/EdgeDemo.qml:170
110#: Components/EdgeDemo.qml:170
111msgid "Close"
111msgid "Close"
112−msgstr ""
112+msgstr "أغلق"
113
113
114#: Components/EdgeDemo.qml:171
114#: Components/EdgeDemo.qml:171
115msgid "Swipe up again to close the settings screen"
115msgid "Swipe up again to close the settings screen"
116−msgstr ""
116+msgstr "اسحب اصعبك لأعلى مرة أخرى لغلق شاشة الإعدادات"
117
117
118#: Components/EdgeDemo.qml:198
118#: Components/EdgeDemo.qml:198
119msgid "Left edge"
119msgid "Left edge"
120−msgstr ""
120+msgstr "الحافة اليسرى"
121
121
122#: Components/EdgeDemo.qml:199
122#: Components/EdgeDemo.qml:199
123msgid "Swipe from the left to reveal the launcher for quick access to apps"
123msgid "Swipe from the left to reveal the launcher for quick access to apps"
124msgstr ""
124msgstr ""
125+"اسحب أصبعك من الحافة اليسرى لإظهار شريط يونتي للوصول السريع للتطبيقات"
125
126
126#: Components/EdgeDemo.qml:226
127#: Components/EdgeDemo.qml:226
127msgid "Well done"
128msgid "Well done"
128−msgstr ""
129+msgstr "أحسنت!"
129
130
130#: Components/EdgeDemo.qml:227
131#: Components/EdgeDemo.qml:227
131msgid ""
132msgid ""
132"You have now mastered the edge gestures and can start using the "
133"You have now mastered the edge gestures and can start using the "
133"phone<br><br>Tap anywhere to start"
134"phone<br><br>Tap anywhere to start"
134msgstr ""
135msgstr ""
136+"لقد أتقنت الآن إيماءات الحواف ويمكنك البدء باستخدام الهاتف<br><br>انقر في أي "
137+"مكان للبدء"
135
138
136#: Components/PageHeader.qml:341
139#: Components/PageHeader.qml:341
137msgid "Recent searches"
140msgid "Recent searches"
@@ -142,7 +145,7 @@ msgstr "عمليات البحث الأخيرة"
142#: Dash/Apps/AppInfo.qml:73 Dash/Previews/Header.qml:93
145#: Dash/Apps/AppInfo.qml:73 Dash/Previews/Header.qml:93
143#, qt-format
146#, qt-format
144msgid "(%1)"
147msgid "(%1)"
145−msgstr ""
148+msgstr "(%1)"
146
149
147#. TRANSLATORS: Number of persons who wrote reviews for this app
150#. TRANSLATORS: Number of persons who wrote reviews for this app
148#. TRANSLATORS: Number of persons who wrote reviews for this app/video/whatever
151#. TRANSLATORS: Number of persons who wrote reviews for this app/video/whatever
@@ -150,32 +153,36 @@ msgstr ""
150#, qt-format
153#, qt-format
151msgid "%1 review"
154msgid "%1 review"
152msgid_plural "%1 reviews"
155msgid_plural "%1 reviews"
153−msgstr[0] ""
156+msgstr[0] "لا تعليقات (%1)"
157+msgstr[1] "تعليق واحد (%1)"
158+msgstr[2] "تعليقان (%1)"
154−msgstr[1] ""
159+msgstr[3] "%1 تعليقات"
160+msgstr[4] "%1 تعليقا"
161+msgstr[5] "%1 تعليق"
155
162
156#: Dash/Apps/AppPreview.qml:126
163#: Dash/Apps/AppPreview.qml:126
157msgid "Rate this"
164msgid "Rate this"
158−msgstr ""
165+msgstr "قيّم ذلك"
159
166
160#: Dash/Previews/Reviews.qml:74
167#: Dash/Previews/Reviews.qml:74
161msgid "Add a review"
168msgid "Add a review"
162−msgstr ""
169+msgstr "أضف تعليق"
163
170
164#: Dash/Previews/Reviews.qml:86
171#: Dash/Previews/Reviews.qml:86
165msgid "Review"
172msgid "Review"
166−msgstr ""
173+msgstr "التعليق"
167
174
168#: Dash/Previews/Reviews.qml:121
175#: Dash/Previews/Reviews.qml:121
169msgid "Send"
176msgid "Send"
170−msgstr ""
177+msgstr "أرسل"
171
178
172#: Dash/Previews/Reviews.qml:139
179#: Dash/Previews/Reviews.qml:139
173msgid "Comments:"
180msgid "Comments:"
174−msgstr ""
181+msgstr "التعليقات:"
175
182
176#: Greeter/Lockscreen.qml:142
183#: Greeter/Lockscreen.qml:142
177msgid "Emergency Call"
184msgid "Emergency Call"
178−msgstr ""
185+msgstr "مكالمة طوارئ"
179
186
180#: Greeter/PassphraseLockscreen.qml:59
187#: Greeter/PassphraseLockscreen.qml:59
181#, qt-format
188#, qt-format
@@ -216,27 +223,9 @@ msgstr "عذراً، لا يوجد ما يطابق بحثك."
216
223
217#: plugins/Unity/showallfilteroption.cpp:41
224#: plugins/Unity/showallfilteroption.cpp:41
218msgid "All"
225msgid "All"
219−msgstr ""
226+msgstr "الكل"
220
227
221#: Shell.qml:438
228#: Shell.qml:438
222#, qt-format
229#, qt-format
223msgid "Please enter %1"
230msgid "Please enter %1"
224−msgstr ""
231+msgstr "من فضلك أدخِل %1"
225−
226−#~ msgid "Featured"
227−#~ msgstr "المميز"
228−
229−#~ msgid "Recent"
230−#~ msgstr "الحديث"
231−
232−#~ msgid "New Releases"
233−#~ msgstr "الإصدارات الجديدة"
234−
235−#~ msgid "Music"
236−#~ msgstr "موسيقى"
237−
238−#~ msgid "Popular Online"
239−#~ msgstr "الشائع على الإنترنت"
240−
241−#~ msgid "Videos"
242−#~ msgstr "فيديوهات"
po/de.po+11−28
@@ -8,15 +8,15 @@ msgstr ""
8"Project-Id-Version: unity\n"
8"Project-Id-Version: unity\n"
9"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
9"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
10"POT-Creation-Date: 2013-10-11 12:12+0200\n"
10"POT-Creation-Date: 2013-10-11 12:12+0200\n"
11−"PO-Revision-Date: 2013-10-06 10:57+0000\n"
11+"PO-Revision-Date: 2013-10-18 12:26+0000\n"
12−"Last-Translator: SaGrLand <sg@samuel-greef.de>\n"
12+"Last-Translator: Phillip Sz <Unknown>\n"
13"Language-Team: German <de@li.org>\n"
13"Language-Team: German <de@li.org>\n"
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17"Plural-Forms: nplurals=2; plural=n != 1;\n"
17"Plural-Forms: nplurals=2; plural=n != 1;\n"
18−"X-Launchpad-Export-Date: 2013-10-13 05:43+0000\n"
18+"X-Launchpad-Export-Date: 2013-10-19 05:30+0000\n"
19−"X-Generator: Launchpad (build 16799)\n"
19+"X-Generator: Launchpad (build 16807)\n"
20
20
21#: Applications/applications.js:23
21#: Applications/applications.js:23
22msgid "Phone"
22msgid "Phone"
@@ -96,7 +96,7 @@ msgstr "Rechter Rand"
96
96
97#: Components/EdgeDemo.qml:113
97#: Components/EdgeDemo.qml:113
98msgid "Try swiping from the right edge to unlock the phone"
98msgid "Try swiping from the right edge to unlock the phone"
99−msgstr ""
99+msgstr "Vom rechten Rand her wischen, um das Gerät zu entsperren"
100
100
101#: Components/EdgeDemo.qml:144
101#: Components/EdgeDemo.qml:144
102msgid "Top edge"
102msgid "Top edge"
@@ -104,7 +104,7 @@ msgstr "Oberer Rand"
104
104
105#: Components/EdgeDemo.qml:145
105#: Components/EdgeDemo.qml:145
106msgid "Try swiping from the top edge to access the indicators"
106msgid "Try swiping from the top edge to access the indicators"
107−msgstr ""
107+msgstr "Vom oberen Rand her wischen, um die Statusmeldungen anzuzeigen"
108
108
109#: Components/EdgeDemo.qml:170
109#: Components/EdgeDemo.qml:170
110msgid "Close"
110msgid "Close"
@@ -112,7 +112,7 @@ msgstr "Schließen"
112
112
113#: Components/EdgeDemo.qml:171
113#: Components/EdgeDemo.qml:171
114msgid "Swipe up again to close the settings screen"
114msgid "Swipe up again to close the settings screen"
115−msgstr ""
115+msgstr "Nochmals nach oben wischen, um das Einstellungsmenü zu schließen"
116
116
117#: Components/EdgeDemo.qml:198
117#: Components/EdgeDemo.qml:198
118msgid "Left edge"
118msgid "Left edge"
@@ -121,6 +121,8 @@ msgstr "Linker Rand"
121#: Components/EdgeDemo.qml:199
121#: Components/EdgeDemo.qml:199
122msgid "Swipe from the left to reveal the launcher for quick access to apps"
122msgid "Swipe from the left to reveal the launcher for quick access to apps"
123msgstr ""
123msgstr ""
124+"Von links wischen, um die Seitenleiste für den Anwendungs-Schnellzugriff "
125+"aufzurufen"
124
126
125#: Components/EdgeDemo.qml:226
127#: Components/EdgeDemo.qml:226
126msgid "Well done"
128msgid "Well done"
@@ -131,6 +133,8 @@ msgid ""
131"You have now mastered the edge gestures and can start using the "
133"You have now mastered the edge gestures and can start using the "
132"phone<br><br>Tap anywhere to start"
134"phone<br><br>Tap anywhere to start"
133msgstr ""
135msgstr ""
136+"Sie haben nun die Einführung abgeschlossen und können Ihr Gerät nun "
137+"verwenden<br><br>Antippen um zu starten"
134
138
135#: Components/PageHeader.qml:341
139#: Components/PageHeader.qml:341
136msgid "Recent searches"
140msgid "Recent searches"
@@ -221,24 +225,3 @@ msgstr "Alle"
221#, qt-format
225#, qt-format
222msgid "Please enter %1"
226msgid "Please enter %1"
223msgstr "Bitte geben Sie %1 ein"
227msgstr "Bitte geben Sie %1 ein"
224−
225−#~ msgid "Featured"
226−#~ msgstr "Empfehlungen"
227−
228−#~ msgid "Recent"
229−#~ msgstr "Zuletzt verwendet"
230−
231−#~ msgid "New Releases"
232−#~ msgstr "Neue Veröffentlichungen"
233−
234−#~ msgid "Top Charting"
235−#~ msgstr "Top Tabellenplatz"
236−
237−#~ msgid "Music"
238−#~ msgstr "Musik"
239−
240−#~ msgid "Popular Online"
241−#~ msgstr "Online Beliebt"
242−
243−#~ msgid "Videos"
244−#~ msgstr "Videos"
po/uk.po+6−25
@@ -8,7 +8,7 @@ msgstr ""
8"Project-Id-Version: unity\n"
8"Project-Id-Version: unity\n"
9"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
9"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
10"POT-Creation-Date: 2013-10-11 12:12+0200\n"
10"POT-Creation-Date: 2013-10-11 12:12+0200\n"
11−"PO-Revision-Date: 2013-09-28 07:54+0000\n"
11+"PO-Revision-Date: 2013-10-19 16:44+0000\n"
12"Last-Translator: Yuri Chornoivan <yurchor@gmail.com>\n"
12"Last-Translator: Yuri Chornoivan <yurchor@gmail.com>\n"
13"Language-Team: Ukrainian <uk@li.org>\n"
13"Language-Team: Ukrainian <uk@li.org>\n"
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
@@ -16,8 +16,8 @@ msgstr ""
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
17"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
18"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
18"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
19−"X-Launchpad-Export-Date: 2013-10-13 05:43+0000\n"
19+"X-Launchpad-Export-Date: 2013-10-20 05:20+0000\n"
20−"X-Generator: Launchpad (build 16799)\n"
20+"X-Generator: Launchpad (build 16807)\n"
21
21
22#: Applications/applications.js:23
22#: Applications/applications.js:23
23msgid "Phone"
23msgid "Phone"
@@ -135,6 +135,8 @@ msgid ""
135"You have now mastered the edge gestures and can start using the "
135"You have now mastered the edge gestures and can start using the "
136"phone<br><br>Tap anywhere to start"
136"phone<br><br>Tap anywhere to start"
137msgstr ""
137msgstr ""
138+"Тепер жести налаштовано, ви можете почати користуватися "
139+"телефоном.<br><br>Натисніть у довільному місці екрана."
138
140
139#: Components/PageHeader.qml:341
141#: Components/PageHeader.qml:341
140msgid "Recent searches"
142msgid "Recent searches"
@@ -220,30 +222,9 @@ msgstr "Вибачте, для вказаних вами ключових слі
220
222
221#: plugins/Unity/showallfilteroption.cpp:41
223#: plugins/Unity/showallfilteroption.cpp:41
222msgid "All"
224msgid "All"
223−msgstr ""
225+msgstr "Усе"
224
226
225#: Shell.qml:438
227#: Shell.qml:438
226#, qt-format
228#, qt-format
227msgid "Please enter %1"
229msgid "Please enter %1"
228msgstr "Будь ласка, введіть %1"
230msgstr "Будь ласка, введіть %1"
229−
230−#~ msgid "Featured"
231−#~ msgstr "Рекомендовані"
232−
233−#~ msgid "Recent"
234−#~ msgstr "Нещодавні"
235−
236−#~ msgid "New Releases"
237−#~ msgstr "Нові випуски"
238−
239−#~ msgid "Top Charting"
240−#~ msgstr "З високими оцінками"
241−
242−#~ msgid "Music"
243−#~ msgstr "Музика"
244−
245−#~ msgid "Popular Online"
246−#~ msgstr "Популярне у мережі"
247−
248−#~ msgid "Videos"
249−#~ msgstr "Відео"
tests/autopilot/unity8/__init__.py+46−1
@@ -52,7 +52,11 @@ def get_mocks_library_path():
52 if running_installed_tests():
52 if running_installed_tests():
53 mock_path = "qml/mocks/"
53 mock_path = "qml/mocks/"
54 else:
54 else:
55+ mock_path = os.path.join(
56+ "../lib/",
57+ sysconfig.get_config_var('MULTIARCH'),
55− mock_path = "../lib/x86_64-linux-gnu/unity8/qml/mocks/"
58+ "unity8/qml/mocks/"
59+ )
56 lib_path = get_lib_path()
60 lib_path = get_lib_path()
57 ld_library_path = os.path.abspath(
61 ld_library_path = os.path.abspath(
58 os.path.join(
62 os.path.join(
@@ -84,6 +88,47 @@ def get_binary_path(binary="unity8"):
84 return binary_path
88 return binary_path
85
89
86
90
91+def get_data_dirs():
92+ """Prepend a mock data path to XDG_DATA_DIRS."""
93+ if running_installed_tests():
94+ data_path = "/usr/share/unity8/mocks/data"
95+ else:
96+ data_path = "../../mocks/data"
97+ full_data_path = os.path.abspath(
98+ os.path.join(
99+ os.path.dirname(__file__),
100+ data_path
101+ )
102+ )
103+
104+ if os.path.exists(full_data_path):
105+ xdg_path = _get_xdg_env_path()
106+ if xdg_path is not None:
107+ return "{0}:{1}".format(full_data_path, xdg_path)
108+ else:
109+ return full_data_path
110+ else:
111+ return None
112+
113+
114+def _get_xdg_env_path():
115+ path = os.getenv("XDG_DATA_DIRS")
116+ if path is None:
117+ path = _get_xdg_upstart_env()
118+ return path
119+
120+
121+def _get_xdg_upstart_env():
122+ try:
123+ return subprocess.check_output([
124+ "/sbin/initctl",
125+ "get-env",
126+ "--global",
127+ "XDG_DATA_DIRS"
128+ ]).rstrip()
129+ except subprocess.CalledProcessError:
130+ return None
131+
87def get_grid_size():
132def get_grid_size():
88 grid_size = os.getenv('GRID_UNIT_PX')
133 grid_size = os.getenv('GRID_UNIT_PX')
89 if grid_size is None:
134 if grid_size is None:
tests/autopilot/unity8/shell/tests/__init__.py+8
@@ -41,6 +41,7 @@ from unity8 import (
41 get_binary_path,
41 get_binary_path,
42 get_mocks_library_path,
42 get_mocks_library_path,
43 get_default_extra_mock_libraries,
43 get_default_extra_mock_libraries,
44+ get_data_dirs
44)
45)
45from unity8.shell.emulators import UnityEmulatorBase
46from unity8.shell.emulators import UnityEmulatorBase
46from unity8.shell.emulators.dash import Dash
47from unity8.shell.emulators.dash import Dash
@@ -122,6 +123,8 @@ class UnityTestCase(AutopilotTestCase):
122 self._qml_mock_enabled = True
123 self._qml_mock_enabled = True
123 self._environment = {}
124 self._environment = {}
124
125
126+ self._patch_data_dirs()
127+
125 #### FIXME: This is a work around re: lp:1238417 ####
128 #### FIXME: This is a work around re: lp:1238417 ####
126 if model() != "Desktop":
129 if model() != "Desktop":
127 from autopilot.input import _uinput
130 from autopilot.input import _uinput
@@ -297,6 +300,11 @@ class UnityTestCase(AutopilotTestCase):
297 except subprocess.CalledProcessError:
300 except subprocess.CalledProcessError:
298 logger.warning("Appears unity was already stopped!")
301 logger.warning("Appears unity was already stopped!")
299
302
303+ def _patch_data_dirs(self):
304+ data_dirs = get_data_dirs()
305+ if data_dirs is not None:
306+ self._environment['XDG_DATA_DIRS'] = data_dirs
307+
300 def patch_lightdm_mock(self, mock_type='single'):
308 def patch_lightdm_mock(self, mock_type='single'):
301 self._lightdm_mock_type = mock_type
309 self._lightdm_mock_type = mock_type
302 logger.info("Setting up LightDM mock type '%s'", mock_type)
310 logger.info("Setting up LightDM mock type '%s'", mock_type)
tests/autopilot/unity8/shell/tests/test_notifications.py+10−9
@@ -145,7 +145,7 @@ class InteractiveNotificationBase(NotificationsBase):
145 hints,
145 hints,
146 )
146 )
147
147
148− get_notification = lambda: notify_list.select_single('Notification')
148+ get_notification = lambda: notify_list.select_single('Notification', objectName='notification1')
149 self.assertThat(get_notification, Eventually(NotEquals(None)))
149 self.assertThat(get_notification, Eventually(NotEquals(None)))
150 notification = get_notification()
150 notification = get_notification()
151
151
@@ -191,7 +191,7 @@ class InteractiveNotificationBase(NotificationsBase):
191 hints
191 hints
192 )
192 )
193
193
194− get_notification = lambda: notify_list.select_single('Notification')
194+ get_notification = lambda: notify_list.select_single('Notification', objectName='notification1')
195 self.assertThat(get_notification, Eventually(NotEquals(None)))
195 self.assertThat(get_notification, Eventually(NotEquals(None)))
196 notification = get_notification()
196 notification = get_notification()
197 self._assert_notification(notification, None, None, True, True, 1.0)
197 self._assert_notification(notification, None, None, True, True, 1.0)
@@ -360,7 +360,7 @@ class EphemeralNotificationsTests(NotificationsBase):
360
360
361 notification.show()
361 notification.show()
362
362
363− get_notification = lambda: notify_list.select_single('Notification')
363+ get_notification = lambda: notify_list.select_single('Notification', objectName='notification1')
364 self.assertThat(get_notification, Eventually(NotEquals(None)))
364 self.assertThat(get_notification, Eventually(NotEquals(None)))
365 notification = get_notification()
365 notification = get_notification()
366 self._assert_notification(notification, summary, body, True, True, 1.0)
366 self._assert_notification(notification, summary, body, True, True, 1.0)
@@ -391,7 +391,7 @@ class EphemeralNotificationsTests(NotificationsBase):
391
391
392 notification.show()
392 notification.show()
393
393
394− get_notification = lambda: notify_list.select_single('Notification')
394+ get_notification = lambda: notify_list.select_single('Notification', objectName='notification1')
395 self.assertThat(get_notification, Eventually(NotEquals(None)))
395 self.assertThat(get_notification, Eventually(NotEquals(None)))
396 notification = get_notification()
396 notification = get_notification()
397 self._assert_notification(
397 self._assert_notification(
@@ -508,7 +508,7 @@ class EphemeralNotificationsTests(NotificationsBase):
508 notification = self._create_ephemeral_notification(summary, body)
508 notification = self._create_ephemeral_notification(summary, body)
509 notification.show()
509 notification.show()
510
510
511− get_notification = lambda: notify_list.select_single('Notification')
511+ get_notification = lambda: notify_list.select_single('Notification', objectName='notification1')
512 self.assertThat(get_notification, Eventually(NotEquals(None)))
512 self.assertThat(get_notification, Eventually(NotEquals(None)))
513 notification = get_notification()
513 notification = get_notification()
514 self._assert_notification(
514 self._assert_notification(
@@ -533,7 +533,7 @@ class EphemeralNotificationsTests(NotificationsBase):
533 notification = self._create_ephemeral_notification(summary)
533 notification = self._create_ephemeral_notification(summary)
534 notification.show()
534 notification.show()
535
535
536− get_notification = lambda: notify_list.select_single('Notification')
536+ get_notification = lambda: notify_list.select_single('Notification', objectName='notification1')
537 self.assertThat(get_notification, Eventually(NotEquals(None)))
537 self.assertThat(get_notification, Eventually(NotEquals(None)))
538 notification = get_notification()
538 notification = get_notification()
539
539
@@ -603,7 +603,7 @@ class EphemeralNotificationsTests(NotificationsBase):
603 )
603 )
604 notification.show()
604 notification.show()
605
605
606− get_notification = lambda: notify_list.select_single('Notification')
606+ get_notification = lambda: notify_list.select_single('Notification', objectName='notification1')
607 self.assertThat(get_notification, Eventually(NotEquals(None)))
607 self.assertThat(get_notification, Eventually(NotEquals(None)))
608 self._assert_notification(
608 self._assert_notification(
609 get_notification(),
609 get_notification(),
@@ -645,7 +645,7 @@ class EphemeralNotificationsTests(NotificationsBase):
645
645
646 notification.show()
646 notification.show()
647
647
648− get_notification = lambda: notify_list.select_single('Notification')
648+ get_notification = lambda: notify_list.select_single('Notification', objectName='notification1')
649 self.assertThat(get_notification, Eventually(NotEquals(None)))
649 self.assertThat(get_notification, Eventually(NotEquals(None)))
650 notification = get_notification()
650 notification = get_notification()
651 self._assert_notification(
651 self._assert_notification(
@@ -678,7 +678,8 @@ class EphemeralNotificationsTests(NotificationsBase):
678 )
678 )
679 notification.show()
679 notification.show()
680 get_notification = lambda: notify_list.select_single(
680 get_notification = lambda: notify_list.select_single(
681− 'Notification'
681+ 'Notification',
682+ objectName='notification1'
682 )
683 )
683 self.assertThat(get_notification, Eventually(NotEquals(None)))
684 self.assertThat(get_notification, Eventually(NotEquals(None)))
684 notification = get_notification()
685 notification = get_notification()
tests/mocks/CMakeLists.txt+5
@@ -7,3 +7,8 @@ add_subdirectory(Powerd)
7add_subdirectory(QMenuModel)
7add_subdirectory(QMenuModel)
8add_subdirectory(Ubuntu)
8add_subdirectory(Ubuntu)
9add_subdirectory(Unity)
9add_subdirectory(Unity)
10+
11+install(
12+ DIRECTORY data
13+ DESTINATION ${SHELL_APP_DIR}/mocks
14+)
tests/mocks/data/applications/camera-app.desktopnew file

No changes to the content.

tests/plugins/Unity/resultstest.cpp+52
@@ -23,6 +23,7 @@
23
23
24#include "resultstest.h"
24#include "resultstest.h"
25#include "categoryresults.h"
25#include "categoryresults.h"
26+#include "variantutils.h"
26
27
27static DeeModel* createBackendModel()
28static DeeModel* createBackendModel()
28{
29{
@@ -193,4 +194,55 @@ void ResultsTest::testSpecialIcons()
193 QCOMPARE(transformedIcon, result);
194 QCOMPARE(transformedIcon, result);
194}
195}
195
196
197+void ResultsTest::testMetadataOverride_data()
198+{
199+ QTest::addColumn<QString>("uri");
200+ QTest::addColumn<QVariantHash>("result");
201+
202+ QVariantHash expected_result;
203+ QVariantHash inner_hash;
204+
205+ expected_result = QVariantHash();
206+ expected_result["scope-id"] = QVariant::fromValue(QString("applications.scope"));
207+ expected_result["content"] = QVariant::fromValue(QVariantHash());
208+
209+ QTest::newRow("single scope") << "subscope:applications.scope" << expected_result;
210+
211+ expected_result = QVariantHash();
212+ expected_result["scope-id"] = QVariant::fromValue(QString("applications.scope"));
213+ inner_hash = QVariantHash();
214+ inner_hash["foo"] = QVariant::fromValue(QString("bar"));
215+ inner_hash["qoo"] = QVariant::fromValue(QString("baz"));
216+ expected_result["content"] = QVariant::fromValue(inner_hash);
217+
218+ QTest::newRow("single scope with data") << "subscope:applications.scope?foo=bar&qoo=baz" << expected_result;
219+
220+ expected_result = QVariantHash();
221+ inner_hash = QVariantHash();
222+ inner_hash["scope-id"] = QVariant::fromValue(QString("applications-local.scope"));
223+ inner_hash["content"] = QVariant::fromValue(QVariantHash());
224+ expected_result["scope-id"] = QVariant::fromValue(QString("applications.scope"));
225+ expected_result["content"] = QVariant::fromValue(inner_hash);
226+ QTest::newRow("master scope") << "subscope:applications.scope/applications-local.scope" << expected_result;
227+
228+ expected_result = QVariantHash();
229+ expected_result["foo"] = QVariant::fromValue(QString("baz"));
230+ expected_result["qoo"] = QVariant::fromValue(QString("baz"));
231+ inner_hash = QVariantHash();
232+ inner_hash["scope-id"] = QVariant::fromValue(QString("applications-local.scope"));
233+ inner_hash["content"] = QVariant::fromValue(expected_result);
234+ expected_result = QVariantHash();
235+ expected_result["scope-id"] = QVariant::fromValue(QString("applications.scope"));
236+ expected_result["content"] = QVariant::fromValue(inner_hash);
237+ QTest::newRow("nested with data") << "subscope:applications.scope/applications-local.scope?foo=baz&qoo=baz" << expected_result;
238+}
239+
240+void ResultsTest::testMetadataOverride()
241+{
242+ QFETCH(QString, uri);
243+ QFETCH(QVariantHash, result);
244+
245+ QCOMPARE(subscopeUriToMetadataHash(uri), result);
246+}
247+
196QTEST_MAIN(ResultsTest)
248QTEST_MAIN(ResultsTest)
tests/plugins/Unity/resultstest.h+2
@@ -32,6 +32,8 @@ class ResultsTest : public QObject
32 void testIconColumn();
32 void testIconColumn();
33 void testSpecialIcons_data();
33 void testSpecialIcons_data();
34 void testSpecialIcons();
34 void testSpecialIcons();
35+ void testMetadataOverride_data();
36+ void testMetadataOverride();
35};
37};
36
38
37#endif
39#endif
tests/qmltests/Dash/Apps/tst_AppPreview.qml+3−2
@@ -137,11 +137,12 @@ Item {
137 for(var i = 0; i < buttons.count; i++) {
137 for(var i = 0; i < buttons.count; i++) {
138 var button = findChild(appPreview, "button" + i);
138 var button = findChild(appPreview, "button" + i);
139 mouseClick(button, 1, 1);
139 mouseClick(button, 1, 1);
140+ appPreview.showProcessingAction = false;
140 }
141 }
141
142
142 var actions = data.actions;
143 var actions = data.actions;
143− for(var i = 0; i < actions.length; i++) {
144+ for(var j = 0; j < actions.length; j++) {
144− compare(root.calls[i][0], actions[i].id, "Id of action not found.");
145+ compare(root.calls[j][0], actions[j].id, "Id of action not found.");
145 }
146 }
146 }
147 }
147
148
tests/qmltests/Dash/Movie/tst_MoviePreview.qml+1
@@ -74,6 +74,7 @@ Item {
74 for(var i = 0; i < buttons.count; i++) {
74 for(var i = 0; i < buttons.count; i++) {
75 var button = findChild(moviePreview, "button" + i);
75 var button = findChild(moviePreview, "button" + i);
76 mouseClick(button, 1, 1);
76 mouseClick(button, 1, 1);
77+ moviePreview.showProcessingAction = false;
77 }
78 }
78
79
79 var actions = get_actions_data();
80 var actions = get_actions_data();
tests/qmltests/Dash/tst_GenericPreview.qml+1
@@ -76,6 +76,7 @@ Item {
76 for(var i = 0; i < buttons.count; i++) {
76 for(var i = 0; i < buttons.count; i++) {
77 var button = findChild(genericPreview, "button" + i);
77 var button = findChild(genericPreview, "button" + i);
78 mouseClick(button, 1, 1);
78 mouseClick(button, 1, 1);
79+ genericPreview.showProcessingAction = false;
79 }
80 }
80
81
81 var actions = get_actions_data();
82 var actions = get_actions_data();
tests/qmltests/Dash/tst_GenericScopeView.qml+11
@@ -66,6 +66,17 @@ Item {
66 scopes.get(0).hideDash();
66 scopes.get(0).hideDash();
67 tryCompare(genericScopeView, "previewShown", false);
67 tryCompare(genericScopeView, "previewShown", false);
68 }
68 }
69+
70+ function test_show_spinner() {
71+ var previewLoader = findChild(genericScopeView, "previewLoader");
72+ previewLoader.open = true;
73+ previewLoader.source = "../../../Dash/Generic/GenericPreview.qml";
74+ previewLoader.item.showProcessingAction = true;
75+ var waitingForAction = findChild(genericScopeView, "waitingForActionMouseArea");
76+ tryCompare(waitingForAction, "enabled", true);
77+ previewLoader.closePreviewSpinner();
78+ tryCompare(waitingForAction, "enabled", false);
79+ }
69 }
80 }
70 }
81 }
71}
82}