mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-12-17 17:34:50 -05:00
Make C++11 mandatory.
This commit is contained in:
parent
0e85c98d02
commit
7fa0eddc5f
112 changed files with 332 additions and 411 deletions
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
AutoTypeAssociationsModel::AutoTypeAssociationsModel(QObject* parent)
|
||||
: QAbstractListModel(parent)
|
||||
, m_autoTypeAssociations(Q_NULLPTR)
|
||||
, m_autoTypeAssociations(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,12 +29,12 @@ class AutoTypeAssociationsModel : public QAbstractListModel
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit AutoTypeAssociationsModel(QObject* parent = Q_NULLPTR);
|
||||
explicit AutoTypeAssociationsModel(QObject* parent = nullptr);
|
||||
void setAutoTypeAssociations(AutoTypeAssociations* autoTypeAssociations);
|
||||
int rowCount(const QModelIndex& parent = QModelIndex()) const Q_DECL_OVERRIDE;
|
||||
int columnCount(const QModelIndex& parent = QModelIndex()) const Q_DECL_OVERRIDE;
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
|
||||
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
|
||||
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
|
||||
int columnCount(const QModelIndex& parent = QModelIndex()) const override;
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
|
||||
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
|
||||
|
||||
public Q_SLOTS:
|
||||
void associationChange(int i);
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@
|
|||
|
||||
EditEntryWidget::EditEntryWidget(QWidget* parent)
|
||||
: EditWidget(parent)
|
||||
, m_entry(Q_NULLPTR)
|
||||
, m_entry(nullptr)
|
||||
, m_mainUi(new Ui::EditEntryWidgetMain())
|
||||
, m_advancedUi(new Ui::EditEntryWidgetAdvanced())
|
||||
, m_autoTypeUi(new Ui::EditEntryWidgetAutoType())
|
||||
|
|
@ -477,8 +477,8 @@ void EditEntryWidget::cancel()
|
|||
|
||||
void EditEntryWidget::clear()
|
||||
{
|
||||
m_entry = Q_NULLPTR;
|
||||
m_database = Q_NULLPTR;
|
||||
m_entry = nullptr;
|
||||
m_database = nullptr;
|
||||
m_entryAttributes->clear();
|
||||
m_entryAttachments->clear();
|
||||
m_autoTypeAssoc->clear();
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ class EditEntryWidget : public EditWidget
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit EditEntryWidget(QWidget* parent = Q_NULLPTR);
|
||||
explicit EditEntryWidget(QWidget* parent = nullptr);
|
||||
~EditEntryWidget();
|
||||
|
||||
void loadEntry(Entry* entry, bool create, bool history, const QString& parentName,
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
EntryAttachmentsModel::EntryAttachmentsModel(QObject* parent)
|
||||
: QAbstractListModel(parent)
|
||||
, m_entryAttachments(Q_NULLPTR)
|
||||
, m_entryAttachments(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,8 +20,6 @@
|
|||
|
||||
#include <QAbstractListModel>
|
||||
|
||||
#include "core/Global.h"
|
||||
|
||||
class EntryAttachments;
|
||||
|
||||
class EntryAttachmentsModel : public QAbstractListModel
|
||||
|
|
@ -29,11 +27,11 @@ class EntryAttachmentsModel : public QAbstractListModel
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit EntryAttachmentsModel(QObject* parent = Q_NULLPTR);
|
||||
explicit EntryAttachmentsModel(QObject* parent = nullptr);
|
||||
void setEntryAttachments(EntryAttachments* entry);
|
||||
int rowCount(const QModelIndex& parent = QModelIndex()) const Q_DECL_OVERRIDE;
|
||||
int columnCount(const QModelIndex& parent = QModelIndex()) const Q_DECL_OVERRIDE;
|
||||
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
|
||||
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
|
||||
int columnCount(const QModelIndex& parent = QModelIndex()) const override;
|
||||
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
|
||||
QString keyByIndex(const QModelIndex& index) const;
|
||||
|
||||
private Q_SLOTS:
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
EntryAttributesModel::EntryAttributesModel(QObject* parent)
|
||||
: QAbstractListModel(parent)
|
||||
, m_entryAttributes(Q_NULLPTR)
|
||||
, m_entryAttributes(nullptr)
|
||||
, m_nextRenameDataChange(false)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,8 +20,6 @@
|
|||
|
||||
#include <QAbstractListModel>
|
||||
|
||||
#include "core/Global.h"
|
||||
|
||||
class EntryAttributes;
|
||||
|
||||
class EntryAttributesModel : public QAbstractListModel
|
||||
|
|
@ -29,14 +27,14 @@ class EntryAttributesModel : public QAbstractListModel
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit EntryAttributesModel(QObject* parent = Q_NULLPTR);
|
||||
explicit EntryAttributesModel(QObject* parent = nullptr);
|
||||
void setEntryAttributes(EntryAttributes* entryAttributes);
|
||||
int rowCount(const QModelIndex& parent = QModelIndex()) const Q_DECL_OVERRIDE;
|
||||
int columnCount(const QModelIndex& parent = QModelIndex()) const Q_DECL_OVERRIDE;
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
|
||||
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
|
||||
bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) Q_DECL_OVERRIDE;
|
||||
Qt::ItemFlags flags(const QModelIndex& index) const Q_DECL_OVERRIDE;
|
||||
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
|
||||
int columnCount(const QModelIndex& parent = QModelIndex()) const override;
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
|
||||
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
|
||||
bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override;
|
||||
Qt::ItemFlags flags(const QModelIndex& index) const override;
|
||||
QModelIndex indexByKey(const QString& key) const;
|
||||
QString keyByIndex(const QModelIndex& index) const;
|
||||
|
||||
|
|
|
|||
|
|
@ -20,8 +20,6 @@
|
|||
|
||||
#include <QAbstractTableModel>
|
||||
|
||||
#include "core/Global.h"
|
||||
|
||||
class Entry;
|
||||
|
||||
class EntryHistoryModel : public QAbstractTableModel
|
||||
|
|
@ -29,13 +27,13 @@ class EntryHistoryModel : public QAbstractTableModel
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit EntryHistoryModel(QObject* parent = Q_NULLPTR);
|
||||
explicit EntryHistoryModel(QObject* parent = nullptr);
|
||||
|
||||
Entry* entryFromIndex(const QModelIndex& index) const;
|
||||
int columnCount(const QModelIndex& parent = QModelIndex()) const Q_DECL_OVERRIDE;
|
||||
int rowCount(const QModelIndex& parent = QModelIndex()) const Q_DECL_OVERRIDE;
|
||||
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role) const Q_DECL_OVERRIDE;
|
||||
int columnCount(const QModelIndex& parent = QModelIndex()) const override;
|
||||
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
|
||||
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
|
||||
|
||||
void setEntries(const QList<Entry*>& entries);
|
||||
void clear();
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
EntryModel::EntryModel(QObject* parent)
|
||||
: QAbstractTableModel(parent)
|
||||
, m_group(Q_NULLPTR)
|
||||
, m_group(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -71,7 +71,7 @@ void EntryModel::setEntryList(const QList<Entry*>& entries)
|
|||
|
||||
severConnections();
|
||||
|
||||
m_group = Q_NULLPTR;
|
||||
m_group = nullptr;
|
||||
m_allGroups.clear();
|
||||
m_entries = entries;
|
||||
m_orgEntries = entries;
|
||||
|
|
@ -215,7 +215,7 @@ QStringList EntryModel::mimeTypes() const
|
|||
QMimeData* EntryModel::mimeData(const QModelIndexList& indexes) const
|
||||
{
|
||||
if (indexes.isEmpty()) {
|
||||
return Q_NULLPTR;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QMimeData* data = new QMimeData();
|
||||
|
|
@ -240,7 +240,7 @@ QMimeData* EntryModel::mimeData(const QModelIndexList& indexes) const
|
|||
|
||||
if (seenEntries.isEmpty()) {
|
||||
delete data;
|
||||
return Q_NULLPTR;
|
||||
return nullptr;
|
||||
}
|
||||
else {
|
||||
data->setData(mimeTypes().first(), encoded);
|
||||
|
|
@ -298,11 +298,11 @@ void EntryModel::entryDataChanged(Entry* entry)
|
|||
void EntryModel::severConnections()
|
||||
{
|
||||
if (m_group) {
|
||||
disconnect(m_group, Q_NULLPTR, this, Q_NULLPTR);
|
||||
disconnect(m_group, nullptr, this, nullptr);
|
||||
}
|
||||
|
||||
Q_FOREACH (const Group* group, m_allGroups) {
|
||||
disconnect(group, Q_NULLPTR, this, Q_NULLPTR);
|
||||
disconnect(group, nullptr, this, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,8 +20,6 @@
|
|||
|
||||
#include <QAbstractTableModel>
|
||||
|
||||
#include "core/Global.h"
|
||||
|
||||
class Entry;
|
||||
class Group;
|
||||
|
||||
|
|
@ -38,19 +36,19 @@ public:
|
|||
Url = 3
|
||||
};
|
||||
|
||||
explicit EntryModel(QObject* parent = Q_NULLPTR);
|
||||
explicit EntryModel(QObject* parent = nullptr);
|
||||
Entry* entryFromIndex(const QModelIndex& index) const;
|
||||
QModelIndex indexFromEntry(Entry* entry) const;
|
||||
|
||||
int rowCount(const QModelIndex& parent = QModelIndex()) const Q_DECL_OVERRIDE;
|
||||
int columnCount(const QModelIndex& parent = QModelIndex()) const Q_DECL_OVERRIDE;
|
||||
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
|
||||
Qt::DropActions supportedDropActions() const Q_DECL_OVERRIDE;
|
||||
Qt::DropActions supportedDragActions() const Q_DECL_OVERRIDE;
|
||||
Qt::ItemFlags flags(const QModelIndex& modelIndex) const Q_DECL_OVERRIDE;
|
||||
QStringList mimeTypes() const Q_DECL_OVERRIDE;
|
||||
QMimeData* mimeData(const QModelIndexList& indexes) const Q_DECL_OVERRIDE;
|
||||
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
|
||||
int columnCount(const QModelIndex& parent = QModelIndex()) const override;
|
||||
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
|
||||
Qt::DropActions supportedDropActions() const override;
|
||||
Qt::DropActions supportedDragActions() const override;
|
||||
Qt::ItemFlags flags(const QModelIndex& modelIndex) const override;
|
||||
QStringList mimeTypes() const override;
|
||||
QMimeData* mimeData(const QModelIndexList& indexes) const override;
|
||||
|
||||
void setEntryList(const QList<Entry*>& entries);
|
||||
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ Entry* EntryView::currentEntry()
|
|||
return m_model->entryFromIndex(m_sortModel->mapToSource(list.first()));
|
||||
}
|
||||
else {
|
||||
return Q_NULLPTR;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -129,7 +129,7 @@ Entry* EntryView::entryFromIndex(const QModelIndex& index)
|
|||
return m_model->entryFromIndex(m_sortModel->mapToSource(index));
|
||||
}
|
||||
else {
|
||||
return Q_NULLPTR;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,8 +20,6 @@
|
|||
|
||||
#include <QTreeView>
|
||||
|
||||
#include "core/Global.h"
|
||||
|
||||
#include "gui/entry/EntryModel.h"
|
||||
|
||||
class Entry;
|
||||
|
|
@ -34,8 +32,8 @@ class EntryView : public QTreeView
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit EntryView(QWidget* parent = Q_NULLPTR);
|
||||
void setModel(QAbstractItemModel* model) Q_DECL_OVERRIDE;
|
||||
explicit EntryView(QWidget* parent = nullptr);
|
||||
void setModel(QAbstractItemModel* model) override;
|
||||
Entry* currentEntry();
|
||||
void setCurrentEntry(Entry* entry);
|
||||
Entry* entryFromIndex(const QModelIndex& index);
|
||||
|
|
@ -52,7 +50,7 @@ Q_SIGNALS:
|
|||
void entrySelectionChanged();
|
||||
|
||||
protected:
|
||||
void keyPressEvent(QKeyEvent* event) Q_DECL_OVERRIDE;
|
||||
void keyPressEvent(QKeyEvent* event) override;
|
||||
|
||||
private Q_SLOTS:
|
||||
void emitEntryActivated(const QModelIndex& index);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue