on xenial help sign in
Merge from trunk
b751906Michael Terry
debian/changelog+8
@@ -4,6 +4,14 @@ unity8 (7.87+14.10.20140505-0ubuntu1) UNRELEASED; urgency=medium
4
4
5 -- Michael Terry <mterry@ubuntu.com> Wed, 02 Apr 2014 14:39:45 -0400
5 -- Michael Terry <mterry@ubuntu.com> Wed, 02 Apr 2014 14:39:45 -0400
6
6
7+unity8 (7.86+14.10.20140514.1-0ubuntu1) utopic; urgency=low
8+
9+ [ Antti Kaijanmäki ]
10+ * Indicators/RootActionState: use g_variant_iter_loop to extract
11+ icons.
12+
13+ -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Wed, 14 May 2014 11:43:55 +0000
14+
7unity8 (7.86+14.10.20140513-0ubuntu1) utopic; urgency=low
15unity8 (7.86+14.10.20140513-0ubuntu1) utopic; urgency=low
8
16
9 [ Andrea Cimitan ]
17 [ Andrea Cimitan ]
plugins/Unity/Indicators/rootactionstate.cpp+7−8
@@ -240,19 +240,18 @@ QVariant RootActionState::toQVariant(GVariant* state) const
240
240
241 QStringList icons;
241 QStringList icons;
242
242
243− if (g_variant_type_is_array(g_variant_get_type(vvalue))) {
243+ if (g_variant_is_of_type(vvalue, G_VARIANT_TYPE("av"))) {
244−
244+ GVariantIter iter;
245−
245+ GVariant *val = 0;
246− for (int i = 0, iMax = g_variant_n_children(vvalue); i < iMax; i++) {
246+ g_variant_iter_init (&iter, vvalue);
247− GVariant *child = g_variant_get_child_value(vvalue, i);
247+ while (g_variant_iter_loop (&iter, "v", &val))
248−
248+ {
249 // FIXME - should be sending a url.
249 // FIXME - should be sending a url.
250− GIcon *gicon = g_icon_deserialize (child);
250+ GIcon *gicon = g_icon_deserialize (val);
251 if (gicon) {
251 if (gicon) {
252 icons << iconUri(gicon);
252 icons << iconUri(gicon);
253 g_object_unref (gicon);
253 g_object_unref (gicon);
254 }
254 }
255− g_variant_unref(child);
256 }
255 }
257 }
256 }
258 // will overwrite icon.
257 // will overwrite icon.
po/ca.po+9−9
@@ -8,14 +8,14 @@ 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: 2014-04-10 11:13-0400\n"
10"POT-Creation-Date: 2014-04-10 11:13-0400\n"
11−"PO-Revision-Date: 2014-01-10 07:45+0000\n"
11+"PO-Revision-Date: 2014-05-14 08:15+0000\n"
12"Last-Translator: Adolfo Jayme <fitoschido@gmail.com>\n"
12"Last-Translator: Adolfo Jayme <fitoschido@gmail.com>\n"
13"Language-Team: Catalan <ca@li.org>\n"
13"Language-Team: Catalan <ca@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−"X-Launchpad-Export-Date: 2014-05-01 06:43+0000\n"
17+"X-Launchpad-Export-Date: 2014-05-15 06:15+0000\n"
18−"X-Generator: Launchpad (build 16985)\n"
18+"X-Generator: Launchpad (build 17007)\n"
19
19
20#: plugins/Unity/Launcher/launcheritem.cpp:43
20#: plugins/Unity/Launcher/launcheritem.cpp:43
21#: plugins/Unity/Launcher/launcheritem.cpp:73
21#: plugins/Unity/Launcher/launcheritem.cpp:73
@@ -84,11 +84,11 @@ msgstr "Cerques recents"
84
84
85#: qml/Components/SeeMore.qml:35
85#: qml/Components/SeeMore.qml:35
86msgid "See more"
86msgid "See more"
87−msgstr ""
87+msgstr "Mostra'n més"
88
88
89#: qml/Components/SeeMore.qml:58
89#: qml/Components/SeeMore.qml:58
90msgid "See less"
90msgid "See less"
91−msgstr ""
91+msgstr "Mostra'n menys"
92
92
93#: qml/Dash/DashApps.qml:37
93#: qml/Dash/DashApps.qml:37
94msgid "Recent"
94msgid "Recent"
@@ -97,15 +97,15 @@ msgstr ""
97#: qml/Dash/PreviewListView.qml:52
97#: qml/Dash/PreviewListView.qml:52
98#, qt-format
98#, qt-format
99msgid "%1 Preview"
99msgid "%1 Preview"
100−msgstr ""
100+msgstr "Previsualització de %1"
101
101
102#: qml/Dash/Previews/PreviewActionCombo.qml:34
102#: qml/Dash/Previews/PreviewActionCombo.qml:34
103msgid "More..."
103msgid "More..."
104−msgstr ""
104+msgstr "Més..."
105
105
106#: qml/Dash/Previews/PreviewActionCombo.qml:34
106#: qml/Dash/Previews/PreviewActionCombo.qml:34
107msgid "Less..."
107msgid "Less..."
108−msgstr ""
108+msgstr "Menys..."
109
109
110#: qml/Dash/Previews/PreviewRatingInput.qml:81
110#: qml/Dash/Previews/PreviewRatingInput.qml:81
111msgid "Rate this"
111msgid "Rate this"
@@ -162,7 +162,7 @@ msgstr "Mostra la contrasenya"
162
162
163#: qml/Notifications/NotificationMenuItemFactory.qml:103
163#: qml/Notifications/NotificationMenuItemFactory.qml:103
164msgid "Please enter SIM PIN"
164msgid "Please enter SIM PIN"
165−msgstr ""
165+msgstr "Introduïu el PIN de la targeta SIM"
166
166
167#: qml/Panel/SearchIndicator.qml:27
167#: qml/Panel/SearchIndicator.qml:27
168msgid "Search"
168msgid "Search"
tests/plugins/Unity/Indicators/rootactionstatetest.cpp+37
@@ -21,6 +21,7 @@
21
21
22#include <unitymenumodel.h>
22#include <unitymenumodel.h>
23#include <QtTest>
23#include <QtTest>
24+#include <gio/gio.h>
24
25
25class RootActionStateTest : public QObject
26class RootActionStateTest : public QObject
26{
27{
@@ -52,6 +53,42 @@ private Q_SLOTS:
52 QVERIFY(rootState->menu() == NULL);
53 QVERIFY(rootState->menu() == NULL);
53 delete rootState;
54 delete rootState;
54 }
55 }
56+
57+ void testToQVariantIcons()
58+ {
59+ GVariantBuilder builderIcons;
60+ g_variant_builder_init(&builderIcons, G_VARIANT_TYPE("av"));
61+ for (int i = 0; i < 3; i ++) {
62+
63+ GIcon* icon = NULL;
64+ icon = g_icon_new_for_string (QString("testIcon%1").arg(i).toUtf8().constData(), NULL);
65+
66+ g_variant_builder_add(&builderIcons,
67+ "v",
68+ g_icon_serialize (icon));
69+ g_object_unref(icon);
70+ }
71+
72+ GVariantBuilder builderParams;
73+ g_variant_builder_init(&builderParams, G_VARIANT_TYPE_ARRAY);
74+ GVariant* icons = g_variant_builder_end (&builderIcons);
75+ g_variant_ref_sink (icons);
76+ g_variant_builder_add (&builderParams, "{sv}", g_strdup ("icons"), icons, NULL);
77+
78+ GVariant* params = g_variant_builder_end (&builderParams);
79+
80+ RootActionState rootState;
81+ QVariant result = rootState.toQVariant(params);
82+ g_variant_unref(params);
83+
84+ QVariantMap paramResult = result.toMap();
85+ QVERIFY(paramResult.contains("icons"));
86+
87+ QStringList serializedIcons = paramResult["icons"].toStringList();
88+ QVERIFY(serializedIcons[0] == "image://theme/testIcon0");
89+ QVERIFY(serializedIcons[1] == "image://theme/testIcon1");
90+ QVERIFY(serializedIcons[2] == "image://theme/testIcon2");
91+ }
55};
92};
56
93
57QTEST_GUILESS_MAIN(RootActionStateTest)
94QTEST_GUILESS_MAIN(RootActionStateTest)