This commit is contained in:
Martin Rotter 2021-01-29 14:41:31 +01:00
parent b0e5773b22
commit 85e5fd1560
4 changed files with 19 additions and 2 deletions

View File

@ -2447,6 +2447,15 @@ QList<ServiceRoot*> 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);

View File

@ -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<ServiceRoot*> 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,

View File

@ -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,

View File

@ -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) {