mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-28 00:39:43 -05:00
Use constructor initialization lists where possible.
This commit is contained in:
parent
4152e93bb7
commit
308d3ad84b
@ -29,10 +29,9 @@ Entry::Entry()
|
|||||||
: m_attributes(new EntryAttributes(this))
|
: m_attributes(new EntryAttributes(this))
|
||||||
, m_attachments(new EntryAttachments(this))
|
, m_attachments(new EntryAttachments(this))
|
||||||
, m_autoTypeAssociations(new AutoTypeAssociations(this))
|
, m_autoTypeAssociations(new AutoTypeAssociations(this))
|
||||||
|
, m_tmpHistoryItem(Q_NULLPTR)
|
||||||
|
, m_updateTimeinfo(true)
|
||||||
{
|
{
|
||||||
m_updateTimeinfo = true;
|
|
||||||
m_tmpHistoryItem = Q_NULLPTR;
|
|
||||||
|
|
||||||
m_data.iconNumber = DefaultIconNumber;
|
m_data.iconNumber = DefaultIconNumber;
|
||||||
m_data.autoTypeEnabled = true;
|
m_data.autoTypeEnabled = true;
|
||||||
m_data.autoTypeObfuscation = 0;
|
m_data.autoTypeObfuscation = 0;
|
||||||
|
@ -25,13 +25,12 @@
|
|||||||
const int Group::DefaultIconNumber = 48;
|
const int Group::DefaultIconNumber = 48;
|
||||||
|
|
||||||
Group::Group()
|
Group::Group()
|
||||||
|
: m_iconNumber(DefaultIconNumber)
|
||||||
|
, m_isExpanded(true)
|
||||||
|
, m_autoTypeEnabled(Inherit)
|
||||||
|
, m_searchingEnabled(Inherit)
|
||||||
|
, m_updateTimeinfo(true)
|
||||||
{
|
{
|
||||||
m_iconNumber = DefaultIconNumber;
|
|
||||||
m_isExpanded = true;
|
|
||||||
m_autoTypeEnabled = Inherit;
|
|
||||||
m_searchingEnabled = Inherit;
|
|
||||||
|
|
||||||
m_updateTimeinfo = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Group::~Group()
|
Group::~Group()
|
||||||
|
@ -26,15 +26,21 @@ const int Metadata::DefaultHistoryMaxSize = 6 * 1024 * 1024;
|
|||||||
|
|
||||||
Metadata::Metadata(QObject* parent)
|
Metadata::Metadata(QObject* parent)
|
||||||
: QObject(parent)
|
: QObject(parent)
|
||||||
|
, m_generator("KeePassX")
|
||||||
|
, m_maintenanceHistoryDays(365)
|
||||||
|
, m_protectTitle(false)
|
||||||
|
, m_protectUsername(false)
|
||||||
|
, m_protectPassword(true)
|
||||||
|
, m_protectUrl(false)
|
||||||
|
, m_protectNotes(false)
|
||||||
|
// , m_autoEnableVisualHiding(false)
|
||||||
|
, m_recycleBinEnabled(true)
|
||||||
|
, m_masterKeyChangeRec(-1)
|
||||||
|
, m_masterKeyChangeForce(-1)
|
||||||
|
, m_historyMaxItems(DefaultHistoryMaxItems)
|
||||||
|
, m_historyMaxSize(DefaultHistoryMaxSize)
|
||||||
|
, m_updateDatetime(true)
|
||||||
{
|
{
|
||||||
m_generator = "KeePassX";
|
|
||||||
m_maintenanceHistoryDays = 365;
|
|
||||||
m_recycleBinEnabled = true;
|
|
||||||
m_masterKeyChangeRec = -1;
|
|
||||||
m_masterKeyChangeForce = -1;
|
|
||||||
m_historyMaxItems = DefaultHistoryMaxItems;
|
|
||||||
m_historyMaxSize = DefaultHistoryMaxSize;
|
|
||||||
|
|
||||||
QDateTime now = Tools::currentDateTimeUtc();
|
QDateTime now = Tools::currentDateTimeUtc();
|
||||||
m_nameChanged = now;
|
m_nameChanged = now;
|
||||||
m_descriptionChanged = now;
|
m_descriptionChanged = now;
|
||||||
@ -42,15 +48,6 @@ Metadata::Metadata(QObject* parent)
|
|||||||
m_recycleBinChanged = now;
|
m_recycleBinChanged = now;
|
||||||
m_entryTemplatesGroupChanged = now;
|
m_entryTemplatesGroupChanged = now;
|
||||||
m_masterKeyChanged = now;
|
m_masterKeyChanged = now;
|
||||||
|
|
||||||
m_protectTitle = false;
|
|
||||||
m_protectUsername = false;
|
|
||||||
m_protectPassword = true;
|
|
||||||
m_protectUrl = false;
|
|
||||||
m_protectNotes = false;
|
|
||||||
// m_autoEnableVisualHiding = false;
|
|
||||||
|
|
||||||
m_updateDatetime = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class P, class V> bool Metadata::set(P& property, const V& value)
|
template <class P, class V> bool Metadata::set(P& property, const V& value)
|
||||||
|
@ -20,10 +20,9 @@
|
|||||||
#include "core/Tools.h"
|
#include "core/Tools.h"
|
||||||
|
|
||||||
TimeInfo::TimeInfo()
|
TimeInfo::TimeInfo()
|
||||||
|
: m_expires(false)
|
||||||
|
, m_usageCount(0)
|
||||||
{
|
{
|
||||||
m_expires = false;
|
|
||||||
m_usageCount = 0;
|
|
||||||
|
|
||||||
QDateTime now = Tools::currentDateTimeUtc();
|
QDateTime now = Tools::currentDateTimeUtc();
|
||||||
m_lastModificationTime = now;
|
m_lastModificationTime = now;
|
||||||
m_creationTime = now;
|
m_creationTime = now;
|
||||||
|
@ -40,7 +40,7 @@ private Q_SLOTS:
|
|||||||
void dragSwitchTab();
|
void dragSwitchTab();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QTimer* m_tabSwitchTimer;
|
QTimer* const m_tabSwitchTimer;
|
||||||
int m_tabSwitchIndex;
|
int m_tabSwitchIndex;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -34,14 +34,13 @@ IconStruct::IconStruct()
|
|||||||
|
|
||||||
EditWidgetIcons::EditWidgetIcons(QWidget* parent)
|
EditWidgetIcons::EditWidgetIcons(QWidget* parent)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
, m_ui(new Ui::EditWidgetIcons())
|
, m_ui(new Ui::EditWidgetIcons())
|
||||||
|
, m_defaultIconModel(new DefaultIconModel(this))
|
||||||
|
, m_customIconModel(new CustomIconModel(this))
|
||||||
{
|
{
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
|
|
||||||
m_defaultIconModel = new DefaultIconModel(this);
|
|
||||||
m_ui->defaultIconsView->setModel(m_defaultIconModel);
|
m_ui->defaultIconsView->setModel(m_defaultIconModel);
|
||||||
|
|
||||||
m_customIconModel = new CustomIconModel(this);
|
|
||||||
m_ui->customIconsView->setModel(m_customIconModel);
|
m_ui->customIconsView->setModel(m_customIconModel);
|
||||||
|
|
||||||
connect(m_ui->defaultIconsView, SIGNAL(clicked(QModelIndex)),
|
connect(m_ui->defaultIconsView, SIGNAL(clicked(QModelIndex)),
|
||||||
|
@ -62,8 +62,8 @@ private:
|
|||||||
const QScopedPointer<Ui::EditWidgetIcons> m_ui;
|
const QScopedPointer<Ui::EditWidgetIcons> m_ui;
|
||||||
Database* m_database;
|
Database* m_database;
|
||||||
Uuid m_currentUuid;
|
Uuid m_currentUuid;
|
||||||
DefaultIconModel* m_defaultIconModel;
|
DefaultIconModel* const m_defaultIconModel;
|
||||||
CustomIconModel* m_customIconModel;
|
CustomIconModel* const m_customIconModel;
|
||||||
|
|
||||||
Q_DISABLE_COPY(EditWidgetIcons)
|
Q_DISABLE_COPY(EditWidgetIcons)
|
||||||
};
|
};
|
||||||
|
@ -26,8 +26,8 @@
|
|||||||
|
|
||||||
LineEdit::LineEdit(QWidget* parent)
|
LineEdit::LineEdit(QWidget* parent)
|
||||||
: QLineEdit(parent)
|
: QLineEdit(parent)
|
||||||
|
, m_clearButton(new QToolButton(this))
|
||||||
{
|
{
|
||||||
m_clearButton = new QToolButton(this);
|
|
||||||
m_clearButton->setObjectName("clearButton");
|
m_clearButton->setObjectName("clearButton");
|
||||||
|
|
||||||
QIcon icon;
|
QIcon icon;
|
||||||
|
@ -40,7 +40,7 @@ private Q_SLOTS:
|
|||||||
void updateCloseButton(const QString& text);
|
void updateCloseButton(const QString& text);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QToolButton* m_clearButton;
|
QToolButton* const m_clearButton;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // KEEPASSX_LINEEDIT_H
|
#endif // KEEPASSX_LINEEDIT_H
|
||||||
|
Loading…
Reference in New Issue
Block a user