save¨
This commit is contained in:
parent
b0e5773b22
commit
85e5fd1560
4 changed files with 19 additions and 2 deletions
|
@ -2447,6 +2447,15 @@ QList<ServiceRoot*> DatabaseQueries::getStandardAccounts(const QSqlDatabase& db,
|
||||||
return roots;
|
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) {
|
bool DatabaseQueries::deleteTtRssAccount(const QSqlDatabase& db, int account_id) {
|
||||||
QSqlQuery q(db);
|
QSqlQuery q(db);
|
||||||
|
|
||||||
|
|
|
@ -149,6 +149,7 @@ class DatabaseQueries {
|
||||||
static void fillFeedData(T* feed, const QSqlRecord& sql_record);
|
static void fillFeedData(T* feed, const QSqlRecord& sql_record);
|
||||||
|
|
||||||
// Greader account.
|
// Greader account.
|
||||||
|
static bool deleteGreaderAccount(const QSqlDatabase& db, int account_id);
|
||||||
static QList<ServiceRoot*> getGreaderAccounts(const QSqlDatabase& db, bool* ok = nullptr);
|
static QList<ServiceRoot*> getGreaderAccounts(const QSqlDatabase& db, bool* ok = nullptr);
|
||||||
static bool createGreaderAccount(const QSqlDatabase& db, int id_to_assign, const QString& username,
|
static bool createGreaderAccount(const QSqlDatabase& db, int id_to_assign, const QString& username,
|
||||||
const QString& password, GreaderServiceRoot::Service service,
|
const QString& password, GreaderServiceRoot::Service service,
|
||||||
|
|
|
@ -254,7 +254,7 @@ RootItem* GreaderNetwork::decodeTagsSubscriptions(const QString& categories, con
|
||||||
QByteArray icon_data;
|
QByteArray icon_data;
|
||||||
|
|
||||||
if (icon_url.startsWith(QSL("//"))) {
|
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,
|
if (NetworkFactory::performNetworkOperation(icon_url, timeout,
|
||||||
|
|
|
@ -42,7 +42,14 @@ bool GreaderServiceRoot::editViaGui() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GreaderServiceRoot::deleteViaGui() {
|
bool GreaderServiceRoot::deleteViaGui() {
|
||||||
|
QSqlDatabase database = qApp->database()->connection(metaObject()->className());
|
||||||
|
|
||||||
|
if (DatabaseQueries::deleteGreaderAccount(database, accountId())) {
|
||||||
|
return ServiceRoot::deleteViaGui();
|
||||||
|
}
|
||||||
|
else {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GreaderServiceRoot::start(bool freshly_activated) {
|
void GreaderServiceRoot::start(bool freshly_activated) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue