Fix merging browser keys

* Introduce protected custom data function to prevent loss during merge operations
This commit is contained in:
varjolintu
2020-05-01 11:07:14 +03:00
committed by Jonathan White
parent 48bf4fb85d
commit e367c6df95
6 changed files with 29 additions and 20 deletions

View File

@@ -22,6 +22,8 @@
const QString CustomData::LastModified = QStringLiteral("_LAST_MODIFIED");
const QString CustomData::Created = QStringLiteral("_CREATED");
const QString CustomData::BrowserKeyPrefix = QStringLiteral("KPXC_BROWSER_");
const QString CustomData::BrowserLegacyKeyPrefix = QStringLiteral("Public Key: ");
CustomData::CustomData(QObject* parent)
: QObject(parent)
@@ -128,6 +130,11 @@ QDateTime CustomData::getLastModified() const
return {};
}
bool CustomData::isProtectedCustomData(const QString& key) const
{
return key.startsWith(CustomData::BrowserKeyPrefix) || key.startsWith(CustomData::Created);
}
bool CustomData::operator==(const CustomData& other) const
{
return (m_data == other.m_data);