Make use of Q_NULLPTR.

This commit is contained in:
Felix Geyer 2012-06-29 14:15:16 +02:00
parent af142fc433
commit 68155e8f89
59 changed files with 144 additions and 96 deletions

View File

@ -23,7 +23,7 @@
#include <QtGui/QApplication>
#include <QtGui/QDesktopServices>
Config* Config::m_instance(0);
Config* Config::m_instance(Q_NULLPTR);
QVariant Config::get(const QString& key)
{

View File

@ -21,6 +21,8 @@
#include <QtCore/QScopedPointer>
#include <QtCore/QVariant>
#include "core/Global.h"
class QSettings;
class Config : public QObject

View File

@ -22,7 +22,7 @@
#include "config-keepassx.h"
DataPath* DataPath::m_instance(0);
DataPath* DataPath::m_instance(Q_NULLPTR);
QString DataPath::path(const QString& name)
{

View File

@ -21,6 +21,8 @@
#include <QtCore/QString>
#include <QtGui/QIcon>
#include "core/Global.h"
class DataPath
{
public:

View File

@ -19,7 +19,7 @@
#include "core/DataPath.h"
DatabaseIcons* DatabaseIcons::m_instance(0);
DatabaseIcons* DatabaseIcons::m_instance(Q_NULLPTR);
QImage DatabaseIcons::icon(int index)
{

View File

@ -23,6 +23,8 @@
#include <QtGui/QPixmap>
#include <QtGui/QPixmapCache>
#include "core/Global.h"
class DatabaseIcons
{
public:

View File

@ -26,7 +26,7 @@
Entry::Entry()
{
m_updateTimeinfo = true;
m_tmpHistoryItem = 0;
m_tmpHistoryItem = Q_NULLPTR;
m_data.iconNumber = DefaultIconNumber;
m_data.autoTypeEnabled = true;
@ -467,7 +467,7 @@ void Entry::endUpdate()
delete m_tmpHistoryItem;
}
m_tmpHistoryItem = 0;
m_tmpHistoryItem = Q_NULLPTR;
}
void Entry::updateModifiedSinceBegin()

View File

@ -29,6 +29,7 @@
#include "core/EntryAttachments.h"
#include "core/EntryAttributes.h"
#include "core/Global.h"
#include "core/TimeInfo.h"
#include "core/Uuid.h"

View File

@ -21,12 +21,14 @@
#include <QtCore/QMap>
#include <QtCore/QObject>
#include "core/Global.h"
class EntryAttachments : public QObject
{
Q_OBJECT
public:
explicit EntryAttachments(QObject* parent = 0);
explicit EntryAttachments(QObject* parent = Q_NULLPTR);
QList<QString> keys() const;
QByteArray value(const QString& key) const;
void set(const QString& key, const QByteArray& value);

View File

@ -23,12 +23,14 @@
#include <QtCore/QObject>
#include <QtCore/QStringList>
#include "core/Global.h"
class EntryAttributes : public QObject
{
Q_OBJECT
public:
explicit EntryAttributes(QObject* parent = 0);
explicit EntryAttributes(QObject* parent = Q_NULLPTR);
QList<QString> keys() const;
QString value(const QString& key) const;
bool isProtected(const QString& key) const;

View File

@ -355,7 +355,7 @@ void Group::setParent(Database* db)
cleanupParent();
m_parent = 0;
m_parent = Q_NULLPTR;
recSetDatabase(db);
QObject::setParent(db);

View File

@ -24,6 +24,7 @@
#include <QtGui/QColor>
#include <QtGui/QImage>
#include "core/Global.h"
#include "core/Uuid.h"
class Database;
@ -34,7 +35,7 @@ class Metadata : public QObject
Q_OBJECT
public:
explicit Metadata(QObject* parent = 0);
explicit Metadata(QObject* parent = Q_NULLPTR);
QString generator() const;
QString name() const;

View File

@ -18,6 +18,8 @@
#ifndef KEEPASSX_CRYPTO_H
#define KEEPASSX_CRYPTO_H
#include "core/Global.h"
class Crypto
{
public:

View File

@ -71,7 +71,7 @@ void SymmetricCipherGcrypt::init()
Q_ASSERT(error == 0); // TODO: real error checking
size_t blockSizeT;
error = gcry_cipher_algo_info(m_algo, GCRYCTL_GET_BLKLEN, 0, &blockSizeT);
error = gcry_cipher_algo_info(m_algo, GCRYCTL_GET_BLKLEN, Q_NULLPTR, &blockSizeT);
Q_ASSERT(error == 0);
m_blockSize = blockSizeT;
}
@ -118,10 +118,10 @@ void SymmetricCipherGcrypt::processInPlace(QByteArray& data)
gcry_error_t error;
if (m_direction == SymmetricCipher::Decrypt) {
error = gcry_cipher_decrypt(m_ctx, data.data(), data.size(), 0, 0);
error = gcry_cipher_decrypt(m_ctx, data.data(), data.size(), Q_NULLPTR, 0);
}
else {
error = gcry_cipher_encrypt(m_ctx, data.data(), data.size(), 0, 0);
error = gcry_cipher_encrypt(m_ctx, data.data(), data.size(), Q_NULLPTR, 0);
}
Q_ASSERT(error == 0);
@ -135,13 +135,13 @@ void SymmetricCipherGcrypt::processInPlace(QByteArray& data, quint64 rounds)
if (m_direction == SymmetricCipher::Decrypt) {
for (quint64 i = 0; i != rounds; ++i) {
error = gcry_cipher_decrypt(m_ctx, data.data(), data.size(), 0, 0);
error = gcry_cipher_decrypt(m_ctx, data.data(), data.size(), Q_NULLPTR, 0);
Q_ASSERT(error == 0);
}
}
else {
for (quint64 i = 0; i != rounds; ++i) {
error = gcry_cipher_encrypt(m_ctx, data.data(), data.size(), 0, 0);
error = gcry_cipher_encrypt(m_ctx, data.data(), data.size(), Q_NULLPTR, 0);
Q_ASSERT(error == 0);
}
}

View File

@ -29,9 +29,9 @@
#include "streams/QtIOCompressor"
KeePass2XmlReader::KeePass2XmlReader()
: m_randomStream(0)
, m_db(0)
, m_meta(0)
: m_randomStream(Q_NULLPTR)
, m_db(Q_NULLPTR)
, m_meta(Q_NULLPTR)
{
}
@ -400,7 +400,7 @@ Group* KeePass2XmlReader::parseGroup()
{
Q_ASSERT(m_xml.isStartElement() && m_xml.name() == "Group");
Group* group = 0;
Group* group = Q_NULLPTR;
while (!m_xml.error() && m_xml.readNextStartElement()) {
if (m_xml.name() == "UUID") {
Uuid uuid = readUuid();

View File

@ -25,6 +25,7 @@
#include <QtCore/QXmlStreamReader>
#include <QtGui/QColor>
#include "core/Global.h"
#include "core/TimeInfo.h"
#include "core/Uuid.h"
@ -41,7 +42,7 @@ class KeePass2XmlReader
public:
KeePass2XmlReader();
Database* readDatabase(QIODevice* device);
void readDatabase(QIODevice* device, Database* db, KeePass2RandomStream* randomStream = 0);
void readDatabase(QIODevice* device, Database* db, KeePass2RandomStream* randomStream = Q_NULLPTR);
Database* readDatabase(const QString& filename);
bool hasError();
QString errorString();

View File

@ -25,9 +25,9 @@
#include "streams/QtIOCompressor"
KeePass2XmlWriter::KeePass2XmlWriter()
: m_db(0)
, m_meta(0)
, m_randomStream(0)
: m_db(Q_NULLPTR)
, m_meta(Q_NULLPTR)
, m_randomStream(Q_NULLPTR)
{
m_xml.setAutoFormatting(true);
m_xml.setAutoFormattingIndent(-1); // 1 tab

View File

@ -36,8 +36,8 @@ class KeePass2XmlWriter
{
public:
KeePass2XmlWriter();
void writeDatabase(QIODevice* device, Database* db, KeePass2RandomStream* randomStream = 0);
void writeDatabase(const QString& filename, Database* db, KeePass2RandomStream* randomStream = 0);
void writeDatabase(QIODevice* device, Database* db, KeePass2RandomStream* randomStream = Q_NULLPTR);
void writeDatabase(const QString& filename, Database* db, KeePass2RandomStream* randomStream = Q_NULLPTR);
bool error();
QString errorString();

View File

@ -21,6 +21,8 @@
#include <QtCore/QScopedPointer>
#include <QtGui/QDialog>
#include "core/Global.h"
namespace Ui {
class AboutDialog;
}
@ -30,7 +32,7 @@ class AboutDialog : public QDialog
Q_OBJECT
public:
explicit AboutDialog(QWidget* parent = 0);
explicit AboutDialog(QWidget* parent = Q_NULLPTR);
~AboutDialog();
private:

View File

@ -33,7 +33,7 @@ class ChangeMasterKeyWidget : public DialogyWidget
Q_OBJECT
public:
explicit ChangeMasterKeyWidget(QWidget* parent = 0);
explicit ChangeMasterKeyWidget(QWidget* parent = Q_NULLPTR);
~ChangeMasterKeyWidget();
void clearForms();
CompositeKey newMasterKey();

View File

@ -28,7 +28,7 @@
#include "core/Config.h"
Clipboard* Clipboard::m_instance(0);
Clipboard* Clipboard::m_instance(Q_NULLPTR);
Clipboard::Clipboard(QObject* parent)
: QObject(parent)

View File

@ -20,6 +20,8 @@
#include <QtCore/QObject>
#include "core/Global.h"
class QTimer;
class Clipboard : public QObject
@ -36,7 +38,7 @@ private Q_SLOTS:
void clearClipboard();
private:
explicit Clipboard(QObject* parent = 0);
explicit Clipboard(QObject* parent = Q_NULLPTR);
static Clipboard* m_instance;

View File

@ -30,8 +30,8 @@
DatabaseOpenWidget::DatabaseOpenWidget(QWidget* parent)
: DialogyWidget(parent)
, m_ui(new Ui::DatabaseOpenWidget())
, m_db(0)
, m_file(0)
, m_db(Q_NULLPTR)
, m_file(Q_NULLPTR)
{
m_ui->setupUi(this);

View File

@ -34,7 +34,7 @@ class DatabaseOpenWidget : public DialogyWidget
Q_OBJECT
public:
DatabaseOpenWidget(QWidget* parent = 0);
DatabaseOpenWidget(QWidget* parent = Q_NULLPTR);
~DatabaseOpenWidget();
void load(QFile* file, const QString& filename);
void enterKey(const QString& pw, const QString& keyFile);

View File

@ -26,7 +26,7 @@
DatabaseSettingsWidget::DatabaseSettingsWidget(QWidget* parent)
: DialogyWidget(parent)
, m_ui(new Ui::DatabaseSettingsWidget())
, m_db(0)
, m_db(Q_NULLPTR)
{
m_ui->setupUi(this);

View File

@ -33,7 +33,7 @@ class DatabaseSettingsWidget : public DialogyWidget
Q_OBJECT
public:
explicit DatabaseSettingsWidget(QWidget* parent = 0);
explicit DatabaseSettingsWidget(QWidget* parent = Q_NULLPTR);
~DatabaseSettingsWidget();
void load(Database* db);

View File

@ -32,8 +32,8 @@
#include "gui/group/GroupView.h"
DatabaseManagerStruct::DatabaseManagerStruct()
: file(0)
, dbWidget(0)
: file(Q_NULLPTR)
, dbWidget(Q_NULLPTR)
, modified(false)
, readOnly(false)
{

View File

@ -99,7 +99,7 @@ private:
Database* databaseFromDatabaseWidget(DatabaseWidget* dbWidget);
void insertDatabase(Database* db, const DatabaseManagerStruct& dbStruct);
void updateLastDatabases(const QString& filename);
void connectDatabase(Database* newDb, Database* oldDb = 0);
void connectDatabase(Database* newDb, Database* oldDb = Q_NULLPTR);
QWidget* const m_window;
KeePass2Writer m_writer;

View File

@ -45,9 +45,9 @@ DatabaseWidget::DatabaseWidget(Database* db, QWidget* parent)
, m_db(db)
, m_searchUi(new Ui::SearchWidget())
, m_searchWidget(new QWidget())
, m_newGroup(0)
, m_newEntry(0)
, m_newParent(0)
, m_newGroup(Q_NULLPTR)
, m_newEntry(Q_NULLPTR)
, m_newParent(Q_NULLPTR)
, m_menuGroup(new QMenu(this))
, m_menuEntry(new QMenu(this))
{
@ -394,8 +394,8 @@ void DatabaseWidget::switchToView(bool accepted)
delete m_newGroup;
}
m_newGroup = 0;
m_newParent = 0;
m_newGroup = Q_NULLPTR;
m_newParent = Q_NULLPTR;
}
else if (m_newEntry) {
if (accepted) {
@ -407,8 +407,8 @@ void DatabaseWidget::switchToView(bool accepted)
delete m_newEntry;
}
m_newEntry = 0;
m_newParent = 0;
m_newEntry = Q_NULLPTR;
m_newParent = Q_NULLPTR;
}
setCurrentIndex(0);
@ -475,9 +475,9 @@ void DatabaseWidget::openDatabase(bool accepted)
// We won't need those anymore and KeePass1OpenWidget closes
// the file in its dtor.
delete m_databaseOpenWidget;
m_databaseOpenWidget = 0;
m_databaseOpenWidget = Q_NULLPTR;
delete m_keepass1OpenWidget;
m_keepass1OpenWidget = 0;
m_keepass1OpenWidget = Q_NULLPTR;
}
else {
if (m_databaseOpenWidget->database()) {
@ -641,7 +641,7 @@ bool DatabaseWidget::canDeleteCurrentGoup()
void DatabaseWidget::clearLastGroup(Group* group)
{
if (group) {
m_lastGroup = 0;
m_lastGroup = Q_NULLPTR;
m_searchWidget->hide();
}
}

View File

@ -21,6 +21,8 @@
#include <QtCore/QScopedPointer>
#include <QtGui/QStackedWidget>
#include "core/Global.h"
class ChangeMasterKeyWidget;
class DatabaseOpenWidget;
class DatabaseSettingsWidget;
@ -63,7 +65,7 @@ public:
EntryCopyPassword
};
explicit DatabaseWidget(Database* db, QWidget* parent = 0);
explicit DatabaseWidget(Database* db, QWidget* parent = Q_NULLPTR);
~DatabaseWidget();
GroupView* groupView();
EntryView* entryView();

View File

@ -21,12 +21,14 @@
#include <QtGui/QDialogButtonBox>
#include <QtGui/QWidget>
#include "core/Global.h"
class DialogyWidget : public QWidget
{
Q_OBJECT
public:
explicit DialogyWidget(QWidget* parent = 0);
explicit DialogyWidget(QWidget* parent = Q_NULLPTR);
protected:
virtual void keyPressEvent(QKeyEvent* e);

View File

@ -20,12 +20,14 @@
#include <QtGui/QTabBar>
#include "core/Global.h"
class DragTabBar : public QTabBar
{
Q_OBJECT
public:
explicit DragTabBar(QWidget* parent = 0);
explicit DragTabBar(QWidget* parent = Q_NULLPTR);
protected:
void dragEnterEvent(QDragEnterEvent* event);

View File

@ -33,7 +33,7 @@ class EditWidget : public DialogyWidget
Q_OBJECT
public:
explicit EditWidget(QWidget* parent = 0);
explicit EditWidget(QWidget* parent = Q_NULLPTR);
~EditWidget();
void add(const QString& labelText, QWidget* widget);

View File

@ -85,7 +85,7 @@ IconStruct EditWidgetIcons::save()
}
}
m_database = 0;
m_database = Q_NULLPTR;
m_currentUuid = Uuid();
return iconStruct;
}

View File

@ -20,6 +20,7 @@
#include <QtGui/QWidget>
#include "core/Global.h"
#include "core/Uuid.h"
class Database;
@ -43,7 +44,7 @@ class EditWidgetIcons : public QWidget
Q_OBJECT
public:
explicit EditWidgetIcons(QWidget* parent = 0);
explicit EditWidgetIcons(QWidget* parent = Q_NULLPTR);
~EditWidgetIcons();
IconStruct save();

View File

@ -19,7 +19,7 @@
#include "core/Config.h"
FileDialog* FileDialog::m_instance(0);
FileDialog* FileDialog::m_instance(Q_NULLPTR);
QString FileDialog::getOpenFileName(QWidget* parent, const QString& caption, QString dir,
const QString& filter, QString* selectedFilter,

View File

@ -20,15 +20,17 @@
#include <QtGui/QFileDialog>
#include "core/Global.h"
class FileDialog
{
public:
QString getOpenFileName(QWidget* parent = 0, const QString& caption = QString(),
QString getOpenFileName(QWidget* parent = Q_NULLPTR, const QString& caption = QString(),
QString dir = QString(), const QString& filter = QString(),
QString* selectedFilter = 0, QFileDialog::Options options = 0);
QString getSaveFileName(QWidget* parent = 0, const QString& caption = QString(),
QString* selectedFilter = Q_NULLPTR, QFileDialog::Options options = Q_NULLPTR);
QString getSaveFileName(QWidget* parent = Q_NULLPTR, const QString& caption = QString(),
QString dir = QString(), const QString& filter = QString(),
QString* selectedFilter = 0, QFileDialog::Options options = 0);
QString* selectedFilter = Q_NULLPTR, QFileDialog::Options options = Q_NULLPTR);
/**
* Sets the result of the next get* method call.

View File

@ -21,6 +21,7 @@
#include <QtCore/QAbstractListModel>
#include <QtGui/QImage>
#include "core/Global.h"
#include "core/Uuid.h"
class DefaultIconModel : public QAbstractListModel
@ -28,7 +29,7 @@ class DefaultIconModel : public QAbstractListModel
Q_OBJECT
public:
explicit DefaultIconModel(QObject* parent = 0);
explicit DefaultIconModel(QObject* parent = Q_NULLPTR);
int rowCount(const QModelIndex& parent = QModelIndex()) const;
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;
@ -39,7 +40,7 @@ class CustomIconModel : public QAbstractListModel
Q_OBJECT
public:
explicit CustomIconModel(QObject* parent = 0);
explicit CustomIconModel(QObject* parent = Q_NULLPTR);
virtual int rowCount(const QModelIndex& parent = QModelIndex()) const;
virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;

View File

@ -25,7 +25,7 @@ class KeePass1OpenWidget : public DatabaseOpenWidget
Q_OBJECT
public:
explicit KeePass1OpenWidget(QWidget* parent = 0);
explicit KeePass1OpenWidget(QWidget* parent = Q_NULLPTR);
~KeePass1OpenWidget();
protected:

View File

@ -22,6 +22,8 @@
#include <QtGui/QLineEdit>
#include "core/Global.h"
class QToolButton;
class LineEdit : public QLineEdit
@ -29,7 +31,7 @@ class LineEdit : public QLineEdit
Q_OBJECT
public:
explicit LineEdit(QWidget* parent = 0);
explicit LineEdit(QWidget* parent = Q_NULLPTR);
protected:
void resizeEvent(QResizeEvent* event);

View File

@ -30,7 +30,7 @@ class SettingsWidget : public EditWidget
Q_OBJECT
public:
explicit SettingsWidget(QWidget* parent = 0);
explicit SettingsWidget(QWidget* parent = Q_NULLPTR);
~SettingsWidget();
void loadSettings();

View File

@ -20,6 +20,8 @@
#include <QtGui/QWidget>
#include "core/Global.h"
namespace Ui {
class WelcomeWidget;
}
@ -29,7 +31,7 @@ class WelcomeWidget : public QWidget
Q_OBJECT
public:
explicit WelcomeWidget(QWidget* parent = 0);
explicit WelcomeWidget(QWidget* parent = Q_NULLPTR);
~WelcomeWidget();
private:

View File

@ -40,7 +40,7 @@
EditEntryWidget::EditEntryWidget(QWidget* parent)
: EditWidget(parent)
, m_entry(0)
, m_entry(Q_NULLPTR)
, m_mainUi(new Ui::EditEntryWidgetMain())
, m_notesUi(new Ui::EditEntryWidgetNotes())
, m_advancedUi(new Ui::EditEntryWidgetAdvanced())
@ -267,8 +267,8 @@ void EditEntryWidget::setForms(const Entry* entry, bool restore)
void EditEntryWidget::saveEntry()
{
if (m_history) {
m_entry = 0;
m_database = 0;
m_entry = Q_NULLPTR;
m_database = Q_NULLPTR;
m_entryAttributes->clear();
m_entryAttachments->clear();
Q_EMIT editFinished(false);
@ -325,8 +325,8 @@ void EditEntryWidget::saveEntry()
}
m_entry = 0;
m_database = 0;
m_entry = Q_NULLPTR;
m_database = Q_NULLPTR;
m_entryAttributes->clear();
m_entryAttachments->clear();
m_historyModel->clear();
@ -337,8 +337,8 @@ void EditEntryWidget::saveEntry()
void EditEntryWidget::cancel()
{
if (m_history) {
m_entry = 0;
m_database = 0;
m_entry = Q_NULLPTR;
m_database = Q_NULLPTR;
m_entryAttributes->clear();
m_entryAttachments->clear();
Q_EMIT editFinished(false);

View File

@ -47,7 +47,7 @@ class EditEntryWidget : public EditWidget
Q_OBJECT
public:
explicit EditEntryWidget(QWidget* parent = 0);
explicit EditEntryWidget(QWidget* parent = Q_NULLPTR);
~EditEntryWidget();
void loadEntry(Entry* entry, bool create, bool history, const QString& groupName,

View File

@ -22,7 +22,7 @@
EntryAttachmentsModel::EntryAttachmentsModel(QObject* parent)
: QAbstractListModel(parent)
, m_entryAttachments(0)
, m_entryAttachments(Q_NULLPTR)
{
}

View File

@ -20,6 +20,8 @@
#include <QtCore/QAbstractListModel>
#include "core/Global.h"
class EntryAttachments;
class EntryAttachmentsModel : public QAbstractListModel
@ -27,7 +29,7 @@ class EntryAttachmentsModel : public QAbstractListModel
Q_OBJECT
public:
explicit EntryAttachmentsModel(QObject* parent = 0);
explicit EntryAttachmentsModel(QObject* parent = Q_NULLPTR);
void setEntryAttachments(EntryAttachments* entry);
int rowCount(const QModelIndex& parent = QModelIndex()) const;
int columnCount(const QModelIndex& parent = QModelIndex()) const;

View File

@ -22,7 +22,7 @@
EntryAttributesModel::EntryAttributesModel(QObject* parent)
: QAbstractListModel(parent)
, m_entryAttributes(0)
, m_entryAttributes(Q_NULLPTR)
, m_nextRenameDataChange(false)
{
}

View File

@ -20,6 +20,8 @@
#include <QtCore/QAbstractListModel>
#include "core/Global.h"
class EntryAttributes;
class EntryAttributesModel : public QAbstractListModel
@ -27,7 +29,7 @@ class EntryAttributesModel : public QAbstractListModel
Q_OBJECT
public:
explicit EntryAttributesModel(QObject* parent = 0);
explicit EntryAttributesModel(QObject* parent = Q_NULLPTR);
void setEntryAttributes(EntryAttributes* entryAttributes);
int rowCount(const QModelIndex& parent = QModelIndex()) const;
int columnCount(const QModelIndex& parent = QModelIndex()) const;

View File

@ -20,6 +20,8 @@
#include <QtCore/QAbstractTableModel>
#include "core/Global.h"
class Entry;
class EntryHistoryModel : public QAbstractTableModel
@ -27,7 +29,7 @@ class EntryHistoryModel : public QAbstractTableModel
Q_OBJECT
public:
explicit EntryHistoryModel(QObject* parent = 0);
explicit EntryHistoryModel(QObject* parent = Q_NULLPTR);
Entry* entryFromIndex(const QModelIndex& index) const;
int columnCount(const QModelIndex& parent = QModelIndex()) const;

View File

@ -26,7 +26,7 @@
EntryModel::EntryModel(QObject* parent)
: QAbstractTableModel(parent)
, m_group(0)
, m_group(Q_NULLPTR)
{
setSupportedDragActions(Qt::MoveAction);
}
@ -69,7 +69,7 @@ void EntryModel::setEntries(const QList<Entry*>& entries)
severConnections();
m_group = 0;
m_group = Q_NULLPTR;
m_allGroups.clear();
m_entries = entries;
@ -257,11 +257,11 @@ void EntryModel::entryDataChanged(Entry* entry)
void EntryModel::severConnections()
{
if (m_group) {
disconnect(m_group, 0, this, 0);
disconnect(m_group, Q_NULLPTR, this, Q_NULLPTR);
}
Q_FOREACH (const Group* group, m_allGroups) {
disconnect(group, 0, this, 0);
disconnect(group, Q_NULLPTR, this, Q_NULLPTR);
}
}

View File

@ -20,6 +20,8 @@
#include <QtCore/QAbstractTableModel>
#include "core/Global.h"
class Entry;
class Group;
@ -28,7 +30,7 @@ class EntryModel : public QAbstractTableModel
Q_OBJECT
public:
explicit EntryModel(QObject* parent = 0);
explicit EntryModel(QObject* parent = Q_NULLPTR);
Entry* entryFromIndex(const QModelIndex& index) const;
QModelIndex indexFromEntry(Entry* entry) const;

View File

@ -20,6 +20,8 @@
#include <QtGui/QTreeView>
#include "core/Global.h"
class Entry;
class EntryModel;
class Group;
@ -30,7 +32,7 @@ class EntryView : public QTreeView
Q_OBJECT
public:
explicit EntryView(QWidget* parent = 0);
explicit EntryView(QWidget* parent = Q_NULLPTR);
void setModel(QAbstractItemModel* model);
Entry* currentEntry();
bool isSingleEntrySelected();

View File

@ -30,7 +30,7 @@ EditGroupWidget::EditGroupWidget(QWidget* parent)
, m_editGroupWidgetMain(new QWidget())
, m_editGroupWidgetIcons(new EditWidgetIcons())
, m_editGroupWidgetAdvanced(new QWidget())
, m_group(0)
, m_group(Q_NULLPTR)
{
m_mainUi->setupUi(m_editGroupWidgetMain);
m_advancedUi->setupUi(m_editGroupWidgetAdvanced);
@ -133,8 +133,8 @@ void EditGroupWidget::save()
m_group->setIcon(iconStruct.uuid);
}
m_group = 0;
m_database = 0;
m_group = Q_NULLPTR;
m_database = Q_NULLPTR;
Q_EMIT editFinished(true);
}
@ -145,7 +145,7 @@ void EditGroupWidget::cancel()
m_group->setIcon(Entry::DefaultIconNumber);
}
m_group = 0;
m_database = 0;
m_group = Q_NULLPTR;
m_database = Q_NULLPTR;
Q_EMIT editFinished(false);
}

View File

@ -36,7 +36,7 @@ class EditGroupWidget : public EditWidget
Q_OBJECT
public:
explicit EditGroupWidget(QWidget* parent = 0);
explicit EditGroupWidget(QWidget* parent = Q_NULLPTR);
~EditGroupWidget();
void loadGroup(Group* group, bool create, Database* database);

View File

@ -27,7 +27,7 @@
GroupModel::GroupModel(Database* db, QObject* parent)
: QAbstractItemModel(parent)
, m_db(0)
, m_db(Q_NULLPTR)
{
changeDatabase(db);
}

View File

@ -20,6 +20,8 @@
#include <QtCore/QAbstractItemModel>
#include "core/Global.h"
class Database;
class Group;
@ -28,7 +30,7 @@ class GroupModel : public QAbstractItemModel
Q_OBJECT
public:
explicit GroupModel(Database* db, QObject* parent = 0);
explicit GroupModel(Database* db, QObject* parent = Q_NULLPTR);
void changeDatabase(Database* newDb);
QModelIndex index(Group* group) const;
Group* groupFromIndex(const QModelIndex& index) const;

View File

@ -20,6 +20,8 @@
#include <QtGui/QTreeView>
#include "core/Global.h"
class Database;
class Group;
class GroupModel;
@ -29,7 +31,7 @@ class GroupView : public QTreeView
Q_OBJECT
public:
explicit GroupView(Database* db, QWidget* parent = 0);
explicit GroupView(Database* db, QWidget* parent = Q_NULLPTR);
void changeDatabase(Database* newDb);
void setModel(QAbstractItemModel* model);
Group* currentGroup();

View File

@ -20,6 +20,7 @@
#include <QtCore/QXmlStreamReader>
#include "core/Global.h"
#include "keys/Key.h"
class QIODevice;
@ -29,11 +30,11 @@ class FileKey : public Key
public:
FileKey();
bool load(QIODevice* device);
bool load(const QString& fileName, QString* errorMsg = 0);
bool load(const QString& fileName, QString* errorMsg = Q_NULLPTR);
QByteArray rawKey() const;
FileKey* clone() const;
static void create(QIODevice* device);
static bool create(const QString& fileName, QString* errorMsg = 0);
static bool create(const QString& fileName, QString* errorMsg = Q_NULLPTR);
private:
bool loadXml(QIODevice* device);

View File

@ -94,12 +94,12 @@ void TestKeePass2XmlReader::testMetadata()
QCOMPARE(m_db->metadata()->protectUrl(), true);
QCOMPARE(m_db->metadata()->protectNotes(), false);
QCOMPARE(m_db->metadata()->recycleBinEnabled(), true);
QVERIFY(m_db->metadata()->recycleBin() != 0);
QVERIFY(m_db->metadata()->recycleBin() != Q_NULLPTR);
QCOMPARE(m_db->metadata()->recycleBin()->name(), QString("Recycle Bin"));
QCOMPARE(m_db->metadata()->recycleBinChanged(), genDT(2010, 8, 25, 16, 12, 57));
QVERIFY(m_db->metadata()->entryTemplatesGroup() == 0);
QVERIFY(m_db->metadata()->entryTemplatesGroup() == Q_NULLPTR);
QCOMPARE(m_db->metadata()->entryTemplatesGroupChanged(), genDT(2010, 8, 8, 17, 24, 19));
QVERIFY(m_db->metadata()->lastSelectedGroup() != 0);
QVERIFY(m_db->metadata()->lastSelectedGroup() != Q_NULLPTR);
QCOMPARE(m_db->metadata()->lastSelectedGroup()->name(), QString("NewDatabase"));
QVERIFY(m_db->metadata()->lastTopVisibleGroup() == m_db->metadata()->lastSelectedGroup());
QCOMPARE(m_db->metadata()->historyMaxItems(), -1);