From 676be9da1693696a5fbde5abad4ba5d8d8a8d78c Mon Sep 17 00:00:00 2001 From: Felix Geyer Date: Mon, 16 Jul 2012 17:47:21 +0200 Subject: [PATCH] Coding style fixes. --- src/autotype/AutoType.cpp | 2 +- src/gui/entry/EditEntryWidget.cpp | 13 ++++++------- src/gui/entry/EditEntryWidget.h | 14 +++++++------- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/autotype/AutoType.cpp b/src/autotype/AutoType.cpp index 720f32a8..cd31dc32 100644 --- a/src/autotype/AutoType.cpp +++ b/src/autotype/AutoType.cpp @@ -155,7 +155,7 @@ void AutoType::performGlobalAutoType(const QList& dbList) } else if (entryList.size() == 1) { m_inAutoType = false; - performAutoType(entryList.first().first, 0, entryList.first().second); + performAutoType(entryList.first().first, Q_NULLPTR, entryList.first().second); } else { // TODO: implement diff --git a/src/gui/entry/EditEntryWidget.cpp b/src/gui/entry/EditEntryWidget.cpp index 25bab8fe..7f4955ce 100644 --- a/src/gui/entry/EditEntryWidget.cpp +++ b/src/gui/entry/EditEntryWidget.cpp @@ -55,6 +55,12 @@ EditEntryWidget::EditEntryWidget(QWidget* parent) , m_iconsWidget(new EditWidgetIcons()) , m_autoTypeWidget(new QWidget()) , m_historyWidget(new QWidget()) + , m_entryAttachments(new EntryAttachments(this)) + , m_attachmentsModel(new EntryAttachmentsModel(m_advancedWidget)) + , m_entryAttributes(new EntryAttributes(this)) + , m_attributesModel(new EntryAttributesModel(m_advancedWidget)) + , m_historyModel(new EntryHistoryModel(this)) + , m_sortModel(new QSortFilterProxyModel(this)) , m_autoTypeAssoc(new AutoTypeAssociations(this)) , m_autoTypeAssocModel(new AutoTypeAssociationsModel(this)) , m_autoTypeDefaultSequenceGroup(new QButtonGroup(this)) @@ -79,16 +85,12 @@ EditEntryWidget::EditEntryWidget(QWidget* parent) m_historyUi->setupUi(m_historyWidget); add(tr("History"), m_historyWidget); - m_entryAttachments = new EntryAttachments(this); - m_attachmentsModel = new EntryAttachmentsModel(m_advancedWidget); m_attachmentsModel->setEntryAttachments(m_entryAttachments); m_advancedUi->attachmentsView->setModel(m_attachmentsModel); connect(m_advancedUi->saveAttachmentButton, SIGNAL(clicked()), SLOT(saveCurrentAttachment())); connect(m_advancedUi->addAttachmentButton, SIGNAL(clicked()), SLOT(insertAttachment())); connect(m_advancedUi->removeAttachmentButton, SIGNAL(clicked()), SLOT(removeCurrentAttachment())); - m_entryAttributes = new EntryAttributes(this); - m_attributesModel = new EntryAttributesModel(m_advancedWidget); m_attributesModel->setEntryAttributes(m_entryAttributes); m_advancedUi->attributesView->setModel(m_attributesModel); connect(m_advancedUi->addAttributeButton, SIGNAL(clicked()), SLOT(insertAttribute())); @@ -130,9 +132,6 @@ EditEntryWidget::EditEntryWidget(QWidget* parent) connect(m_autoTypeUi->windowSequenceEdit, SIGNAL(textChanged(QString)), SLOT(applyCurrentAssoc())); - m_historyModel = new EntryHistoryModel(this); - - m_sortModel = new QSortFilterProxyModel(this); m_sortModel->setSourceModel(m_historyModel); m_sortModel->setDynamicSortFilter(true); m_sortModel->setSortLocaleAware(true); diff --git a/src/gui/entry/EditEntryWidget.h b/src/gui/entry/EditEntryWidget.h index f8a103ce..7ea5ab7d 100644 --- a/src/gui/entry/EditEntryWidget.h +++ b/src/gui/entry/EditEntryWidget.h @@ -93,7 +93,7 @@ private Q_SLOTS: private: bool passwordsEqual(); - void setForms(const Entry* entry, bool restore = false); + void setForms(const Entry* entry, bool restore = false); Entry* m_entry; Database* m_database; @@ -111,12 +111,12 @@ private: EditWidgetIcons* const m_iconsWidget; QWidget* const m_autoTypeWidget; QWidget* const m_historyWidget; - EntryAttachmentsModel* m_attachmentsModel; - EntryAttributesModel* m_attributesModel; - EntryHistoryModel* m_historyModel; - QSortFilterProxyModel* m_sortModel; - EntryAttachments* m_entryAttachments; - EntryAttributes* m_entryAttributes; + EntryAttachments* const m_entryAttachments; + EntryAttachmentsModel* const m_attachmentsModel; + EntryAttributes* const m_entryAttributes; + EntryAttributesModel* const m_attributesModel; + EntryHistoryModel* const m_historyModel; + QSortFilterProxyModel* const m_sortModel; QPersistentModelIndex m_currentAttribute; AutoTypeAssociations* const m_autoTypeAssoc; AutoTypeAssociationsModel* const m_autoTypeAssocModel;