Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/keepassxreboot/keepassxc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Geyer <debfx@fobos.de>2010-09-25 14:41:00 +0400
committerFelix Geyer <debfx@fobos.de>2010-09-25 14:41:00 +0400
commite3da80fcc61476a931564cac98ea56186dabacce (patch)
tree20e201ce4a68b12045645c016b77c09951909a17 /src/streams
parenta9ac4bbf41aa1d7f4f25f45ea5cc237894e1fb56 (diff)
Add KeePass2Writer.
Support attributes MasterKeyChanged, MasterKeyChangeRec, MasterKeyChangeForce and Tags. Close streams in the dtor.
Diffstat (limited to 'src/streams')
-rw-r--r--src/streams/HashedBlockStream.cpp5
-rw-r--r--src/streams/HashedBlockStream.h1
-rw-r--r--src/streams/LayeredStream.cpp5
-rw-r--r--src/streams/LayeredStream.h1
-rw-r--r--src/streams/SymmetricCipherStream.cpp5
-rw-r--r--src/streams/SymmetricCipherStream.h1
-rw-r--r--src/streams/qtiocompressor.cpp2
7 files changed, 19 insertions, 1 deletions
diff --git a/src/streams/HashedBlockStream.cpp b/src/streams/HashedBlockStream.cpp
index c0f97764a..3ad35e30a 100644
--- a/src/streams/HashedBlockStream.cpp
+++ b/src/streams/HashedBlockStream.cpp
@@ -38,6 +38,11 @@ HashedBlockStream::HashedBlockStream(QIODevice* baseDevice, qint32 blockSize)
init();
}
+HashedBlockStream::~HashedBlockStream()
+{
+ close();
+}
+
void HashedBlockStream::init()
{
m_buffer.clear();
diff --git a/src/streams/HashedBlockStream.h b/src/streams/HashedBlockStream.h
index 3aa23bf22..fc20ce14f 100644
--- a/src/streams/HashedBlockStream.h
+++ b/src/streams/HashedBlockStream.h
@@ -29,6 +29,7 @@ class HashedBlockStream : public LayeredStream
public:
explicit HashedBlockStream(QIODevice* baseDevice);
HashedBlockStream(QIODevice* baseDevice, qint32 blockSize);
+ ~HashedBlockStream();
bool reset();
void close();
diff --git a/src/streams/LayeredStream.cpp b/src/streams/LayeredStream.cpp
index d0078085c..b71eb228a 100644
--- a/src/streams/LayeredStream.cpp
+++ b/src/streams/LayeredStream.cpp
@@ -24,6 +24,11 @@ LayeredStream::LayeredStream(QIODevice* baseDevice)
connect(baseDevice, SIGNAL(aboutToClose()), SLOT(closeStream()));
}
+LayeredStream::~LayeredStream()
+{
+ close();
+}
+
bool LayeredStream::isSequential() const
{
return true;
diff --git a/src/streams/LayeredStream.h b/src/streams/LayeredStream.h
index 86e9d1a6b..0c008ae93 100644
--- a/src/streams/LayeredStream.h
+++ b/src/streams/LayeredStream.h
@@ -26,6 +26,7 @@ class LayeredStream : public QIODevice
public:
explicit LayeredStream(QIODevice* baseDevice);
+ virtual ~LayeredStream();
bool isSequential() const;
virtual QString errorString() const;
diff --git a/src/streams/SymmetricCipherStream.cpp b/src/streams/SymmetricCipherStream.cpp
index fd7354727..edfbc0b74 100644
--- a/src/streams/SymmetricCipherStream.cpp
+++ b/src/streams/SymmetricCipherStream.cpp
@@ -28,6 +28,11 @@ SymmetricCipherStream::SymmetricCipherStream(QIODevice* baseDevice, SymmetricCip
m_cipher = new SymmetricCipher(algo, mode, direction, key, iv);
}
+SymmetricCipherStream::~SymmetricCipherStream()
+{
+ close();
+}
+
bool SymmetricCipherStream::reset()
{
if (isWritable()) {
diff --git a/src/streams/SymmetricCipherStream.h b/src/streams/SymmetricCipherStream.h
index 90bfc7257..186bd1200 100644
--- a/src/streams/SymmetricCipherStream.h
+++ b/src/streams/SymmetricCipherStream.h
@@ -30,6 +30,7 @@ class SymmetricCipherStream : public LayeredStream
public:
SymmetricCipherStream(QIODevice* baseDevice, SymmetricCipher::Algorithm algo, SymmetricCipher::Mode mode,
SymmetricCipher::Direction direction, const QByteArray& key, const QByteArray& iv);
+ ~SymmetricCipherStream();
bool reset();
void close();
diff --git a/src/streams/qtiocompressor.cpp b/src/streams/qtiocompressor.cpp
index 0de5dff4d..569596302 100644
--- a/src/streams/qtiocompressor.cpp
+++ b/src/streams/qtiocompressor.cpp
@@ -45,7 +45,7 @@
****************************************************************************/
#include "qtiocompressor.h"
-#include "zlib.h"
+#include <zlib.h>
#include <QtCore/QDebug>
typedef Bytef ZlibByte;