diff --git a/src/librssguard/miscellaneous/databasequeries.cpp b/src/librssguard/miscellaneous/databasequeries.cpp index 12481cadb..717d60110 100755 --- a/src/librssguard/miscellaneous/databasequeries.cpp +++ b/src/librssguard/miscellaneous/databasequeries.cpp @@ -2447,6 +2447,15 @@ QList DatabaseQueries::getStandardAccounts(const QSqlDatabase& db, return roots; } +bool DatabaseQueries::deleteGreaderAccount(const QSqlDatabase& db, int account_id) { + QSqlQuery q(db); + + q.setForwardOnly(true); + q.prepare(QSL("DELETE FROM GoogleReaderApiAccounts WHERE id = :id;")); + q.bindValue(QSL(":id"), account_id); + return q.exec(); +} + bool DatabaseQueries::deleteTtRssAccount(const QSqlDatabase& db, int account_id) { QSqlQuery q(db); diff --git a/src/librssguard/miscellaneous/databasequeries.h b/src/librssguard/miscellaneous/databasequeries.h index 5e5274d6c..cfeef4b42 100644 --- a/src/librssguard/miscellaneous/databasequeries.h +++ b/src/librssguard/miscellaneous/databasequeries.h @@ -149,6 +149,7 @@ class DatabaseQueries { static void fillFeedData(T* feed, const QSqlRecord& sql_record); // Greader account. + static bool deleteGreaderAccount(const QSqlDatabase& db, int account_id); static QList getGreaderAccounts(const QSqlDatabase& db, bool* ok = nullptr); static bool createGreaderAccount(const QSqlDatabase& db, int id_to_assign, const QString& username, const QString& password, GreaderServiceRoot::Service service, diff --git a/src/librssguard/services/greader/greadernetwork.cpp b/src/librssguard/services/greader/greadernetwork.cpp index 90af7ae7f..98bc7b87e 100755 --- a/src/librssguard/services/greader/greadernetwork.cpp +++ b/src/librssguard/services/greader/greadernetwork.cpp @@ -254,7 +254,7 @@ RootItem* GreaderNetwork::decodeTagsSubscriptions(const QString& categories, con QByteArray icon_data; if (icon_url.startsWith(QSL("//"))) { - icon_url = QSL("https:") + icon_url; + icon_url = QUrl(baseUrl()).scheme() + QSL(":") + icon_url; } if (NetworkFactory::performNetworkOperation(icon_url, timeout, diff --git a/src/librssguard/services/greader/greaderserviceroot.cpp b/src/librssguard/services/greader/greaderserviceroot.cpp index 0d147f0b1..026b13a18 100755 --- a/src/librssguard/services/greader/greaderserviceroot.cpp +++ b/src/librssguard/services/greader/greaderserviceroot.cpp @@ -42,7 +42,14 @@ bool GreaderServiceRoot::editViaGui() { } bool GreaderServiceRoot::deleteViaGui() { - return false; + QSqlDatabase database = qApp->database()->connection(metaObject()->className()); + + if (DatabaseQueries::deleteGreaderAccount(database, accountId())) { + return ServiceRoot::deleteViaGui(); + } + else { + return false; + } } void GreaderServiceRoot::start(bool freshly_activated) {