mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-25 23:39:45 -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_attachments(new EntryAttachments(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.autoTypeEnabled = true;
|
||||
m_data.autoTypeObfuscation = 0;
|
||||
|
@ -25,13 +25,12 @@
|
||||
const int Group::DefaultIconNumber = 48;
|
||||
|
||||
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()
|
||||
|
@ -26,15 +26,21 @@ const int Metadata::DefaultHistoryMaxSize = 6 * 1024 * 1024;
|
||||
|
||||
Metadata::Metadata(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();
|
||||
m_nameChanged = now;
|
||||
m_descriptionChanged = now;
|
||||
@ -42,15 +48,6 @@ Metadata::Metadata(QObject* parent)
|
||||
m_recycleBinChanged = now;
|
||||
m_entryTemplatesGroupChanged = 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)
|
||||
|
@ -20,10 +20,9 @@
|
||||
#include "core/Tools.h"
|
||||
|
||||
TimeInfo::TimeInfo()
|
||||
: m_expires(false)
|
||||
, m_usageCount(0)
|
||||
{
|
||||
m_expires = false;
|
||||
m_usageCount = 0;
|
||||
|
||||
QDateTime now = Tools::currentDateTimeUtc();
|
||||
m_lastModificationTime = now;
|
||||
m_creationTime = now;
|
||||
|
@ -40,7 +40,7 @@ private Q_SLOTS:
|
||||
void dragSwitchTab();
|
||||
|
||||
private:
|
||||
QTimer* m_tabSwitchTimer;
|
||||
QTimer* const m_tabSwitchTimer;
|
||||
int m_tabSwitchIndex;
|
||||
};
|
||||
|
||||
|
@ -34,14 +34,13 @@ IconStruct::IconStruct()
|
||||
|
||||
EditWidgetIcons::EditWidgetIcons(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_defaultIconModel = new DefaultIconModel(this);
|
||||
m_ui->defaultIconsView->setModel(m_defaultIconModel);
|
||||
|
||||
m_customIconModel = new CustomIconModel(this);
|
||||
m_ui->customIconsView->setModel(m_customIconModel);
|
||||
|
||||
connect(m_ui->defaultIconsView, SIGNAL(clicked(QModelIndex)),
|
||||
|
@ -62,8 +62,8 @@ private:
|
||||
const QScopedPointer<Ui::EditWidgetIcons> m_ui;
|
||||
Database* m_database;
|
||||
Uuid m_currentUuid;
|
||||
DefaultIconModel* m_defaultIconModel;
|
||||
CustomIconModel* m_customIconModel;
|
||||
DefaultIconModel* const m_defaultIconModel;
|
||||
CustomIconModel* const m_customIconModel;
|
||||
|
||||
Q_DISABLE_COPY(EditWidgetIcons)
|
||||
};
|
||||
|
@ -26,8 +26,8 @@
|
||||
|
||||
LineEdit::LineEdit(QWidget* parent)
|
||||
: QLineEdit(parent)
|
||||
, m_clearButton(new QToolButton(this))
|
||||
{
|
||||
m_clearButton = new QToolButton(this);
|
||||
m_clearButton->setObjectName("clearButton");
|
||||
|
||||
QIcon icon;
|
||||
|
@ -40,7 +40,7 @@ private Q_SLOTS:
|
||||
void updateCloseButton(const QString& text);
|
||||
|
||||
private:
|
||||
QToolButton* m_clearButton;
|
||||
QToolButton* const m_clearButton;
|
||||
};
|
||||
|
||||
#endif // KEEPASSX_LINEEDIT_H
|
||||
|
Loading…
Reference in New Issue
Block a user