Newly added accounts with more data.
This commit is contained in:
parent
2c7a524cb3
commit
aa4157e72a
@ -1600,13 +1600,17 @@ bool DatabaseQueries::overwriteInoreaderAccount(QSqlDatabase db, const QString&
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool DatabaseQueries::createInoreaderAccount(QSqlDatabase db, int id_to_assign, const QString& username,
|
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) {
|
const QString& refresh_token, int batch_size) {
|
||||||
QSqlQuery q(db);
|
QSqlQuery q(db);
|
||||||
|
|
||||||
q.prepare("INSERT INTO InoreaderAccounts (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, :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(":id"), id_to_assign);
|
||||||
q.bindValue(QSL(":username"), username);
|
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(":refresh_token"), refresh_token);
|
||||||
q.bindValue(QSL(":msg_limit"), batch_size <= 0 ? INOREADER_DEFAULT_BATCH_SIZE : batch_size);
|
q.bindValue(QSL(":msg_limit"), batch_size <= 0 ? INOREADER_DEFAULT_BATCH_SIZE : batch_size);
|
||||||
|
|
||||||
|
@ -87,6 +87,7 @@ class DatabaseQueries {
|
|||||||
const QString& app_key, const QString& redirect_url, const QString& refresh_token,
|
const QString& app_key, const QString& redirect_url, const QString& refresh_token,
|
||||||
int batch_size, int account_id);
|
int batch_size, int account_id);
|
||||||
static bool createInoreaderAccount(QSqlDatabase db, int id_to_assign, const QString& username,
|
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);
|
const QString& refresh_token, int batch_size);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -84,6 +84,9 @@ void InoreaderServiceRoot::saveAccountDataToDatabase() {
|
|||||||
if (saved) {
|
if (saved) {
|
||||||
if (DatabaseQueries::createInoreaderAccount(database, id_to_assign,
|
if (DatabaseQueries::createInoreaderAccount(database, id_to_assign,
|
||||||
m_network->userName(),
|
m_network->userName(),
|
||||||
|
m_network->oauth()->clientId(),
|
||||||
|
m_network->oauth()->clientSecret(),
|
||||||
|
m_network->oauth()->redirectUri(),
|
||||||
m_network->oauth()->refreshToken(),
|
m_network->oauth()->refreshToken(),
|
||||||
m_network->batchSize())) {
|
m_network->batchSize())) {
|
||||||
setId(id_to_assign);
|
setId(id_to_assign);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user