mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
Add Created column to Browser Integration at Database settings
This commit is contained in:
parent
a6c3c118a7
commit
e6186b07e1
@ -338,6 +338,8 @@ QString BrowserService::storeKey(const QString& key)
|
||||
|
||||
hideWindow();
|
||||
db->metadata()->customData()->set(ASSOCIATE_KEY_PREFIX + id, key);
|
||||
db->metadata()->customData()->set(QString("%1_%2").arg(CustomData::Created, id),
|
||||
Clock::currentDateTime().toString(Qt::SystemLocaleShortDate));
|
||||
return id;
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,8 @@
|
||||
|
||||
#include "core/Global.h"
|
||||
|
||||
const QString CustomData::LastModified = "_LAST_MODIFIED";
|
||||
const QString CustomData::LastModified = QStringLiteral("_LAST_MODIFIED");
|
||||
const QString CustomData::Created = QStringLiteral("_CREATED");
|
||||
|
||||
CustomData::CustomData(QObject* parent)
|
||||
: QObject(parent)
|
||||
|
@ -47,6 +47,7 @@ public:
|
||||
bool operator!=(const CustomData& other) const;
|
||||
|
||||
static const QString LastModified;
|
||||
static const QString Created;
|
||||
|
||||
signals:
|
||||
void customDataModified();
|
||||
|
@ -120,14 +120,16 @@ void DatabaseSettingsWidgetBrowser::toggleRemoveButton(const QItemSelection& sel
|
||||
void DatabaseSettingsWidgetBrowser::updateModel()
|
||||
{
|
||||
m_customDataModel->clear();
|
||||
m_customDataModel->setHorizontalHeaderLabels({tr("Key"), tr("Value")});
|
||||
m_customDataModel->setHorizontalHeaderLabels({tr("Key"), tr("Value"), tr("Created")});
|
||||
|
||||
for (const QString& key : customData()->keys()) {
|
||||
if (key.startsWith(BrowserService::ASSOCIATE_KEY_PREFIX)) {
|
||||
QString strippedKey = key;
|
||||
strippedKey.remove(BrowserService::ASSOCIATE_KEY_PREFIX);
|
||||
m_customDataModel->appendRow(QList<QStandardItem*>() << new QStandardItem(strippedKey)
|
||||
<< new QStandardItem(customData()->value(key)));
|
||||
auto created = customData()->value(QString("%1_%2").arg(CustomData::Created, strippedKey));
|
||||
m_customDataModel->appendRow(QList<QStandardItem*>()
|
||||
<< new QStandardItem(strippedKey)
|
||||
<< new QStandardItem(customData()->value(key)) << new QStandardItem(created));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user