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
path: root/src
diff options
context:
space:
mode:
authorFelix Geyer <debfx@fobos.de>2011-06-29 18:47:05 +0400
committerFelix Geyer <debfx@fobos.de>2011-06-29 18:47:05 +0400
commit5cb906c235217e998e09c6ec582e1b877ef32272 (patch)
treecd63eec8e91ddbf20a93bca597b00cce2d312961 /src
parentc548c7f4b4565c39a5cd14048c2057f80c775755 (diff)
Properly initialize various attributes.
Diffstat (limited to 'src')
-rw-r--r--src/core/Database.cpp6
-rw-r--r--src/core/Entry.cpp2
-rw-r--r--src/core/Group.cpp2
-rw-r--r--src/core/Metadata.cpp8
-rw-r--r--src/core/TimeInfo.cpp8
5 files changed, 26 insertions, 0 deletions
diff --git a/src/core/Database.cpp b/src/core/Database.cpp
index 09a8eb088..25fda295b 100644
--- a/src/core/Database.cpp
+++ b/src/core/Database.cpp
@@ -22,10 +22,16 @@
#include "Metadata.h"
#include "crypto/Random.h"
+#include "format/KeePass2.h"
Database::Database()
{
m_metadata = new Metadata(this);
+ m_rootGroup = 0;
+
+ m_cipher = KeePass2::CIPHER_AES;
+ m_compressionAlgo = CompressionNone; // TODO change to CompressionGZip?
+ m_transformRounds = 1000; // TODO random number
}
Group* Database::rootGroup()
diff --git a/src/core/Entry.cpp b/src/core/Entry.cpp
index 0495fea52..a71ffae31 100644
--- a/src/core/Entry.cpp
+++ b/src/core/Entry.cpp
@@ -26,6 +26,8 @@ Entry::Entry()
{
m_group = 0;
m_db = 0;
+
+ m_iconNumber = 0; // TODO change?
}
Entry::~Entry()
diff --git a/src/core/Group.cpp b/src/core/Group.cpp
index 730171244..255255d96 100644
--- a/src/core/Group.cpp
+++ b/src/core/Group.cpp
@@ -28,6 +28,8 @@ Group::Group()
{
m_parent = 0;
m_db = 0;
+
+ m_iconNumber = 0; // TODO change?
}
Group::~Group()
diff --git a/src/core/Metadata.cpp b/src/core/Metadata.cpp
index 3dd38bd19..ee322d966 100644
--- a/src/core/Metadata.cpp
+++ b/src/core/Metadata.cpp
@@ -28,6 +28,14 @@ Metadata::Metadata(Database* parent)
m_entryTemplatesGroup = 0;
m_lastSelectedGroup = 0;
m_lastTopVisibleGroup = 0;
+
+ QDateTime now = QDateTime::currentDateTime();
+ m_nameChanged = now;
+ m_descriptionChanged = now;
+ m_defaultUserNameChanged = now;
+ m_recycleBinChanged = now;
+ m_entryTemplatesGroupChanged = now;
+ m_masterKeyChanged = now;
}
QString Metadata::generator() const
diff --git a/src/core/TimeInfo.cpp b/src/core/TimeInfo.cpp
index 477543952..d5bf1fb8c 100644
--- a/src/core/TimeInfo.cpp
+++ b/src/core/TimeInfo.cpp
@@ -20,6 +20,14 @@
TimeInfo::TimeInfo()
{
m_expires = false;
+ m_usageCount = 0; // TODO ???
+
+ QDateTime now = QDateTime::currentDateTime();
+ m_lastModificationTime = now;
+ m_creationTime = now;
+ m_lastAccessTime = now;
+ m_expiryTime = now;
+ m_locationChanged = now;
}
QDateTime TimeInfo::lastModificationTime() const