mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-07-29 09:38:48 -04:00
Add Created column to Browser Integration at Database settings
This commit is contained in:
parent
a6c3c118a7
commit
e6186b07e1
4 changed files with 10 additions and 4 deletions
|
@ -338,6 +338,8 @@ QString BrowserService::storeKey(const QString& key)
|
||||||
|
|
||||||
hideWindow();
|
hideWindow();
|
||||||
db->metadata()->customData()->set(ASSOCIATE_KEY_PREFIX + id, key);
|
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;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,8 @@
|
||||||
|
|
||||||
#include "core/Global.h"
|
#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)
|
CustomData::CustomData(QObject* parent)
|
||||||
: QObject(parent)
|
: QObject(parent)
|
||||||
|
|
|
@ -47,6 +47,7 @@ public:
|
||||||
bool operator!=(const CustomData& other) const;
|
bool operator!=(const CustomData& other) const;
|
||||||
|
|
||||||
static const QString LastModified;
|
static const QString LastModified;
|
||||||
|
static const QString Created;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void customDataModified();
|
void customDataModified();
|
||||||
|
|
|
@ -120,14 +120,16 @@ void DatabaseSettingsWidgetBrowser::toggleRemoveButton(const QItemSelection& sel
|
||||||
void DatabaseSettingsWidgetBrowser::updateModel()
|
void DatabaseSettingsWidgetBrowser::updateModel()
|
||||||
{
|
{
|
||||||
m_customDataModel->clear();
|
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()) {
|
for (const QString& key : customData()->keys()) {
|
||||||
if (key.startsWith(BrowserService::ASSOCIATE_KEY_PREFIX)) {
|
if (key.startsWith(BrowserService::ASSOCIATE_KEY_PREFIX)) {
|
||||||
QString strippedKey = key;
|
QString strippedKey = key;
|
||||||
strippedKey.remove(BrowserService::ASSOCIATE_KEY_PREFIX);
|
strippedKey.remove(BrowserService::ASSOCIATE_KEY_PREFIX);
|
||||||
m_customDataModel->appendRow(QList<QStandardItem*>() << new QStandardItem(strippedKey)
|
auto created = customData()->value(QString("%1_%2").arg(CustomData::Created, strippedKey));
|
||||||
<< new QStandardItem(customData()->value(key)));
|
m_customDataModel->appendRow(QList<QStandardItem*>()
|
||||||
|
<< new QStandardItem(strippedKey)
|
||||||
|
<< new QStandardItem(customData()->value(key)) << new QStandardItem(created));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue