Merge lp://staging/~abreu-alexandre/unity-webapps-qml/location-specific-homepage into lp://staging/unity-webapps-qml

Proposed by Alexandre Abreu
Status: Work in progress
Proposed branch: lp://staging/~abreu-alexandre/unity-webapps-qml/location-specific-homepage
Merge into: lp://staging/unity-webapps-qml
Diff against target: 400 lines (+194/-39)
9 files modified
src/Ubuntu/UnityWebApps/plugin/unity-webapps-app-manifest-parser.cpp (+49/-10)
src/Ubuntu/UnityWebApps/plugin/unity-webapps-app-manifest-parser.h (+22/-6)
src/Ubuntu/UnityWebApps/plugin/unity-webapps-app-model.cpp (+14/-2)
tests/unit/test_plugin/data/installed-webapps/unity-webapps-valid/manifest.json (+29/-9)
tests/unit/test_plugin/data/installed-webapps/unity-webapps-with-requires-valid/manifest.json (+29/-9)
tests/unit/test_plugin/data/manifests/valid-manifest-per-country-homepage.json (+17/-0)
tests/unit/test_plugin/test_plugin.pro (+4/-0)
tests/unit/test_plugin/tst_webappsAppModel.cpp (+28/-2)
tests/unit/test_plugin/tst_webappsAppModel.h (+2/-1)
To merge this branch: bzr merge lp://staging/~abreu-alexandre/unity-webapps-qml/location-specific-homepage
Reviewer Review Type Date Requested Status
WebApps Pending
Review via email: mp+284918@code.staging.launchpad.net

Commit message

Homepage as a URL or a per-country url object

Description of the change

Homepage as a URL or a per-country url object

To post a comment you must log in.
Revision history for this message
David Barth (dbarth) wrote :
Download full text (14.6 KiB)

Hmm, I don't get where you choose between countries in that change

On Wed, Feb 3, 2016 at 4:37 PM, Alexandre Abreu <
<email address hidden>> wrote:

> Alexandre Abreu has proposed merging
> lp:~abreu-alexandre/unity-webapps-qml/location-specific-homepage into
> lp:unity-webapps-qml.
>
> Commit message:
> Homepage as a URL or a per-country url object
>
> Requested reviews:
> WebApps (webapps)
> Related bugs:
> Bug #1523464 in webapp-container: "Amazon web app on the launcher in
> 16.04 sends me to .COM instead of .co.uk"
> https://bugs.launchpad.net/webapp-container/+bug/1523464
>
> For more details, see:
>
> https://code.launchpad.net/~abreu-alexandre/unity-webapps-qml/location-specific-homepage/+merge/284918
>
> Homepage as a URL or a per-country url object
> --
> Your team WebApps is requested to review the proposed merge of
> lp:~abreu-alexandre/unity-webapps-qml/location-specific-homepage into
> lp:unity-webapps-qml.
>
> === modified file
> 'src/Ubuntu/UnityWebApps/plugin/unity-webapps-app-manifest-parser.cpp'
> --- src/Ubuntu/UnityWebApps/plugin/unity-webapps-app-manifest-parser.cpp
> 2014-05-14 01:41:14 +0000
> +++ src/Ubuntu/UnityWebApps/plugin/unity-webapps-app-manifest-parser.cpp
> 2016-02-03 15:36:20 +0000
> @@ -1,5 +1,5 @@
> /*
> - * Copyright 2013 Canonical Ltd.
> + * Copyright 2013-2016 Canonical Ltd.
> *
> * This file is part of unity-webapps-qml.
> *
> @@ -16,12 +16,13 @@
> * along with this program. If not, see <http://www.gnu.org/licenses/>.
> */
>
> -#include <QTextStream>
> -#include <QJsonDocument>
> -#include <QJsonObject>
> -#include <QJsonArray>
> -#include <QJsonValue>
> -#include <QDebug>
> +#include <QtCore/QDebug>
> +#include <QtCore/QJsonDocument>
> +#include <QtCore/QJsonObject>
> +#include <QtCore/QJsonArray>
> +#include <QtCore/QJsonValue>
> +#include <QtCore/QTextStream>
> +#include <QtCore/QVariantMap>
>
> #include "unity-webapps-app-manifest-parser.h"
>
> @@ -62,6 +63,33 @@
> return ManifestFileInfoOption(infos);
> }
>
> +WebappHomepage UnityWebappsAppManifestParser::extractHomepage(
> + const QJsonValue& o)
> +{
> + WebappHomepage homepage;
> + if (o.isString())
> + {
> + homepage.homepageURI = QUrl::fromUserInput(o.toString());
> + return homepage;
> + }
> +
> + if (o.isObject())
> + {
> + QVariantMap vm = o.toVariant().toMap();
> + Q_FOREACH(const QString& k, vm.keys())
> + {
> + if (vm[k].canConvert(QVariant::String))
> + {
> + homepage.homepagePerCountry[k.toLower()] =
> + QUrl::fromUserInput(vm[k].toString());
> + }
> + }
> + return homepage;
> + }
> +
> + return homepage;
> +}
> +
> bool UnityWebappsAppManifestParser::parseWebappDeclaration(const
> QJsonObject& json,
>
> ManifestFileInfo * infos)
> {
> @@ -70,20 +98,31 @@
> if ( !json.contains(QLatin1String(property)) \
> || !json.value(QLatin1String(property)).predicate()) \
> { \
> - qDebug() << "Invalid webapp webapp definition:" << property
> << "not found or fails predicate" << #predicate; \
> + qDebu...

Unmerged revisions

155. By Alexandre Abreu

Homepage as a URL or a per-country url object

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: