mirror of
https://github.com/martinrotter/rssguard.git
synced 2025-01-29 00:30:12 +01:00
save
This commit is contained in:
parent
b2ef7e8121
commit
54d1a2b4b1
@ -1798,7 +1798,7 @@ bool DatabaseQueries::createOwnCloudAccount(const QSqlDatabase& db, int id_to_as
|
||||
}
|
||||
}
|
||||
|
||||
int DatabaseQueries::createAccount(const QSqlDatabase& db, const QString& code, bool* ok) {
|
||||
int DatabaseQueries::createBaseAccount(const QSqlDatabase& db, const QString& code, bool* ok) {
|
||||
QSqlQuery q(db);
|
||||
|
||||
// First obtain the ID, which can be assigned to this new account.
|
||||
@ -1838,6 +1838,13 @@ int DatabaseQueries::createAccount(const QSqlDatabase& db, const QString& code,
|
||||
}
|
||||
}
|
||||
|
||||
void DatabaseQueries::editBaseAccount(const QSqlDatabase& db, ServiceRoot* account, bool* ok) {
|
||||
Q_UNUSED(account)
|
||||
Q_UNUSED(ok)
|
||||
|
||||
// TODO: edit proxy etc
|
||||
}
|
||||
|
||||
bool DatabaseQueries::deleteFeed(const QSqlDatabase& db, int feed_custom_id, int account_id) {
|
||||
QSqlQuery q(db);
|
||||
|
||||
|
@ -88,7 +88,8 @@ class DatabaseQueries {
|
||||
bool* ok = nullptr);
|
||||
|
||||
// Common account methods.
|
||||
static int createAccount(const QSqlDatabase& db, const QString& code, bool* ok = nullptr);
|
||||
static int createBaseAccount(const QSqlDatabase& db, const QString& code, bool* ok = nullptr);
|
||||
static void editBaseAccount(const QSqlDatabase& db, ServiceRoot* account, bool* ok = nullptr);
|
||||
static int updateMessages(QSqlDatabase db, const QList<Message>& messages, const QString& feed_custom_id,
|
||||
int account_id, const QString& url, bool force_update, bool* any_message_changed, bool* ok = nullptr);
|
||||
static bool deleteAccount(const QSqlDatabase& db, int account_id);
|
||||
|
@ -91,7 +91,7 @@ void GmailServiceRoot::saveAccountDataToDatabase() {
|
||||
}
|
||||
else {
|
||||
bool saved;
|
||||
int id_to_assign = DatabaseQueries::createAccount(database, code(), &saved);
|
||||
int id_to_assign = DatabaseQueries::createBaseAccount(database, code(), &saved);
|
||||
|
||||
if (saved) {
|
||||
if (DatabaseQueries::createGmailAccount(database, id_to_assign,
|
||||
|
@ -61,7 +61,7 @@ void InoreaderServiceRoot::saveAccountDataToDatabase() {
|
||||
}
|
||||
else {
|
||||
bool saved;
|
||||
int id_to_assign = DatabaseQueries::createAccount(database, code(), &saved);
|
||||
int id_to_assign = DatabaseQueries::createBaseAccount(database, code(), &saved);
|
||||
|
||||
if (saved) {
|
||||
if (DatabaseQueries::createInoreaderAccount(database, id_to_assign,
|
||||
|
@ -142,7 +142,7 @@ void OwnCloudServiceRoot::saveAccountDataToDatabase() {
|
||||
}
|
||||
else {
|
||||
bool saved;
|
||||
int id_to_assign = DatabaseQueries::createAccount(database, code(), &saved);
|
||||
int id_to_assign = DatabaseQueries::createBaseAccount(database, code(), &saved);
|
||||
|
||||
if (saved) {
|
||||
if (DatabaseQueries::createOwnCloudAccount(database, id_to_assign, m_network->authUsername(),
|
||||
|
@ -31,7 +31,7 @@ ServiceRoot* StandardServiceEntryPoint::createNewRoot() const {
|
||||
// Switch DB.
|
||||
QSqlDatabase database = qApp->database()->connection(QSL("StandardServiceEntryPoint"));
|
||||
bool ok;
|
||||
int new_id = DatabaseQueries::createAccount(database, code(), &ok);
|
||||
int new_id = DatabaseQueries::createBaseAccount(database, code(), &ok);
|
||||
|
||||
if (ok) {
|
||||
auto* root = new StandardServiceRoot();
|
||||
|
@ -227,7 +227,7 @@ void TtRssServiceRoot::saveAccountDataToDatabase() {
|
||||
}
|
||||
else {
|
||||
bool saved;
|
||||
int id_to_assign = DatabaseQueries::createAccount(database, code(), &saved);
|
||||
int id_to_assign = DatabaseQueries::createBaseAccount(database, code(), &saved);
|
||||
|
||||
if (saved) {
|
||||
if (DatabaseQueries::createTtRssAccount(database, id_to_assign, m_network->username(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user