mirror of
https://github.com/martinrotter/rssguard.git
synced 2024-12-27 08:33:27 +01:00
save¨
This commit is contained in:
parent
b0e5773b22
commit
85e5fd1560
@ -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);
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user