Browser connection keys and rules are stored in custom data instead of attributes (#1497)

This commit is contained in:
Sami Vänttinen 2018-10-24 17:49:53 +03:00 committed by Jonathan White
parent cfa1eca249
commit efdb43dc53
17 changed files with 680 additions and 213 deletions

View file

@ -21,7 +21,7 @@
#include "core/EntryAttributes.h"
#include <QtCore>
static const char KEEPASSBROWSER_NAME[] = "KeePassXC-Browser Settings";
static const char KEEPASSXCBROWSER_NAME[] = "KeePassXC-Browser Settings";
BrowserEntryConfig::BrowserEntryConfig(QObject* parent)
: QObject(parent)
@ -82,7 +82,7 @@ void BrowserEntryConfig::setRealm(const QString& realm)
bool BrowserEntryConfig::load(const Entry* entry)
{
QString s = entry->attributes()->value(KEEPASSBROWSER_NAME);
QString s = entry->customData()->value(KEEPASSXCBROWSER_NAME);
if (s.isEmpty()) {
return false;
}
@ -104,5 +104,5 @@ void BrowserEntryConfig::save(Entry* entry)
QVariantMap v = qo2qv(this);
QJsonObject o = QJsonObject::fromVariantMap(v);
QByteArray json = QJsonDocument(o).toJson(QJsonDocument::Compact);
entry->attributes()->set(KEEPASSBROWSER_NAME, json);
entry->customData()->set(KEEPASSXCBROWSER_NAME, json);
}