mirror of
https://github.com/martinrotter/rssguard.git
synced 2025-01-31 17:44:52 +01:00
Do NOT set ID on accounts, they should only contain account ID.
This commit is contained in:
parent
581b7c08a0
commit
48909d9ef9
@ -1670,8 +1670,8 @@ void DatabaseQueries::createOverwriteAccount(const QSqlDatabase& db, ServiceRoot
|
||||
throw ApplicationException(q.lastError().text());
|
||||
}
|
||||
else {
|
||||
account->setId(q.lastInsertId().toInt());
|
||||
account->setAccountId(account->id());
|
||||
//account->setId(q.lastInsertId().toInt());
|
||||
account->setAccountId(q.lastInsertId().toInt());
|
||||
}
|
||||
}
|
||||
|
||||
@ -1690,8 +1690,14 @@ void DatabaseQueries::createOverwriteAccount(const QSqlDatabase& db, ServiceRoot
|
||||
q.bindValue(QSL(":proxy_password"), TextFactory::encrypt(proxy.password()));
|
||||
q.bindValue(QSL(":id"), account->accountId());
|
||||
|
||||
q.bindValue(QSL(":custom_data"),
|
||||
QString::fromUtf8(QJsonDocument::fromVariant(account->customDatabaseData()).toJson(QJsonDocument::JsonFormat::Indented)));
|
||||
auto custom_data = account->customDatabaseData();
|
||||
QString serialized_custom_data;
|
||||
|
||||
if (!custom_data.isEmpty()) {
|
||||
serialized_custom_data = QString::fromUtf8(QJsonDocument::fromVariant(custom_data).toJson(QJsonDocument::JsonFormat::Indented));
|
||||
}
|
||||
|
||||
q.bindValue(QSL(":custom_data"), serialized_custom_data);
|
||||
|
||||
if (!q.exec()) {
|
||||
throw ApplicationException(q.lastError().text());
|
||||
|
@ -189,8 +189,8 @@ QList<ServiceRoot*> DatabaseQueries::getAccounts(const QSqlDatabase& db, const Q
|
||||
ServiceRoot* root = new T();
|
||||
|
||||
// Load common data.
|
||||
root->setId(query.value(QSL("id")).toInt());
|
||||
root->setAccountId(root->id());
|
||||
//root->setId(query.value(QSL("id")).toInt());
|
||||
root->setAccountId(query.value(QSL("id")).toInt());
|
||||
|
||||
QNetworkProxy proxy(QNetworkProxy::ProxyType(query.value(QSL("proxy_type")).toInt()),
|
||||
query.value(QSL("proxy_host")).toString(),
|
||||
|
@ -13,5 +13,7 @@ FormEditStandardAccount::FormEditStandardAccount(QWidget* parent)
|
||||
|
||||
void FormEditStandardAccount::apply() {
|
||||
FormAccountDetails::apply();
|
||||
|
||||
m_account->saveAccountDataToDatabase();
|
||||
accept();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user