mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-05-10 18:45:20 -04:00
parent
93585aded7
commit
eb56bd8973
13 changed files with 393 additions and 3 deletions
|
@ -43,7 +43,7 @@ KeePass2Reader::KeePass2Reader()
|
|||
{
|
||||
}
|
||||
|
||||
Database* KeePass2Reader::readDatabase(QIODevice* device, const CompositeKey& key)
|
||||
Database* KeePass2Reader::readDatabase(QIODevice* device, const CompositeKey& key, bool keepDatabase)
|
||||
{
|
||||
QScopedPointer<Database> db(new Database());
|
||||
m_db = db.data();
|
||||
|
@ -178,7 +178,12 @@ Database* KeePass2Reader::readDatabase(QIODevice* device, const CompositeKey& ke
|
|||
|
||||
if (xmlReader.hasError()) {
|
||||
raiseError(xmlReader.errorString());
|
||||
return Q_NULLPTR;
|
||||
if (keepDatabase) {
|
||||
return db.take();
|
||||
}
|
||||
else {
|
||||
return Q_NULLPTR;
|
||||
}
|
||||
}
|
||||
|
||||
Q_ASSERT(version < 0x00030001 || !xmlReader.headerHash().isEmpty());
|
||||
|
@ -232,6 +237,11 @@ QByteArray KeePass2Reader::xmlData()
|
|||
return m_xmlData;
|
||||
}
|
||||
|
||||
QByteArray KeePass2Reader::streamKey()
|
||||
{
|
||||
return m_protectedStreamKey;
|
||||
}
|
||||
|
||||
void KeePass2Reader::raiseError(const QString& errorMessage)
|
||||
{
|
||||
m_error = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue