Replace zeroes and nulls by nullptrs

pull/3029/head
Andrei Kortunov 4 years ago
parent 86fad60c7d
commit 8084a336b5

@ -20,7 +20,7 @@ namespace Launcher
public: public:
AdvancedPage(Files::ConfigurationManager &cfg, Config::GameSettings &gameSettings, AdvancedPage(Files::ConfigurationManager &cfg, Config::GameSettings &gameSettings,
Settings::Manager &engineSettings, QWidget *parent = 0); Settings::Manager &engineSettings, QWidget *parent = nullptr);
bool loadSettings(); bool loadSettings();
void saveSettings(); void saveSettings();

@ -32,7 +32,7 @@ namespace Launcher
public: public:
explicit DataFilesPage (Files::ConfigurationManager &cfg, Config::GameSettings &gameSettings, explicit DataFilesPage (Files::ConfigurationManager &cfg, Config::GameSettings &gameSettings,
Config::LauncherSettings &launcherSettings, QWidget *parent = 0); Config::LauncherSettings &launcherSettings, QWidget *parent = nullptr);
QAbstractItemModel* profilesModel() const; QAbstractItemModel* profilesModel() const;

@ -20,7 +20,7 @@ namespace Launcher
Q_OBJECT Q_OBJECT
public: public:
GraphicsPage(Files::ConfigurationManager &cfg, Settings::Manager &engineSettings, QWidget *parent = 0); GraphicsPage(Files::ConfigurationManager &cfg, Settings::Manager &engineSettings, QWidget *parent = nullptr);
void saveSettings(); void saveSettings();
bool loadSettings(); bool loadSettings();

@ -48,7 +48,7 @@ namespace Launcher
Q_OBJECT Q_OBJECT
public: public:
explicit MainDialog(QWidget *parent = 0); explicit MainDialog(QWidget *parent = nullptr);
~MainDialog(); ~MainDialog();
FirstRunDialogResult showFirstRunDialog(); FirstRunDialogResult showFirstRunDialog();

@ -16,7 +16,7 @@ namespace Launcher
Q_OBJECT Q_OBJECT
public: public:
PlayPage(QWidget *parent = 0); PlayPage(QWidget *parent = nullptr);
void setProfilesModel(QAbstractItemModel *model); void setProfilesModel(QAbstractItemModel *model);
signals: signals:

@ -24,7 +24,7 @@ namespace Launcher
public: public:
SettingsPage(Files::ConfigurationManager &cfg, Config::GameSettings &gameSettings, SettingsPage(Files::ConfigurationManager &cfg, Config::GameSettings &gameSettings,
Config::LauncherSettings &launcherSettings, MainDialog *parent = 0); Config::LauncherSettings &launcherSettings, MainDialog *parent = nullptr);
~SettingsPage(); ~SettingsPage();
void saveSettings(); void saveSettings();

@ -24,7 +24,7 @@ class LineEdit : public QLineEdit
QString mPlaceholderText; QString mPlaceholderText;
public: public:
LineEdit(QWidget *parent = 0); LineEdit(QWidget *parent = nullptr);
protected: protected:
void resizeEvent(QResizeEvent *) override; void resizeEvent(QResizeEvent *) override;

@ -33,7 +33,7 @@ void ProfilesComboBox::setEditEnabled(bool editable)
ComboBoxLineEdit *edit = new ComboBoxLineEdit(this); ComboBoxLineEdit *edit = new ComboBoxLineEdit(this);
setLineEdit(edit); setLineEdit(edit);
setCompleter(0); setCompleter(nullptr);
connect(lineEdit(), SIGNAL(editingFinished()), this, connect(lineEdit(), SIGNAL(editingFinished()), this,
SLOT(slotEditingFinished())); SLOT(slotEditingFinished()));

@ -16,12 +16,12 @@ public:
class ComboBoxLineEdit : public LineEdit class ComboBoxLineEdit : public LineEdit
{ {
public: public:
explicit ComboBoxLineEdit (QWidget *parent = 0); explicit ComboBoxLineEdit (QWidget *parent = nullptr);
}; };
public: public:
explicit ProfilesComboBox(QWidget *parent = 0); explicit ProfilesComboBox(QWidget *parent = nullptr);
void setEditEnabled(bool editable); void setEditEnabled(bool editable);
void setCurrentProfile(int index) void setCurrentProfile(int index)
{ {

@ -23,7 +23,7 @@ Launcher::TextInputDialog::TextInputDialog(const QString& title, const QString &
QValidator *validator = new QRegExpValidator(QRegExp("^[a-zA-Z0-9_]*$"), this); // Alpha-numeric + underscore QValidator *validator = new QRegExpValidator(QRegExp("^[a-zA-Z0-9_]*$"), this); // Alpha-numeric + underscore
mLineEdit = new LineEdit(this); mLineEdit = new LineEdit(this);
mLineEdit->setValidator(validator); mLineEdit->setValidator(validator);
mLineEdit->setCompleter(0); mLineEdit->setCompleter(nullptr);
QVBoxLayout *dialogLayout = new QVBoxLayout(this); QVBoxLayout *dialogLayout = new QVBoxLayout(this);
dialogLayout->addWidget(label); dialogLayout->addWidget(label);

@ -15,7 +15,7 @@ namespace Launcher
public: public:
explicit TextInputDialog(const QString& title, const QString &text, QWidget *parent = 0); explicit TextInputDialog(const QString& title, const QString &text, QWidget *parent = nullptr);
~TextInputDialog (); ~TextInputDialog ();
inline LineEdit *lineEdit() { return mLineEdit; } inline LineEdit *lineEdit() { return mLineEdit; }

@ -25,7 +25,7 @@ namespace CSMDoc
public: public:
OperationHolder (Operation *operation = 0); OperationHolder (Operation *operation = nullptr);
void setOperation (Operation *operation); void setOperation (Operation *operation);

@ -8,7 +8,7 @@
#include "operationholder.hpp" #include "operationholder.hpp"
CSMDoc::Runner::Runner (const boost::filesystem::path& projectPath) CSMDoc::Runner::Runner (const boost::filesystem::path& projectPath)
: mRunning (false), mStartup (0), mProjectPath (projectPath) : mRunning (false), mStartup (nullptr), mProjectPath (projectPath)
{ {
connect (&mProcess, SIGNAL (finished (int, QProcess::ExitStatus)), connect (&mProcess, SIGNAL (finished (int, QProcess::ExitStatus)),
this, SLOT (finished (int, QProcess::ExitStatus))); this, SLOT (finished (int, QProcess::ExitStatus)));
@ -25,7 +25,7 @@ CSMDoc::Runner::~Runner()
{ {
if (mRunning) if (mRunning)
{ {
disconnect (&mProcess, 0, this, 0); disconnect (&mProcess, nullptr, this, nullptr);
mProcess.kill(); mProcess.kill();
mProcess.waitForFinished(); mProcess.waitForFinished();
} }
@ -36,7 +36,7 @@ void CSMDoc::Runner::start (bool delayed)
if (mStartup) if (mStartup)
{ {
delete mStartup; delete mStartup;
mStartup = 0; mStartup = nullptr;
} }
if (!delayed) if (!delayed)
@ -102,7 +102,7 @@ void CSMDoc::Runner::start (bool delayed)
void CSMDoc::Runner::stop() void CSMDoc::Runner::stop()
{ {
delete mStartup; delete mStartup;
mStartup = 0; mStartup = nullptr;
if (mProcess.state()==QProcess::NotRunning) if (mProcess.state()==QProcess::NotRunning)
{ {

@ -11,7 +11,7 @@
CSMPrefs::BoolSetting::BoolSetting (Category *parent, Settings::Manager *values, CSMPrefs::BoolSetting::BoolSetting (Category *parent, Settings::Manager *values,
QMutex *mutex, const std::string& key, const std::string& label, bool default_) QMutex *mutex, const std::string& key, const std::string& label, bool default_)
: Setting (parent, values, mutex, key, label), mDefault (default_), mWidget(0) : Setting (parent, values, mutex, key, label), mDefault (default_), mWidget(nullptr)
{} {}
CSMPrefs::BoolSetting& CSMPrefs::BoolSetting::setTooltip (const std::string& tooltip) CSMPrefs::BoolSetting& CSMPrefs::BoolSetting::setTooltip (const std::string& tooltip)
@ -33,7 +33,7 @@ std::pair<QWidget *, QWidget *> CSMPrefs::BoolSetting::makeWidgets (QWidget *par
connect (mWidget, SIGNAL (stateChanged (int)), this, SLOT (valueChanged (int))); connect (mWidget, SIGNAL (stateChanged (int)), this, SLOT (valueChanged (int)));
return std::make_pair (static_cast<QWidget *> (0), mWidget); return std::make_pair (static_cast<QWidget *> (nullptr), mWidget);
} }
void CSMPrefs::BoolSetting::updateWidget() void CSMPrefs::BoolSetting::updateWidget()

@ -14,7 +14,7 @@
CSMPrefs::ColourSetting::ColourSetting (Category *parent, Settings::Manager *values, CSMPrefs::ColourSetting::ColourSetting (Category *parent, Settings::Manager *values,
QMutex *mutex, const std::string& key, const std::string& label, QColor default_) QMutex *mutex, const std::string& key, const std::string& label, QColor default_)
: Setting (parent, values, mutex, key, label), mDefault (default_), mWidget(0) : Setting (parent, values, mutex, key, label), mDefault (default_), mWidget(nullptr)
{} {}
CSMPrefs::ColourSetting& CSMPrefs::ColourSetting::setTooltip (const std::string& tooltip) CSMPrefs::ColourSetting& CSMPrefs::ColourSetting::setTooltip (const std::string& tooltip)

@ -16,7 +16,7 @@ CSMPrefs::DoubleSetting::DoubleSetting (Category *parent, Settings::Manager *val
QMutex *mutex, const std::string& key, const std::string& label, double default_) QMutex *mutex, const std::string& key, const std::string& label, double default_)
: Setting (parent, values, mutex, key, label), : Setting (parent, values, mutex, key, label),
mPrecision(2), mMin (0), mMax (std::numeric_limits<double>::max()), mPrecision(2), mMin (0), mMax (std::numeric_limits<double>::max()),
mDefault (default_), mWidget(0) mDefault (default_), mWidget(nullptr)
{} {}
CSMPrefs::DoubleSetting& CSMPrefs::DoubleSetting::setPrecision(int precision) CSMPrefs::DoubleSetting& CSMPrefs::DoubleSetting::setPrecision(int precision)

@ -42,7 +42,7 @@ CSMPrefs::EnumValues& CSMPrefs::EnumValues::add (const std::string& value, const
CSMPrefs::EnumSetting::EnumSetting (Category *parent, Settings::Manager *values, CSMPrefs::EnumSetting::EnumSetting (Category *parent, Settings::Manager *values,
QMutex *mutex, const std::string& key, const std::string& label, const EnumValue& default_) QMutex *mutex, const std::string& key, const std::string& label, const EnumValue& default_)
: Setting (parent, values, mutex, key, label), mDefault (default_), mWidget(0) : Setting (parent, values, mutex, key, label), mDefault (default_), mWidget(nullptr)
{} {}
CSMPrefs::EnumSetting& CSMPrefs::EnumSetting::setTooltip (const std::string& tooltip) CSMPrefs::EnumSetting& CSMPrefs::EnumSetting::setTooltip (const std::string& tooltip)

@ -15,7 +15,7 @@
CSMPrefs::IntSetting::IntSetting (Category *parent, Settings::Manager *values, CSMPrefs::IntSetting::IntSetting (Category *parent, Settings::Manager *values,
QMutex *mutex, const std::string& key, const std::string& label, int default_) QMutex *mutex, const std::string& key, const std::string& label, int default_)
: Setting (parent, values, mutex, key, label), mMin (0), mMax (std::numeric_limits<int>::max()), : Setting (parent, values, mutex, key, label), mMin (0), mMax (std::numeric_limits<int>::max()),
mDefault (default_), mWidget(0) mDefault (default_), mWidget(nullptr)
{} {}
CSMPrefs::IntSetting& CSMPrefs::IntSetting::setRange (int min, int max) CSMPrefs::IntSetting& CSMPrefs::IntSetting::setRange (int min, int max)

@ -15,7 +15,7 @@ namespace CSMPrefs
ModifierSetting::ModifierSetting(Category* parent, Settings::Manager* values, QMutex* mutex, const std::string& key, ModifierSetting::ModifierSetting(Category* parent, Settings::Manager* values, QMutex* mutex, const std::string& key,
const std::string& label) const std::string& label)
: Setting(parent, values, mutex, key, label) : Setting(parent, values, mutex, key, label)
, mButton(0) , mButton(nullptr)
, mEditorActive(false) , mEditorActive(false)
{ {
} }

@ -23,7 +23,7 @@ namespace CSMPrefs
, mLastPos(0) , mLastPos(0)
, mActivationStatus(AS_Inactive) , mActivationStatus(AS_Inactive)
, mModifierStatus(false) , mModifierStatus(false)
, mAction(0) , mAction(nullptr)
{ {
assert (parent); assert (parent);
@ -42,7 +42,7 @@ namespace CSMPrefs
, mLastPos(0) , mLastPos(0)
, mActivationStatus(AS_Inactive) , mActivationStatus(AS_Inactive)
, mModifierStatus(false) , mModifierStatus(false)
, mAction(0) , mAction(nullptr)
{ {
assert (parent); assert (parent);
@ -62,7 +62,7 @@ namespace CSMPrefs
, mLastPos(0) , mLastPos(0)
, mActivationStatus(AS_Inactive) , mActivationStatus(AS_Inactive)
, mModifierStatus(false) , mModifierStatus(false)
, mAction(0) , mAction(nullptr)
{ {
assert (parent); assert (parent);
@ -218,6 +218,6 @@ namespace CSMPrefs
void Shortcut::actionDeleted() void Shortcut::actionDeleted()
{ {
mAction = 0; mAction = nullptr;
} }
} }

@ -781,7 +781,7 @@ namespace CSMPrefs
std::make_pair((int)Qt::Key_LastNumberRedial , "LastNumberRedial"), std::make_pair((int)Qt::Key_LastNumberRedial , "LastNumberRedial"),
std::make_pair((int)Qt::Key_Camera , "Camera"), std::make_pair((int)Qt::Key_Camera , "Camera"),
std::make_pair((int)Qt::Key_CameraFocus , "CameraFocus"), std::make_pair((int)Qt::Key_CameraFocus , "CameraFocus"),
std::make_pair(0 , (const char*) 0) std::make_pair(0 , (const char*) nullptr)
}; };
} }

@ -18,7 +18,7 @@ namespace CSMPrefs
ShortcutSetting::ShortcutSetting(Category* parent, Settings::Manager* values, QMutex* mutex, const std::string& key, ShortcutSetting::ShortcutSetting(Category* parent, Settings::Manager* values, QMutex* mutex, const std::string& key,
const std::string& label) const std::string& label)
: Setting(parent, values, mutex, key, label) : Setting(parent, values, mutex, key, label)
, mButton(0) , mButton(nullptr)
, mEditorActive(false) , mEditorActive(false)
, mEditorPos(0) , mEditorPos(0)
{ {

@ -12,7 +12,7 @@
#include "shortcutsetting.hpp" #include "shortcutsetting.hpp"
#include "modifiersetting.hpp" #include "modifiersetting.hpp"
CSMPrefs::State *CSMPrefs::State::sThis = 0; CSMPrefs::State *CSMPrefs::State::sThis = nullptr;
void CSMPrefs::State::load() void CSMPrefs::State::load()
{ {
@ -599,7 +599,7 @@ CSMPrefs::State::State (const Files::ConfigurationManager& configurationManager)
CSMPrefs::State::~State() CSMPrefs::State::~State()
{ {
sThis = 0; sThis = nullptr;
} }
void CSMPrefs::State::save() void CSMPrefs::State::save()

@ -104,7 +104,7 @@ void CSMTools::MergeReferencesStage::perform (int stage, CSMDoc::Messages& messa
ref.mNew = false; ref.mNew = false;
CSMWorld::Record<CSMWorld::CellRef> newRecord ( CSMWorld::Record<CSMWorld::CellRef> newRecord (
CSMWorld::RecordBase::State_ModifiedOnly, 0, &ref); CSMWorld::RecordBase::State_ModifiedOnly, nullptr, &ref);
mState.mTarget->getData().getReferences().appendRecord (newRecord); mState.mTarget->getData().getReferences().appendRecord (newRecord);
} }

@ -82,7 +82,7 @@ namespace CSMTools
const CSMWorld::Record<RecordType>& record = source.getRecord (stage); const CSMWorld::Record<RecordType>& record = source.getRecord (stage);
if (!record.isDeleted()) if (!record.isDeleted())
target.appendRecord (CSMWorld::Record<RecordType> (CSMWorld::RecordBase::State_ModifiedOnly, 0, &record.get())); target.appendRecord (CSMWorld::Record<RecordType> (CSMWorld::RecordBase::State_ModifiedOnly, nullptr, &record.get()));
} }
class MergeRefIdsStage : public CSMDoc::Stage class MergeRefIdsStage : public CSMDoc::Stage

@ -50,7 +50,7 @@ void CSMTools::ScriptCheckStage::report (const std::string& message, Type type)
} }
CSMTools::ScriptCheckStage::ScriptCheckStage (const CSMDoc::Document& document) CSMTools::ScriptCheckStage::ScriptCheckStage (const CSMDoc::Document& document)
: mDocument (document), mContext (document.getData()), mMessages (0), mWarningMode (Mode_Ignore) : mDocument (document), mContext (document.getData()), mMessages (nullptr), mWarningMode (Mode_Ignore)
{ {
/// \todo add an option to configure warning mode /// \todo add an option to configure warning mode
setWarningsMode (0); setWarningsMode (0);
@ -73,7 +73,7 @@ int CSMTools::ScriptCheckStage::setup()
mWarningMode = Mode_Strict; mWarningMode = Mode_Strict;
mContext.clear(); mContext.clear();
mMessages = 0; mMessages = nullptr;
mId.clear(); mId.clear();
Compiler::ErrorHandler::reset(); Compiler::ErrorHandler::reset();
@ -130,5 +130,5 @@ void CSMTools::ScriptCheckStage::perform (int stage, CSMDoc::Messages& messages)
messages.add (id, stream.str(), "", CSMDoc::Message::Severity_SeriousError); messages.add (id, stream.str(), "", CSMDoc::Message::Severity_SeriousError);
} }
mMessages = 0; mMessages = nullptr;
} }

@ -5,7 +5,7 @@
#include "searchoperation.hpp" #include "searchoperation.hpp"
CSMTools::SearchStage::SearchStage (const CSMWorld::IdTableBase *model) CSMTools::SearchStage::SearchStage (const CSMWorld::IdTableBase *model)
: mModel (model), mOperation (0) : mModel (model), mOperation (nullptr)
{} {}
int CSMTools::SearchStage::setup() int CSMTools::SearchStage::setup()

@ -43,7 +43,7 @@ CSMDoc::OperationHolder *CSMTools::Tools::get (int type)
case CSMDoc::State_Merging: return &mMerge; case CSMDoc::State_Merging: return &mMerge;
} }
return 0; return nullptr;
} }
const CSMDoc::OperationHolder *CSMTools::Tools::get (int type) const const CSMDoc::OperationHolder *CSMTools::Tools::get (int type) const
@ -138,8 +138,8 @@ CSMDoc::OperationHolder *CSMTools::Tools::getVerifier()
} }
CSMTools::Tools::Tools (CSMDoc::Document& document, ToUTF8::FromType encoding) CSMTools::Tools::Tools (CSMDoc::Document& document, ToUTF8::FromType encoding)
: mDocument (document), mData (document.getData()), mVerifierOperation (0), : mDocument (document), mData (document.getData()), mVerifierOperation (nullptr),
mSearchOperation (0), mMergeOperation (0), mNextReportNumber (0), mEncoding (encoding) mSearchOperation (nullptr), mMergeOperation (nullptr), mNextReportNumber (0), mEncoding (encoding)
{ {
// index 0: load error log // index 0: load error log
mReports.insert (std::make_pair (mNextReportNumber++, new ReportModel)); mReports.insert (std::make_pair (mNextReportNumber++, new ReportModel));

@ -2254,7 +2254,7 @@ namespace CSMWorld
QVariant get (const Record<ESXRecordT>& record) const override QVariant get (const Record<ESXRecordT>& record) const override
{ {
const std::string *string = 0; const std::string *string = nullptr;
switch (this->mColumnId) switch (this->mColumnId)
{ {
@ -2272,7 +2272,7 @@ namespace CSMWorld
void set (Record<ESXRecordT>& record, const QVariant& data) override void set (Record<ESXRecordT>& record, const QVariant& data) override
{ {
std::string *string = 0; std::string *string = nullptr;
ESXRecordT record2 = record.get(); ESXRecordT record2 = record.get();
@ -2312,7 +2312,7 @@ namespace CSMWorld
QVariant get (const Record<ESXRecordT>& record) const override QVariant get (const Record<ESXRecordT>& record) const override
{ {
const std::string *string = 0; const std::string *string = nullptr;
switch (this->mColumnId) switch (this->mColumnId)
{ {
@ -2330,7 +2330,7 @@ namespace CSMWorld
void set (Record<ESXRecordT>& record, const QVariant& data) override void set (Record<ESXRecordT>& record, const QVariant& data) override
{ {
std::string *string = 0; std::string *string = nullptr;
ESXRecordT record2 = record.get(); ESXRecordT record2 = record.get();

@ -34,7 +34,7 @@ namespace CSMWorld
public: public:
CommandDispatcher (CSMDoc::Document& document, const CSMWorld::UniversalId& id, CommandDispatcher (CSMDoc::Document& document, const CSMWorld::UniversalId& id,
QObject *parent = 0); QObject *parent = nullptr);
///< \param id ID of the table the commands should operate on primarily. ///< \param id ID of the table the commands should operate on primarily.
void setEditLock (bool locked); void setEditLock (bool locked);

@ -290,7 +290,7 @@ void CSMWorld::CreateCommand::undo()
} }
CSMWorld::RevertCommand::RevertCommand (IdTable& model, const std::string& id, QUndoCommand* parent) CSMWorld::RevertCommand::RevertCommand (IdTable& model, const std::string& id, QUndoCommand* parent)
: QUndoCommand (parent), mModel (model), mId (id), mOld (0) : QUndoCommand (parent), mModel (model), mId (id), mOld (nullptr)
{ {
setText (("Revert record " + id).c_str()); setText (("Revert record " + id).c_str());
@ -326,7 +326,7 @@ void CSMWorld::RevertCommand::undo()
CSMWorld::DeleteCommand::DeleteCommand (IdTable& model, CSMWorld::DeleteCommand::DeleteCommand (IdTable& model,
const std::string& id, CSMWorld::UniversalId::Type type, QUndoCommand* parent) const std::string& id, CSMWorld::UniversalId::Type type, QUndoCommand* parent)
: QUndoCommand (parent), mModel (model), mId (id), mOld (0), mType(type) : QUndoCommand (parent), mModel (model), mId (id), mOld (nullptr), mType(type)
{ {
setText (("Delete record " + id).c_str()); setText (("Delete record " + id).c_str());

@ -140,7 +140,7 @@ namespace CSMWorld
public: public:
ModifyCommand (QAbstractItemModel& model, const QModelIndex& index, const QVariant& new_, ModifyCommand (QAbstractItemModel& model, const QModelIndex& index, const QVariant& new_,
QUndoCommand *parent = 0); QUndoCommand *parent = nullptr);
void redo() override; void redo() override;
@ -167,7 +167,7 @@ namespace CSMWorld
public: public:
CreateCommand (IdTable& model, const std::string& id, QUndoCommand *parent = 0); CreateCommand (IdTable& model, const std::string& id, QUndoCommand *parent = nullptr);
void setType (UniversalId::Type type); void setType (UniversalId::Type type);
@ -189,7 +189,7 @@ namespace CSMWorld
CloneCommand (IdTable& model, const std::string& idOrigin, CloneCommand (IdTable& model, const std::string& idOrigin,
const std::string& IdDestination, const std::string& IdDestination,
const UniversalId::Type type, const UniversalId::Type type,
QUndoCommand* parent = 0); QUndoCommand* parent = nullptr);
void redo() override; void redo() override;
@ -208,7 +208,7 @@ namespace CSMWorld
public: public:
RevertCommand (IdTable& model, const std::string& id, QUndoCommand *parent = 0); RevertCommand (IdTable& model, const std::string& id, QUndoCommand *parent = nullptr);
virtual ~RevertCommand(); virtual ~RevertCommand();
@ -231,7 +231,7 @@ namespace CSMWorld
public: public:
DeleteCommand (IdTable& model, const std::string& id, DeleteCommand (IdTable& model, const std::string& id,
UniversalId::Type type = UniversalId::Type_None, QUndoCommand *parent = 0); UniversalId::Type type = UniversalId::Type_None, QUndoCommand *parent = nullptr);
virtual ~DeleteCommand(); virtual ~DeleteCommand();
@ -259,7 +259,7 @@ namespace CSMWorld
{ {
public: public:
CreatePathgridCommand(IdTable& model, const std::string& id, QUndoCommand *parent = 0); CreatePathgridCommand(IdTable& model, const std::string& id, QUndoCommand *parent = nullptr);
void redo() override; void redo() override;
}; };
@ -279,7 +279,7 @@ namespace CSMWorld
public: public:
UpdateCellCommand (IdTable& model, int row, QUndoCommand *parent = 0); UpdateCellCommand (IdTable& model, int row, QUndoCommand *parent = nullptr);
void redo() override; void redo() override;
@ -316,7 +316,7 @@ namespace CSMWorld
public: public:
DeleteNestedCommand (IdTree& model, const std::string& id, int nestedRow, int parentColumn, QUndoCommand* parent = 0); DeleteNestedCommand (IdTree& model, const std::string& id, int nestedRow, int parentColumn, QUndoCommand* parent = nullptr);
void redo() override; void redo() override;
@ -338,7 +338,7 @@ namespace CSMWorld
public: public:
AddNestedCommand(IdTree& model, const std::string& id, int nestedRow, int parentColumn, QUndoCommand* parent = 0); AddNestedCommand(IdTree& model, const std::string& id, int nestedRow, int parentColumn, QUndoCommand* parent = nullptr);
void redo() override; void redo() override;

@ -68,7 +68,7 @@ int CSMWorld::Data::count (RecordBase::State state, const CollectionBase& collec
CSMWorld::Data::Data (ToUTF8::FromType encoding, bool fsStrict, const Files::PathContainer& dataPaths, CSMWorld::Data::Data (ToUTF8::FromType encoding, bool fsStrict, const Files::PathContainer& dataPaths,
const std::vector<std::string>& archives, const boost::filesystem::path& resDir) const std::vector<std::string>& archives, const boost::filesystem::path& resDir)
: mEncoder (encoding), mPathgrids (mCells), mRefs (mCells), : mEncoder (encoding), mPathgrids (mCells), mRefs (mCells),
mReader (0), mDialogue (0), mReaderIndex(1), mReader (nullptr), mDialogue (nullptr), mReaderIndex(1),
mFsStrict(fsStrict), mDataPaths(dataPaths), mArchives(archives) mFsStrict(fsStrict), mDataPaths(dataPaths), mArchives(archives)
{ {
mVFS.reset(new VFS::Manager(mFsStrict)); mVFS.reset(new VFS::Manager(mFsStrict));
@ -916,7 +916,7 @@ const CSMWorld::MetaData& CSMWorld::Data::getMetaData() const
void CSMWorld::Data::setMetaData (const MetaData& metaData) void CSMWorld::Data::setMetaData (const MetaData& metaData)
{ {
Record<MetaData> record (RecordBase::State_ModifiedOnly, 0, &metaData); Record<MetaData> record (RecordBase::State_ModifiedOnly, nullptr, &metaData);
mMetaData.setRecord (0, record); mMetaData.setRecord (0, record);
} }
@ -932,7 +932,7 @@ QAbstractItemModel *CSMWorld::Data::getTableModel (const CSMWorld::UniversalId&
// construction of the ESX data where no update signals are available. // construction of the ESX data where no update signals are available.
if (id.getType()==UniversalId::Type_RegionMap) if (id.getType()==UniversalId::Type_RegionMap)
{ {
RegionMap *table = 0; RegionMap *table = nullptr;
addModel (table = new RegionMap (*this), UniversalId::Type_RegionMap, false); addModel (table = new RegionMap (*this), UniversalId::Type_RegionMap, false);
return table; return table;
} }
@ -962,9 +962,9 @@ int CSMWorld::Data::startLoading (const boost::filesystem::path& path, bool base
// Don't delete the Reader yet. Some record types store a reference to the Reader to handle on-demand loading // Don't delete the Reader yet. Some record types store a reference to the Reader to handle on-demand loading
std::shared_ptr<ESM::ESMReader> ptr(mReader); std::shared_ptr<ESM::ESMReader> ptr(mReader);
mReaders.push_back(ptr); mReaders.push_back(ptr);
mReader = 0; mReader = nullptr;
mDialogue = 0; mDialogue = nullptr;
mReader = new ESM::ESMReader; mReader = new ESM::ESMReader;
mReader->setEncoder (&mEncoder); mReader->setEncoder (&mEncoder);
@ -982,7 +982,7 @@ int CSMWorld::Data::startLoading (const boost::filesystem::path& path, bool base
metaData.mId = "sys::meta"; metaData.mId = "sys::meta";
metaData.load (*mReader); metaData.load (*mReader);
mMetaData.setRecord (0, Record<MetaData> (RecordBase::State_ModifiedOnly, 0, &metaData)); mMetaData.setRecord (0, Record<MetaData> (RecordBase::State_ModifiedOnly, nullptr, &metaData));
} }
// Fix uninitialized master data index // Fix uninitialized master data index
@ -1064,9 +1064,9 @@ bool CSMWorld::Data::continueLoading (CSMDoc::Messages& messages)
else else
delete mReader; delete mReader;
mReader = 0; mReader = nullptr;
mDialogue = 0; mDialogue = nullptr;
loadFallbackEntries(); loadFallbackEntries();
@ -1151,7 +1151,7 @@ bool CSMWorld::Data::continueLoading (CSMDoc::Messages& messages)
if (isDeleted) if (isDeleted)
{ {
// record vector can be shuffled around which would make pointer to record invalid // record vector can be shuffled around which would make pointer to record invalid
mDialogue = 0; mDialogue = nullptr;
if (mJournals.tryDelete (record.mId)) if (mJournals.tryDelete (record.mId))
{ {

@ -35,7 +35,7 @@ namespace CSMWorld
public: public:
IdTableProxyModel (QObject *parent = 0); IdTableProxyModel (QObject *parent = nullptr);
virtual QModelIndex getModelIndex (const std::string& id, int column) const; virtual QModelIndex getModelIndex (const std::string& id, int column) const;

@ -28,7 +28,7 @@ namespace CSMWorld
///< \a currentRow is a row of the source model. ///< \a currentRow is a row of the source model.
public: public:
InfoTableProxyModel(UniversalId::Type type, QObject *parent = 0); InfoTableProxyModel(UniversalId::Type type, QObject *parent = nullptr);
void setSourceModel(QAbstractItemModel *sourceModel) override; void setSourceModel(QAbstractItemModel *sourceModel) override;

@ -87,7 +87,7 @@ namespace CSMWorld
template <typename ESXRecordT> template <typename ESXRecordT>
RecordBase *Record<ESXRecordT>::modifiedCopy() const RecordBase *Record<ESXRecordT>::modifiedCopy() const
{ {
return new Record<ESXRecordT> (State_ModifiedOnly, 0, &(this->get())); return new Record<ESXRecordT> (State_ModifiedOnly, nullptr, &(this->get()));
} }
template <typename ESXRecordT> template <typename ESXRecordT>

@ -350,7 +350,7 @@ CSMWorld::RefIdCollection::RefIdCollection()
}; };
// for re-use in NPC records // for re-use in NPC records
const RefIdColumn *essential = 0; const RefIdColumn *essential = nullptr;
for (int i=0; sCreatureFlagTable[i].mName!=-1; ++i) for (int i=0; sCreatureFlagTable[i].mName!=-1; ++i)
{ {

@ -25,9 +25,9 @@ namespace CSMWorld
/// \param type Type of resources in this table. /// \param type Type of resources in this table.
Resources (const VFS::Manager* vfs, const std::string& baseDirectory, UniversalId::Type type, Resources (const VFS::Manager* vfs, const std::string& baseDirectory, UniversalId::Type type,
const char * const *extensions = 0); const char * const *extensions = nullptr);
void recreate(const VFS::Manager* vfs, const char * const *extensions = 0); void recreate(const VFS::Manager* vfs, const char * const *extensions = nullptr);
int getSize() const; int getSize() const;

@ -32,7 +32,7 @@ namespace CSVDoc
public: public:
AdjusterWidget (QWidget *parent = 0); AdjusterWidget (QWidget *parent = nullptr);
void setLocalData (const boost::filesystem::path& localData); void setLocalData (const boost::filesystem::path& localData);
void setAction (ContentAction action); void setAction (ContentAction action);

@ -18,7 +18,7 @@
#include "adjusterwidget.hpp" #include "adjusterwidget.hpp"
CSVDoc::FileDialog::FileDialog(QWidget *parent) : CSVDoc::FileDialog::FileDialog(QWidget *parent) :
QDialog(parent), mSelector (0), mAction(ContentAction_Undefined), mFileWidget (0), mAdjusterWidget (0), mDialogBuilt(false) QDialog(parent), mSelector (nullptr), mAction(ContentAction_Undefined), mFileWidget (nullptr), mAdjusterWidget (nullptr), mDialogBuilt(false)
{ {
ui.setupUi (this); ui.setupUi (this);
resize(400, 400); resize(400, 400);

@ -42,7 +42,7 @@ namespace CSVDoc
public: public:
explicit FileDialog(QWidget *parent = 0); explicit FileDialog(QWidget *parent = nullptr);
void showDialog (ContentAction action); void showDialog (ContentAction action);
void addFiles (const QString &path); void addFiles (const QString &path);

@ -23,7 +23,7 @@ namespace CSVDoc
public: public:
FileWidget (QWidget *parent = 0); FileWidget (QWidget *parent = nullptr);
void setType (bool addon); void setType (bool addon);

@ -13,7 +13,7 @@ void CSVDoc::GlobalDebugProfileMenu::rebuild()
clear(); clear();
delete mActions; delete mActions;
mActions = 0; mActions = nullptr;
int idColumn = mDebugProfiles->findColumnIndex (CSMWorld::Columns::ColumnId_Id); int idColumn = mDebugProfiles->findColumnIndex (CSMWorld::Columns::ColumnId_Id);
int stateColumn = mDebugProfiles->findColumnIndex (CSMWorld::Columns::ColumnId_Modification); int stateColumn = mDebugProfiles->findColumnIndex (CSMWorld::Columns::ColumnId_Modification);
@ -48,7 +48,7 @@ void CSVDoc::GlobalDebugProfileMenu::rebuild()
CSVDoc::GlobalDebugProfileMenu::GlobalDebugProfileMenu (CSMWorld::IdTable *debugProfiles, CSVDoc::GlobalDebugProfileMenu::GlobalDebugProfileMenu (CSMWorld::IdTable *debugProfiles,
QWidget *parent) QWidget *parent)
: QMenu (parent), mDebugProfiles (debugProfiles), mActions (0) : QMenu (parent), mDebugProfiles (debugProfiles), mActions (nullptr)
{ {
rebuild(); rebuild();

@ -26,7 +26,7 @@ namespace CSVDoc
public: public:
GlobalDebugProfileMenu (CSMWorld::IdTable *debugProfiles, QWidget *parent = 0); GlobalDebugProfileMenu (CSMWorld::IdTable *debugProfiles, QWidget *parent = nullptr);
void updateActions (bool running); void updateActions (bool running);

@ -17,7 +17,7 @@ void CSVDoc::LoadingDocument::closeEvent (QCloseEvent *event)
} }
CSVDoc::LoadingDocument::LoadingDocument (CSMDoc::Document *document) CSVDoc::LoadingDocument::LoadingDocument (CSMDoc::Document *document)
: mDocument (document), mAborted (false), mMessages (0), mTotalRecords (0) : mDocument (document), mAborted (false), mMessages (nullptr), mTotalRecords (0)
{ {
setWindowTitle (QString::fromUtf8((std::string("Opening ") + document->getSavePath().filename().string()).c_str())); setWindowTitle (QString::fromUtf8((std::string("Opening ") + document->getSavePath().filename().string()).c_str()));

@ -11,7 +11,7 @@ namespace CSVDoc
QSize mSize; QSize mSize;
public: public:
SizeHintWidget(QWidget *parent = 0); SizeHintWidget(QWidget *parent = nullptr);
~SizeHintWidget(); ~SizeHintWidget();
QSize sizeHint() const override; QSize sizeHint() const override;

@ -733,7 +733,7 @@ void CSVDoc::View::infoAbout()
#endif #endif
// Get current year // Get current year
time_t now = time(NULL); time_t now = time(nullptr);
struct tm tstruct; struct tm tstruct;
char copyrightInfo[40]; char copyrightInfo[40];
tstruct = *localtime(&now); tstruct = *localtime(&now);

@ -43,7 +43,7 @@ namespace CSVDoc
ViewManager& operator= (const ViewManager&); ViewManager& operator= (const ViewManager&);
void updateIndices(); void updateIndices();
bool notifySaveOnClose (View *view = 0); bool notifySaveOnClose (View *view = nullptr);
bool showModifiedDocumentMessageBox (View *view); bool showModifiedDocumentMessageBox (View *view);
bool showSaveInProgressMessageBox (View *view); bool showSaveInProgressMessageBox (View *view);
bool removeDocument(View *view); bool removeDocument(View *view);

@ -30,7 +30,7 @@ namespace CSVFilter
public: public:
EditWidget (CSMWorld::Data& data, QWidget *parent = 0); EditWidget (CSMWorld::Data& data, QWidget *parent = nullptr);
void createFilterRequest(std::vector<std::pair<std::string, std::vector<std::string> > >& filterSource, void createFilterRequest(std::vector<std::pair<std::string, std::vector<std::string> > >& filterSource,
Qt::DropAction action); Qt::DropAction action);

@ -25,7 +25,7 @@ namespace CSVFilter
RecordFilterBox *mRecordFilterBox; RecordFilterBox *mRecordFilterBox;
public: public:
FilterBox (CSMWorld::Data& data, QWidget *parent = 0); FilterBox (CSMWorld::Data& data, QWidget *parent = nullptr);
void setRecordFilter (const std::string& filter); void setRecordFilter (const std::string& filter);

@ -25,7 +25,7 @@ namespace CSVFilter
public: public:
RecordFilterBox (CSMWorld::Data& data, QWidget *parent = 0); RecordFilterBox (CSMWorld::Data& data, QWidget *parent = nullptr);
void setFilter (const std::string& filter); void setFilter (const std::string& filter);

@ -16,9 +16,9 @@ namespace CSVPrefs
{ {
KeyBindingPage::KeyBindingPage(CSMPrefs::Category& category, QWidget* parent) KeyBindingPage::KeyBindingPage(CSMPrefs::Category& category, QWidget* parent)
: PageBase(category, parent) : PageBase(category, parent)
, mStackedLayout(0) , mStackedLayout(nullptr)
, mPageLayout(0) , mPageLayout(nullptr)
, mPageSelector(0) , mPageSelector(nullptr)
{ {
// Need one widget for scroll area // Need one widget for scroll area
QWidget* topWidget = new QWidget(); QWidget* topWidget = new QWidget();

@ -504,12 +504,12 @@ void CSVRender::Cell::setCellArrows (int mask)
bool enable = mask & direction; bool enable = mask & direction;
if (enable!=(mCellArrows[i].get()!=0)) if (enable!=(mCellArrows[i].get()!=nullptr))
{ {
if (enable) if (enable)
mCellArrows[i].reset (new CellArrow (mCellNode, direction, mCoordinates)); mCellArrows[i].reset (new CellArrow (mCellNode, direction, mCoordinates));
else else
mCellArrows[i].reset (0); mCellArrows[i].reset (nullptr);
} }
} }
} }

@ -27,9 +27,9 @@ namespace CSVRender
: mData(data) : mData(data)
, mId(id) , mId(id)
, mParentNode(cellNode) , mParentNode(cellNode)
, mWaterTransform(0) , mWaterTransform(nullptr)
, mWaterNode(0) , mWaterNode(nullptr)
, mWaterGeometry(0) , mWaterGeometry(nullptr)
, mDeleted(false) , mDeleted(false)
, mExterior(false) , mExterior(false)
, mHasWater(false) , mHasWater(false)
@ -137,7 +137,7 @@ namespace CSVRender
if (mWaterGeometry) if (mWaterGeometry)
{ {
mWaterNode->removeDrawable(mWaterGeometry); mWaterNode->removeDrawable(mWaterGeometry);
mWaterGeometry = 0; mWaterGeometry = nullptr;
} }
if (mDeleted || !mHasWater) if (mDeleted || !mHasWater)

@ -30,7 +30,7 @@ namespace CSVRender
public: public:
EditMode (WorldspaceWidget *worldspaceWidget, const QIcon& icon, unsigned int mask, EditMode (WorldspaceWidget *worldspaceWidget, const QIcon& icon, unsigned int mask,
const QString& tooltip = "", QWidget *parent = 0); const QString& tooltip = "", QWidget *parent = nullptr);
unsigned int getInteractionMask() const; unsigned int getInteractionMask() const;

@ -98,7 +98,7 @@ osg::Vec3f CSVRender::InstanceMode::getScreenCoords(const osg::Vec3f& pos)
CSVRender::InstanceMode::InstanceMode (WorldspaceWidget *worldspaceWidget, osg::ref_ptr<osg::Group> parentNode, QWidget *parent) CSVRender::InstanceMode::InstanceMode (WorldspaceWidget *worldspaceWidget, osg::ref_ptr<osg::Group> parentNode, QWidget *parent)
: EditMode (worldspaceWidget, QIcon (":scenetoolbar/editing-instance"), Mask_Reference | Mask_Terrain, "Instance editing", : EditMode (worldspaceWidget, QIcon (":scenetoolbar/editing-instance"), Mask_Reference | Mask_Terrain, "Instance editing",
parent), mSubMode (0), mSubModeId ("move"), mSelectionMode (0), mDragMode (DragMode_None), parent), mSubMode (nullptr), mSubModeId ("move"), mSelectionMode (nullptr), mDragMode (DragMode_None),
mDragAxis (-1), mLocked (false), mUnitScaleDist(1), mParentNode (parentNode) mDragAxis (-1), mLocked (false), mUnitScaleDist(1), mParentNode (parentNode)
{ {
connect(this, SIGNAL(requestFocus(const std::string&)), connect(this, SIGNAL(requestFocus(const std::string&)),
@ -169,14 +169,14 @@ void CSVRender::InstanceMode::deactivate (CSVWidget::SceneToolbar *toolbar)
{ {
toolbar->removeTool (mSelectionMode); toolbar->removeTool (mSelectionMode);
delete mSelectionMode; delete mSelectionMode;
mSelectionMode = 0; mSelectionMode = nullptr;
} }
if (mSubMode) if (mSubMode)
{ {
toolbar->removeTool (mSubMode); toolbar->removeTool (mSubMode);
delete mSubMode; delete mSubMode;
mSubMode = 0; mSubMode = nullptr;
} }
EditMode::deactivate (toolbar); EditMode::deactivate (toolbar);

@ -62,7 +62,7 @@ namespace CSVRender
public: public:
InstanceMode (WorldspaceWidget *worldspaceWidget, osg::ref_ptr<osg::Group> parentNode, QWidget *parent = 0); InstanceMode (WorldspaceWidget *worldspaceWidget, osg::ref_ptr<osg::Group> parentNode, QWidget *parent = nullptr);
void activate (CSVWidget::SceneToolbar *toolbar) override; void activate (CSVWidget::SceneToolbar *toolbar) override;

@ -11,7 +11,7 @@ namespace CSVRender
public: public:
InstanceMoveMode (QWidget *parent = 0); InstanceMoveMode (QWidget *parent = nullptr);
}; };
} }

@ -16,7 +16,7 @@ namespace CSVRender
{ {
public: public:
Lighting() : mRootNode(0) {} Lighting() : mRootNode(nullptr) {}
virtual ~Lighting(); virtual ~Lighting();
virtual void activate (osg::Group* rootNode, bool isExterior) = 0; virtual void activate (osg::Group* rootNode, bool isExterior) = 0;

@ -413,7 +413,7 @@ osg::Vec3f CSVRender::Object::getMarkerPosition (float x, float y, float z, int
CSVRender::Object::Object (CSMWorld::Data& data, osg::Group* parentNode, CSVRender::Object::Object (CSMWorld::Data& data, osg::Group* parentNode,
const std::string& id, bool referenceable, bool forceBaseToZero) const std::string& id, bool referenceable, bool forceBaseToZero)
: mData (data), mBaseNode(0), mSelected(false), mParentNode(parentNode), mResourceSystem(data.getResourceSystem().get()), mForceBaseToZero (forceBaseToZero), : mData (data), mBaseNode(nullptr), mSelected(false), mParentNode(parentNode), mResourceSystem(data.getResourceSystem().get()), mForceBaseToZero (forceBaseToZero),
mScaleOverride (1), mOverrideFlags (0), mSubMode (-1), mMarkerTransparency(0.5f) mScaleOverride (1), mOverrideFlags (0), mSubMode (-1), mMarkerTransparency(0.5f)
{ {
mRootNode = new osg::PositionAttitudeTransform; mRootNode = new osg::PositionAttitudeTransform;

@ -13,7 +13,7 @@ namespace CSVRender
QWidget* parent) QWidget* parent)
: ModeButton(icon, tooltip, parent) : ModeButton(icon, tooltip, parent)
, mWorldspaceWidget(worldspaceWidget) , mWorldspaceWidget(worldspaceWidget)
, mCenterOnSelection(0) , mCenterOnSelection(nullptr)
{ {
mCenterShortcut = new CSMPrefs::Shortcut("orbit-center-selection", worldspaceWidget); mCenterShortcut = new CSMPrefs::Shortcut("orbit-center-selection", worldspaceWidget);
mCenterShortcut->enable(false); mCenterShortcut->enable(false);
@ -35,7 +35,7 @@ namespace CSVRender
void OrbitCameraMode::deactivate(CSVWidget::SceneToolbar* toolbar) void OrbitCameraMode::deactivate(CSVWidget::SceneToolbar* toolbar)
{ {
mCenterShortcut->associateAction(0); mCenterShortcut->associateAction(nullptr);
mCenterShortcut->enable(false); mCenterShortcut->enable(false);
} }

@ -787,7 +787,7 @@ CSVRender::Cell* CSVRender::PagedWorldspaceWidget::getCell(const osg::Vec3d& poi
if (searchResult != mCells.end()) if (searchResult != mCells.end())
return searchResult->second; return searchResult->second;
else else
return 0; return nullptr;
} }
CSVRender::Cell* CSVRender::PagedWorldspaceWidget::getCell(const CSMWorld::CellCoordinates& coords) const CSVRender::Cell* CSVRender::PagedWorldspaceWidget::getCell(const CSMWorld::CellCoordinates& coords) const

@ -60,8 +60,8 @@ namespace CSVRender
, mRemoveGeometry(false) , mRemoveGeometry(false)
, mUseOffset(true) , mUseOffset(true)
, mParent(parent) , mParent(parent)
, mPathgridGeometry(0) , mPathgridGeometry(nullptr)
, mDragGeometry(0) , mDragGeometry(nullptr)
, mTag(new PathgridTag(this)) , mTag(new PathgridTag(this))
{ {
const float CoordScalar = ESM::Land::REAL_SIZE; const float CoordScalar = ESM::Land::REAL_SIZE;
@ -219,7 +219,7 @@ namespace CSVRender
mMoveOffset.set(0, 0, 0); mMoveOffset.set(0, 0, 0);
mPathgridGeode->removeDrawable(mDragGeometry); mPathgridGeode->removeDrawable(mDragGeometry);
mDragGeometry = 0; mDragGeometry = nullptr;
} }
void Pathgrid::applyPoint(CSMWorld::CommandMacro& commands, const osg::Vec3d& worldPos) void Pathgrid::applyPoint(CSMWorld::CommandMacro& commands, const osg::Vec3d& worldPos)
@ -557,7 +557,7 @@ namespace CSVRender
if (mPathgridGeometry) if (mPathgridGeometry)
{ {
mPathgridGeode->removeDrawable(mPathgridGeometry); mPathgridGeode->removeDrawable(mPathgridGeometry);
mPathgridGeometry = 0; mPathgridGeometry = nullptr;
} }
} }
@ -566,7 +566,7 @@ namespace CSVRender
if (mSelectedGeometry) if (mSelectedGeometry)
{ {
mPathgridGeode->removeDrawable(mSelectedGeometry); mPathgridGeode->removeDrawable(mSelectedGeometry);
mSelectedGeometry = 0; mSelectedGeometry = nullptr;
} }
} }
@ -612,7 +612,7 @@ namespace CSVRender
return &mPathgridCollection.getRecord(index).get(); return &mPathgridCollection.getRecord(index).get();
} }
return 0; return nullptr;
} }
int Pathgrid::edgeExists(const CSMWorld::Pathgrid& source, unsigned short node1, unsigned short node2) int Pathgrid::edgeExists(const CSMWorld::Pathgrid& source, unsigned short node1, unsigned short node2)

@ -27,7 +27,7 @@ namespace CSVRender
getTooltip(), parent) getTooltip(), parent)
, mDragMode(DragMode_None) , mDragMode(DragMode_None)
, mFromNode(0) , mFromNode(0)
, mSelectionMode(0) , mSelectionMode(nullptr)
{ {
} }
@ -59,7 +59,7 @@ namespace CSVRender
{ {
toolbar->removeTool (mSelectionMode); toolbar->removeTool (mSelectionMode);
delete mSelectionMode; delete mSelectionMode;
mSelectionMode = 0; mSelectionMode = nullptr;
} }
} }
@ -214,7 +214,7 @@ namespace CSVRender
Cell* cell = getWorldspaceWidget().getCell(hit.worldPos); Cell* cell = getWorldspaceWidget().getCell(hit.worldPos);
if (cell && cell->getPathgrid()) if (cell && cell->getPathgrid())
{ {
PathgridTag* tag = 0; PathgridTag* tag = nullptr;
if (hit.tag && (tag = dynamic_cast<PathgridTag*>(hit.tag.get())) && tag->getPathgrid()->getId() == mEdgeId) if (hit.tag && (tag = dynamic_cast<PathgridTag*>(hit.tag.get())) && tag->getPathgrid()->getId() == mEdgeId)
{ {
unsigned short node = SceneUtil::getPathgridNode(static_cast<unsigned short>(hit.index0)); unsigned short node = SceneUtil::getPathgridNode(static_cast<unsigned short>(hit.index0));

@ -15,7 +15,7 @@ namespace CSVRender
public: public:
PathgridMode(WorldspaceWidget* worldspace, QWidget* parent=0); PathgridMode(WorldspaceWidget* worldspace, QWidget* parent=nullptr);
void activate(CSVWidget::SceneToolbar* toolbar) override; void activate(CSVWidget::SceneToolbar* toolbar) override;

@ -29,7 +29,7 @@ namespace CSVRender
public: public:
PreviewWidget (CSMWorld::Data& data, const std::string& id, bool referenceable, PreviewWidget (CSMWorld::Data& data, const std::string& id, bool referenceable,
QWidget *parent = 0); QWidget *parent = nullptr);
signals: signals:

@ -36,7 +36,7 @@ namespace CSVRender
RenderWidget::RenderWidget(QWidget *parent, Qt::WindowFlags f) RenderWidget::RenderWidget(QWidget *parent, Qt::WindowFlags f)
: QWidget(parent, f) : QWidget(parent, f)
, mRootNode(0) , mRootNode(nullptr)
{ {
osgViewer::CompositeViewer& viewer = CompositeViewer::get(); osgViewer::CompositeViewer& viewer = CompositeViewer::get();
@ -257,7 +257,7 @@ void SceneWidget::setLighting(Lighting *lighting)
mLighting = lighting; mLighting = lighting;
mLighting->activate (mRootNode, mIsExterior); mLighting->activate (mRootNode, mIsExterior);
osg::Vec4f ambient = mLighting->getAmbientColour(mHasDefaultAmbient ? &mDefaultAmbient : 0); osg::Vec4f ambient = mLighting->getAmbientColour(mHasDefaultAmbient ? &mDefaultAmbient : nullptr);
setAmbient(ambient); setAmbient(ambient);
flagAsModified(); flagAsModified();

@ -99,7 +99,7 @@ void CSVRender::TerrainShapeMode::primaryOpenPressed (const WorldspaceHitResult&
void CSVRender::TerrainShapeMode::primaryEditPressed(const WorldspaceHitResult& hit) void CSVRender::TerrainShapeMode::primaryEditPressed(const WorldspaceHitResult& hit)
{ {
if (hit.hit && hit.tag == 0) if (hit.hit && hit.tag == nullptr)
{ {
if (mShapeEditTool == ShapeEditTool_Flatten) if (mShapeEditTool == ShapeEditTool_Flatten)
setFlattenToolTargetHeight(hit); setFlattenToolTargetHeight(hit);
@ -124,7 +124,7 @@ void CSVRender::TerrainShapeMode::primaryEditPressed(const WorldspaceHitResult&
void CSVRender::TerrainShapeMode::primarySelectPressed(const WorldspaceHitResult& hit) void CSVRender::TerrainShapeMode::primarySelectPressed(const WorldspaceHitResult& hit)
{ {
if(hit.hit && hit.tag == 0) if(hit.hit && hit.tag == nullptr)
{ {
selectTerrainShapes(CSMWorld::CellCoordinates::toVertexCoords(hit.worldPos), 0, false); selectTerrainShapes(CSMWorld::CellCoordinates::toVertexCoords(hit.worldPos), 0, false);
} }
@ -132,7 +132,7 @@ void CSVRender::TerrainShapeMode::primarySelectPressed(const WorldspaceHitResult
void CSVRender::TerrainShapeMode::secondarySelectPressed(const WorldspaceHitResult& hit) void CSVRender::TerrainShapeMode::secondarySelectPressed(const WorldspaceHitResult& hit)
{ {
if(hit.hit && hit.tag == 0) if(hit.hit && hit.tag == nullptr)
{ {
selectTerrainShapes(CSMWorld::CellCoordinates::toVertexCoords(hit.worldPos), 1, false); selectTerrainShapes(CSMWorld::CellCoordinates::toVertexCoords(hit.worldPos), 1, false);
} }
@ -144,7 +144,7 @@ bool CSVRender::TerrainShapeMode::primaryEditStartDrag (const QPoint& pos)
mDragMode = InteractionType_PrimaryEdit; mDragMode = InteractionType_PrimaryEdit;
if (hit.hit && hit.tag == 0) if (hit.hit && hit.tag == nullptr)
{ {
mEditingPos = hit.worldPos; mEditingPos = hit.worldPos;
mIsEditing = true; mIsEditing = true;
@ -164,7 +164,7 @@ bool CSVRender::TerrainShapeMode::primarySelectStartDrag (const QPoint& pos)
{ {
WorldspaceHitResult hit = getWorldspaceWidget().mousePick (pos, getWorldspaceWidget().getInteractionMask()); WorldspaceHitResult hit = getWorldspaceWidget().mousePick (pos, getWorldspaceWidget().getInteractionMask());
mDragMode = InteractionType_PrimarySelect; mDragMode = InteractionType_PrimarySelect;
if (!hit.hit || hit.tag != 0) if (!hit.hit || hit.tag != nullptr)
{ {
mDragMode = InteractionType_None; mDragMode = InteractionType_None;
return false; return false;
@ -177,7 +177,7 @@ bool CSVRender::TerrainShapeMode::secondarySelectStartDrag (const QPoint& pos)
{ {
WorldspaceHitResult hit = getWorldspaceWidget().mousePick (pos, getWorldspaceWidget().getInteractionMask()); WorldspaceHitResult hit = getWorldspaceWidget().mousePick (pos, getWorldspaceWidget().getInteractionMask());
mDragMode = InteractionType_SecondarySelect; mDragMode = InteractionType_SecondarySelect;
if (!hit.hit || hit.tag != 0) if (!hit.hit || hit.tag != nullptr)
{ {
mDragMode = InteractionType_None; mDragMode = InteractionType_None;
return false; return false;
@ -202,13 +202,13 @@ void CSVRender::TerrainShapeMode::drag (const QPoint& pos, int diffX, int diffY,
if (mDragMode == InteractionType_PrimarySelect) if (mDragMode == InteractionType_PrimarySelect)
{ {
WorldspaceHitResult hit = getWorldspaceWidget().mousePick (pos, getWorldspaceWidget().getInteractionMask()); WorldspaceHitResult hit = getWorldspaceWidget().mousePick (pos, getWorldspaceWidget().getInteractionMask());
if (hit.hit && hit.tag == 0) selectTerrainShapes(CSMWorld::CellCoordinates::toVertexCoords(hit.worldPos), 0, true); if (hit.hit && hit.tag == nullptr) selectTerrainShapes(CSMWorld::CellCoordinates::toVertexCoords(hit.worldPos), 0, true);
} }
if (mDragMode == InteractionType_SecondarySelect) if (mDragMode == InteractionType_SecondarySelect)
{ {
WorldspaceHitResult hit = getWorldspaceWidget().mousePick (pos, getWorldspaceWidget().getInteractionMask()); WorldspaceHitResult hit = getWorldspaceWidget().mousePick (pos, getWorldspaceWidget().getInteractionMask());
if (hit.hit && hit.tag == 0) selectTerrainShapes(CSMWorld::CellCoordinates::toVertexCoords(hit.worldPos), 1, true); if (hit.hit && hit.tag == nullptr) selectTerrainShapes(CSMWorld::CellCoordinates::toVertexCoords(hit.worldPos), 1, true);
} }
} }

@ -119,7 +119,7 @@ void CSVRender::TerrainTextureMode::primaryEditPressed(const WorldspaceHitResult
CSMWorld::IdCollection<CSMWorld::LandTexture>& landtexturesCollection = document.getData().getLandTextures(); CSMWorld::IdCollection<CSMWorld::LandTexture>& landtexturesCollection = document.getData().getLandTextures();
int index = landtexturesCollection.searchId(mBrushTexture); int index = landtexturesCollection.searchId(mBrushTexture);
if (index != -1 && !landtexturesCollection.getRecord(index).isDeleted() && hit.hit && hit.tag == 0) if (index != -1 && !landtexturesCollection.getRecord(index).isDeleted() && hit.hit && hit.tag == nullptr)
{ {
undoStack.beginMacro ("Edit texture records"); undoStack.beginMacro ("Edit texture records");
if(allowLandTextureEditing(mCellId)) if(allowLandTextureEditing(mCellId))
@ -133,7 +133,7 @@ void CSVRender::TerrainTextureMode::primaryEditPressed(const WorldspaceHitResult
void CSVRender::TerrainTextureMode::primarySelectPressed(const WorldspaceHitResult& hit) void CSVRender::TerrainTextureMode::primarySelectPressed(const WorldspaceHitResult& hit)
{ {
if(hit.hit && hit.tag == 0) if(hit.hit && hit.tag == nullptr)
{ {
selectTerrainTextures(CSMWorld::CellCoordinates::toTextureCoords(hit.worldPos), 0, false); selectTerrainTextures(CSMWorld::CellCoordinates::toTextureCoords(hit.worldPos), 0, false);
} }
@ -141,7 +141,7 @@ void CSVRender::TerrainTextureMode::primarySelectPressed(const WorldspaceHitResu
void CSVRender::TerrainTextureMode::secondarySelectPressed(const WorldspaceHitResult& hit) void CSVRender::TerrainTextureMode::secondarySelectPressed(const WorldspaceHitResult& hit)
{ {
if(hit.hit && hit.tag == 0) if(hit.hit && hit.tag == nullptr)
{ {
selectTerrainTextures(CSMWorld::CellCoordinates::toTextureCoords(hit.worldPos), 1, false); selectTerrainTextures(CSMWorld::CellCoordinates::toTextureCoords(hit.worldPos), 1, false);
} }
@ -166,7 +166,7 @@ bool CSVRender::TerrainTextureMode::primaryEditStartDrag (const QPoint& pos)
CSMWorld::IdCollection<CSMWorld::LandTexture>& landtexturesCollection = document.getData().getLandTextures(); CSMWorld::IdCollection<CSMWorld::LandTexture>& landtexturesCollection = document.getData().getLandTextures();
int index = landtexturesCollection.searchId(mBrushTexture); int index = landtexturesCollection.searchId(mBrushTexture);
if (index != -1 && !landtexturesCollection.getRecord(index).isDeleted() && hit.hit && hit.tag == 0) if (index != -1 && !landtexturesCollection.getRecord(index).isDeleted() && hit.hit && hit.tag == nullptr)
{ {
undoStack.beginMacro ("Edit texture records"); undoStack.beginMacro ("Edit texture records");
mIsEditing = true; mIsEditing = true;
@ -189,7 +189,7 @@ bool CSVRender::TerrainTextureMode::primarySelectStartDrag (const QPoint& pos)
{ {
WorldspaceHitResult hit = getWorldspaceWidget().mousePick (pos, getWorldspaceWidget().getInteractionMask()); WorldspaceHitResult hit = getWorldspaceWidget().mousePick (pos, getWorldspaceWidget().getInteractionMask());
mDragMode = InteractionType_PrimarySelect; mDragMode = InteractionType_PrimarySelect;
if (!hit.hit || hit.tag != 0) if (!hit.hit || hit.tag != nullptr)
{ {
mDragMode = InteractionType_None; mDragMode = InteractionType_None;
return false; return false;
@ -202,7 +202,7 @@ bool CSVRender::TerrainTextureMode::secondarySelectStartDrag (const QPoint& pos)
{ {
WorldspaceHitResult hit = getWorldspaceWidget().mousePick (pos, getWorldspaceWidget().getInteractionMask()); WorldspaceHitResult hit = getWorldspaceWidget().mousePick (pos, getWorldspaceWidget().getInteractionMask());
mDragMode = InteractionType_SecondarySelect; mDragMode = InteractionType_SecondarySelect;
if (!hit.hit || hit.tag != 0) if (!hit.hit || hit.tag != nullptr)
{ {
mDragMode = InteractionType_None; mDragMode = InteractionType_None;
return false; return false;
@ -222,7 +222,7 @@ void CSVRender::TerrainTextureMode::drag (const QPoint& pos, int diffX, int diff
CSMWorld::IdCollection<CSMWorld::LandTexture>& landtexturesCollection = document.getData().getLandTextures(); CSMWorld::IdCollection<CSMWorld::LandTexture>& landtexturesCollection = document.getData().getLandTextures();
int index = landtexturesCollection.searchId(mBrushTexture); int index = landtexturesCollection.searchId(mBrushTexture);
if (index != -1 && !landtexturesCollection.getRecord(index).isDeleted() && hit.hit && hit.tag == 0) if (index != -1 && !landtexturesCollection.getRecord(index).isDeleted() && hit.hit && hit.tag == nullptr)
{ {
editTerrainTextureGrid(hit); editTerrainTextureGrid(hit);
} }
@ -231,13 +231,13 @@ void CSVRender::TerrainTextureMode::drag (const QPoint& pos, int diffX, int diff
if (mDragMode == InteractionType_PrimarySelect) if (mDragMode == InteractionType_PrimarySelect)
{ {
WorldspaceHitResult hit = getWorldspaceWidget().mousePick (pos, getWorldspaceWidget().getInteractionMask()); WorldspaceHitResult hit = getWorldspaceWidget().mousePick (pos, getWorldspaceWidget().getInteractionMask());
if (hit.hit && hit.tag == 0) selectTerrainTextures(CSMWorld::CellCoordinates::toTextureCoords(hit.worldPos), 0, true); if (hit.hit && hit.tag == nullptr) selectTerrainTextures(CSMWorld::CellCoordinates::toTextureCoords(hit.worldPos), 0, true);
} }
if (mDragMode == InteractionType_SecondarySelect) if (mDragMode == InteractionType_SecondarySelect)
{ {
WorldspaceHitResult hit = getWorldspaceWidget().mousePick (pos, getWorldspaceWidget().getInteractionMask()); WorldspaceHitResult hit = getWorldspaceWidget().mousePick (pos, getWorldspaceWidget().getInteractionMask());
if (hit.hit && hit.tag == 0) selectTerrainTextures(CSMWorld::CellCoordinates::toTextureCoords(hit.worldPos), 1, true); if (hit.hit && hit.tag == nullptr) selectTerrainTextures(CSMWorld::CellCoordinates::toTextureCoords(hit.worldPos), 1, true);
} }
} }

@ -34,11 +34,11 @@
CSVRender::WorldspaceWidget::WorldspaceWidget (CSMDoc::Document& document, QWidget* parent) CSVRender::WorldspaceWidget::WorldspaceWidget (CSMDoc::Document& document, QWidget* parent)
: SceneWidget (document.getData().getResourceSystem(), parent, Qt::WindowFlags(), false) : SceneWidget (document.getData().getResourceSystem(), parent, Qt::WindowFlags(), false)
, mSceneElements(0) , mSceneElements(nullptr)
, mRun(0) , mRun(nullptr)
, mDocument(document) , mDocument(document)
, mInteractionMask (0) , mInteractionMask (0)
, mEditMode (0) , mEditMode (nullptr)
, mLocked (false) , mLocked (false)
, mDragMode(InteractionType_None) , mDragMode(InteractionType_None)
, mDragging (false) , mDragging (false)
@ -435,7 +435,7 @@ CSVRender::WorldspaceHitResult CSVRender::WorldspaceWidget::mousePick (const QPo
} }
// Something untagged, probably terrain // Something untagged, probably terrain
WorldspaceHitResult hit = { true, 0, 0, 0, 0, intersection.getWorldIntersectPoint() }; WorldspaceHitResult hit = { true, nullptr, 0, 0, 0, intersection.getWorldIntersectPoint() };
if (intersection.indexList.size() >= 3) if (intersection.indexList.size() >= 3)
{ {
hit.index0 = intersection.indexList[0]; hit.index0 = intersection.indexList[0];
@ -449,7 +449,7 @@ CSVRender::WorldspaceHitResult CSVRender::WorldspaceWidget::mousePick (const QPo
direction.normalize(); direction.normalize();
direction *= CSMPrefs::get()["3D Scene Editing"]["distance"].toInt(); direction *= CSMPrefs::get()["3D Scene Editing"]["distance"].toInt();
WorldspaceHitResult hit = { false, 0, 0, 0, 0, start + direction }; WorldspaceHitResult hit = { false, nullptr, 0, 0, 0, start + direction };
return hit; return hit;
} }

@ -96,7 +96,7 @@ namespace CSVRender
InteractionType_None InteractionType_None
}; };
WorldspaceWidget (CSMDoc::Document& document, QWidget *parent = 0); WorldspaceWidget (CSMDoc::Document& document, QWidget *parent = nullptr);
~WorldspaceWidget (); ~WorldspaceWidget ();
CSVWidget::SceneToolMode *makeNavigationSelector (CSVWidget::SceneToolbar *parent); CSVWidget::SceneToolMode *makeNavigationSelector (CSVWidget::SceneToolbar *parent);

@ -27,7 +27,7 @@ void CSVTools::Merge::keyPressEvent (QKeyEvent *event)
} }
CSVTools::Merge::Merge (CSMDoc::DocumentManager& documentManager, QWidget *parent) CSVTools::Merge::Merge (CSMDoc::DocumentManager& documentManager, QWidget *parent)
: QWidget (parent), mDocument (0), mDocumentManager (documentManager) : QWidget (parent), mDocument (nullptr), mDocumentManager (documentManager)
{ {
setWindowTitle ("Merge Content Files into a new Game File"); setWindowTitle ("Merge Content Files into a new Game File");
@ -117,7 +117,7 @@ CSMDoc::Document *CSVTools::Merge::getDocument() const
void CSVTools::Merge::cancel() void CSVTools::Merge::cancel()
{ {
mDocument = 0; mDocument = nullptr;
hide(); hide();
} }

@ -39,7 +39,7 @@ namespace CSVTools
public: public:
Merge (CSMDoc::DocumentManager& documentManager, QWidget *parent = 0); Merge (CSMDoc::DocumentManager& documentManager, QWidget *parent = nullptr);
/// Configure dialogue for a new merge /// Configure dialogue for a new merge
void configure (CSMDoc::Document *document); void configure (CSMDoc::Document *document);

@ -25,7 +25,7 @@ namespace CSVTools
{ {
public: public:
RichTextDelegate (QObject *parent = 0); RichTextDelegate (QObject *parent = nullptr);
void paint(QPainter *painter, const QStyleOptionViewItem& option, void paint(QPainter *painter, const QStyleOptionViewItem& option,
const QModelIndex& index) const override; const QModelIndex& index) const override;
@ -142,7 +142,7 @@ CSVTools::ReportTable::ReportTable (CSMDoc::Document& document,
const CSMWorld::UniversalId& id, bool richTextDescription, int refreshState, const CSMWorld::UniversalId& id, bool richTextDescription, int refreshState,
QWidget *parent) QWidget *parent)
: CSVWorld::DragRecordTable (document, parent), mModel (document.getReport (id)), : CSVWorld::DragRecordTable (document, parent), mModel (document.getReport (id)),
mRefreshAction (0), mRefreshState (refreshState) mRefreshAction (nullptr), mRefreshState (refreshState)
{ {
horizontalHeader()->setSectionResizeMode (QHeaderView::Interactive); horizontalHeader()->setSectionResizeMode (QHeaderView::Interactive);
horizontalHeader()->setStretchLastSection (true); horizontalHeader()->setStretchLastSection (true);
@ -159,7 +159,7 @@ CSVTools::ReportTable::ReportTable (CSMDoc::Document& document,
setModel (mProxyModel); setModel (mProxyModel);
setColumnHidden (2, true); setColumnHidden (2, true);
mIdTypeDelegate = CSVWorld::IdTypeDelegateFactory().makeDelegate (0, mIdTypeDelegate = CSVWorld::IdTypeDelegateFactory().makeDelegate (nullptr,
mDocument, this); mDocument, this);
setItemDelegateForColumn (0, mIdTypeDelegate); setItemDelegateForColumn (0, mIdTypeDelegate);

@ -62,7 +62,7 @@ namespace CSVTools
/// 0 no refresh function exists. If the document current has the specified state /// 0 no refresh function exists. If the document current has the specified state
/// the refresh function is disabled. /// the refresh function is disabled.
ReportTable (CSMDoc::Document& document, const CSMWorld::UniversalId& id, ReportTable (CSMDoc::Document& document, const CSMWorld::UniversalId& id,
bool richTextDescription, int refreshState = 0, QWidget *parent = 0); bool richTextDescription, int refreshState = 0, QWidget *parent = nullptr);
std::vector<CSMWorld::UniversalId> getDraggedRecords() const override; std::vector<CSMWorld::UniversalId> getDraggedRecords() const override;

@ -41,7 +41,7 @@ namespace CSVTools
public: public:
SearchBox (QWidget *parent = 0); SearchBox (QWidget *parent = nullptr);
void setSearchMode (bool enabled); void setSearchMode (bool enabled);

@ -30,7 +30,7 @@ void CSVTools::SearchSubView::replace (bool selection)
bool autoDelete = CSMPrefs::get()["Search & Replace"]["auto-delete"].isTrue(); bool autoDelete = CSMPrefs::get()["Search & Replace"]["auto-delete"].isTrue();
CSMTools::Search search (mSearch); CSMTools::Search search (mSearch);
CSMWorld::IdTableBase *currentTable = 0; CSMWorld::IdTableBase *currentTable = nullptr;
// We are running through the indices in reverse order to avoid messing up multiple results // We are running through the indices in reverse order to avoid messing up multiple results
// in a single string. // in a single string.

@ -22,8 +22,8 @@ namespace CSVWidget
QPoint calculatePopupPosition(); QPoint calculatePopupPosition();
public: public:
ColorEditor(const QColor &color, QWidget *parent = 0, const bool popupOnStart = false); ColorEditor(const QColor &color, QWidget *parent = nullptr, const bool popupOnStart = false);
ColorEditor(const int colorInt, QWidget *parent = 0, const bool popupOnStart = false); ColorEditor(const int colorInt, QWidget *parent = nullptr, const bool popupOnStart = false);
QColor color() const; QColor color() const;
@ -41,7 +41,7 @@ namespace CSVWidget
void showEvent(QShowEvent *event) override; void showEvent(QShowEvent *event) override;
private: private:
ColorEditor(QWidget *parent = 0, const bool popupOnStart = false); ColorEditor(QWidget *parent = nullptr, const bool popupOnStart = false);
private slots: private slots:
void showPicker(); void showPicker();

@ -8,7 +8,7 @@ namespace CSVWidget
class CompleterPopup : public QListView class CompleterPopup : public QListView
{ {
public: public:
CompleterPopup(QWidget *parent = 0); CompleterPopup(QWidget *parent = nullptr);
int sizeHintForRow(int row) const override; int sizeHintForRow(int row) const override;
}; };

@ -26,7 +26,7 @@ namespace CSVWidget
///< The accepted Display type for this LineEdit. ///< The accepted Display type for this LineEdit.
public: public:
DropLineEdit(CSMWorld::ColumnBase::Display type, QWidget *parent = 0); DropLineEdit(CSMWorld::ColumnBase::Display type, QWidget *parent = nullptr);
protected: protected:
void dragEnterEvent(QDragEnterEvent *event) override; void dragEnterEvent(QDragEnterEvent *event) override;

@ -17,7 +17,7 @@ namespace CSVWidget
public: public:
ModeButton (const QIcon& icon, const QString& tooltip = "", ModeButton (const QIcon& icon, const QString& tooltip = "",
QWidget *parent = 0); QWidget *parent = nullptr);
/// Default-Implementation: do nothing /// Default-Implementation: do nothing
virtual void activate (SceneToolbar *toolbar); virtual void activate (SceneToolbar *toolbar);

@ -48,11 +48,11 @@ namespace CSVWidget
/// \param push Do not maintain a toggle state /// \param push Do not maintain a toggle state
PushButton (const QIcon& icon, Type type, const QString& tooltip = "", PushButton (const QIcon& icon, Type type, const QString& tooltip = "",
QWidget *parent = 0); QWidget *parent = nullptr);
/// \param push Do not maintain a toggle state /// \param push Do not maintain a toggle state
PushButton (Type type, const QString& tooltip = "", PushButton (Type type, const QString& tooltip = "",
QWidget *parent = 0); QWidget *parent = nullptr);
bool hasKeepOpen() const; bool hasKeepOpen() const;

@ -23,11 +23,11 @@ namespace CSVWidget
public: public:
SceneToolbar (int buttonSize, QWidget *parent = 0); SceneToolbar (int buttonSize, QWidget *parent = nullptr);
/// If insertPoint==0, insert \a tool at the end of the scrollbar. Otherwise /// If insertPoint==0, insert \a tool at the end of the scrollbar. Otherwise
/// insert tool after \a insertPoint. /// insert tool after \a insertPoint.
void addTool (SceneTool *tool, SceneTool *insertPoint = 0); void addTool (SceneTool *tool, SceneTool *insertPoint = nullptr);
void removeTool (SceneTool *tool); void removeTool (SceneTool *tool);

@ -33,7 +33,7 @@ void CSVWidget::SceneToolMode::adjustToolTip (const ModeButton *activeMode)
toolTip += "<p>(left click to change mode)"; toolTip += "<p>(left click to change mode)";
if (createContextMenu (0)) if (createContextMenu (nullptr))
toolTip += "<br>(right click to access context menu)"; toolTip += "<br>(right click to access context menu)";
setToolTip (toolTip); setToolTip (toolTip);
@ -62,7 +62,7 @@ void CSVWidget::SceneToolMode::setButton (std::map<ModeButton *, std::string>::i
CSVWidget::SceneToolMode::SceneToolMode (SceneToolbar *parent, const QString& toolTip) CSVWidget::SceneToolMode::SceneToolMode (SceneToolbar *parent, const QString& toolTip)
: SceneTool (parent), mButtonSize (parent->getButtonSize()), mIconSize (parent->getIconSize()), : SceneTool (parent), mButtonSize (parent->getButtonSize()), mIconSize (parent->getIconSize()),
mToolTip (toolTip), mFirst (0), mCurrent (0), mToolbar (parent) mToolTip (toolTip), mFirst (nullptr), mCurrent (nullptr), mToolbar (parent)
{ {
mPanel = new QFrame (this, Qt::Popup); mPanel = new QFrame (this, Qt::Popup);

@ -54,7 +54,7 @@ namespace CSVWidget
public: public:
ShapeBrushWindow(CSMDoc::Document& document, QWidget *parent = 0); ShapeBrushWindow(CSMDoc::Document& document, QWidget *parent = nullptr);
void configureButtonInitialSettings(QPushButton *button); void configureButtonInitialSettings(QPushButton *button);
const QString toolTipPoint = "Paint single point"; const QString toolTipPoint = "Paint single point";

@ -57,7 +57,7 @@ namespace CSVWidget
Q_OBJECT Q_OBJECT
public: public:
TextureBrushWindow(CSMDoc::Document& document, QWidget *parent = 0); TextureBrushWindow(CSMDoc::Document& document, QWidget *parent = nullptr);
void configureButtonInitialSettings(QPushButton *button); void configureButtonInitialSettings(QPushButton *button);
const QString toolTipPoint = "Paint single point"; const QString toolTipPoint = "Paint single point";

@ -115,7 +115,7 @@ QRect CSVWidget::SceneToolToggle::getIconBox (int index) const
CSVWidget::SceneToolToggle::SceneToolToggle (SceneToolbar *parent, const QString& toolTip, CSVWidget::SceneToolToggle::SceneToolToggle (SceneToolbar *parent, const QString& toolTip,
const std::string& emptyIcon) const std::string& emptyIcon)
: SceneTool (parent), mEmptyIcon (emptyIcon), mButtonSize (parent->getButtonSize()), : SceneTool (parent), mEmptyIcon (emptyIcon), mButtonSize (parent->getButtonSize()),
mIconSize (parent->getIconSize()), mToolTip (toolTip), mFirst (0) mIconSize (parent->getIconSize()), mToolTip (toolTip), mFirst (nullptr)
{ {
mPanel = new QFrame (this, Qt::Popup); mPanel = new QFrame (this, Qt::Popup);

@ -57,7 +57,7 @@ CSVWidget::SceneToolToggle2::SceneToolToggle2 (SceneToolbar *parent, const QStri
const std::string& compositeIcon, const std::string& singleIcon) const std::string& compositeIcon, const std::string& singleIcon)
: SceneTool (parent), mCompositeIcon (compositeIcon), mSingleIcon (singleIcon), : SceneTool (parent), mCompositeIcon (compositeIcon), mSingleIcon (singleIcon),
mButtonSize (parent->getButtonSize()), mIconSize (parent->getIconSize()), mToolTip (toolTip), mButtonSize (parent->getButtonSize()), mIconSize (parent->getIconSize()), mToolTip (toolTip),
mFirst (0) mFirst (nullptr)
{ {
mPanel = new QFrame (this, Qt::Popup); mPanel = new QFrame (this, Qt::Popup);

@ -17,5 +17,5 @@ CSVWorld::CreatorFactoryBase::~CreatorFactoryBase() {}
CSVWorld::Creator *CSVWorld::NullCreatorFactory::makeCreator (CSMDoc::Document& document, CSVWorld::Creator *CSVWorld::NullCreatorFactory::makeCreator (CSMDoc::Document& document,
const CSMWorld::UniversalId& id) const const CSMWorld::UniversalId& id) const
{ {
return 0; return nullptr;
} }

@ -12,7 +12,7 @@ namespace CSVWorld
public: public:
DialogueSpinBox (QWidget *parent = 0); DialogueSpinBox (QWidget *parent = nullptr);
protected: protected:
@ -27,7 +27,7 @@ namespace CSVWorld
public: public:
DialogueDoubleSpinBox (QWidget *parent = 0); DialogueDoubleSpinBox (QWidget *parent = nullptr);
protected: protected:

@ -498,7 +498,7 @@ void CSVWorld::EditWidget::remake(int row)
if (mDispatcher) if (mDispatcher)
delete mDispatcher; delete mDispatcher;
mDispatcher = new DialogueDelegateDispatcher(0/*this*/, mTable, mCommandDispatcher, mDocument); mDispatcher = new DialogueDelegateDispatcher(nullptr/*this*/, mTable, mCommandDispatcher, mDocument);
if (mNestedTableDispatcher) if (mNestedTableDispatcher)
delete mNestedTableDispatcher; delete mNestedTableDispatcher;
@ -648,7 +648,7 @@ void CSVWorld::EditWidget::remake(int row)
mNestedTableMapper->setModel(tree); mNestedTableMapper->setModel(tree);
// FIXME: lack MIME support? // FIXME: lack MIME support?
mNestedTableDispatcher = mNestedTableDispatcher =
new DialogueDelegateDispatcher (0/*this*/, mTable, mCommandDispatcher, mDocument, tree); new DialogueDelegateDispatcher (nullptr/*this*/, mTable, mCommandDispatcher, mDocument, tree);
mNestedTableMapper->setRootIndex (tree->index(row, i)); mNestedTableMapper->setRootIndex (tree->index(row, i));
mNestedTableMapper->setItemDelegate(mNestedTableDispatcher); mNestedTableMapper->setItemDelegate(mNestedTableDispatcher);
@ -732,7 +732,7 @@ bool CSVWorld::SimpleDialogueSubView::isLocked() const
CSVWorld::SimpleDialogueSubView::SimpleDialogueSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document) : CSVWorld::SimpleDialogueSubView::SimpleDialogueSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document) :
SubView (id), SubView (id),
mEditWidget(0), mEditWidget(nullptr),
mMainLayout(nullptr), mMainLayout(nullptr),
mTable(dynamic_cast<CSMWorld::IdTable*>(document.getData().getTableModel(id))), mTable(dynamic_cast<CSMWorld::IdTable*>(document.getData().getTableModel(id))),
mLocked(false), mLocked(false),
@ -834,7 +834,7 @@ void CSVWorld::SimpleDialogueSubView::rowsAboutToBeRemoved(const QModelIndex &pa
if(mEditWidget) if(mEditWidget)
{ {
delete mEditWidget; delete mEditWidget;
mEditWidget = 0; mEditWidget = nullptr;
} }
emit closeRequest(this); emit closeRequest(this);
} }
@ -869,7 +869,7 @@ void CSVWorld::DialogueSubView::addButtonBar()
CSVWorld::DialogueSubView::DialogueSubView (const CSMWorld::UniversalId& id, CSVWorld::DialogueSubView::DialogueSubView (const CSMWorld::UniversalId& id,
CSMDoc::Document& document, const CreatorFactoryBase& creatorFactory, bool sorting) CSMDoc::Document& document, const CreatorFactoryBase& creatorFactory, bool sorting)
: SimpleDialogueSubView (id, document), mButtons (0) : SimpleDialogueSubView (id, document), mButtons (nullptr)
{ {
// bottom box // bottom box
mBottom = new TableBottomBox (creatorFactory, document, id, this); mBottom = new TableBottomBox (creatorFactory, document, id, this);
@ -905,7 +905,7 @@ void CSVWorld::DialogueSubView::settingChanged (const CSMPrefs::Setting *setting
{ {
getMainLayout().removeWidget (mButtons); getMainLayout().removeWidget (mButtons);
delete mButtons; delete mButtons;
mButtons = 0; mButtons = nullptr;
} }
} }
} }

@ -50,7 +50,7 @@ namespace CSVWorld
const CSMWorld::IdTable* mTable; const CSMWorld::IdTable* mTable;
public: public:
NotEditableSubDelegate(const CSMWorld::IdTable* table, NotEditableSubDelegate(const CSMWorld::IdTable* table,
QObject * parent = 0); QObject * parent = nullptr);
void setEditorData (QWidget* editor, const QModelIndex& index) const override; void setEditorData (QWidget* editor, const QModelIndex& index) const override;
@ -126,7 +126,7 @@ namespace CSVWorld
CSMWorld::IdTable* table, CSMWorld::IdTable* table,
CSMWorld::CommandDispatcher& commandDispatcher, CSMWorld::CommandDispatcher& commandDispatcher,
CSMDoc::Document& document, CSMDoc::Document& document,
QAbstractItemModel* model = 0); QAbstractItemModel* model = nullptr);
~DialogueDelegateDispatcher(); ~DialogueDelegateDispatcher();

@ -71,7 +71,7 @@ QWidget *CSVWorld::EnumDelegate::createEditor(QWidget *parent, const QStyleOptio
const QModelIndex& index, CSMWorld::ColumnBase::Display display) const const QModelIndex& index, CSMWorld::ColumnBase::Display display) const
{ {
if (!index.data(Qt::EditRole).isValid() && !index.data(Qt::DisplayRole).isValid()) if (!index.data(Qt::EditRole).isValid() && !index.data(Qt::DisplayRole).isValid())
return 0; return nullptr;
QComboBox *comboBox = new QComboBox (parent); QComboBox *comboBox = new QComboBox (parent);

@ -57,7 +57,7 @@ namespace CSVWorld
public: public:
ExtendedCommandConfigurator(CSMDoc::Document &document, ExtendedCommandConfigurator(CSMDoc::Document &document,
const CSMWorld::UniversalId &id, const CSMWorld::UniversalId &id,
QWidget *parent = 0); QWidget *parent = nullptr);
void configure(Mode mode, const std::vector<std::string> &selectedIds); void configure(Mode mode, const std::vector<std::string> &selectedIds);
void setEditLock(bool locked); void setEditLock(bool locked);

@ -148,8 +148,8 @@ void CSVWorld::GenericCreator::addScope (const QString& name, CSMWorld::Scope sc
CSVWorld::GenericCreator::GenericCreator (CSMWorld::Data& data, QUndoStack& undoStack, CSVWorld::GenericCreator::GenericCreator (CSMWorld::Data& data, QUndoStack& undoStack,
const CSMWorld::UniversalId& id, bool relaxedIdRules) const CSMWorld::UniversalId& id, bool relaxedIdRules)
: mData (data), mUndoStack (undoStack), mListId (id), mLocked (false), : mData (data), mUndoStack (undoStack), mListId (id), mLocked (false),
mClonedType (CSMWorld::UniversalId::Type_None), mScopes (CSMWorld::Scope_Content), mScope (0), mClonedType (CSMWorld::UniversalId::Type_None), mScopes (CSMWorld::Scope_Content), mScope (nullptr),
mScopeLabel (0), mCloneMode (false) mScopeLabel (nullptr), mCloneMode (false)
{ {
// If the collection ID has a parent type, use it instead. // If the collection ID has a parent type, use it instead.
// It will change IDs with Record/SubRecord class (used for creators in Dialogue subviews) // It will change IDs with Record/SubRecord class (used for creators in Dialogue subviews)
@ -322,10 +322,10 @@ void CSVWorld::GenericCreator::setScope (unsigned int scope)
else else
{ {
delete mScope; delete mScope;
mScope = 0; mScope = nullptr;
delete mScopeLabel; delete mScopeLabel;
mScopeLabel = 0; mScopeLabel = nullptr;
} }
updateNamespace(); updateNamespace();

@ -74,7 +74,7 @@ QWidget *CSVWorld::IdCompletionDelegate::createEditor(QWidget *parent,
{ {
return new CSVWidget::DropLineEdit(display, parent); return new CSVWidget::DropLineEdit(display, parent);
} }
default: return 0; // The rest of them can't be edited anyway default: return nullptr; // The rest of them can't be edited anyway
} }
} }

@ -19,7 +19,7 @@ namespace CSVWorld
public: public:
IdValidator (bool relaxed = false, QObject *parent = 0); IdValidator (bool relaxed = false, QObject *parent = nullptr);
///< \param relaxed Relaxed rules for IDs that also functino as user visible text ///< \param relaxed Relaxed rules for IDs that also functino as user visible text
State validate (QString& input, int& pos) const override; State validate (QString& input, int& pos) const override;

@ -58,8 +58,8 @@ namespace CSVWorld
public: public:
RecordButtonBar (const CSMWorld::UniversalId& id, RecordButtonBar (const CSMWorld::UniversalId& id,
CSMWorld::IdTable& table, TableBottomBox *bottomBox = 0, CSMWorld::IdTable& table, TableBottomBox *bottomBox = nullptr,
CSMWorld::CommandDispatcher *commandDispatcher = 0, QWidget *parent = 0); CSMWorld::CommandDispatcher *commandDispatcher = nullptr, QWidget *parent = nullptr);
void setEditLock (bool locked); void setEditLock (bool locked);

@ -19,7 +19,7 @@ namespace CSVWorld
RecordStatusDelegate (const ValueList& values, const IconList& icons, RecordStatusDelegate (const ValueList& values, const IconList& icons,
CSMWorld::CommandDispatcher *dispatcher, CSMDoc::Document& document, CSMWorld::CommandDispatcher *dispatcher, CSMDoc::Document& document,
QObject *parent = 0); QObject *parent = nullptr);
}; };
class RecordStatusDelegateFactory : public DataDisplayDelegateFactory class RecordStatusDelegateFactory : public DataDisplayDelegateFactory

@ -61,7 +61,7 @@ namespace CSVWorld
public: public:
RegionMap (const CSMWorld::UniversalId& universalId, CSMDoc::Document& document, RegionMap (const CSMWorld::UniversalId& universalId, CSMDoc::Document& document,
QWidget *parent = 0); QWidget *parent = nullptr);
std::vector<CSMWorld::UniversalId> getDraggedRecords() const override; std::vector<CSMWorld::UniversalId> getDraggedRecords() const override;

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save