From aa4157e72a3c094399371d437a6e9de9183feb37 Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Mon, 2 Oct 2017 14:34:31 +0200 Subject: [PATCH] Newly added accounts with more data. --- src/miscellaneous/databasequeries.cpp | 8 ++++++-- src/miscellaneous/databasequeries.h | 1 + src/services/inoreader/inoreaderserviceroot.cpp | 3 +++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/miscellaneous/databasequeries.cpp b/src/miscellaneous/databasequeries.cpp index aab5c362f..537e8087a 100755 --- a/src/miscellaneous/databasequeries.cpp +++ b/src/miscellaneous/databasequeries.cpp @@ -1600,13 +1600,17 @@ bool DatabaseQueries::overwriteInoreaderAccount(QSqlDatabase db, const QString& } bool DatabaseQueries::createInoreaderAccount(QSqlDatabase db, int id_to_assign, const QString& username, + const QString& app_id, const QString& app_key, const QString& redirect_url, const QString& refresh_token, int batch_size) { QSqlQuery q(db); - q.prepare("INSERT INTO InoreaderAccounts (id, username, refresh_token, msg_limit) " - "VALUES (:id, :username, :refresh_token, :msg_limit);"); + q.prepare("INSERT INTO InoreaderAccounts (id, username, app_id, app_key, redirect_url, refresh_token, msg_limit) " + "VALUES (:id, :username, :app_id, :app_key, :redirect_url, :refresh_token, :msg_limit);"); q.bindValue(QSL(":id"), id_to_assign); q.bindValue(QSL(":username"), username); + q.bindValue(QSL(":app_id"), app_id); + q.bindValue(QSL(":app_key"), app_key); + q.bindValue(QSL(":redirect_url"), redirect_url); q.bindValue(QSL(":refresh_token"), refresh_token); q.bindValue(QSL(":msg_limit"), batch_size <= 0 ? INOREADER_DEFAULT_BATCH_SIZE : batch_size); diff --git a/src/miscellaneous/databasequeries.h b/src/miscellaneous/databasequeries.h index c05e92e2a..b3c688a60 100755 --- a/src/miscellaneous/databasequeries.h +++ b/src/miscellaneous/databasequeries.h @@ -87,6 +87,7 @@ class DatabaseQueries { const QString& app_key, const QString& redirect_url, const QString& refresh_token, int batch_size, int account_id); static bool createInoreaderAccount(QSqlDatabase db, int id_to_assign, const QString& username, + const QString& app_id, const QString& app_key, const QString& redirect_url, const QString& refresh_token, int batch_size); #endif diff --git a/src/services/inoreader/inoreaderserviceroot.cpp b/src/services/inoreader/inoreaderserviceroot.cpp index 4bc6994b3..76d0ebfb3 100755 --- a/src/services/inoreader/inoreaderserviceroot.cpp +++ b/src/services/inoreader/inoreaderserviceroot.cpp @@ -84,6 +84,9 @@ void InoreaderServiceRoot::saveAccountDataToDatabase() { if (saved) { if (DatabaseQueries::createInoreaderAccount(database, id_to_assign, m_network->userName(), + m_network->oauth()->clientId(), + m_network->oauth()->clientSecret(), + m_network->oauth()->redirectUri(), m_network->oauth()->refreshToken(), m_network->batchSize())) { setId(id_to_assign);