Remove Feedly fetcher

This commit is contained in:
Muki 2019-03-02 15:06:17 +01:00
parent 5b1bdf869f
commit 7e33b57974
18 changed files with 127 additions and 1746 deletions

View file

@ -1,4 +0,0 @@
static const QString feedly_client_id = "sandbox";
static const QString feedly_client_secret = "YNXZHOH3GPYO6DF7B43K";
//static const QString feedly_server = "https://cloud.feedly.com";
static const QString feedly_server = "https://sandbox.feedly.com";

View file

@ -32,7 +32,6 @@ SOURCES += \
src/fetcher.cpp \
src/oldreaderfetcher.cpp \
src/nvfetcher.cpp \
src/feedlyfetcher.cpp \
src/ttrssfetcher.cpp \
src/networkaccessmanagerfactory.cpp \
src/customnetworkaccessmanager.cpp \
@ -57,11 +56,9 @@ HEADERS += \
src/fetcher.h \
src/oldreaderfetcher.h \
src/nvfetcher.h \
src/feedlyfetcher.h \
src/ttrssfetcher.h \
src/networkaccessmanagerfactory.h \
src/customnetworkaccessmanager.h \
feedly.h \
key.h
# libs
@ -105,7 +102,6 @@ OTHER_FILES += \
EntryPage.qml \
ErrorPage.qml \
FeedIcon.qml \
FeedlySignInDialog.qml \
FeedPage.qml \
FeedWebContentPage.qml \
FirstPage.qml \

View file

