[-]
[+]
|
Changed |
_service:tar_git:harbour-hafenschau.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-hafenschau.spec
^
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -2,7 +2,7 @@
<service name="tar_git">
<param name="url">https://github.com/black-sheep-dev/harbour-hafenschau.git</param>
<param name="branch">master</param>
- <param name="revision">8cac09e</param>
+ <param name="revision">0.9.6-1</param>
<param name="debian">N</param>
<param name="dumb">N</param>
</service>
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-hafenschau-0.7.3+master.20220522163703.1.g8cac09e.tar.bz2/qml/pages/settings/SettingsCachePage.qml
^
|
@@ -1,53 +0,0 @@
-import QtQuick 2.0
-import Sailfish.Silica 1.0
-
-import org.nubecula.harbour.hafenschau 1.0
-
-Page {
- id: page
-
- allowedOrientations: Orientation.All
-
- SilicaFlickable {
- anchors.fill: parent
-
- contentHeight: column.height
-
- Column {
- id: column
-
- width: page.width
- spacing: Theme.paddingLarge
-
- PageHeader {
- title: qsTr("Cache Settings")
- }
-
- ProgressCircle {
- id: cacheUsage
-
- width: parent.width * 0.5
- height: width
- anchors.horizontalCenter: parent.horizontalCenter
- borderWidth: 0.1 * width
-
- progressValue: api.cacheSize() / api.maxCacheSize()
-
- Label {
- anchors.centerIn: parent
-
- text: Math.round(api.cacheSize() / 1000000) + "/" + Math.round(api.maxCacheSize() / 1000000) + " MB"
- }
- }
-
- ButtonLayout {
- width: parent.width
-
- Button {
- text: qsTr("Reset")
- onClicked: api.clearCache()
- }
- }
- }
- }
-}
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-hafenschau-0.7.3+master.20220522163703.1.g8cac09e.tar.bz2/ressources.qrc
^
|
@@ -1,6 +0,0 @@
-<RCC>
- <qresource prefix="/icons">
- <file alias="git">icons/github.svg</file>
- <file alias="twitter">icons/twitter.svg</file>
- </qresource>
-</RCC>
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-hafenschau-0.7.3+master.20220522163703.1.g8cac09e.tar.bz2/src/api/apiinterface.cpp
^
|
@@ -1,154 +0,0 @@
-#include "apiinterface.h"
-
-#ifdef QT_DEBUG
-#include <QDebug>
-#endif
-
-#include <QJsonDocument>
-#include <QJsonObject>
-#include <QJsonParseError>
-#include <QStandardPaths>
-
-#include <zlib.h>
-
-ApiInterface::ApiInterface(QNetworkAccessManager *manager, QObject *parent) :
- QObject(parent),
- m_manager(manager)
-{
- m_manager->setParent(this);
-
- connect(m_manager, &QNetworkAccessManager::finished, this, &ApiInterface::onRequestFinished);
-}
-
-qint64 ApiInterface::cacheSize() const
-{
- return m_manager->cache()->cacheSize();
-}
-
-void ApiInterface::clearCache() const
-{
- m_manager->cache()->clear();
-}
-
-qint64 ApiInterface::maxCacheSize() const
-{
- return qobject_cast<QNetworkDiskCache *>(m_manager->cache())->maximumCacheSize();
-}
-
-void ApiInterface::request(const QString &query, const QString &id, bool cached)
-{
-#ifdef QT_DEBUG
- qDebug() << "REQUEST";
- qDebug() << "QUERY: " << query;
- qDebug() << "ID: " << id;
- qDebug() << "CACHED: " << cached;
-#endif
-
- QNetworkRequest request(query);
-
- if (cached) {
- request.setAttribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::PreferCache);
- } else {
- request.setRawHeader("Cache-Control", "no-cache");
- }
-
- request.setRawHeader("User-Agent", "Mozilla/5.0 (X11; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0");
- request.setRawHeader("Accept", "application/json");
- request.setRawHeader("Connection", "keep-alive");
- request.setRawHeader("Accept-Encoding", "gzip");
-
- request.setSslConfiguration(QSslConfiguration::defaultConfiguration());
-
- auto reply = m_manager->get(request);
- reply->setProperty("id", id);
-}
-
-void ApiInterface::onRequestFinished(QNetworkReply *reply)
-{
-#ifdef QT_DEBUG
- qDebug() << QStringLiteral("REQUEST FINISHED");
-#endif
-
- if (reply == nullptr)
- return;
-
- // read request id
- const QString id = reply->property("id").toString();
-
- // check if an error occured
- if (reply->error()) {
- emit requestFailed(id, reply->error());
- reply->deleteLater();
- return;
- }
-
- // read and unzip data
- const auto data = gunzip(reply->readAll());
-
- // delete reply
- reply->deleteLater();
-
- // parse data
- QJsonParseError error{};
-
- const QJsonObject obj = QJsonDocument::fromJson(data, &error).object();
-
- if (error.error) {
-#ifdef QT_DEBUG
- qDebug() << QStringLiteral("JSON parse error");
-#endif
- emit requestFinishedWithRawData(id, data);
- return;
- }
-
- emit requestFinished(id, obj);
-}
-
-QByteArray ApiInterface::gunzip(const QByteArray &data)
-{
- if (data.size() <= 4) {
- return data;
- }
-
- QByteArray result;
-
- int ret{0};
- z_stream strm;
- static const int CHUNK_SIZE = 1024;
- char out[CHUNK_SIZE];
-
- /* allocate inflate state */
- strm.zalloc = Z_NULL;
- strm.zfree = Z_NULL;
- strm.opaque = Z_NULL;
- strm.avail_in = data.size();
- strm.next_in = (Bytef*)(data.data());
-
- ret = inflateInit2(&strm, 15 + 32); // gzip decoding
- if (ret != Z_OK)
- return data;
-
- // run inflate()
- do {
- strm.avail_out = CHUNK_SIZE;
- strm.next_out = (Bytef*)(out);
-
- ret = inflate(&strm, Z_NO_FLUSH);
- Q_ASSERT(ret != Z_STREAM_ERROR); // state not clobbered
-
- switch (ret) {
- case Z_NEED_DICT:
- ret = Z_DATA_ERROR; // and fall through
- case Z_DATA_ERROR:
- case Z_MEM_ERROR:
- (void)inflateEnd(&strm);
- return data;
- }
-
- result.append(out, CHUNK_SIZE - strm.avail_out);
- } while (strm.avail_out == 0);
-
- // clean up and return
- inflateEnd(&strm);
- return result;
-}
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-hafenschau-0.7.3+master.20220522163703.1.g8cac09e.tar.bz2/src/api/apiinterface.h
^
|
@@ -1,38 +0,0 @@
-#ifndef APIINTERFACE_H
-#define APIINTERFACE_H
-
-#include <QObject>
-
-#include <QNetworkAccessManager>
-#include <QNetworkDiskCache>
-#include <QNetworkReply>
-#include <QNetworkRequest>
-
-class ApiInterface : public QObject
-{
- Q_OBJECT
-public:
- explicit ApiInterface(QNetworkAccessManager *manager, QObject *parent = nullptr);
-
- Q_INVOKABLE qint64 cacheSize() const;
- Q_INVOKABLE void clearCache() const;
- Q_INVOKABLE qint64 maxCacheSize() const;
-
-signals:
- void requestFinished(const QString &id, const QJsonObject &data);
- void requestFinishedWithRawData(const QString &id, const QString &data);
- void requestFailed(const QString &id, int error = 0);
-
-public slots:
- void request(const QString &query, const QString &id, bool cached = true);
-
-private slots:
- void onRequestFinished(QNetworkReply *reply);
-
-private:
- QByteArray gunzip(const QByteArray &data);
-
- QNetworkAccessManager *m_manager{nullptr};
-};
-
-#endif // APIINTERFACE_H
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-hafenschau-0.7.3+master.20220522163703.1.g8cac09e.tar.bz2/src/api/networkaccessmanagerfactory.cpp
^
|
@@ -1,17 +0,0 @@
-#include "networkaccessmanagerfactory.h"
-
-#include <QStandardPaths>
-
-#include <QNetworkDiskCache>
-#include <QNetworkAccessManager>
-
-QNetworkAccessManager *NetworkAccessManagerFactory::create(QObject *parent)
-{
- auto manager = new QNetworkAccessManager(parent);
- auto cache = new QNetworkDiskCache(parent);
- cache->setCacheDirectory(QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + "/api");
- cache->setMaximumCacheSize(100000000);
- manager->setCache(cache);
-
- return manager;
-}
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-hafenschau-0.7.3+master.20220522163703.1.g8cac09e.tar.bz2/src/api/networkaccessmanagerfactory.h
^
|
@@ -1,16 +0,0 @@
-#ifndef NETWORKACCESSMANAGERFACTORY_H
-#define NETWORKACCESSMANAGERFACTORY_H
-
-#include <QQmlNetworkAccessManagerFactory>
-
-class NetworkAccessManagerFactory : public QQmlNetworkAccessManagerFactory
-{
-public:
- NetworkAccessManagerFactory() = default;
-
- // QQmlNetworkAccessManagerFactory interface
-public:
- QNetworkAccessManager *create(QObject *parent) override;
-};
-
-#endif // NETWORKACCESSMANAGERFACTORY_H
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-hafenschau-0.7.3+master.20220522163703.1.g8cac09e.tar.bz2/src/enums/developeroption.h
^
|
@@ -1,20 +0,0 @@
-#ifndef DEVELOPEROPTION_H
-#define DEVELOPEROPTION_H
-
-#include <QObject>
-
-class DeveloperOption {
- Q_GADGET
-
-public:
- enum Option {
- None = 0x00,
- SaveNews = 0x01,
- ShowUnkownContent = 0x02
- };
- Q_ENUM(Option)
- Q_DECLARE_FLAGS(Options, Option)
-};
-Q_DECLARE_OPERATORS_FOR_FLAGS(DeveloperOption::Options)
-
-#endif // DEVELOPEROPTION_H
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-hafenschau-0.7.3+master.20220522163703.1.g8cac09e.tar.bz2/src/enums/enums.h
^
|
@@ -1,9 +0,0 @@
-#ifndef ENUMS_H
-#define ENUMS_H
-
-#include "developeroption.h"
-#include "newstype.h"
-#include "ressort.h"
-#include "videoquality.h"
-
-#endif // ENUMS_H
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-hafenschau-0.7.3+master.20220522163703.1.g8cac09e.tar.bz2/src/enums/newstype.h
^
|
@@ -1,19 +0,0 @@
-#ifndef NEWSTYPE_H
-#define NEWSTYPE_H
-
-#include <QObject>
-
-class NewsType {
- Q_GADGET
-
-public:
- enum Type {
- Undefined,
- Story, // story
- Video, // video
- WebView // webview
- };
- Q_ENUM(Type)
-};
-
-#endif // NEWSTYPE_H
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-hafenschau-0.7.3+master.20220522163703.1.g8cac09e.tar.bz2/src/enums/ressort.h
^
|
@@ -1,23 +0,0 @@
-#ifndef RESSORT_H
-#define RESSORT_H
-
-#include <QObject>
-
-class Ressort {
- Q_GADGET
-public:
- enum Type {
- Undefined,
- Ausland,
- Inland,
- Investigativ,
- Regional,
- Search,
- Sport,
- Video,
- Wirtschaft
- };
- Q_ENUM(Type)
-};
-
-#endif // RESSORT_H
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-hafenschau-0.7.3+master.20220522163703.1.g8cac09e.tar.bz2/src/enums/videoquality.h
^
|
@@ -1,17 +0,0 @@
-#ifndef VIDEOQUALITY_H
-#define VIDEOQUALITY_H
-
-#include <QObject>
-
-class VideoQuality {
- Q_GADGET
-public:
- enum Quality {
- Low,
- Medium,
- High
- };
- Q_ENUM(Quality)
-};
-
-#endif // VIDEOQUALITY_H
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-hafenschau-0.7.3+master.20220522163703.1.g8cac09e.tar.bz2/src/harbour-hafenschau.cpp
^
|
@@ -1,66 +0,0 @@
-
-#include <QtQuick>
-
-#include <sailfishapp.h>
-
-#include "api/apiinterface.h"
-#include "api/networkaccessmanagerfactory.h"
-#include "comments/commentsmodel.h"
-#include "comments/commentssortfiltermodel.h"
-#include "enums/enums.h"
-#include "news/newslistmodel.h"
-#include "news/newssortfiltermodel.h"
-#include "region/regionsmodel.h"
-#include "tools/datawriter.h"
-
-int main(int argc, char *argv[])
-{
- // Disable crash guard and prefer egl for webgl.
- setenv("MOZ_DISABLE_CRASH_GUARD", "1", 1);
- setenv("MOZ_WEBGL_PREFER_EGL", "1", 1);
-
- // Set up QML engine.
- QScopedPointer<QGuiApplication> app(SailfishApp::application(argc, argv));
- QScopedPointer<QQuickView> v(SailfishApp::createView());
- QQmlContext *context = v.data()->rootContext();
-
- NetworkAccessManagerFactory factory;
- v->engine()->setNetworkAccessManagerFactory(&factory);
-
- // set app data
- app->setApplicationName(QStringLiteral("hafenschau"));
- app->setApplicationVersion(APP_VERSION);
- app->setOrganizationName(QStringLiteral("org.nubecula"));
- app->setOrganizationDomain(QStringLiteral("org.nubecula"));
-
-
-#ifndef QT_DEBUG
- auto uri = "org.nubecula.harbour.hafenschau";
-#else
- #define uri "org.nubecula.harbour.hafenschau"
-#endif
-
- // register enums
- qmlRegisterUncreatableType<DeveloperOption>(uri, 1, 0, "DeveloperOption", "");
- qmlRegisterUncreatableType<NewsType>(uri, 1, 0, "NewsType", "");
- qmlRegisterUncreatableType<Ressort>(uri, 1, 0, "Ressort", "");
- qmlRegisterUncreatableType<VideoQuality>(uri, 1, 0, "VideoQuality", "");
-
- // register uncreatable types
- auto api = new ApiInterface(factory.create(nullptr));
- context->setContextProperty("api", api);
- qmlRegisterUncreatableType<ApiInterface>(uri, 1, 0, "ApiInterface", "");
-
- // register types
- qmlRegisterType<CommentsModel>(uri, 1, 0, "CommentsModel");
- qmlRegisterType<CommentsSortFilterModel>(uri, 1, 0, "CommentsSortFilterModel");
- qmlRegisterType<DataWriter>(uri, 1, 0, "DataWriter");
- qmlRegisterType<NewsListModel>(uri, 1, 0, "NewsListModel");
- qmlRegisterType<NewsSortFilterModel>(uri, 1, 0, "NewsSortFilterModel");
- qmlRegisterType<RegionsModel>(uri, 1, 0, "RegionsModel");
-
- v->setSource(SailfishApp::pathTo("qml/harbour-hafenschau.qml"));
- v->show();
-
- return app->exec();
-}
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-hafenschau-0.7.3+master.20220522163703.1.g8cac09e.tar.bz2/src/news/newsitem.h
^
|
@@ -1,20 +0,0 @@
-#ifndef NEWSITEM_H
-#define NEWSITEM_H
-
-#include <QDateTime>
-#include <QJsonObject>
-#include <QString>
-
-struct NewsItem {
- QDateTime datetime;
- QString details;
- QString detailsWeb;
- QString firstSentence;
- QJsonObject streams;
- QString thumbnail;
- QString title;
- QString topline;
- quint8 type{0};
-};
-
-#endif // NEWSITEM_H
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-hafenschau-0.7.3+master.20220522163703.1.g8cac09e.tar.bz2/src/news/newslistmodel.cpp
^
|
@@ -1,176 +0,0 @@
-#include "newslistmodel.h"
-
-#include <QJsonArray>
-#include <QJsonObject>
-
-#include "src/enums/newstype.h"
-
-NewsListModel::NewsListModel(QObject *parent) :
- QAbstractListModel(parent)
-{
-
-}
-
-NewsListModel::~NewsListModel()
-{
- m_items.clear();
-}
-
-int NewsListModel::count() const
-{
- return m_items.count();
-}
-
-QString NewsListModel::newsDetails(int index) const
-{
- if (index < 0 || index >= m_items.count())
- return QString();
-
- return m_items[index].details;
-}
-
-void NewsListModel::addItems(const QJsonArray &items)
-{
- QList<NewsItem> list = parseItems(items);
-
- if (list.isEmpty())
- return;
-
- beginInsertRows(QModelIndex(), m_items.count(), m_items.count() + list.count() - 1);
- m_items.append(list);
- endInsertRows();
-
- emit countChanged(m_items.count());
-}
-
-void NewsListModel::setItems(const QJsonArray &items)
-{
- beginResetModel();
- m_items.clear();
- m_items = parseItems(items);
- endResetModel();
-
- emit countChanged(m_items.count());
-}
-
-void NewsListModel::clear()
-{
- beginResetModel();
- m_items.clear();
- endResetModel();
-
- emit countChanged(m_items.count());
-}
-
-void NewsListModel::refresh()
-{
- beginResetModel();
- endResetModel();
-}
-
-QList<NewsItem> NewsListModel::parseItems(const QJsonArray &items)
-{
- QList<NewsItem> list;
-
- for (const auto &v : items) {
- const auto obj = v.toObject();
-
- if (obj.isEmpty())
- continue;
-
- NewsItem item;
- item.datetime = QDateTime::fromString(obj.value("date").toString(), Qt::ISODate);
- item.details = obj.value("details").toString();
- item.firstSentence = obj.value("firstSentence").toString();
- item.thumbnail = obj.value("teaserImage").toObject()
- .value("portraetgross8x9").toObject()
- .value("imageurl").toString();
- item.title = obj.value("title").toString();
- item.topline = obj.value("topline").toString();
-
- const QString type = obj.value("type").toString();
- if (type == QLatin1String("story")) {
- item.type = NewsType::Story;
- } else if (type == QLatin1String("video")) {
- item.type = NewsType::Video;
- item.streams = obj.value("streams").toObject();
- } else if (type == QLatin1String("webview")) {
- item.type = NewsType::WebView;
- item.detailsWeb = obj.value("detailsweb").toString();
- } else {
- item.type = NewsType::Undefined;
- }
-
- list.append(item);
- }
-
- return list;
-}
-
-int NewsListModel::rowCount(const QModelIndex &parent) const
-{
- Q_UNUSED(parent)
-
- return m_items.count();
-}
-
-QVariant NewsListModel::data(const QModelIndex &index, int role) const
-{
- if (!index.isValid())
- return QVariant();
-
- const auto &item = m_items[index.row()];
-
- switch (role) {
- case DetailsRole:
- return item.details;
-
- case DetailsWebRole:
- return item.detailsWeb;
-
- case FirstSentenceRole:
- return item.firstSentence;
-
- case ThumbnailRole:
- return item.thumbnail;
-
- case TitleRole:
- return item.title;
-
- case ToplineRole:
- return item.topline;
-
- case TypeRole:
- return item.type;
-
- case DatetimeRole:
- return item.datetime;
-
- case StreamsRole:
- return item.streams;
-
- case SearchRole:
- return item.title + item.topline + item.firstSentence;
-
- default:
- return QVariant();
- }
-}
-
-QHash<int, QByteArray> NewsListModel::roleNames() const
-{
- QHash<int, QByteArray> roles;
-
- roles[DatetimeRole] = "datetime";
- roles[DetailsRole] = "details";
- roles[DetailsWebRole] = "detailsWeb";
- roles[FirstSentenceRole] = "firstSentence";
- roles[StreamsRole] = "streams";
- roles[ThumbnailRole] = "thumbnail";
- roles[TitleRole] = "title";
- roles[ToplineRole] = "topline";
- roles[TypeRole] = "type";
- roles[SearchRole] = "search";
-
- return roles;
-}
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-hafenschau-0.7.3+master.20220522163703.1.g8cac09e.tar.bz2/src/news/newslistmodel.h
^
|
@@ -1,56 +0,0 @@
-#ifndef NEWSLISTMODEL_H
-#define NEWSLISTMODEL_H
-
-#include <QAbstractListModel>
-
-#include "newsitem.h"
-
-class NewsListModel : public QAbstractListModel
-{
- Q_OBJECT
-
- Q_PROPERTY(int count READ count NOTIFY countChanged)
-
-public:
- enum NewsItemRoles {
- DatetimeRole = Qt::UserRole + 1,
- DetailsRole,
- DetailsWebRole,
- FirstSentenceRole,
- StreamsRole,
- ThumbnailRole,
- TitleRole,
- ToplineRole,
- TypeRole,
- SearchRole
- };
- Q_ENUM(NewsItemRoles)
-
- explicit NewsListModel(QObject *parent = nullptr);
- ~NewsListModel() override;
-
- int count() const;
- Q_INVOKABLE QString newsDetails(int index) const;
- Q_INVOKABLE void addItems(const QJsonArray &items);
- Q_INVOKABLE void setItems(const QJsonArray &items);
-
-signals:
- void countChanged(int count);
-
-public slots:
- void clear();
- void refresh();
-
-private:
- QList<NewsItem> parseItems(const QJsonArray &items);
-
- QList<NewsItem> m_items;
-
- // QAbstractItemModel interface
-public:
- int rowCount(const QModelIndex &parent) const override;
- QVariant data(const QModelIndex &index, int role) const override;
- QHash<int, QByteArray> roleNames() const override;
-};
-
-#endif // NEWSLISTMODEL_H
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-hafenschau-0.7.3+master.20220522163703.1.g8cac09e.tar.bz2/src/news/newssortfiltermodel.cpp
^
|
@@ -1,14 +0,0 @@
-#include "newssortfiltermodel.h"
-
-#include "newslistmodel.h"
-
-NewsSortFilterModel::NewsSortFilterModel(QObject *parent) :
- QSortFilterProxyModel(parent)
-{
- setFilterRole(NewsListModel::SearchRole);
-}
-
-int NewsSortFilterModel::sourceIndex(const QModelIndex &index) const
-{
- return mapToSource(index).row();
-}
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-hafenschau-0.7.3+master.20220522163703.1.g8cac09e.tar.bz2/src/news/newssortfiltermodel.h
^
|
@@ -1,15 +0,0 @@
-#ifndef NEWSSORTFILTERMODEL_H
-#define NEWSSORTFILTERMODEL_H
-
-#include <QSortFilterProxyModel>
-
-class NewsSortFilterModel : public QSortFilterProxyModel
-{
- Q_OBJECT
-public:
- explicit NewsSortFilterModel(QObject *parent = nullptr);
-
- Q_INVOKABLE int sourceIndex(const QModelIndex &index) const;
-};
-
-#endif // NEWSSORTFILTERMODEL_H
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-hafenschau-0.7.3+master.20220522163703.1.g8cac09e.tar.bz2/src/region/regionsmodel.cpp
^
|
@@ -1,103 +0,0 @@
-#include "regionsmodel.h"
-
-RegionsModel::RegionsModel(QObject *parent) :
- QAbstractListModel(parent)
-{
- m_names << QStringLiteral("Baden-Württemberg")
- << QStringLiteral("Bayern")
- << QStringLiteral("Berlin")
- << QStringLiteral("Brandenburg")
- << QStringLiteral("Bremen")
- << QStringLiteral("Hamburg")
- << QStringLiteral("Hessen")
- << QStringLiteral("Mecklenburg-Vorpommern")
- << QStringLiteral("Niedersachsen")
- << QStringLiteral("Nordrhein-Westfalen")
- << QStringLiteral("Rheinland-Pfalz")
- << QStringLiteral("Saarland")
- << QStringLiteral("Sachsen")
- << QStringLiteral("Sachsen-Anhalt")
- << QStringLiteral("Schleswig-Holstein")
- << QStringLiteral("Thüringen");
-}
-
-const QList<int> &RegionsModel::activeRegions() const
-{
- return m_activeRegions;
-}
-
-void RegionsModel::resetRegions()
-{
- beginResetModel();
- m_activeRegions.clear();
- endResetModel();
-
- emit activeRegionsChanged(m_activeRegions);
-}
-
-void RegionsModel::setActiveRegions(const QList<int> ®ions)
-{
- beginResetModel();
- m_activeRegions = regions;
- endResetModel();
-}
-
-int RegionsModel::rowCount(const QModelIndex &parent) const
-{
- Q_UNUSED(parent)
-
- return m_names.count();
-}
-
-QVariant RegionsModel::data(const QModelIndex &index, int role) const
-{
- if (!index.isValid())
- return QVariant();
-
- switch (role) {
- case NameRole:
- return m_names.at(index.row());
-
- case ActiveRole:
- return m_activeRegions.contains(index.row() + 1);
-
- default:
- return QVariant();
- }
-}
-
-bool RegionsModel::setData(const QModelIndex &index, const QVariant &value, int role)
-{
- if (!index.isValid())
- return false;
-
- const int idx = index.row() + 1;
-
- switch (role) {
- case ActiveRole:
- if (value.toBool()) {
- if (!m_activeRegions.contains(idx))
- m_activeRegions.append(idx);
- } else {
- m_activeRegions.removeAll(idx);
- }
- emit dataChanged(index, index);
- emit activeRegionsChanged(m_activeRegions);
- break;
-
- default:
- break;
- }
-
- return true;
-}
-
-QHash<int, QByteArray> RegionsModel::roleNames() const
-{
- QHash<int, QByteArray> roles;
-
- roles[NameRole] = "name";
- roles[ActiveRole] = "active";
-
- return roles;
-}
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-hafenschau-0.7.3+master.20220522163703.1.g8cac09e.tar.bz2/src/region/regionsmodel.h
^
|
@@ -1,40 +0,0 @@
-#ifndef REGIONSMODEL_H
-#define REGIONSMODEL_H
-
-#include <QAbstractListModel>
-
-class RegionsModel : public QAbstractListModel
-{
- Q_OBJECT
-
- Q_PROPERTY(QList<int> activeRegions READ activeRegions WRITE setActiveRegions NOTIFY activeRegionsChanged)
-
-public:
- enum RegionRoles {
- NameRole = Qt::UserRole + 1,
- ActiveRole
- };
- Q_ENUM(RegionRoles)
-
- explicit RegionsModel(QObject *parent = nullptr);
-
- const QList<int> &activeRegions() const;
- Q_INVOKABLE void resetRegions();
- void setActiveRegions(const QList<int> ®ions);
-
-signals:
- void activeRegionsChanged(const QList<int> ®ions);
-
-private:
- QList<int> m_activeRegions;
- QStringList m_names;
-
- // QAbstractItemModel interface
-public:
- int rowCount(const QModelIndex &parent) const override;
- QVariant data(const QModelIndex &index, int role) const override;
- bool setData(const QModelIndex &index, const QVariant &value, int role) override;
- QHash<int, QByteArray> roleNames() const override;
-};
-
-#endif // REGIONSMODEL_H
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-hafenschau-0.7.3+master.20220522163703.1.g8cac09e.tar.bz2/src/tools/datawriter.cpp
^
|
@@ -1,34 +0,0 @@
-#include "datawriter.h"
-
-#include <QDateTime>
-#include <QFile>
-#include <QJsonDocument>
-#include <QJsonObject>
-#include <QSettings>
-#include <QStandardPaths>
-#include <QTextStream>
-
-DataWriter::DataWriter(QObject *parent) :
- QObject(parent)
-{
-
-}
-
-void DataWriter::saveNews(const QJsonObject &news)
-{
- QFile file(QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation)
- + QStringLiteral("/hafenschau-news-")
- + news.value("sophoraId").toString()
- + '-'
- + QDateTime::currentDateTimeUtc().toString("yyyyMMddhhmmss")
- + QStringLiteral(".json"));
-
- if (!file.open(QIODevice::WriteOnly | QIODevice::Text))
- return;
-
- QTextStream out(&file);
-
- out << QString(QJsonDocument(news).toJson(QJsonDocument::Indented));
-
- file.close();
-}
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-hafenschau-0.7.3+master.20220522163703.1.g8cac09e.tar.bz2/src/tools/datawriter.h
^
|
@@ -1,15 +0,0 @@
-#ifndef DATAWRITER_H
-#define DATAWRITER_H
-
-#include <QObject>
-
-class DataWriter : public QObject
-{
- Q_OBJECT
-public:
- explicit DataWriter(QObject *parent = nullptr);
-
- Q_INVOKABLE void saveNews(const QJsonObject &news);
-};
-
-#endif // DATAWRITER_H
|
[-]
[+]
|
Added |
_service:tar_git:harbour-hafenschau-0.9.6.tar.bz2/.github/FUNDING.yml
^
|
@@ -0,0 +1,12 @@
+# These are supported funding model platforms
+
+github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
+patreon: # Replace with a single Patreon username
+open_collective: # Replace with a single Open Collective username
+ko_fi: # Replace with a single Ko-fi username
+tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
+community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
+liberapay: black-sheep-dev
+issuehunt: # Replace with a single IssueHunt username
+otechie: # Replace with a single Otechie username
+custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-hafenschau-0.9.6.tar.bz2/README.md
^
|
@@ -6,6 +6,8 @@
>![](icons/128x128/harbour-hafenschau.png)
+![](https://www.codefactor.io/repository/github/black-sheep-dev/harbour-hafenschau/badge?style=plastic)
+
[![](https://github.com/black-sheep-dev/harbour-hafenschau/actions/workflows/main.yml/badge.svg)](https://github.com/black-sheep-dev/harbour-hafenschau/actions/workflows/main.yml)
## Version compatibility
@@ -21,13 +23,17 @@
#### Features
-- News Reader
-- Audio Player
-- Video Player
-- Integrated Web View (crashes on i486)
-- Search for news content
-- Show comments for content
+- News Reader
+- Audio Player
+- Video Player
+- Integrated Web View (crashes on i486)
+- Search for news content
+- Show comments for content
#### Intention of this project
-This app is part of my plan to replace all android apps I use with native ones. If they don't exist, I will try to create one.
\ No newline at end of file
+This app is part of my plan to replace all android apps I use with native ones. If they don't exist, I will try to create one.
+
+## Social Media
+
+Follow this project on [Mastodon](https://social.nubecula.org/@hafenschau)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-hafenschau-0.9.6.tar.bz2/harbour-hafenschau.desktop
^
|
@@ -1,10 +1,9 @@
[Desktop Entry]
Type=Application
-Icon=harbour-hafenschau
X-Nemo-Application-Type=silica-qt5
-Exec=harbour-hafenschau
+Icon=harbour-hafenschau
+Exec=sailfish-qml harbour-hafenschau
Name=Hafenschau
-Categories=Network
[X-Sailjail]
OrganizationName=org.nubecula
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-hafenschau-0.9.6.tar.bz2/harbour-hafenschau.pro
^
|
@@ -1,44 +1,13 @@
-# NOTICE:
-#
-# Application name defined in TARGET has a corresponding QML filename.
-# If name defined in TARGET is changed, the following needs to be done
-# to match new name:
-# - corresponding QML filename must be changed
-# - desktop icon filename must be changed
-# - desktop filename must be changed
-# - icon definition filename in desktop file must be changed
-# - translation filenames have to be changed
-
-# VERSION
-VERSION = 0.7.3-1
-DEFINES += APP_VERSION=\\\"$$VERSION\\\"
-
-# The name of your application
TARGET = harbour-hafenschau
-DEFINES += APP_TARGET=\\\"$$TARGET\\\"
-
-QT += dbus
-CONFIG += link_pkgconfig sailfishapp
+CONFIG += sailfishapp_qml
PKGCONFIG += \
qt5embedwidget \
nemonotifications-qt5 \
- qt5embedwidget \
keepalive
-LIBS += -lz
-
-SOURCES += src/harbour-hafenschau.cpp \
- src/api/apiinterface.cpp \
- src/api/networkaccessmanagerfactory.cpp \
- src/comments/commentsmodel.cpp \
- src/comments/commentssortfiltermodel.cpp \
- src/news/newslistmodel.cpp \
- src/news/newssortfiltermodel.cpp \
- src/region/regionsmodel.cpp \
- src/tools/datawriter.cpp
-
DISTFILES += qml/harbour-hafenschau.qml \
+ qml/api.qml \
qml/components/RemoteImage.qml \
qml/content/ContentAudio.qml \
qml/content/ContentBox.qml \
@@ -56,6 +25,9 @@
qml/cover/CoverPage.qml \
qml/delegates/NewsListItem.qml \
qml/global.qml \
+ qml/models/CommentsModel.qml \
+ qml/models/NewsModel.qml \
+ qml/pages/ChannelsPage.qml \
qml/pages/CommentsListPage.qml \
qml/pages/DataReaderPage.qml \
qml/pages/GalleryPage.qml \
@@ -68,14 +40,13 @@
qml/pages/VideoPlayerPage.qml \
qml/pages/WebViewPage.qml \
qml/pages/settings/SettingsAutoRefreshPage.qml \
- qml/pages/settings/SettingsCachePage.qml \
qml/pages/settings/SettingsCoverPage.qml \
- qml/pages/settings/SettingsDeveloperPage.qml \
qml/pages/settings/SettingsPage.qml \
qml/pages/settings/SettingsRegionsPage.qml \
qml/pages/settings/SettingsVideoPage.qml \
qml/pages/settings/SettingsWebviewPage.qml \
qml/qmldir \
+ qml/tools.qml \
rpm/harbour-hafenschau.changes \
rpm/harbour-hafenschau.changes.run.in \
rpm/harbour-hafenschau.spec \
@@ -95,27 +66,10 @@
# modify the localized app name in the the .desktop file.
TRANSLATIONS += translations/harbour-hafenschau-de.ts
-HEADERS += \
- src/api/apiinterface.h \
- src/api/networkaccessmanagerfactory.h \
- src/comments/comment.h \
- src/comments/commentsmodel.h \
- src/comments/commentssortfiltermodel.h \
- src/enums/developeroption.h \
- src/enums/enums.h \
- src/enums/newstype.h \
- src/enums/ressort.h \
- src/enums/videoquality.h \
- src/news/newsitem.h \
- src/news/newslistmodel.h \
- src/news/newssortfiltermodel.h \
- src/region/regionsmodel.h \
- src/tools/datawriter.h
-
-RESOURCES += \
- ressources.qrc
+icons.files = icons/*.svg
+icons.path = $$INSTALL_ROOT/usr/share/harbour-hafenschau/icons
images.files = images/*.png
images.path = $$INSTALL_ROOT/usr/share/harbour-hafenschau/images
-INSTALLS += images
+INSTALLS += icons images
|
[-]
[+]
|
Added |
_service:tar_git:harbour-hafenschau-0.9.6.tar.bz2/icons/liberpay.svg
^
|
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80"><g transform="matrix(.83012 0 0 .83012-135.4-247.7)"><path d="m259.55 385.57c0 5.145-4.169 9.318-9.318 9.318h-77.74c-5.144 0-9.318-4.174-9.318-9.318v-77.74c0-5.145 4.174-9.318 9.318-9.318h77.74c5.149 0 9.318 4.173 9.318 9.318v77.74" fill="#f6c915"/><g fill="#fff"><path d="m202.45 366.03c-3.104 0-5.541-.405-7.311-1.213-1.77-.809-3.039-1.912-3.803-3.313-.766-1.398-1.137-3-1.115-4.818.021-1.814.272-3.748.754-5.803l8.327-34.817 10.164-1.573-9.114 37.768c-.175.786-.273 1.508-.295 2.163-.023.655.098 1.235.36 1.737.262.504.71.908 1.344 1.213.633.307 1.519.504 2.656.591l-1.967 8.06"/><path d="m239.16 344.33c0 3.19-.525 6.108-1.574 8.753-1.049 2.646-2.503 4.929-4.36 6.852-1.858 1.925-4.087 3.421-6.688 4.491-2.601 1.07-5.432 1.607-8.49 1.607-1.487 0-2.973-.132-4.459-.395l-2.951 11.869h-9.704l10.884-45.37c1.748-.524 3.748-.994 5.999-1.41 2.252-.415 4.689-.622 7.312-.622 2.448 0 4.558.371 6.327 1.114 1.771.743 3.224 1.76 4.361 3.049 1.136 1.29 1.977 2.798 2.523 4.524.546 1.726.82 3.574.82 5.542m-23.802 13.442c.743.175 1.661.262 2.754.262 1.704 0 3.256-.316 4.655-.951 1.398-.633 2.59-1.518 3.574-2.655.982-1.136 1.747-2.501 2.294-4.098.546-1.595.819-3.354.819-5.278 0-1.879-.416-3.475-1.245-4.787-.831-1.311-2.273-1.967-4.327-1.967-1.4 0-2.711.131-3.935.394l-4.589 19.08"/></g></g></svg>
|
[-]
[+]
|
Added |
_service:tar_git:harbour-hafenschau-0.9.6.tar.bz2/icons/mastodon.svg
^
|
@@ -0,0 +1,8 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" version="1.1">
+ <path style="opacity:0.2" d="M 18,5 C 11.352,5 6,10.430561 6,17.175781 v 6.648438 c 0,0.144485 0.016613,0.284496 0.021484,0.427734 0.07553,4.681749 0.6485998,13.189434 3.7851562,16.761719 C 12.865595,44.497574 20.000733,45 22.882812,45 28.004687,45 31,42.994141 31,42.994141 v -3.007813 c 0,0 -3.802747,1.078474 -7.451172,1.013672 C 21.043431,40.9555 18.610509,40.299064 17.533203,38.675781 17.077381,37.988948 17.231959,37.113613 17,36 c -0.0034,-0.01627 -0.0064,-0.03444 -0.0098,-0.05078 C 17.323834,35.977232 17.659035,36 18,36 h 12 c 6.648,0 12,-5.430561 12,-12.175781 V 17.175781 C 42,10.430561 36.648,5 30,5 Z"/>
+ <rect style="fill:#3088d4" width="36" height="31" x="6" y="4" rx="12" ry="12.175"/>
+ <path style="fill:#3088d4" d="m 6.032951,20 h 10.566226 c 0,0 -0.74784,9.485369 0.400823,15 0.231959,1.113613 0.0773,1.988257 0.533122,2.67509 C 18.610428,39.298373 21.042714,39.9555 23.548111,40 27.196536,40.064802 31,38.985559 31,38.985559 v 3.008665 C 31,41.994224 28.003954,44 22.88208,44 20,44 12.865804,43.498342 9.8068499,40.01444 5.3878012,34.9815 6.032951,20 6.032951,20 Z"/>
+ <circle style="opacity:0.2" cx="16" cy="17" r="2"/>
+ <circle style="fill:#ffffff" cx="16" cy="16" r="2"/>
+ <path style="opacity:0.2;fill:#ffffff" d="M 18 4 C 11.352 4 6 9.4305608 6 16.175781 L 6 17.175781 C 6 10.430561 11.352 5 18 5 L 30 5 C 36.648 5 42 10.430561 42 17.175781 L 42 16.175781 C 42 9.4305608 36.648 4 30 4 L 18 4 z M 16.990234 35.949219 C 16.993634 35.965559 16.9966 35.98373 17 36 C 17.231959 37.113613 17.077381 37.988948 17.533203 38.675781 C 18.610509 40.299064 21.043431 40.9555 23.548828 41 C 27.197253 41.064802 31 39.986328 31 39.986328 L 31 38.986328 C 31 38.986328 27.197253 40.064802 23.548828 40 C 21.043431 39.9555 18.610509 39.299064 17.533203 37.675781 C 17.218095 37.200975 17.193864 36.628448 17.132812 35.957031 C 17.085619 35.953334 17.037354 35.953175 16.990234 35.949219 z"/>
+</svg>
|
[-]
[+]
|
Added |
_service:tar_git:harbour-hafenschau-0.9.6.tar.bz2/icons/paypal.svg
^
|
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg id="svg46" width="86px" height="86px" enable-background="new 0 0 86 86" version="1.1" viewBox="0 0 86 86" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><metadata id="metadata52"><rdf:RDF><cc:Work rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/><dc:title/></cc:Work></rdf:RDF></metadata>
+
+
+<g id="g944" transform="matrix(3.9875 0 0 3.9875 114.1 -10.118)" fill="#fff"><path id="_Path_" class="cls-2" d="m-12.356 9.416-0.05 0.29c-0.66 3.37-2.9 4.53-5.77 4.53h-1.46a0.71 0.71 0 0 0-0.7 0.6l-0.75 4.74-0.21 1.34a0.37 0.37 0 0 0 0.37 0.43h2.59a0.62 0.62 0 0 0 0.62-0.52v-0.13l0.48-3.09v-0.17a0.62 0.62 0 0 1 0.62-0.53h0.39c2.51 0 4.47-1 5-4a3.38 3.38 0 0 0-0.52-3 2.47 2.47 0 0 0-0.61-0.49z" opacity=".3" data-name="<Path>"/><path id="_Path_2" class="cls-3" d="m-13.046 9.146-0.31-0.08-0.33-0.06a8.1 8.1 0 0 0-1.28-0.09h-3.9a0.62 0.62 0 0 0-0.61 0.53l-0.83 5.25v0.15a0.71 0.71 0 0 1 0.7-0.6h1.46c2.87 0 5.11-1.16 5.77-4.53 0-0.1 0-0.2 0.05-0.29a3.49 3.49 0 0 0-0.54-0.23z" opacity=".5" data-name="<Path>"/><path id="_Path_3" class="cls-4" d="m-19.486 9.436a0.62 0.62 0 0 1 0.61-0.53h3.9a8.1 8.1 0 0 1 1.29 0.09l0.33 0.06 0.31 0.08h0.15a3.54 3.54 0 0 1 0.54 0.23 3.18 3.18 0 0 0-0.67-2.86c-0.74-0.84-2.08-1.21-3.79-1.21h-5a0.71 0.71 0 0 0-0.7 0.6l-2.06 13.19a0.43 0.43 0 0 0 0.42 0.49h3.07l0.77-4.89z" data-name="<Path>"/></g></svg>
|
[-]
[+]
|
Added |
_service:tar_git:harbour-hafenschau-0.9.6.tar.bz2/qml/api.qml
^
|
@@ -0,0 +1,32 @@
+pragma Singleton
+import QtQuick 2.0
+
+Item {
+ function request (url, callback) {
+ var xhr = new XMLHttpRequest()
+ xhr.onreadystatechange = (function(myxhr) {
+ return function() {
+ if (myxhr.readyState !== 4) return
+
+ if (myxhr.status === 308) {
+ const location = myxhr.getResponseHeader("Location")
+ request.call(myxhr, location, callback)
+ return
+ }
+
+ var data
+
+ try {
+ data = JSON.parse(myxhr.responseText)
+ } catch (e) {
+ data = myxhr.responseText
+ }
+
+ callback(data, myxhr.status)
+ }
+ })(xhr)
+
+ xhr.open("GET", url)
+ xhr.send()
+ }
+}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-hafenschau-0.9.6.tar.bz2/qml/content/ContentAudio.qml
^
|
@@ -4,6 +4,7 @@
import QtMultimedia 5.6
import "../components/"
+import "../."
BackgroundItem {
property bool playing: false
@@ -25,7 +26,9 @@
RemoteImage {
id: headerImage
- source: item.teaserImage === undefined ? "/usr/share/harbour-hafenschau/images/audiograph.png" : item.teaserImage.videowebl.imageurl
+ source: item.teaserImage === undefined ?
+ "/usr/share/harbour-hafenschau/images/audiograph.png" :
+ Tools.getPreferredImageSize16x9(width, item.teaserImage.imageVariants)
placeholderUrl: "/usr/share/harbour-hafenschau/images/audiograph.png"
Image {
@@ -112,6 +115,8 @@
MediaPlayer {
id: audioPlayer
source: item.stream
+
+ onError: console.log(errorString)
}
Connections {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-hafenschau-0.9.6.tar.bz2/qml/content/ContentBox.qml
^
|
@@ -2,6 +2,7 @@
import Sailfish.Silica 1.0
import "../components/"
+import "../."
BackgroundItem {
property var item
@@ -16,14 +17,14 @@
spacing: Theme.paddingMedium
Separator {
- visible: !item.hasOwnProperty("images")
+ visible: !item.hasOwnProperty("image")
width: parent.width
color: Theme.highlightBackgroundColor
}
RemoteImage {
- visible: item.hasOwnProperty("images")
- source: item.images.videowebl.imageurl
+ visible: item.hasOwnProperty("image")
+ source: Tools.getPreferredImageSize16x9(width, item.image.imageVariants)
}
Label {
@@ -34,7 +35,7 @@
font.pixelSize: Theme.fontSizeSmall
wrapMode: Text.WordWrap
- text: item.subtitle
+ text: item.hasOwnProperty("subtitle") ? item.subtitle : ""
}
Label {
@@ -60,7 +61,7 @@
textFormat: Text.RichText
- text: item.text
+ text: item.hasOwnProperty("text") ? item.text : ""
}
Separator {
@@ -73,7 +74,7 @@
if (item.link === undefined) return
var link = item.link.match(/(?:ht|f)tps?:\/\/[-a-zA-Z0-9.]+\.[a-zA-Z]{2,3}(\/[^"<]*)?/g)[0]
- if (link.substr(0, 31) === "https://www.tagesschau.de/api2/")
+ if (link.substr(0, 30) === "https://www.tagesschau.de/api2")
pageStack.push(Qt.resolvedUrl("../pages/ReaderPage.qml"), {link: link})
else
Qt.openUrlExternally(link)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-hafenschau-0.9.6.tar.bz2/qml/content/ContentGallery.qml
^
|
@@ -2,6 +2,7 @@
import Sailfish.Silica 1.0
import "../components/"
+import "../."
BackgroundItem {
property var item
@@ -42,7 +43,7 @@
model: item
delegate: RemoteImage {
- source: modelData.videowebl.imageurl
+ source: Tools.getPreferredImageSize16x9(width, modelData.imageVariants)
}
onDragStarted: switchTimer.stop()
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-hafenschau-0.9.6.tar.bz2/qml/content/ContentList.qml
^
|
@@ -11,7 +11,7 @@
if (link.length === 0) return
const l = link.match(/(?:ht|f)tps?:\/\/[-a-zA-Z0-9.]+\.[a-zA-Z]{2,3}(\/[^"<]*)?/g)[0]
- if (l.substr(0, 31) === "https://www.tagesschau.de/api2/")
+ if (l.substr(0, 30) === "https://www.tagesschau.de/api2")
pageStack.push(Qt.resolvedUrl("../pages/ReaderPage.qml"), {link: l})
else
Qt.openUrlExternally(l)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-hafenschau-0.9.6.tar.bz2/qml/content/ContentRelated.qml
^
|
@@ -2,6 +2,7 @@
import Sailfish.Silica 1.0
import "../components/"
+import "../."
Item {
property var item
@@ -61,7 +62,7 @@
width: Theme.itemSizeHuge * 0.8
height: width
- source: modelData.teaserImage.videoweb1x1l.imageurl
+ source: Tools.getPreferredImageSize1x1(width, modelData.teaserImage.imageVariants)
placeholderUrl: "/usr/share/harbour-hafenschau/images/dummy_thumbnail.png"
Image {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-hafenschau-0.9.6.tar.bz2/qml/content/ContentSocial.qml
^
|
@@ -2,6 +2,7 @@
import Sailfish.Silica 1.0
import "../components/"
+import "../."
BackgroundItem {
property var item
@@ -59,7 +60,7 @@
height: Theme.itemSizeMedium
fillMode: Image.PreserveAspectCrop
- placeholderUrl: "qrc:/icons/twitter"
+ placeholderUrl: "/usr/share/harbour-" + Qt.application.name + "/icons/twitter.svg"
}
Label {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-hafenschau-0.9.6.tar.bz2/qml/content/ContentText.qml
^
|
@@ -19,7 +19,7 @@
text: item.value
onLinkActivated: {
- if (link.substr(0, 31) === "https://www.tagesschau.de/api2/")
+ if (link.substr(0, 30) === "https://www.tagesschau.de/api2")
pageStack.push(Qt.resolvedUrl("../pages/ReaderPage.qml"), {link: link})
else
Qt.openUrlExternally(link)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-hafenschau-0.9.6.tar.bz2/qml/content/ContentVideo.qml
^
|
@@ -2,6 +2,7 @@
import Sailfish.Silica 1.0
import "../components/"
+import "../."
BackgroundItem {
property var item
@@ -16,7 +17,7 @@
spacing: Theme.paddingMedium
RemoteImage {
- source: item.teaserImage.videowebl.imageurl
+ source: Tools.getPreferredImageSize16x9(width, item.teaserImage.imageVariants)
placeholderUrl: "/usr/share/harbour-hafenschau/images/video_dummy.png"
Image {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-hafenschau-0.9.6.tar.bz2/qml/content/ContentWebview.qml
^
|
@@ -19,7 +19,7 @@
text: item.inline
onLinkActivated: {
- if (link.substr(0, 31) === "https://www.tagesschau.de/api2/")
+ if (link.substr(0, 30) === "https://www.tagesschau.de/api2")
pageStack.push(Qt.resolvedUrl("../pages/ReaderPage.qml"), {link: link})
else
Qt.openUrlExternally(link)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-hafenschau-0.9.6.tar.bz2/qml/cover/CoverPage.qml
^
|
@@ -1,47 +1,44 @@
import QtQuick 2.0
import Sailfish.Silica 1.0
-import org.nubecula.harbour.hafenschau 1.0
-
import "../components/"
+import "../."
CoverBackground {
- property int currentIndex: 0
-
function increment() {
- if (currentIndex === (mainModel.count - 1)) {
- currentIndex = 0
+ if (currentCoverIndex === (mainNews.count - 1)) {
+ currentCoverIndex = 0
} else {
- currentIndex++
+ currentCoverIndex++
}
}
Connections {
- target: mainModel
- onCountChanged: currentIndex = 0
+ target: mainNews
+ onUpdated: currentCoverIndex = 0
}
id: coverBackground
Timer {
id: timer
- interval: settings.coverSwitchInterval
+ interval: config.coverSwitchInterval
repeat: true
- running: settings.coverSwitch
+ running: config.coverSwitch
onTriggered: increment()
}
Row {
- x: currentIndex * parent.width * -1
+ x: currentCoverIndex * parent.width * -1
height: parent.height
Behavior on x {
- NumberAnimation { duration: currentIndex === (mainModel.count - 1) ? 0 : 250 }
+ NumberAnimation { duration: currentCoverIndex === (mainNews.count - 1) ? 0 : 250 }
}
Repeater {
- model: mainModel
+ model: mainNews
Rectangle {
width: coverBackground.width
@@ -56,7 +53,7 @@
opacity: 0.5
- source: model.thumbnail
+ source: Tools.getPreferredImageSize1x1(height, teaserImage.imageVariants)
}
Column {
@@ -71,18 +68,20 @@
Label {
x: Theme.horizontalPageMargin
width: parent.width - 2*x
- text: model.title
+ text: title
font.bold: true
wrapMode: Text.WordWrap
font.pixelSize: Theme.fontSizeSmall
+ truncationMode: TruncationMode.Fade
}
Label {
x: Theme.horizontalPageMargin
width: parent.width - 2*x
- text: model.firstSentence
+ text: model.hasOwnProperty("firstSentence") ? firstSentence : ""
wrapMode: Text.WordWrap
font.pixelSize: Theme.fontSizeExtraSmall
+ truncationMode: TruncationMode.Fade
}
}
}
@@ -93,13 +92,8 @@
id: coverAction
CoverAction {
- iconSource: "image://theme/icon-cover-search"
- onTriggered: dbusAdaptor.open(mainModel.newsDetails(currentIndex))
- }
-
- CoverAction {
iconSource: "image://theme/icon-cover-refresh"
- onTriggered: mainModel.checkForUpdate()
+ onTriggered: mainNews.refresh()
}
CoverAction {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-hafenschau-0.9.6.tar.bz2/qml/delegates/NewsListItem.qml
^
|
@@ -1,13 +1,20 @@
import QtQuick 2.0
import Sailfish.Silica 1.0
-import org.nubecula.harbour.hafenschau 1.0
-
import "../components/"
+import "../."
ListItem {
contentHeight: contentRow.height + separatorBottom.height
+ menu: ContextMenu {
+ enabled: model.hasOwnProperty("shareURL")
+ MenuItem {
+ text: qsTr("Copy link to clipboard")
+ onClicked: Clipboard.text = shareURL
+ }
+ }
+
Row {
id: contentRow
x: Theme.horizontalPageMargin
@@ -20,12 +27,12 @@
width: Theme.itemSizeExtraLarge
height: Theme.itemSizeExtraLarge * 1.4
- source: model.thumbnail
+ source: Tools.getPreferredImageSize1x1(height, teaserImage.imageVariants)
placeholderUrl: "/usr/share/harbour-hafenschau/images/dummy_thumbnail.png"
Image {
- visible: model.type === NewsType.Video
+ visible: type === "video"
anchors.centerIn: parent
source: "image://theme/icon-m-play"
}
@@ -37,28 +44,35 @@
spacing: Theme.paddingSmall
Label {
- text: model.type === NewsType.Video ? model.datetime.toLocaleString() : model.topline
+ text: type === "video" ? new Date(date).toLocaleString() : topline
width: parent.width
wrapMode: Text.WordWrap
font.pixelSize: Theme.fontSizeExtraSmall
+ truncationMode: TruncationMode.Fade
}
Label {
- text: model.title
+ text: title
width: parent.width
wrapMode: Text.WordWrap
font.pixelSize: Theme.fontSizeSmall
color: Theme.highlightColor
+ truncationMode: TruncationMode.Fade
}
Label {
- text: model.firstSentence
+ text: model.hasOwnProperty("firstSentence") ? firstSentence : ""
width: parent.width
wrapMode: Text.WordWrap
font.pixelSize: Theme.fontSizeExtraSmall
+ truncationMode: TruncationMode.Fade
+ }
+ Item {
+ width: 1
+ height: Theme.paddingSmall
}
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-hafenschau-0.9.6.tar.bz2/qml/global.qml
^
|
@@ -1,7 +1,6 @@
pragma Singleton
-
import QtQuick 2.0
QtObject {
- property var activeRegions: []
+ readonly property string appVersion: "0.9.6"
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-hafenschau-0.9.6.tar.bz2/qml/harbour-hafenschau.qml
^
|
@@ -1,205 +1,66 @@
import QtQuick 2.0
import Sailfish.Silica 1.0
import Nemo.DBus 2.0
-import Nemo.Notifications 1.0
-import Nemo.Configuration 1.0
import Nemo.KeepAlive 1.2
-import MeeGo.Connman 0.2
+import Nemo.Configuration 1.0
+import Nemo.Notifications 1.0
+import QtQml.Models 2.2
+import "models"
import "pages"
import "."
-import org.nubecula.harbour.hafenschau 1.0
-
ApplicationWindow
{
id: root
- function refreshActiveRegions() {
- if (settings.regions.length === 0) return
- var regions = settings.regions.split(',')
- regions.map(Number)
- Global.activeRegions = regions.filter(function(value, index, arr) {
- return value > 0
- })
- //console.log(Global.activeRegions)
- }
-
- Connections {
- target: Global
- onActiveRegionsChanged: {
- var regions = Global.activeRegions
- if (regions.length > 0) {
- regions.map(String)
- settings.regions = regions.join(',')
- } else {
- settings.regions = ""
- }
- }
- }
-
- //ApiInterface { id: api }
-
- DataWriter { id: dataWriter }
-
- NewsListModel {
- property bool error: false
- property bool loading: false
- property string newStoriesCountLink: ""
-
- id: mainModel
-
- function refresh(cached) {
- if (cached === undefined)
- cached = false
-
- error = false
- loading = true
- api.request("https://www.tagesschau.de/api2/homepage/", "mainModel.refresh", cached)
- }
-
- function checkForUpdate() {
- if (newStoriesCountLink.length === 0) {
- refresh(false)
- return
- }
-
- error = false
- api.request(newStoriesCountLink, "mainModel.checkForUpdates", false)
- }
-
- function checkUpdateCount(data) {
- if (data === undefined) refresh(false)
-
- const keys = Object.keys(data)
- keys.forEach(function(key) {
- if (data[key] > 0) {
- refresh(false)
- }
- })
- }
-
- function setData(data) {
- newStoriesCountLink = data.newStoriesCountLink
- mainModel.setItems(data.news)
-
- if (Global.activeRegions.length === 0) return
-
- // notify if breaking news
- if (settings.notify) {
- data.news.forEach(function(news) {
- if (news.breakingNews) breakingNewsNotification.notify(news)
- })
- }
-
- const regionalNews = []
- const ids = []
-
- data.regional.forEach(function(news) {
- const id = news.sophoraId
-
- news.regionIds.forEach(function(region) {
-
- if ( Global.activeRegions.indexOf(String(region)) >= 0 && ids.indexOf(id) < 0 ) {
- regionalNews.push(news)
- ids.push(id)
- }
- })
- })
-
- mainModel.addItems(regionalNews)
- }
- }
-
- Connections {
- target: api
- onRequestFailed: {
- if (id.substr(0, 9) !== "mainModel") return
- mainModel.loading = false
- mainModel.error = true
- notification.show(qsTr("Failed to get news"))
- }
-
- onRequestFinished: {
- if (id.substr(0, 9) !== "mainModel") return
-
- mainModel.loading = false
-
- if (id === "mainModel.checkForUpdates") {
- mainModel.checkUpdateCount(data)
- } else if (id === "mainModel.refresh") {
- mainModel.setData(data)
- }
- }
- }
-
- Notification {
- function show(message) {
- replacesId = 0
- previewSummary = ""
- previewBody = message
- icon = "/usr/share/icons/hicolor/86x86/apps/" + appId + ".png"
- publish()
- }
+ property int currentCoverIndex: 0
- id: notification
- appName: "Hafenschau"
- expireTimeout: 3000
- }
-
- Notification {
- property var notifiedNews: []
-
- function notify(news) {
- if (notifiedNews.indexOf(news.sophoraId) >= 0) return
-
- summary = news.title
- subText = news.firstSentence
- body = news.firstSentence
- icon = "/usr/share/icons/hicolor/86x86/apps/" + appId + ".png"
- remoteActions = [{
- name: "default",
- service: "org.nubecula.hafenschau",
- path: "/",
- iface: "org.nubecula.hafenschau",
- method: "open",
- arguments: [news.details]
- }]
-
- notifiedNews.push(news.sophoraId)
- publish()
- }
-
- id: breakingNewsNotification
- appName: "Hafenschau"
+ NewsModel {
+ id: mainNews
+ url: "https://www.tagesschau.de/api2/homepage"
}
ConfigurationGroup {
- id: settings
+ id: config
path: "/apps/harbour-hafenschau"
synchronous: true
+ property string activeRegions: "[]"
property int autoRefresh: 0
property int commentsSortOrder: Qt.AscendingOrder
+ property bool coverShowNews: true
property bool coverSwitch: true
property int coverSwitchInterval: 10000
- property int developerOptions: 0
+ property bool developerMode: false
|
[-]
[+]
|
Added |
_service:tar_git:harbour-hafenschau-0.9.6.tar.bz2/qml/models/NewsModel.qml
^
|
@@ -0,0 +1,107 @@
+import QtQuick 2.0
+
+import "../."
+
+ListModel {
+ property bool busy: false
+ property string url: ""
+ property string nextPage: ""
+ property string newStoriesCountLink: ""
+
+ id: listModel
+
+ signal updated()
+
+ function refresh() {
+ if (newStoriesCountLink.length === 0) {
+ fetch()
+ return
+ }
+
+ Api.request(newStoriesCountLink, function(data, status) {
+ if (status !== 200) {
+ fetch()
+ return
+ }
+
+
+ if (data.tagesschau > 0) {
+ fetch()
+ return
+ }
+
+ const regions = JSON.parse(config.activeRegions)
+
+ regions.forEach(function(region) {
+ if (data.response[region] > 0) {
+ fetch()
+ return
+ }
+ })
+
+ notify.show(qsTr("No updates available"))
+ })
+ }
+
+ function fetch() {
+ busy = true
+ Api.request(url, function (data, status) {
+ busy = false
+
+ if (status !== 200) {
+ notify.show(qsTr("Failed to fetch news"))
+ return
+ }
+
+ if (data.hasOwnProperty("newStoriesCountLink")) newStoriesCountLink = data.newStoriesCountLink
+
+
+ const items
+ if (data.hasOwnProperty("regional")) {
+ const regions = JSON.parse(config.activeRegions)
+
+ const regionalNews = []
+ const ids = []
+
+ data.regional.forEach(function(news) {
+ const id = news.sophoraId
+
+ news.regionIds.forEach(function(region) {
+
+ if ( regions.indexOf(region) >= 0 && ids.indexOf(id) < 0 ) {
+ regionalNews.push(news)
+ ids.push(id)
+ }
+ })
+ })
+
+ items = data.news.concat(regionalNews)
+ } else if (data.hasOwnProperty("channels")) {
+ items = data.channels
+ } else {
+ items = data.news
+ }
+
+ listModel.clear()
+ items.forEach(function(item) { listModel.append(item) })
+ listModel.updated()
+
+ if (data.hasOwnProperty("nextPage")) nextPage = data.nextPage
+ })
+ }
+
+ function loadMore() {
+ if (nextPage.length === 0) return
+ busy = true
+ Api.request(nextPage, function (data, status) {
+ if (status !== 200) {
+ notify.show(qsTr("Failed to fetch more news"))
+ return
+ }
+
+ data.news.forEach(function(item) { listModel.append(item) })
+
+ nextPage = data.nextPage
+ })
+ }
+}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-hafenschau-0.9.6.tar.bz2/qml/pages/AboutPage.qml
^
|
@@ -1,6 +1,7 @@
import QtQuick 2.0
import Sailfish.Silica 1.0
-import Nemo.DBus 2.0
+
+import "../."
Page {
readonly property string appId: "harbour-hafenschau"
@@ -9,16 +10,6 @@
allowedOrientations: Orientation.All
- DBusInterface {
- id: sailHubInterface
-
- service: "org.nubecula.sailhub"
- iface: "org.nubecula.sailhub"
- path: "/"
-
- onStatusChanged: console.log("DBUS :" + status)
- }
-
SilicaFlickable {
anchors.fill: parent
contentHeight: column.height
@@ -39,7 +30,6 @@
height: parent.width / 2
width: parent.width / 2
anchors.horizontalCenter: parent.horizontalCenter
- opacity: 0.7
}
Label {
@@ -54,7 +44,7 @@
Label {
width: parent.width
x : Theme.horizontalPageMargin
- text: Qt.application.version
+ text: Global.appVersion
}
Label {
@@ -77,7 +67,79 @@
+ qsTr("This project tries to offer a solution to consume the contents of the German public broadcasting under Sailfish OS, since there is no native application.")
}
- SectionHeader{
+ SectionHeader {
+ text: qsTr("Social")
+ }
+
+ BackgroundItem {
+ width: parent.width
+ height: Theme.itemSizeMedium
+ contentHeight: Theme.itemSizeMedium
+ Row{
+ width:parent.width - 2 * x
+ height: parent.height
+ x:Theme.horizontalPageMargin
+ spacing:Theme.paddingLarge
+
+ Image {
+ anchors.verticalCenter: parent.verticalCenter
+ width: parent.height * 0.8
+ height: width
+ source: "/usr/share/harbour-" + Qt.application.name + "/icons/mastodon.svg"
+ }
+
+ Label{
+ width: parent.width - parent.height - parent.spacing
+ anchors.verticalCenter: parent.verticalCenter
+ wrapMode: Text.WrapAnywhere
+ font.pixelSize: Theme.fontSizeSmall
+
+ text: "@" + Qt.application.name + "@social.nubecula.org"
+ color: parent.parent.pressed ? Theme.highlightColor : Theme.primaryColor
+
+ }
+ }
+ onClicked: {
+ notify.show(qsTr("Copied to clipboard"))
+ Clipboard.text = "@hafenschau@social.nubecula.org"
+ }
+ }
+
+ ListItem {
+ width: parent.width
+ height: Theme.itemSizeMedium
+ contentHeight: Theme.itemSizeMedium
+ Row{
+ width:parent.width - 2 * x
+ height: parent.height
+ x:Theme.horizontalPageMargin
+ spacing:Theme.paddingLarge
+
+ Image {
+ anchors.verticalCenter: parent.verticalCenter
+ width: parent.height * 0.8
+ height: width
+ source: "/usr/share/harbour-" + Qt.application.name + "/icons/mastodon.svg"
+ }
+
+ Label{
+ width: parent.width - parent.height - parent.spacing
+ anchors.verticalCenter: parent.verticalCenter
+ wrapMode: Text.WrapAnywhere
+ font.pixelSize: Theme.fontSizeSmall
+
+ text: "@blacksheep@social.nubecula.org"
+ color: parent.parent.pressed ? Theme.highlightColor : Theme.primaryColor
+
+ }
+ }
+ onClicked: {
+ notify.show(qsTr("Copied to clipboard"))
+ Clipboard.text = "@blacksheep@social.nubecula.org"
+ }
+ }
+
+ SectionHeader {
text: qsTr("Sources")
}
@@ -88,12 +150,13 @@
width:parent.width - 2 * x
height: parent.height
x:Theme.horizontalPageMargin
- spacing:Theme.paddingMedium
+ spacing:Theme.paddingLarge
Image {
- width: parent.height
+ anchors.verticalCenter: parent.verticalCenter
+ width: parent.height * 0.8
height: width
- source: "qrc:///icons/git"
+ source: "/usr/share/harbour-" + Qt.application.name + "/icons/github.svg"
}
Label{
@@ -102,7 +165,7 @@
wrapMode: Text.WrapAnywhere
font.pixelSize: Theme.fontSizeSmall
- text: "https://github.com/black-sheep-dev/" + appId
+ text: "https://github.com/black-sheep-dev/harbour-" + Qt.application.name
color: parent.parent.pressed ? Theme.highlightColor : Theme.primaryColor
}
@@ -110,13 +173,77 @@
onClicked: Qt.openUrlExternally("https://github.com/black-sheep-dev/" + appId)
}
- ButtonLayout {
+ SectionHeader{
+ text: qsTr("Donations")
+ }
+
+ Label {
+ x : Theme.horizontalPageMargin
+ width: parent.width - 2*x
+
+ wrapMode: Text.Wrap
+ font.pixelSize: Theme.fontSizeSmall
+
+ text: qsTr("If you like my work why not buy me a beer?")
+ }
+
+ BackgroundItem{
width: parent.width
+ height: Theme.itemSizeMedium
- Button {
- text: qsTr("Give star")
- onClicked: sailHubInterface.call("addStar", ["black-sheep-dev", appId])
+ Row{
+ x: Theme.horizontalPageMargin
+ width: parent.width - 2*x
+ height: parent.height
+ spacing:Theme.paddingLarge
+
+ Image {
+ anchors.verticalCenter: parent.verticalCenter
+ width: parent.height * 0.8
+ height: width
+ fillMode: Image.PreserveAspectFit
+ source: "/usr/share/harbour-" + Qt.application.name + "/icons/paypal.svg"
+ }
+ Label{
+ width: parent.width - parent.height - parent.spacing
+ anchors.verticalCenter: parent.verticalCenter
+ wrapMode: Text.WrapAnywhere
+ font.pixelSize: Theme.fontSizeSmall
+ color: parent.parent.pressed ? Theme.highlightColor : Theme.primaryColor
+ text: qsTr("Donate with PayPal")
+ }
+ }
+ onClicked: Qt.openUrlExternally("https://www.paypal.com/paypalme/nubecula/1")
+ }
|
[-]
[+]
|
Added |
_service:tar_git:harbour-hafenschau-0.9.6.tar.bz2/qml/pages/ChannelsPage.qml
^
|
@@ -0,0 +1,66 @@
+import QtQuick 2.0
+import Sailfish.Silica 1.0
+
+import "../delegates"
+import "../models"
+import "../."
+
+Page {
+ id: page
+
+ allowedOrientations: Orientation.All
+
+ NewsModel {
+ id: channelsModel
+ url: "https://www.tagesschau.de/api2/channels"
+ }
+
+ PageBusyIndicator {
+ running: channelsModel.busy && listView.count === 0
+ }
+
+ SilicaListView {
+ PullDownMenu {
+ busy: channelsModel.busy
+
+ MenuItem {
+ text: qsTr("Refresh")
+ onClicked: channelsModel.refresh()
+ }
+ }
+
+ id: listView
+ anchors.fill: parent
+
+ header: PageHeader {
+ title: qsTr("Channels")
+ }
+
+ clip: true
+
+ model: channelsModel
+
+
+ delegate: NewsListItem {
+ id: delegate
+
+ onClicked: pageStack.push(Qt.resolvedUrl("VideoPlayerPage.qml"), {
+ title: title,
+ streams: streams
+ })
+ }
+
+ ViewPlaceholder {
+ enabled: listView.count === 0 && !channelsModel.busy
+ text: qsTr("No channels available")
+ hintText: qsTr("Please refresh or check internet connection!")
+ }
+
+ VerticalScrollDecorator {}
+ }
+
+ onStatusChanged: if (status === PageStatus.Active) pageStack.pushAttached(Qt.resolvedUrl("StreamsListPage.qml"))
+
+ Component.onCompleted: channelsModel.fetch()
+}
+
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-hafenschau-0.9.6.tar.bz2/qml/pages/GalleryPage.qml
^
|
@@ -1,9 +1,8 @@
import QtQuick 2.0
import Sailfish.Silica 1.0
-import org.nubecula.harbour.hafenschau 1.0
-
import "../components/"
+import "../."
Page {
property alias items: view.model
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-hafenschau-0.9.6.tar.bz2/qml/pages/NewsListPage.qml
^
|
@@ -1,254 +1,93 @@
import QtQuick 2.0
import Sailfish.Silica 1.0
-import org.nubecula.harbour.hafenschau 1.0
-
import "../delegates"
+import "../models"
import "../."
Page {
property string ressortTitle
- property int ressort: Ressort.Undefined
- property string ressortQuery
-
- property string previousPage
- property string nextPage
+ property string ressort: ""
id: page
allowedOrientations: Orientation.All
- function checkRequest(request) {
- const parts = request.split('.')
- if (parts.length <= 3) return false
-
- if (parts[0] !== "ressortModel") return false
- if (parts[1] !== String(ressort)) return false
-
- return true
- }
-
- function refresh() {
- newsModel.loading = true
- newsModel.error = false
-
- const query = "https://www.tagesschau.de/api2/news/"
- query += ressortQuery
-
- api.request(query, "ressortModel." + ressort + ".refresh", false)
- }
-
- function loadMore() {
- newsModel.loading = true
- newsModel.error = false
- api.request(nextPage, "ressortModel." + ressort + ".loadMore", false)
- }
-
- Connections {
- target: api
- onRequestFailed: {
- if (checkRequest(id)) return
- newsModel.loading = false
- newsModel.error = true
- notification.show(qsTr("Failed to get news"))
- }
-
- onRequestFinished: {
- if (checkRequest(id)) return
-
- const mode = id.split('.')[2]
-
- newsModel.loading = false
-
- if (mode === "refresh") {
- newsModel.setItems(data.news)
- } else if (mode === "loadMore") {
- newsModel.addItems(data.news)
+ NewsModel {
+ id: newsResortModel
+ url: {
+ if (ressort === "regional") {
+ const regions = JSON.parse(config.activeRegions)
+ return "https://tagesschau.de/api2/news?regions=" + regions.join(',')
+ } else {
+ return "https://tagesschau.de/api2/news?ressort=" + ressort
}
-
- nextPage = data.nextPage
}
}
PageBusyIndicator {
- running: newsModel.loading && listView.count === 0
+ running: newsResortModel.busy && listView.count === 0
}
- SilicaFlickable {
+ SilicaListView {
PullDownMenu {
- busy: newsModel.loading
+ busy: newsResortModel.busy
MenuItem {
text: qsTr("Refresh")
- onClicked: refresh()
- }
- MenuItem {
- text: listView.showSearch ? qsTr("Hide search") : qsTr("Search")
- onClicked: {
- listView.showSearch = !listView.showSearch
-
- if (!listView.showSearch) {
- searchField.focus = false
- searchField.text = ""
- }
- }
- }
- }
-
- PushUpMenu {
- busy: newsModel.loading
- visible: nextPage.length > 0
-
- MenuItem {
- text: qsTr("Load more")
- onClicked: loadMore()
+ onClicked: newsResortModel.refresh()
}
}
+ id: listView
anchors.fill: parent
- Column {
- id: header
- width: parent.width
-
- PageHeader {
- title: page.ressortTitle
- }
-
- SearchField {
- id: searchField
- width: parent.width
- height: listView.showSearch ? implicitHeight : 0
- opacity: listView.showSearch ? 1 : 0
- onTextChanged: {
- filterModel.setFilterFixedString(text)
- }
-
- EnterKey.onClicked: searchField.focus = false
-
- Connections {
- target: listView
- onShowSearchChanged: {
- searchField.forceActiveFocus()
- }
- }
-
- Behavior on height {
- NumberAnimation { duration: 300 }
- }
- Behavior on opacity {
- NumberAnimation { duration: 300 }
- }
- }
+ header: PageHeader {
+ title: page.ressortTitle
}
- SilicaListView {
- property bool showSearch: false
-
- id: listView
+ clip: true
- width: parent.width
- anchors.top: header.bottom
- anchors.bottom: parent.bottom
+ model: newsResortModel
- clip: true
- model: NewsSortFilterModel {
- id: filterModel
- sourceModel: NewsListModel {
- property bool error: false
- property bool loading: false
-
- id: newsModel
- }
- }
+ delegate: NewsListItem {
+ id: delegate
- delegate: NewsListItem {
- id: delegate
-
- onClicked: {
- if (model.type === NewsType.WebView) {
- if (settings.internalWebView) {
- pageStack.push(Qt.resolvedUrl("WebViewPage.qml"), {url: model.detailsWeb })
- } else {
- Qt.openUrlExternally(model.detailsWeb)
- }
- } else if (model.type === NewsType.Video) {
- pageStack.push(Qt.resolvedUrl("VideoPlayerPage.qml"), {
- title: model.title,
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-hafenschau-0.9.6.tar.bz2/qml/pages/ReaderPage.qml
^
|
@@ -1,59 +1,77 @@
import QtQuick 2.0
import Sailfish.Silica 1.0
-import org.nubecula.harbour.hafenschau 1.0
-
import "../components/"
+import "../."
Page {
- property bool error: false
- property string link
- property bool loading: true
- property var news
- property string updateCheckUrl
+ property bool busy: false
+ property string link: ""
+ property var news: undefined
+ property bool ready: false
function checkForUpdate() {
- error = false
+ busy = true
+ Api.request(news.updateCheckUrl, function (data, status) {
+ busy = false
- if (updateCheckUrl === undefined) {
- refresh(false)
- return
- }
+ if (status !== 200) {
+ return
+ }
- api.request(updateCheckUrl, updateCheckUrl, false)
+ if (data === "true") refresh()
+ })
}
- function refresh(cached) {
- error = false
- api.request(link, link, cached)
+ function refresh() {
+ busy = true
+ console.log(link)
+ Api.request(link.length > 0 ? link : news.details, function (data, status) {
+ busy = false
+
+ if (status !== 200) {
+ notify.show(qsTr("Failed to fetch news"))
+ return
+ }
+
+ news = data
+ })
}
+
id: page
allowedOrientations: Orientation.All
+ onNewsChanged: {
+ ready = true
+ refreshContent()
+ }
+
PageBusyIndicator {
- running: loading && news === undefined
+ running: busy && !ready
}
SilicaFlickable {
PullDownMenu {
+ busy: busy
+
MenuItem {
- visible: settings.developerOptions & DeveloperOption.SaveNews
+ visible: config.developerMode
- text: qsTr("Save news data")
- onClicked: dataWriter.saveNews(news)
+ text: qsTr("Show raw data")
+ onClicked: pageStack.push(Qt.resolvedUrl("DataReaderPage.qml"), { text: JSON.stringify(news, null, '\t') });
}
MenuItem {
text: qsTr("Refresh")
- onClicked: checkForUpdate()
+ onClicked: refresh()
}
MenuItem {
visible: news.hasOwnProperty("shareURL")
- text: qsTr("Share")
- onClicked: Qt.openUrlExternally(news.shareURL)
+ text: qsTr("Copy link to clipboard")
+ onClicked: Clipboard.text = news.shareURL
}
MenuItem {
@@ -61,63 +79,51 @@
text: qsTr("Comments")
onClicked: pageStack.push(Qt.resolvedUrl("CommentsListPage.qml"), {link: news.comments})
}
-
- busy: loading
}
PushUpMenu {
+ busy: busy
visible: news.hasOwnProperty("comments")
+
MenuItem {
text: qsTr("Comments")
onClicked: pageStack.push(Qt.resolvedUrl("CommentsListPage.qml"), {link: news.comments})
}
}
- visible: !loading
-
anchors.fill: parent
contentHeight: headerImage.height + columnHeader.height + columnContent.height + bottomSpacer.height
- opacity: (loading && news === undefined) ? 0.0 : 1.0
-
- Behavior on opacity { FadeAnimation {} }
-
- ViewPlaceholder {
- enabled: error && !loading
- text: qsTr("Failed to load news")
- hintText: qsTr("Check your internet connection")
- }
-
RemoteImage {
id: headerImage
- visible: !error
- opacity: news === undefined ? 0:1
+ opacity: !ready ? 0:1
Behavior on opacity {
- FadeAnimation {}
+ FadeAnimation { duration: 150 }
}
- anchors.left: parent.left
- anchors.right: parent.right
+ anchors {
+ left: parent.left
+ right: parent.right
+ }
- source: news.teaserImage.videowebl.imageurl
+ source: Tools.getPreferredImageSize16x9(width, news.teaserImage.imageVariants)
}
Column {
id: columnHeader
- visible: !error
- opacity: news === undefined ? 0:1
+ opacity: !ready ? 0:1
Behavior on opacity {
- FadeAnimation {}
+ FadeAnimation { duration: 500 }
}
anchors.top: headerImage.bottom
x: Theme.horizontalPageMargin
width: parent.width - 2*x
- spacing: Theme.paddingSmall
+ spacing: Theme.paddingLarge
Item {
height: Theme.paddingSmall
@@ -181,17 +187,16 @@
Column {
id: columnContent
- visible: !error
- opacity: news === undefined ? 0:1
+ opacity: !ready ? 0:1
Behavior on opacity {
- FadeAnimation {}
+ FadeAnimation { duration: 1000 }
}
anchors.top: columnHeader.bottom
width: parent.width
- spacing: Theme.paddingMedium
+ spacing: Theme.paddingLarge
}
Item {
@@ -201,32 +206,12 @@
height: Theme.paddingMedium
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-hafenschau-0.9.6.tar.bz2/qml/pages/RessortListPage.qml
^
|
@@ -1,8 +1,6 @@
import QtQuick 2.0
import Sailfish.Silica 1.0
-import org.nubecula.harbour.hafenschau 1.0
-
Page {
id: page
@@ -17,21 +15,21 @@
description: qsTr("Browse domestic news")
icon: "image://theme/icon-m-home"
page: "NewsListPage.qml"
- ressort: Ressort.Inland
+ ressort: "inland"
}
ListElement {
title: qsTr("Foreign News");
description: qsTr("Browse news from foreign countries")
icon: "image://theme/icon-m-airplane-mode"
page: "NewsListPage.qml"
- ressort: Ressort.Ausland
+ ressort: "ausland"
}
ListElement {
title: qsTr("Economic News");
description: qsTr("Browse economic news")
icon: "image://theme/icon-m-storage"
page: "NewsListPage.qml"
- ressort: Ressort.Wirtschaft
+ ressort: "wirtschaft"
}
ListElement {
@@ -39,35 +37,35 @@
description: qsTr("Browse investigative news")
icon: "image://theme/icon-m-camera"
page: "NewsListPage.qml"
- ressort: Ressort.Investigativ
+ ressort: "investigativ"
}
ListElement {
title: qsTr("Regional News");
description: qsTr("Browse regional news")
icon: "image://theme/icon-m-location"
page: "NewsListPage.qml"
- ressort: Ressort.Regional
+ ressort: "regional"
}
ListElement {
title: qsTr("Sport News");
description: qsTr("Browse sport news")
icon: "image://theme/icon-m-person"
page: "NewsListPage.qml"
- ressort: Ressort.Sport
+ ressort: "sport"
}
ListElement {
title: qsTr("Videos");
description: qsTr("Browse videos")
icon: "image://theme/icon-m-video"
page: "NewsListPage.qml"
- ressort: Ressort.Video
+ ressort: "video"
}
ListElement {
title: qsTr("Search");
description: qsTr("Search content")
icon: "image://theme/icon-m-search"
page: "SearchPage.qml"
- ressort: Ressort.Search
+ ressort: "search"
}
}
@@ -127,7 +125,6 @@
}
onClicked: {
- if (model.ressort)
pageStack.push(Qt.resolvedUrl(page), {
ressort: model.ressort,
ressortTitle: model.title
@@ -138,7 +135,7 @@
VerticalScrollDecorator {}
}
- onStatusChanged: if (status === PageStatus.Active) pageStack.pushAttached(Qt.resolvedUrl("StreamsListPage.qml"))
+ onStatusChanged: if (status === PageStatus.Active) pageStack.pushAttached(Qt.resolvedUrl("ChannelsPage.qml"))
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-hafenschau-0.9.6.tar.bz2/qml/pages/SearchPage.qml
^
|
@@ -1,59 +1,45 @@
import QtQuick 2.0
import Sailfish.Silica 1.0
-import org.nubecula.harbour.hafenschau 1.0
-
import "../delegates"
+import "../."
Page {
- property int ressort: Ressort.Search
+ property bool busy: false
+ property string ressort
property string ressortTitle
property int currentPage: 0
property int totalItemCount: 0
readonly property int pageSize: 20
- function search() {
- newsModel.loading = true
- newsModel.error = false
+ //property var items: []
- const query = "https://www.tagesschau.de/api2/search/"
- query += "?searchText=" + searchField.text
- query += "&resultPage=" + currentPage
- query += "&pageSize=" + pageSize
+ function search() {
+ var query = "https://www.tagesschau.de/api2/search"
+ + "?searchText=" + searchField.text
+ + "&resultPage=" + currentPage
+ + "&pageSize=" + pageSize
+
+ busy = true
+ Api.request(query, function(data, status) {
+ busy = false
+ if (status !== 200) {
+ notify.show(qsTr("Failed to search"))
+ console.log("Failed to search, got status:", status)
+ return
+ }
- api.request(query, "search", false)
+ totalItemCount = data.totalItemCount
+ data.searchResults.forEach(function(item) { searchModel.append(item) })
+ })
}
function reset() {
currentPage = 0
totalItemCount = 0
searchField.text = ""
- newsModel.clear()
- }
-
- Connections {
- target: api
- onRequestFailed: {
- if (id !== "search") return
- newsModel.loading = false
- newsModel.error = true
- notification.show(qsTr("Failed to get news"))
- }
-
- onRequestFinished: {
- if (id !== "search") return
-
- newsModel.loading = false
-
- if (currentPage > 0) {
- newsModel.addItems(data.searchResults)
- } else {
- newsModel.setItems(data.searchResults)
- }
-
- totalItemCount = data.totalItemCount
- }
+ //items = []
}
id: page
@@ -61,18 +47,6 @@
allowedOrientations: Orientation.All
SilicaFlickable {
- PushUpMenu {
- busy: newsModel.loading
- visible: totalItemCount > pageSize * currentPage + 1
- MenuItem {
- text: qsTr("Load more") + " (" + (currentPage + 1) + "/" + (Math.floor(totalItemCount / pageSize)) + ")"
- onClicked: {
- currentPage++
- search()
- }
- }
- }
-
anchors.fill: parent
Column {
@@ -100,41 +74,43 @@
}
PageBusyIndicator {
- running: newsModel.loading && listView.count === 0
+ running: busy && listView.count === 0
}
SilicaListView {
id: listView
+ onAtYEndChanged: {
+ if (atYEnd && totalItemCount > pageSize * currentPage + 1) {
+ currentPage++
+ search()
+ }
+ }
+
width: parent.width
anchors.top: header.bottom
anchors.bottom: parent.bottom
clip: true
- model: NewsListModel {
- property bool error: false
- property bool loading: false
-
- id: newsModel
- }
+ model: ListModel { id: searchModel }
delegate: NewsListItem {
id: delegate
onClicked: {
- if (model.type === NewsType.WebView) {
- pageStack.push(Qt.resolvedUrl("../dialogs/OpenExternalUrlDialog.qml"), {url: model.detailsWeb })
- } else if (model.type === NewsType.Video) {
- pageStack.push(Qt.resolvedUrl("../pages/VideoPlayerPage.qml"), {streams: model.streams})
+ if (modelData.type === "webview") {
+ pageStack.push(Qt.resolvedUrl("WebViewPage.qml"), {url: modelData.detailsWeb })
+ } else if (modelData.type === "video") {
+ pageStack.push(Qt.resolvedUrl("../pages/VideoPlayerPage.qml"), {streams: modelData.streams})
} else {
- pageStack.push(Qt.resolvedUrl("ReaderPage.qml"), {link: model.details})
+ pageStack.push(Qt.resolvedUrl("ReaderPage.qml"), {link: modelData.details})
}
}
}
ViewPlaceholder {
- enabled: listView.count === 0 && !newsModel.loading
+ enabled: listView.count === 0 && busy
text: qsTr("No content found")
hintText: qsTr("Type in a search pattern to find content")
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-hafenschau-0.9.6.tar.bz2/qml/pages/StartPage.qml
^
|
@@ -1,8 +1,6 @@
import QtQuick 2.0
import Sailfish.Silica 1.0
-import org.nubecula.harbour.hafenschau 1.0
-
import "../delegates"
import "../."
@@ -12,19 +10,23 @@
allowedOrientations: Orientation.All
PageBusyIndicator {
- running: mainModel.loading && listView.count === 0
+ running: mainNews.busy && listView.count === 0
}
SilicaListView {
PullDownMenu {
- busy: mainModel.loading
+ busy: mainNews.busy
+ MenuItem {
+ text: qsTr("About")
+ onClicked: pageStack.push(Qt.resolvedUrl("AboutPage.qml"))
+ }
MenuItem {
text: qsTr("Settings")
onClicked: pageStack.push(Qt.resolvedUrl("settings/SettingsPage.qml"))
}
MenuItem {
text: qsTr("Refresh")
- onClicked: mainModel.checkForUpdate()
+ onClicked: mainNews.refresh()
}
}
@@ -32,35 +34,31 @@
anchors.fill: parent
- opacity: (mainModel.loading && listView.count === 0) ? 0.0 : 1.0
-
- Behavior on opacity { FadeAnimation {} }
-
header: PageHeader {
title: qsTr("Top News")
}
- model: mainModel
+ model: mainNews
delegate: NewsListItem {
id: delegate
onClicked: {
- if (model.type === NewsType.WebView) {
- if (settings.internalWebView) {
- pageStack.push(Qt.resolvedUrl("WebViewPage.qml"), {url: model.detailsWeb })
+ if (type === "webview") {
+ if (config.internalWebView) {
+ pageStack.push(Qt.resolvedUrl("WebViewPage.qml"), { url: detailsweb })
} else {
- Qt.openUrlExternally(model.detailsWeb)
+ Qt.openUrlExternally(detailsweb)
}
} else {
- pageStack.push(Qt.resolvedUrl("ReaderPage.qml"), {link: model.details})
+ pageStack.push(Qt.resolvedUrl("ReaderPage.qml"), { link: details })
}
}
}
ViewPlaceholder {
- visible: !mainModel.loading
+ visible: !mainNews.busy
enabled: listView.count === 0
text: qsTr("No news available")
hintText: qsTr("Check your internet connection")
@@ -69,7 +67,5 @@
VerticalScrollDecorator {}
}
- Component.onCompleted: mainModel.refresh()
-
onStatusChanged: if (status === PageStatus.Active) pageStack.pushAttached(Qt.resolvedUrl("RessortListPage.qml"))
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-hafenschau-0.9.6.tar.bz2/qml/pages/StreamsListPage.qml
^
|
@@ -1,8 +1,6 @@
import QtQuick 2.0
import Sailfish.Silica 1.0
-import org.nubecula.harbour.hafenschau 1.0
-
import "../components/"
Page {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-hafenschau-0.9.6.tar.bz2/qml/pages/VideoPlayerPage.qml
^
|
@@ -4,8 +4,6 @@
import QtMultimedia 5.6
-import org.nubecula.harbour.hafenschau 1.0
-
Page {
property alias title: titleLabel.text
property var streams
@@ -28,16 +26,16 @@
source: {
if (livestream.length > 0) return livestream
- if (settings.videoQualityAdaptive && streams.hasOwnProperty("adaptivestreaming")) return streams.adaptivestreaming
+ if (config.videoQualityAdaptive && streams.hasOwnProperty("adaptivestreaming")) return streams.adaptivestreaming
- switch (settings.videoQuality) {
- case VideoQuality.Low:
+ switch (config.videoQuality) {
+ case 0:
return streams.h264s
- case VideoQuality.Medium:
+ case 1:
return streams.h264m
- case VideoQuality.High:
+ case 2:
return streams.h264xl
default:
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-hafenschau-0.9.6.tar.bz2/qml/pages/settings/SettingsAutoRefreshPage.qml
^
|
@@ -2,7 +2,7 @@
import Sailfish.Silica 1.0
import Nemo.KeepAlive 1.2
-import org.nubecula.harbour.hafenschau 1.0
+import "../../."
Page {
id: page
@@ -52,35 +52,35 @@
onCurrentIndexChanged: {
switch (currentIndex) {
case 0:
- settings.autoRefresh = 0
+ config.autoRefresh = 0
break
case 1:
- settings.autoRefresh = BackgroundJob.ThirtySeconds
+ config.autoRefresh = BackgroundJob.ThirtySeconds
break
case 2:
- settings.autoRefresh = BackgroundJob.TwoAndHalfMinutes
+ config.autoRefresh = BackgroundJob.TwoAndHalfMinutes
break
case 3:
- settings.autoRefresh = BackgroundJob.FiveMinutes
+ config.autoRefresh = BackgroundJob.FiveMinutes
break
case 4:
- settings.autoRefresh = BackgroundJob.FifteenMinutes
+ config.autoRefresh = BackgroundJob.FifteenMinutes
break
case 5:
- settings.autoRefresh = BackgroundJob.ThirtyMinutes
+ config.autoRefresh = BackgroundJob.ThirtyMinutes
break
case 6:
- settings.autoRefresh = BackgroundJob.OneHour
+ config.autoRefresh = BackgroundJob.OneHour
break
default:
- settings.autoRefresh = 0
+ config.autoRefresh = 0
break
}
@@ -88,7 +88,7 @@
}
Component.onCompleted: {
- switch (settings.autoRefresh) {
+ switch (config.autoRefresh) {
case BackgroundJob.ThirtySeconds:
currentIndex = 1
break
@@ -130,9 +130,9 @@
text: qsTr("Notification")
description: qsTr("Enable notification if breaking news is available")
- onCheckedChanged: settings.notify = checked
+ onCheckedChanged: config.notify = checked
- Component.onCompleted: checked = settings.notify
+ Component.onCompleted: checked = config.notify
}
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-hafenschau-0.9.6.tar.bz2/qml/pages/settings/SettingsCoverPage.qml
^
|
@@ -22,14 +22,25 @@
}
TextSwitch {
+ id: coverShowSwitch
+ x: Theme.horizontalPageMargin
+ width: page.width - 2*x
+ text: qsTr("Show news directly")
+ description: qsTr("Open news instead of news list when pressing cover.")
+
+ onCheckedChanged: config.coverShowNews = checked
+ Component.onCompleted: checked = config.coverShowNews
+ }
+
+ TextSwitch {
id: coverSwitch
x: Theme.horizontalPageMargin
width: page.width - 2*x
text: qsTr("Switch Cover")
- description: qsTr("Turns on automatich switch of cover pages in a defined interval.")
+ description: qsTr("Turns on automatic switch of cover pages in a defined interval.")
- onCheckedChanged: settings.coverSwitch = checked
- Component.onCompleted: checked = settings.coverSwitch
+ onCheckedChanged: config.coverSwitch = checked
+ Component.onCompleted: checked = config.coverSwitch
}
TextField {
@@ -45,8 +56,8 @@
label: qsTr("Update interval (msec)")
description: qsTr("Update interval for cover page switch")
- onTextChanged: settings.coverSwitchInterval = text
- Component.onCompleted: text = settings.coverSwitchInterval
+ onTextChanged: config.coverSwitchInterval = text
+ Component.onCompleted: text = config.coverSwitchInterval
}
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-hafenschau-0.9.6.tar.bz2/qml/pages/settings/SettingsDeveloperPage.qml
^
|
@@ -1,8 +1,6 @@
import QtQuick 2.0
import Sailfish.Silica 1.0
-import org.nubecula.harbour.hafenschau 1.0
-
Page {
id: page
@@ -27,40 +25,13 @@
id: saveNewsDataSwitch
x: Theme.horizontalPageMargin
width: page.width - 2*x
- text: qsTr("Save news api data")
- description: qsTr("When activated an option to save the raw api data is available in pulldown menu on every reader page.")
- + "\n"
- + qsTr("The data is stored in Documents folder on the device.")
- + "\n"
- + qsTr("When there is a problem with displaying a special news, provide this data on GitHub as an issue to help fixing it. An additional screenshot helps too!")
-
- onCheckedChanged: {
- if (checked)
- settings.developerOptions |= DeveloperOption.SaveNews
- else
- settings.developerOptions &= ~DeveloperOption.SaveNews
- }
-
-
- Component.onCompleted: checked = (settings.developerOptions & DeveloperOption.SaveNews) === DeveloperOption.SaveNews
- }
-
- TextSwitch {
- id: showUnkownContentSwitch
- x: Theme.horizontalPageMargin
- width: page.width - 2*x
- text: qsTr("Show unkown content")
- description: qsTr("If enabled unkown content items are displayed in the reader page.")
+ text: qsTr("Developer mode")
+ description: qsTr("When active some developer options are available inside the app")
- onCheckedChanged: {
- if (checked)
- settings.developerOptions |= DeveloperOption.ShowUnkownContent
- else
- settings.developerOptions &= ~DeveloperOption.ShowUnkownContent
- }
+ onCheckedChanged: config.developerMode = checked
- Component.onCompleted: checked = (settings.developerOptions & DeveloperOption.ShowUnkownContent) === DeveloperOption.ShowUnkownContent
+ Component.onCompleted: checked = config.developerMode
}
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-hafenschau-0.9.6.tar.bz2/qml/pages/settings/SettingsPage.qml
^
|
@@ -45,18 +45,6 @@
icon: "image://theme/icon-m-developer-mode"
page: "SettingsDeveloperPage.qml"
}
- ListElement {
- title: qsTr("Cache Settings");
- description: qsTr("Manage cache options")
- icon: "image://theme/icon-m-storage"
- page: "SettingsCachePage.qml"
- }
- ListElement {
- title: qsTr("About");
- description: qsTr("Show about page")
- icon: "image://theme/icon-m-about"
- page: "../AboutPage.qml"
- }
}
anchors.fill: parent
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-hafenschau-0.9.6.tar.bz2/qml/pages/settings/SettingsRegionsPage.qml
^
|
@@ -1,13 +1,13 @@
import QtQuick 2.0
import Sailfish.Silica 1.0
-import org.nubecula.harbour.hafenschau 1.0
-
import "../../."
Page {
id: page
+ property var activeRegions: []
+
allowedOrientations: Orientation.All
SilicaListView {
@@ -15,8 +15,7 @@
MenuItem {
text: qsTr("Reset")
onClicked: remorse.execute(qsTr("Reset region settings"), function() {
- regionsModel.resetRegions()
- settings.regions = ""
+ activeRegions = []
})
}
}
@@ -24,9 +23,74 @@
RemorsePopup { id: remorse }
id: listView
- model: RegionsModel {
+ model: ListModel {
id: regionsModel
- activeRegions: Global.activeRegions
+
+ ListElement {
+ name: "Baden-Württemberg"
+ value: 1
+ }
+ ListElement {
+ name: "Bayern"
+ value: 2
+ }
+ ListElement {
+ name: "Berlin"
+ value: 3
+ }
+ ListElement {
+ name: "Brandenburg"
+ value: 4
+ }
+ ListElement {
+ name: "Bremen"
+ value: 5
+ }
+ ListElement {
+ name: "Hamburg"
+ value: 6
+ }
+ ListElement {
+ name: "Hessen"
+ value: 7
+ }
+ ListElement {
+ name: "Mecklenburg-Vorpommern"
+ value: 8
+ }
+ ListElement {
+ name: "Niedersachsen"
+ value: 9
+ }
+ ListElement {
+ name: "Nordrhein-Westfalen"
+ value: 10
+ }
+ ListElement {
+ name: "Rheinland-Pfalz"
+ value: 11
+ }
+ ListElement {
+ name: "Saarland"
+ value: 12
+ }
+ ListElement {
+ name: "Sachsen"
+ value: 13
+ }
+ ListElement {
+ name: "Sachsen-Anhalt"
+ value: 14
+ }
+ ListElement {
+ name: "Schleswig-Holstein"
+ value: 15
+ }
+ ListElement {
+ name: "Thüringen"
+ value: 16
+ }
+
}
anchors.fill: parent
@@ -56,16 +120,27 @@
anchors.left: nameLabel.right
anchors.verticalCenter: parent.verticalCenter
- visible: active
+ visible: activeRegions.indexOf(value) >= 0
source: "image://theme/icon-m-acknowledge?" + Theme.highlightColor
}
- onClicked: active = !active
+ onClicked: {
+ var regions = activeRegions
+ const idx = activeRegions.indexOf(value)
+ if (idx >= 0) {
+ regions.splice(idx, 1)
+ } else {
+ regions.push(value)
+ }
+ activeRegions = regions
+ }
}
VerticalScrollDecorator {}
}
- onStatusChanged: if (status === PageStatus.Deactivating) Global.activeRegions = regionsModel.activeRegions
+ onStatusChanged: if (status === PageStatus.Deactivating) config.activeRegions = JSON.stringify(activeRegions)
+
+ Component.onCompleted: activeRegions = JSON.parse(config.activeRegions)
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-hafenschau-0.9.6.tar.bz2/qml/pages/settings/SettingsVideoPage.qml
^
|
@@ -2,8 +2,6 @@
import Sailfish.Silica 1.0
import Nemo.KeepAlive 1.2
-import org.nubecula.harbour.hafenschau 1.0
-
Page {
id: page
@@ -43,9 +41,9 @@
text: qsTr("Adaptive Streaming")
description: qsTr("Use adaptive streaming when possible")
- onCheckedChanged: settings.videoQualityAdaptive = checked
+ onCheckedChanged: config.videoQualityAdaptive = checked
- Component.onCompleted: checked = settings.videoQualityAdaptive
+ Component.onCompleted: checked = config.videoQualityAdaptive
}
ComboBox {
@@ -59,8 +57,8 @@
MenuItem { text: qsTr("High") }
}
- onCurrentIndexChanged: settings.videoQuality = currentIndex
- Component.onCompleted: currentIndex = settings.videoQuality
+ onCurrentIndexChanged: config.videoQuality = currentIndex
+ Component.onCompleted: currentIndex = config.videoQuality
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-hafenschau-0.9.6.tar.bz2/qml/pages/settings/SettingsWebviewPage.qml
^
|
@@ -28,9 +28,9 @@
text: qsTr("Internal Webview")
description: qsTr("When deactivated the web content will be opened in the extarnal browser instead of the internal webview.")
- onCheckedChanged: settings.internalWebView = checked
+ onCheckedChanged: config.internalWebView = checked
- Component.onCompleted: checked = settings.internalWebView
+ Component.onCompleted: checked = config.internalWebView
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-hafenschau-0.9.6.tar.bz2/qml/qmldir
^
|
@@ -1,2 +1,4 @@
#qmldir
singleton Global 1.0 global.qml
+singleton Api 1.0 api.qml
+singleton Tools 1.0 tools.qml
|
[-]
[+]
|
Added |
_service:tar_git:harbour-hafenschau-0.9.6.tar.bz2/qml/tools.qml
^
|
@@ -0,0 +1,31 @@
+pragma Singleton
+import QtQuick 2.0
+
+Item {
+ function getPreferredImageSize1x1(width, variants) {
+ const keys = Object.keys(variants)
+
+ var size = 640
+ if (width <= 144 && keys.indexOf("16x9-144") >= 0) size = 144
+ if (width <= 256 && keys.indexOf("16x9-256") >= 0) size = 256
+ if (width <= 432 && keys.indexOf("16x9-432") >= 0) size = 432
+ if (width <= 640 && keys.indexOf("16x9-640") >= 0) size = 640
+
+ console.log("1x1-" + size)
+ return variants["1x1-" + size]
+ }
+
+ function getPreferredImageSize16x9(width, variants) {
+ const keys = Object.keys(variants)
+
+ var size = 1280
+ if (width <= 256 && keys.indexOf("16x9-256") >= 0) size = 256
+ if (width <= 384 && keys.indexOf("16x9-384") >= 0) size = 384
+ if (width <= 512 && keys.indexOf("16x9-512") >= 0) size = 512
+ if (width <= 640 && keys.indexOf("16x9-640") >= 0) size = 640
+ if (width <= 960 && keys.indexOf("16x9-960") >= 0) size = 960
+ if (width <= 1280 && keys.indexOf("16x9-1920") >= 0) size = 1280
+
+ return variants["16x9-" + size]
+ }
+}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-hafenschau-0.9.6.tar.bz2/translations/harbour-hafenschau-de.ts
^
|
@@ -17,7 +17,7 @@
</message>
<message>
<source>I am not the producer of the content used in the app! The content and its copyright belongs to tagesschau.de!</source>
- <translation>Ich bin nicht der Erzeuger der Inhalte welcche in dieser Anwendung gezeigt werden! Die Inhalte und damit das Copyrigth gehören zu tagesschau.de!</translation>
+ <translation>Ich bin nicht der Erzeuger der Inhalte welche in dieser Anwendung gezeigt werden! Die Inhalte und damit das Copyright gehören zu tagesschau.de!</translation>
</message>
<message>
<source>This project tries to offer a solution to consume the contents of the German public broadcasting under Sailfish OS, since there is no native application.</source>
@@ -28,31 +28,54 @@
<translation>Quellen</translation>
</message>
<message>
- <source>Give star</source>
- <translation type="unfinished"></translation>
+ <source>Social</source>
+ <translation>Soziale Medien</translation>
+ </message>
+ <message>
+ <source>Donations</source>
+ <translation>Spenden</translation>
+ </message>
+ <message>
+ <source>If you like my work why not buy me a beer?</source>
+ <translation>Wenn dir meine Arbeit gefällt, warum mir kein Bier ausgeben?</translation>
+ </message>
+ <message>
+ <source>Donate with PayPal</source>
+ <translation>Spenden via PayPal</translation>
+ </message>
+ <message>
+ <source>Donate with Liberpay</source>
+ <translation>Spenden via Liberpay</translation>
+ </message>
+ <message>
+ <source>Copied to clipboard</source>
+ <translation>In die Zwischenablage kopiert</translation>
</message>
</context>
<context>
- <name>CommentsListPage</name>
+ <name>ChannelsPage</name>
<message>
<source>Refresh</source>
<translation>Aktualisieren</translation>
</message>
<message>
- <source>Sort descending</source>
- <translation>Absteigend sortieren</translation>
+ <source>Channels</source>
+ <translation>Multimedia Kanäle</translation>
</message>
<message>
- <source>Sort ascending</source>
- <translation>Aufsteigend sortieren</translation>
+ <source>No channels available</source>
+ <translation>Keine Kanäle verfügbar</translation>
</message>
<message>
- <source>Hide search</source>
- <translation>Suche ausblenden</translation>
+ <source>Please refresh or check internet connection!</source>
+ <translation>Aktualisieren oder die Internetverbindung prüfen!</translation>
</message>
+</context>
+<context>
+ <name>CommentsListPage</name>
<message>
- <source>Search</source>
- <translation>Suchen</translation>
+ <source>Refresh</source>
+ <translation>Aktualisieren</translation>
</message>
<message>
<source>Comments (closed)</source>
@@ -74,6 +97,28 @@
<source>Show in browser</source>
<translation>Im Browser anzeigen</translation>
</message>
+ <message numerus="yes">
+ <source>%n comment(s)</source>
+ <translation>
+ <numerusform>%n Kommentar</numerusform>
+ <numerusform>%n Kommentare</numerusform>
+ </translation>
+ </message>
+ <message>
+ <source>Sort descending</source>
+ <translation>Absteigend sortieren</translation>
+ </message>
+ <message>
+ <source>Sort ascending</source>
+ <translation>Aufsteigend sortieren</translation>
+ </message>
+</context>
+<context>
+ <name>CommentsModel</name>
+ <message>
+ <source>Failed to fetch comments</source>
+ <translation>Konnte Kommentare nicht laden</translation>
+ </message>
</context>
<context>
<name>ContentGallery</name>
@@ -81,7 +126,7 @@
<source>Gallery with %n pictures</source>
<translation>
<numerusform>Galerie mit %n Bild</numerusform>
- <numerusform>Galerie mit %n Bilder</numerusform>
+ <numerusform>Galerie mit %n Bildern</numerusform>
</translation>
</message>
</context>
@@ -107,18 +152,21 @@
</message>
</context>
<context>
- <name>NewsListPage</name>
+ <name>NewsListItem</name>
<message>
- <source>Refresh</source>
- <translation>Aktualisieren</translation>
+ <source>Copy link to clipboard</source>
+ <translation>Link in Zwischenablage kopieren</translation>
</message>
+</context>
+<context>
+ <name>NewsListPage</name>
<message>
- <source>Hide search</source>
- <translation>Suche ausblenden</translation>
+ <source></source>
+ <translation></translation>
</message>
<message>
- <source>Search</source>
- <translation>Suchen</translation>
+ <source>Refresh</source>
+ <translation>Aktualisieren</translation>
</message>
<message>
<source>No news available</source>
@@ -126,23 +174,26 @@
</message>
<message>
<source>Please select some regions in settings first!</source>
- <translation>Bitte zuerst einige Regionen in den Einstellungen festlegen!</translation>
+ <translation>Bitte zuerst eine Region in den Einstellungen auswählen!</translation>
</message>
<message>
<source>Please refresh or check internet connection!</source>
- <translation>Bitte aktualisieren oder die Internetverbindung prüfen!</translation>
+ <translation>Aktualisieren oder die Internetverbindung prüfen!</translation>
</message>
+</context>
+<context>
+ <name>NewsModel</name>
<message>
- <source></source>
- <translation></translation>
+ <source>No updates available</source>
+ <translation>Keine Updates verfügbar</translation>
</message>
<message>
- <source>Load more</source>
- <translation>Mehr laden</translation>
+ <source>Failed to fetch news</source>
+ <translation>Laden von Nachrichten fehlgeschlagen</translation>
</message>
<message>
- <source>Failed to get news</source>
- <translation>Laden von Nachrichten fehlgeschlagen</translation>
+ <source>Failed to fetch more news</source>
+ <translation>Konnte keine weiteren Nachrichten laden</translation>
</message>
</context>
<context>
@@ -160,20 +211,16 @@
<translation>Zeit:</translation>
</message>
<message>
- <source>Share</source>
- <translation>Teilen</translation>
+ <source>Copy link to clipboard</source>
+ <translation>Link in Zwischenablage kopieren</translation>
</message>
<message>
- <source>Save news data</source>
- <translation>Daten speichern</translation>
- </message>
- <message>
- <source>Failed to load news</source>
+ <source>Failed to fetch news</source>
<translation>Laden von Nachrichten fehlgeschlagen</translation>
</message>
<message>
- <source>Check your internet connection</source>
- <translation>Überprüfe deine Internetverbindung</translation>
+ <source>Show raw data</source>
+ <translation>Zeige Rohdaten</translation>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-hafenschau-0.9.6.tar.bz2/translations/harbour-hafenschau.ts
^
|
@@ -28,30 +28,53 @@
<translation type="unfinished"></translation>
</message>
<message>
- <source>Give star</source>
+ <source>Social</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Donations</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>If you like my work why not buy me a beer?</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Donate with PayPal</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Donate with Liberpay</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Copied to clipboard</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
- <name>CommentsListPage</name>
+ <name>ChannelsPage</name>
<message>
<source>Refresh</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Sort descending</source>
+ <source>Channels</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Sort ascending</source>
+ <source>No channels available</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Hide search</source>
+ <source>Please refresh or check internet connection!</source>
<translation type="unfinished"></translation>
</message>
+</context>
+<context>
+ <name>CommentsListPage</name>
<message>
- <source>Search</source>
+ <source>Refresh</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -74,6 +97,28 @@
<source>Show in browser</source>
<translation type="unfinished"></translation>
</message>
+ <message numerus="yes">
+ <source>%n comment(s)</source>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ <numerusform></numerusform>
+ </translation>
+ </message>
+ <message>
+ <source>Sort descending</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Sort ascending</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>CommentsModel</name>
+ <message>
+ <source>Failed to fetch comments</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>ContentGallery</name>
@@ -107,17 +152,20 @@
</message>
</context>
<context>
- <name>NewsListPage</name>
+ <name>NewsListItem</name>
<message>
- <source>Refresh</source>
+ <source>Copy link to clipboard</source>
<translation type="unfinished"></translation>
</message>
+</context>
+<context>
+ <name>NewsListPage</name>
<message>
- <source>Hide search</source>
- <translation type="unfinished"></translation>
+ <source></source>
+ <translation></translation>
</message>
<message>
- <source>Search</source>
+ <source>Refresh</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -132,16 +180,19 @@
<source>Please refresh or check internet connection!</source>
<translation type="unfinished"></translation>
</message>
+</context>
+<context>
+ <name>NewsModel</name>
<message>
- <source></source>
- <translation></translation>
+ <source>No updates available</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <source>Load more</source>
+ <source>Failed to fetch news</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Failed to get news</source>
+ <source>Failed to fetch more news</source>
<translation type="unfinished"></translation>
</message>
</context>
@@ -160,19 +211,15 @@
<translation type="unfinished"></translation>
</message>
<message>
- <source>Share</source>
+ <source>Copy link to clipboard</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Save news data</source>
+ <source>Failed to fetch news</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Failed to load news</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Check your internet connection</source>
+ <source>Show raw data</source>
<translation type="unfinished"></translation>
</message>
</context>
@@ -250,19 +297,15 @@
<context>
<name>SearchPage</name>
<message>
- <source>Failed to get news</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Load more</source>
+ <source>No content found</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>No content found</source>
+ <source>Type in a search pattern to find content</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Type in a search pattern to find content</source>
+ <source>Failed to search</source>
<translation type="unfinished"></translation>
</message>
</context>
@@ -308,17 +351,6 @@
</message>
</context>
<context>
- <name>SettingsCachePage</name>
- <message>
- <source>Cache Settings</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Reset</source>
- <translation type="unfinished"></translation>
- </message>
-</context>
-<context>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-hafenschau.yaml
^
|
@@ -1,11 +1,12 @@
Name: harbour-hafenschau
Summary: Hafenschau
-Version: 0.7.3
+Version: 0.9.6
Release: 1
# The contents of the Group field should be one of the groups listed here:
# https://github.com/mer-tools/spectacle/blob/master/data/GROUPS
Group: Qt/Qt
URL: https://github.com/black-sheep-dev/harbour-hafenschau
+BuildArch: noarch
License: MIT
# This must be generated before uploading a package to a remote build service.
# Usually this line does not need to be modified.
@@ -28,20 +29,17 @@
Url:
Donation: https://www.paypal.com/paypalme/nubecula/1
%endif
-
Builder: qmake5
# This section specifies build dependencies that are resolved using pkgconfig.
# This is the preferred way of specifying build dependencies for your package.
PkgConfigBR:
- - sailfishapp >= 1.0.2
+ - sailfishapp >= 1.0.3
- Qt5Core
- - Qt5DBus
- - Qt5Network
- Qt5Qml
- Qt5Quick
+ - qt5embedwidget
- nemonotifications-qt5
- - qt5embedwidget >= 1.14.9
- keepalive
# Build dependencies without a pkgconfig setup can be listed here
@@ -51,13 +49,11 @@
# Runtime dependencies which are not automatically detected
Requires:
- sailfishsilica-qt5 >= 0.10.9
+ - libsailfishapp-launcher
# All installed files
Files:
- - '%{_bindir}'
+ - '%defattr(0644,root,root,-)'
- '%{_datadir}/%{name}'
- '%{_datadir}/applications/%{name}.desktop'
- '%{_datadir}/icons/hicolor/*/apps/%{name}.png'
-
-# For more information about yaml and what's supported in Sailfish OS
-# build system, please see https://wiki.merproject.org/wiki/Spectacle
|