@ -48,7 +48,6 @@ Page {
model: ListModel {
ListElement { name: "Netvibes"; iconSource: "image://icons/icon-m-netvibes"; type: 1}
ListElement { name: "Old Reader"; iconSource: "image://icons/icon-m-oldreader"; type: 2}
/*ListElement { name: "Feedly (comming soon)"; iconSource: "feedly.png"; type: 3}*/
ListElement { name: "Tiny Tiny Rss"; iconSource: "image://icons/icon-m-ttrss"; type: 4}
}
@ -84,8 +83,12 @@ Page {
Label {
id: label
wrapMode: Text.AlignLeft
anchors.left: icon.right; anchors.right: parent.right;
anchors.leftMargin: Theme.paddingMedium; anchors.rightMargin: Theme.paddingLarge
anchors {
left: icon.right
right: parent.right;
leftMargin: Theme.paddingMedium
rightMargin: Theme.paddingLarge
}
font.pixelSize: Theme.fontSizeMedium
text: name
color: listItem.down ? Theme.highlightColor : Theme.primaryColor
@ -96,29 +99,25 @@ Page {
onClicked: {
if (type == 1) {
app.reconnectFetcher(1);
pageStack.replaceAbove(pageStack.previousPage(),Qt.resolvedUrl("NvSignInDialog.qml"),{"code": 400});
}
if (type == 2) {
pageStack.replaceAbove(pageStack.previousPage(),
Qt.resolvedUrl("NvSignInDialog.qml"),
{"code": 400});
} else if (type == 2) {
app.reconnectFetcher(2);
pageStack.replaceAbove(pageStack.previousPage(),Qt.resolvedUrl("OldReaderSignInDialog.qml"),{"code": 400});
}
if (type == 3) {
app.reconnectFetcher(3);
utils.resetQtWebKit();
fetcher.getConnectUrl(20);
//pageStack.replaceAbove(pageStack.previousPage(),Qt.resolvedUrl("FeedlySignInDialog.qml"),{"code": 400});
}
if (type == 4) {
pageStack.replaceAbove(pageStack.previousPage(),
Qt.resolvedUrl("OldReaderSignInDialog.qml"),
{"code": 400});
} else if (type == 4) {
app.reconnectFetcher(4);
pageStack.replaceAbove(pageStack.previousPage(), Qt.resolvedUrl("TTRssSignInDialog.qml"), {"code": 400});
pageStack.replaceAbove(pageStack.previousPage(),
Qt.resolvedUrl("TTRssSignInDialog.qml"),
{"code": 400});
}
}
}
VerticalScrollDecorator {
flickable: listView
}
}
}

View file

@ -191,7 +191,7 @@ Item {
IconButton {
id: vm5b
visible: app.isNetvibes || (app.isOldReader && settings.showBroadcast) // Disabled for Feedly
visible: app.isNetvibes || (app.isOldReader && settings.showBroadcast)
anchors.verticalCenter: parent.verticalCenter
icon.source: app.isOldReader ? "image://icons/icon-m-vm6?"+root.iconColor :
"image://icons/icon-m-vm5?"+root.iconColor

View file

@ -472,7 +472,8 @@ ListItem {
IconMenuItem {
text: qsTr("Toggle Read")
icon.source: root.read ? 'image://icons/icon-m-read-selected' : 'image://icons/icon-m-read'
icon.source: root.read ? 'image://icons/icon-m-read-selected' :
'image://icons/icon-m-read'
visible: enabled
enabled: root.showMarkedAsRead
onClicked: {
@ -488,8 +489,9 @@ ListItem {
}
IconMenuItem {
text: app.isNetvibes || app.isFeedly ? qsTr("Toggle Save") : qsTr("Toggle Star")
icon.source: root.readlater ? 'image://theme/icon-m-favorite-selected' : 'image://theme/icon-m-favorite'
text: app.isNetvibes ? qsTr("Toggle Save") : qsTr("Toggle Star")
icon.source: root.readlater ? 'image://theme/icon-m-favorite-selected' :
'image://theme/icon-m-favorite'
onClicked: {
if (root.readlater) {
root.unmarkedReadlater();

View file

@ -207,7 +207,7 @@ Page {
case 3:
return qsTr("All feeds");
case 4:
return app.isNetvibes || app.isFeedly ? qsTr("Saved") : qsTr("Starred");
return app.isNetvibes ? qsTr("Saved") : qsTr("Starred");
case 5:
return qsTr("Slow");
case 6:
@ -500,7 +500,7 @@ Page {
id: placeholder
enabled: listView.count == 0
text: fetcher.busy ? qsTr("Wait until sync finish") :
settings.viewMode==4 ? app.isNetvibes || app.isFeedly ? qsTr("No saved items") : qsTr("No starred items") :
settings.viewMode==4 ? app.isNetvibes ? qsTr("No saved items") : qsTr("No starred items") :
settings.viewMode==6 ? qsTr("No liked items") : settings.showOnlyUnread ? qsTr("No unread items") : qsTr("No items")
}

View file

@ -394,7 +394,7 @@ Page {
}
IconBarItem {
text: app.isNetvibes || app.isFeedly ?
text: app.isNetvibes ?
qsTr("Toggle Save") : qsTr("Toggle Star")
icon: root.stared ? "image://theme/icon-m-favorite-selected" : "image://theme/icon-m-favorite"
onClicked: {

View file

@ -1,106 +0,0 @@
/*
Copyright (C) 2014 Michal Kosciesza <michal@mkiol.net>
This file is part of Kaktus.
Kaktus is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Kaktus is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Kaktus. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick 2.0
import Sailfish.Silica 1.0
Dialog {
id: root
property bool showBar: false
property int code
canAccept: false
allowedOrientations: {
switch (settings.allowedOrientations) {
case 1:
return Orientation.Portrait;
case 2:
return Orientation.Landscape;
}
return Orientation.Landscape | Orientation.Portrait;
}
ActiveDetector {}
SilicaFlickable {
anchors {left: parent.left; right: parent.right }
anchors {top: parent.top}
height: app.flickHeight
clip: true
contentHeight: content.height
Column {
id: content
anchors {
left: parent.left
right: parent.right
}
spacing: Theme.paddingSmall
DialogHeader {
acceptText : qsTr("Sign in")
}
Item {
anchors { left: parent.left; right: parent.right}
height: Math.max(icon.height, label.height)
Image {
id: icon
anchors { right: label.left; rightMargin: Theme.paddingMedium }
source: "feedly.png"
}
Label {
id: label
anchors { right: parent.right; rightMargin: Theme.paddingLarge}
text: "Feedly"
wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignRight
color: Theme.highlightColor
font.pixelSize: Theme.fontSizeSmall
y: Theme.paddingSmall/2
}
}
Item {
height: Theme.paddingMedium
width: Theme.paddingMedium
}
Button {
anchors.horizontalCenter: parent.horizontalCenter
text: qsTr("Sign in")
onClicked: {
utils.resetQtWebKit();
fetcher.getConnectUrl(20);
}
}
Item {
height: Theme.itemSizeLarge
width: Theme.itemSizeLarge
}
}
}
}

View file

@ -46,7 +46,7 @@ Rectangle {
Timer {
id: timer1
interval: 3000
onTriggered: {
onTriggered: {s
root.show();
}
}
@ -159,8 +159,7 @@ Rectangle {
horizontalAlignment: Text.AlignHCenter
//textFormat: Text.StyledText
text: app.isFeedly ? qsTr("Bottom bar lets you switch between 4 view modes.\n") :
qsTr("Bottom bar lets you switch between 5 view modes.\n");
text: qsTr("Bottom bar lets you switch between 5 view modes.\n");
}
}
@ -248,8 +247,8 @@ Rectangle {
font.family: Theme.fontFamily
wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignHCenter
text: app.isNetvibes || app.isFeedly ? qsTr("Mode #4\n\nLists all articles you have saved.") :
qsTr("Mode #4\n\nLists all articles you have starred.")
text: app.isNetvibes ? qsTr("Mode #4\n\nLists all articles you have saved.") :
qsTr("Mode #4\n\nLists all articles you have starred.")
}
}
@ -432,7 +431,7 @@ Rectangle {
IconButton {
id: vm5b
x: 4*(width+Theme.paddingMedium)
visible: app.isNetvibes || (app.isOldReader && settings.showBroadcast) // Disabled for Feedly
visible: app.isNetvibes || (app.isOldReader && settings.showBroadcast)
y: ((parent.height-height)/2) + (highlighted ? parent.off : 0)
icon.source: app.isOldReader ? "image://icons/icon-m-vm6?"+(root.transparent ? Theme.primaryColor : Theme.highlightDimmerColor) :
"image://icons/icon-m-vm5?"+(root.transparent ? Theme.primaryColor : Theme.highlightDimmerColor)
@ -485,9 +484,9 @@ Rectangle {
selector.open = true;
}
if (root.progress==5 && app.isFeedly) {
/*if (root.progress==5 && app.isFeedly) {
root.progress++;
}
}*/
if (root.progress==7) {
bar.open = false;

View file

@ -61,37 +61,27 @@ Page {
title: qsTr("Settings")
}
Item {
anchors { left: parent.left; right: parent.right}
Row {
anchors { right: parent.right; rightMargin: Theme.horizontalPageMargin}
spacing: Theme.paddingMedium
height: Math.max(icon.height, label.height)
Image {
id: icon
anchors {
right: label.left
rightMargin: Theme.paddingMedium
verticalCenter: parent.verticalCenter
}
anchors.verticalCenter: parent.verticalCenter
source: app.isNetvibes ? "image://icons/icon-m-netvibes" :
app.isOldReader ? "image://icons/icon-m-oldreader" :
app.isTTRss ? "image://icons/icon-m-ttrss" : null
width: Theme.iconSizeMedium
height: Theme.iconSizeMedium
}
Label {
id: label
anchors {
right: parent.right
rightMargin: Theme.paddingLarge
verticalCenter: parent.verticalCenter
}
anchors.verticalCenter: parent.verticalCenter
text: app.isNetvibes ? "Netvibes":
app.isOldReader ? "Old Reader" :
app.isTTRss ? "Tiny Tiny Rss" : null
wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignRight
color: Theme.highlightColor
font.pixelSize: Theme.fontSizeSmall
}
@ -114,26 +104,23 @@ Page {
visible: !settings.signedIn
}
Label {
text: qsTr("Signed in with")
text: settings.signinType == 1 || settings.signinType == 2 ?
qsTr("Signed in with") : qsTr("Signed in as")
visible: settings.signedIn
}
Label {
color: Theme.highlightColor
visible: settings.signedIn
text: settings.signedIn ?
(settings.signinType==0 ? settings.getUsername() :
settings.signinType==1 ? "Twitter" :
settings.signinType==2 ? "Facebook" :
settings.signinType==10 ? settings.getUsername() :
settings.signinType==20 ? settings.getProvider() :
settings.signinType==30 ? settings.getUsername() : "") : ""
(settings.signinType == 1 ? "Twitter" :
settings.signinType == 2 ? "Facebook" :
settings.getUsername()) : ""
}
}
menu: ContextMenu {
MenuItem {
text: settings.signedIn ? qsTr("Sign out") : qsTr("Sign in")
//enabled: settings.signedIn ? true : dm.online
onClicked: {
if (settings.signedIn) {
pageStack.push(Qt.resolvedUrl("SignOutDialog.qml"));
@ -675,7 +662,7 @@ Page {
iconSource: "image://icons/icon-m-vm3"
}
MenuIconItem {
text: app.isNetvibes || app.isFeedly ? qsTr("Saved") : qsTr("Starred")
text: app.isNetvibes ? qsTr("Saved") : qsTr("Starred")
iconSource: "image://icons/icon-m-vm4"
}
MenuIconItem {

View file

@ -49,10 +49,18 @@ Dialog {
spacing: Theme.paddingSmall
DialogHeader {
//title: qsTr("Sign out")
acceptText : qsTr("Yes")
}
// Sign in types:
// 0 - Netvibes
// 1 - Netvibes with Twitter
// 2 - Netvibes with FB
// 10 - Oldreader
// 20 - Feedly (not supported)
// 22 - Feedly with FB (not supported)
// 30 - Tiny Tiny Rss
Label {
anchors.left: parent.left; anchors.right: parent.right
anchors.margins: Theme.paddingLarge;
@ -60,15 +68,16 @@ Dialog {
font.pixelSize: Theme.fontSizeLarge
color: Theme.primaryColor
text: settings.signinType < 10 ?
qsTr("Disconnect Kaktus from your Netvibes account?") :
qsTr("Disconnect Kaktus from Netvibes account?") :
settings.signinType < 20 ?
qsTr("Disconnect Kaktus from your Old Reader account?") :
qsTr("Disconnect Kaktus from your Feedly account?")
qsTr("Disconnect Kaktus from Old Reader account?") :
settings.signinType < 30 ?
qsTr("Disconnect Kaktus from Feedly account?") :
qsTr("Disconnect Kaktus from Tiny Tiny RSS account?")
}
}
onAccepted: {
settings.signedIn = false;
}
}

View file

@ -368,8 +368,7 @@ Page {
}
IconBarItem {
text: app.isNetvibes || app.isFeedly ?
qsTr("Toggle Save") : qsTr("Toggle Star")
text: app.isNetvibes ? qsTr("Toggle Save") : qsTr("Toggle Star")
icon: root.stared ? "image://theme/icon-m-favorite-selected" : "image://theme/icon-m-favorite"
onClicked: {
if (root.stared) {

View file

@ -30,7 +30,6 @@ ApplicationWindow {
readonly property bool isTablet: Screen.sizeCategory === Screen.Large || Screen.sizeCategory === Screen.ExtraLarge
readonly property bool isNetvibes: settings.signinType >= 0 && settings.signinType < 10
readonly property bool isOldReader: settings.signinType >= 10 && settings.signinType < 20
readonly property bool isFeedly: settings.signinType >= 20 && settings.signinType < 30
readonly property bool isTTRss: settings.signinType >= 30 && settings.signinType < 40
readonly property variant _cache: cache
readonly property int stdHeight: orientation==Orientation.Portrait ? Theme.itemSizeMedium : 0.8 * Theme.itemSizeMedium
@ -298,8 +297,7 @@ ApplicationWindow {
}
function fetcherError(code) {
console.log("Fetcher error");
console.log("code=" + code);
console.log("Fetcher error, code=" + code);
if (code < 400)
return;
@ -321,10 +319,6 @@ ApplicationWindow {
pageStack.push(Qt.resolvedUrl("OldReaderSignInDialog.qml"),{"code": code});
return;
}
if (type < 30) {
pageStack.push(Qt.resolvedUrl("FeedlySignInDialog.qml"),{"code": code});
return;
}
if (type < 40) {
pageStack.push(Qt.resolvedUrl("TTRssSignInDialog.qml"),{"code": code});
return;

File diff suppressed because it is too large Load diff

View file

@ -1,113 +0,0 @@
/*
Copyright (C) 2015 Michal Kosciesza <michal@mkiol.net>
This file is part of Kaktus.
Kaktus is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Kaktus is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Kaktus. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef FEEDLYFETCHER_H
#define FEEDLYFETCHER_H
#include <QObject>
#include <QStringList>
#include <QVariantMap>
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
#include <QJsonArray>
#else
#include <QVariantList>
#endif
#include "fetcher.h"
class FeedlyFetcher : public Fetcher
{
Q_OBJECT
public:
explicit FeedlyFetcher(QObject *parent = 0);
Q_INVOKABLE void getConnectUrl(int type);
Q_INVOKABLE bool setConnectUrl(const QString &url);
protected:
void run();
private Q_SLOTS:
void finishedRefreshToken();
void finishedProfile();
void finishedProfile2();
void finishedSignIn();
void finishedSignInOnlyCheck();
void finishedTabs();
void finishedTabs2();
void finishedFeeds();
void finishedFeeds2();
void finishedStream();
void finishedStream2();
void finishedStarredStream();
void finishedStarredStream2();
void finishedMustStream();
void finishedMustStream2();
void finishedSetAction();
void finishedMarkSlow();
private:
enum Job { Idle, StoreProfile, StoreTabs, StoreFeeds, StoreStream,
StoreStarredStream, StoreMustStream, MarkSlow };
static const int limitAtOnce = 200;
static const int continuationLimit = 100;
Job currentJob;
QStringList tabList;
QString lastContinuation;
int continuationCount;
int lastDate;
bool refreshTokenDone;
void signIn();
void startFetching();
void uploadActions();
void refreshToken();
void fetchProfile();
void fetchTabs();
void fetchFeeds();
void fetchStream();
void fetchUnreadStream();
void fetchStarredStream();
void fetchMustStream();
void setAction();
void startJob(Job job);
void storeProfile();
void storeTabs();
void storeFeeds();
void storeStream();
void markSlowFeeds();
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
void getFolderFromCategories(const QJsonArray &categories, QString &tabId, QString &tabName);
//void getFromTags(const QJsonArray &tags, QVariantMap &result);
bool getSavedFromTags(const QJsonArray &tags);
#else
void getFolderFromCategories(const QVariantList &categories, QString &tabId, QString &tabName);
//void getFromTags(const QVariantList &tags, QVariantMap &result);
bool getSavedFromTags(const QVariantList &tags);
#endif
QString getIdsFromActionString(const QString &actionString);
};
#endif // FEEDLYFETCHER_H

View file

@ -859,6 +859,17 @@ int Settings::getFeedsUpdateAtOnce()
#endif
}
/*
View modes:
0 - Tabs->Feeds->Entries
1 - Tabs->Entries
2 - Feeds->Entries
3 - All entries
4 - Saved entries
5 - Slow entries
6 - Liked entries (Old Reader)
7 - Broadcasted entries (Old Reader)
*/
void Settings::setViewMode(int value)
{
int type = getSigninType();
@ -866,15 +877,15 @@ void Settings::setViewMode(int value)
if (type < 10) {
// Netvibes, Forbidden modes: 6, 7
if (value == 6 || value == 7) {
qWarning() << "Netvibes forbidden mode!";
qWarning() << "Netvibes forbidden mode";
return;
}
} else if (type >= 10 && type < 20) {
// OldReader, Forbidden modes: none
} else if (type >= 20 && type < 30) {
// Feedly, Forbidden modes: 6, 7
if (value == 6 || value == 7) {
qWarning() << "Old Reader forbidden mode!";
} else if (type >= 30 && type < 40) {
// TT-RSS, Forbidden modes: 5, 6, 7
if (value == 5 || value == 6 || value == 7) {
qWarning() << "TT-RSS forbidden mode";
return;
}
}

View file

@ -173,6 +173,17 @@ public:
void setOffsetLimit(int value);
int getOffsetLimit();
/*
View modes:
0 - Tabs->Feeds->Entries
1 - Tabs->Entries
2 - Feeds->Entries
3 - All entries
4 - Saved entries
5 - Slow entries
6 - Liked entries (Old Reader)
7 - Broadcasted entries (Old Reader)
*/
void setViewMode(int value);
int getViewMode();
@ -211,8 +222,8 @@ public:
// 1 - Netvibes with Twitter
// 2 - Netvibes with FB
// 10 - Oldreader
// 20 - Feedly
// 22 - Feedly with FB
// 20 - Feedly (not supported)
// 22 - Feedly with FB (not supported)
// 30 - Tiny Tiny Rss
void setSigninType(int);
int getSigninType();

View file

@ -67,16 +67,15 @@
#include "fetcher.h"
#include "oldreaderfetcher.h"
#include "nvfetcher.h"
#include "feedlyfetcher.h"
#include "ttrssfetcher.h"
Utils::Utils(QObject *parent) :
QObject(parent)//, ncm(new QNetworkConfigurationManager(parent))
{
dashboardModel = NULL;
entryModel = NULL;
tabModel = NULL;
feedModel = NULL;
dashboardModel = nullptr;
entryModel = nullptr;
tabModel = nullptr;
feedModel = nullptr;
#ifdef ANDROID
screen = QGuiApplication::screens().at(0);
#endif
@ -474,14 +473,14 @@ void Utils::setRootModel()
#else
s->context->setContextProperty("tabModel", tabModel);
#endif
if (oldTabModel != NULL) {
if (oldTabModel != nullptr) {
delete oldTabModel;
}
if (feedModel != NULL) {
delete feedModel; feedModel = NULL;
if (feedModel != nullptr) {
delete feedModel; feedModel = nullptr;
}
if (entryModel != NULL) {
delete entryModel; entryModel = NULL;
if (entryModel != nullptr) {
delete entryModel; entryModel = nullptr;
}
break;
case 1:
@ -493,14 +492,14 @@ void Utils::setRootModel()
#else
s->context->setContextProperty("tabModel", tabModel);
#endif
if (oldTabModel != NULL) {
if (oldTabModel != nullptr) {
delete oldTabModel;
}
if (feedModel != NULL) {
delete feedModel; feedModel = NULL;
if (feedModel != nullptr) {
delete feedModel; feedModel = nullptr;
}
if (entryModel != NULL) {
delete entryModel; entryModel = NULL;
if (entryModel != nullptr) {
delete entryModel; entryModel = nullptr;
}
break;
case 2:
@ -512,13 +511,13 @@ void Utils::setRootModel()
#else
s->context->setContextProperty("feedModel", feedModel);
#endif
if (tabModel != NULL)
delete tabModel; tabModel = NULL;
if (oldFeedModel != NULL) {
if (tabModel != nullptr)
delete tabModel; tabModel = nullptr;
if (oldFeedModel != nullptr) {
delete oldFeedModel;
}
if (entryModel != NULL) {
delete entryModel; entryModel = NULL;
if (entryModel != nullptr) {
delete entryModel; entryModel = nullptr;
}
break;
case 3:
@ -538,12 +537,12 @@ void Utils::setRootModel()
#else
s->context->setContextProperty("entryModel", entryModel);
#endif
if (tabModel != NULL)
delete tabModel; tabModel = NULL;
if (feedModel != NULL) {
delete feedModel; feedModel = NULL;
if (tabModel != nullptr)
delete tabModel; tabModel = nullptr;
if (feedModel != nullptr) {
delete feedModel; feedModel = nullptr;
}
if (oldEntryModel != NULL) {
if (oldEntryModel != nullptr) {
delete oldEntryModel;
}
break;
@ -564,7 +563,7 @@ void Utils::setFeedModel(const QString &tabId)
s->context->setContextProperty("feedModel", feedModel);
#endif
if (oldFeedModel != NULL) {
if (oldFeedModel != nullptr) {
delete oldFeedModel;
}
}
@ -583,7 +582,7 @@ void Utils::setEntryModel(const QString &feedId)
s->context->setContextProperty("entryModel", entryModel);
#endif
if (oldEntryModel != NULL) {
if (oldEntryModel != nullptr) {
delete oldEntryModel;
}
}
@ -602,37 +601,37 @@ void Utils::setDashboardModel()
s->context->setContextProperty("dashboardModel", dashboardModel);
#endif
if (oldDashboardModel != NULL)
if (oldDashboardModel != nullptr)
delete oldDashboardModel;
}
void Utils::updateModels()
{
if (dashboardModel != NULL)
if (dashboardModel != nullptr)
dashboardModel->init();
if (tabModel != NULL)
if (tabModel != nullptr)
tabModel->init();
if (feedModel != NULL)
if (feedModel != nullptr)
feedModel->init();
if (entryModel != NULL)
if (entryModel != nullptr)
entryModel->init();
}
Utils::~Utils()
{
if (entryModel != NULL)
if (entryModel != nullptr)
delete entryModel;
if (feedModel != NULL)
if (feedModel != nullptr)
delete feedModel;
if (tabModel != NULL)
if (tabModel != nullptr)
delete tabModel;
if (dashboardModel != NULL)
if (dashboardModel != nullptr)
delete dashboardModel;
}
@ -790,10 +789,10 @@ void Utils::resetFetcher(int type)
{
Settings *s = Settings::instance();
if (s->fetcher != NULL) {
if (s->fetcher != nullptr) {
s->fetcher->disconnect();
delete s->fetcher;
s->fetcher = NULL;
s->fetcher = nullptr;
}
if (type == 1) {
@ -806,17 +805,12 @@ void Utils::resetFetcher(int type)
s->fetcher = new OldReaderFetcher();
}
if (type == 3) {
// Feedly fetcher
s->fetcher = new FeedlyFetcher();
}
if (type == 4) {
// Tiny Tiny Rss fetcher
s->fetcher = new TTRssFetcher();
}
if (s->fetcher != NULL)
if (s->fetcher != nullptr)
#ifdef BB10
s->qml->setContextProperty("fetcher", s->fetcher);
#else