Replace zeroes and nulls by nullptrs

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

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

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

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

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

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

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

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

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

@ -16,12 +16,12 @@ public:
class ComboBoxLineEdit : public LineEdit
{
public:
explicit ComboBoxLineEdit (QWidget *parent = 0);
explicit ComboBoxLineEdit (QWidget *parent = nullptr);
};
public:
explicit ProfilesComboBox(QWidget *parent = 0);
explicit ProfilesComboBox(QWidget *parent = nullptr);
void setEditEnabled(bool editable);
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
mLineEdit = new LineEdit(this);
mLineEdit->setValidator(validator);
mLineEdit->setCompleter(0);
mLineEdit->setCompleter(nullptr);
QVBoxLayout *dialogLayout = new QVBoxLayout(this);
dialogLayout->addWidget(label);

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

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

@ -8,7 +8,7 @@
#include "operationholder.hpp"
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)),
this, SLOT (finished (int, QProcess::ExitStatus)));
@ -25,7 +25,7 @@ CSMDoc::Runner::~Runner()
{
if (mRunning)
{
disconnect (&mProcess, 0, this, 0);
disconnect (&mProcess, nullptr, this, nullptr);
mProcess.kill();
mProcess.waitForFinished();
}
@ -36,7 +36,7 @@ void CSMDoc::Runner::start (bool delayed)
if (mStartup)
{
delete mStartup;
mStartup = 0;
mStartup = nullptr;
}
if (!delayed)
@ -102,7 +102,7 @@ void CSMDoc::Runner::start (bool delayed)
void CSMDoc::Runner::stop()
{
delete mStartup;
mStartup = 0;
mStartup = nullptr;
if (mProcess.state()==QProcess::NotRunning)
{

@ -11,7 +11,7 @@
CSMPrefs::BoolSetting::BoolSetting (Category *parent, Settings::Manager *values,
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)
@ -33,7 +33,7 @@ std::pair<QWidget *, QWidget *> CSMPrefs::BoolSetting::makeWidgets (QWidget *par
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()

@ -14,7 +14,7 @@
CSMPrefs::ColourSetting::ColourSetting (Category *parent, Settings::Manager *values,
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)

@ -16,7 +16,7 @@ CSMPrefs::DoubleSetting::DoubleSetting (Category *parent, Settings::Manager *val
QMutex *mutex, const std::string& key, const std::string& label, double default_)
: Setting (parent, values, mutex, key, label),
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)

@ -42,7 +42,7 @@ CSMPrefs::EnumValues& CSMPrefs::EnumValues::add (const std::string& value, const
CSMPrefs::EnumSetting::EnumSetting (Category *parent, Settings::Manager *values,
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)

@ -15,7 +15,7 @@
CSMPrefs::IntSetting::IntSetting (Category *parent, Settings::Manager *values,
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()),
mDefault (default_), mWidget(0)
mDefault (default_), mWidget(nullptr)
{}
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,
const std::string& label)
: Setting(parent, values, mutex, key, label)
, mButton(0)
, mButton(nullptr)
, mEditorActive(false)
{
}

@ -23,7 +23,7 @@ namespace CSMPrefs
, mLastPos(0)
, mActivationStatus(AS_Inactive)
, mModifierStatus(false)
, mAction(0)
, mAction(nullptr)
{
assert (parent);
@ -42,7 +42,7 @@ namespace CSMPrefs
, mLastPos(0)
, mActivationStatus(AS_Inactive)
, mModifierStatus(false)
, mAction(0)
, mAction(nullptr)
{
assert (parent);
@ -62,7 +62,7 @@ namespace CSMPrefs
, mLastPos(0)
, mActivationStatus(AS_Inactive)
, mModifierStatus(false)
, mAction(0)
, mAction(nullptr)
{
assert (parent);
@ -218,6 +218,6 @@ namespace CSMPrefs
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_Camera , "Camera"),
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,
const std::string& label)
: Setting(parent, values, mutex, key, label)
, mButton(0)
, mButton(nullptr)
, mEditorActive(false)
, mEditorPos(0)
{

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

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

@ -82,7 +82,7 @@ namespace CSMTools
const CSMWorld::Record<RecordType>& record = source.getRecord (stage);
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

@ -50,7 +50,7 @@ void CSMTools::ScriptCheckStage::report (const std::string& message, Type type)
}
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
setWarningsMode (0);
@ -73,7 +73,7 @@ int CSMTools::ScriptCheckStage::setup()
mWarningMode = Mode_Strict;
mContext.clear();
mMessages = 0;
mMessages = nullptr;
mId.clear();
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);
}
mMessages = 0;
mMessages = nullptr;
}

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

@ -43,7 +43,7 @@ CSMDoc::OperationHolder *CSMTools::Tools::get (int type)
case CSMDoc::State_Merging: return &mMerge;
}
return 0;
return nullptr;
}
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)
: mDocument (document), mData (document.getData()), mVerifierOperation (0),
mSearchOperation (0), mMergeOperation (0), mNextReportNumber (0), mEncoding (encoding)
: mDocument (document), mData (document.getData()), mVerifierOperation (nullptr),
mSearchOperation (nullptr), mMergeOperation (nullptr), mNextReportNumber (0), mEncoding (encoding)
{
// index 0: load error log
mReports.insert (std::make_pair (mNextReportNumber++, new ReportModel));

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

@ -34,7 +34,7 @@ namespace CSMWorld
public:
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.
void setEditLock (bool locked);

@ -290,7 +290,7 @@ void CSMWorld::CreateCommand::undo()
}
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());
@ -326,7 +326,7 @@ void CSMWorld::RevertCommand::undo()
CSMWorld::DeleteCommand::DeleteCommand (IdTable& model,
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());

@ -140,7 +140,7 @@ namespace CSMWorld
public:
ModifyCommand (QAbstractItemModel& model, const QModelIndex& index, const QVariant& new_,
QUndoCommand *parent = 0);
QUndoCommand *parent = nullptr);
void redo() override;
@ -167,7 +167,7 @@ namespace CSMWorld
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);
@ -189,7 +189,7 @@ namespace CSMWorld
CloneCommand (IdTable& model, const std::string& idOrigin,
const std::string& IdDestination,
const UniversalId::Type type,
QUndoCommand* parent = 0);
QUndoCommand* parent = nullptr);
void redo() override;
@ -208,7 +208,7 @@ namespace CSMWorld
public:
RevertCommand (IdTable& model, const std::string& id, QUndoCommand *parent = 0);
RevertCommand (IdTable& model, const std::string& id, QUndoCommand *parent = nullptr);
virtual ~RevertCommand();
@ -231,7 +231,7 @@ namespace CSMWorld
public:
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();
@ -259,7 +259,7 @@ namespace CSMWorld
{
public:
CreatePathgridCommand(IdTable& model, const std::string& id, QUndoCommand *parent = 0);
CreatePathgridCommand(IdTable& model, const std::string& id, QUndoCommand *parent = nullptr);
void redo() override;
};
@ -279,7 +279,7 @@ namespace CSMWorld
public:
UpdateCellCommand (IdTable& model, int row, QUndoCommand *parent = 0);
UpdateCellCommand (IdTable& model, int row, QUndoCommand *parent = nullptr);
void redo() override;
@ -316,7 +316,7 @@ namespace CSMWorld
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;
@ -338,7 +338,7 @@ namespace CSMWorld
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;

@ -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,
const std::vector<std::string>& archives, const boost::filesystem::path& resDir)
: mEncoder (encoding), mPathgrids (mCells), mRefs (mCells),
mReader (0), mDialogue (0), mReaderIndex(1),
mReader (nullptr), mDialogue (nullptr), mReaderIndex(1),
mFsStrict(fsStrict), mDataPaths(dataPaths), mArchives(archives)
{
mVFS.reset(new VFS::Manager(mFsStrict));
@ -916,7 +916,7 @@ const CSMWorld::MetaData& CSMWorld::Data::getMetaData() const
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);
}
@ -932,7 +932,7 @@ QAbstractItemModel *CSMWorld::Data::getTableModel (const CSMWorld::UniversalId&
// construction of the ESX data where no update signals are available.
if (id.getType()==UniversalId::Type_RegionMap)
{
RegionMap *table = 0;
RegionMap *table = nullptr;
addModel (table = new RegionMap (*this), UniversalId::Type_RegionMap, false);
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
std::shared_ptr<ESM::ESMReader> ptr(mReader);
mReaders.push_back(ptr);
mReader = 0;
mReader = nullptr;
mDialogue = 0;
mDialogue = nullptr;
mReader = new ESM::ESMReader;
mReader->setEncoder (&mEncoder);
@ -982,7 +982,7 @@ int CSMWorld::Data::startLoading (const boost::filesystem::path& path, bool base
metaData.mId = "sys::meta";
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
@ -1064,9 +1064,9 @@ bool CSMWorld::Data::continueLoading (CSMDoc::Messages& messages)
else
delete mReader;
mReader = 0;
mReader = nullptr;
mDialogue = 0;
mDialogue = nullptr;
loadFallbackEntries();
@ -1151,7 +1151,7 @@ bool CSMWorld::Data::continueLoading (CSMDoc::Messages& messages)
if (isDeleted)
{
// record vector can be shuffled around which would make pointer to record invalid
mDialogue = 0;
mDialogue = nullptr;
if (mJournals.tryDelete (record.mId))
{

@ -35,7 +35,7 @@ namespace CSMWorld
public:
IdTableProxyModel (QObject *parent = 0);
IdTableProxyModel (QObject *parent = nullptr);
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.
public:
InfoTableProxyModel(UniversalId::Type type, QObject *parent = 0);
InfoTableProxyModel(UniversalId::Type type, QObject *parent = nullptr);
void setSourceModel(QAbstractItemModel *sourceModel) override;

@ -87,7 +87,7 @@ namespace CSMWorld
template <typename ESXRecordT>
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>

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

@ -25,9 +25,9 @@ namespace CSMWorld
/// \param type Type of resources in this table.
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;

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

@ -18,7 +18,7 @@
#include "adjusterwidget.hpp"
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);
resize(400, 400);

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

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

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

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

@ -17,7 +17,7 @@ void CSVDoc::LoadingDocument::closeEvent (QCloseEvent *event)
}
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()));

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

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

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

@ -30,7 +30,7 @@ namespace CSVFilter
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,
Qt::DropAction action);

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

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

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

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

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

@ -30,7 +30,7 @@ namespace CSVRender
public:
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;

@ -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)
: 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)
{
connect(this, SIGNAL(requestFocus(const std::string&)),
@ -169,14 +169,14 @@ void CSVRender::InstanceMode::deactivate (CSVWidget::SceneToolbar *toolbar)
{
toolbar->removeTool (mSelectionMode);
delete mSelectionMode;
mSelectionMode = 0;
mSelectionMode = nullptr;
}
if (mSubMode)
{
toolbar->removeTool (mSubMode);
delete mSubMode;
mSubMode = 0;
mSubMode = nullptr;
}
EditMode::deactivate (toolbar);

@ -62,7 +62,7 @@ namespace CSVRender
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;

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

@ -16,7 +16,7 @@ namespace CSVRender
{
public:
Lighting() : mRootNode(0) {}
Lighting() : mRootNode(nullptr) {}
virtual ~Lighting();
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,
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)
{
mRootNode = new osg::PositionAttitudeTransform;

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

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

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

@ -27,7 +27,7 @@ namespace CSVRender
getTooltip(), parent)
, mDragMode(DragMode_None)
, mFromNode(0)
, mSelectionMode(0)
, mSelectionMode(nullptr)
{
}
@ -59,7 +59,7 @@ namespace CSVRender
{
toolbar->removeTool (mSelectionMode);
delete mSelectionMode;
mSelectionMode = 0;
mSelectionMode = nullptr;
}
}
@ -214,7 +214,7 @@ namespace CSVRender
Cell* cell = getWorldspaceWidget().getCell(hit.worldPos);
if (cell && cell->getPathgrid())
{
PathgridTag* tag = 0;
PathgridTag* tag = nullptr;
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));

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

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

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

@ -99,7 +99,7 @@ void CSVRender::TerrainShapeMode::primaryOpenPressed (const WorldspaceHitResult&
void CSVRender::TerrainShapeMode::primaryEditPressed(const WorldspaceHitResult& hit)
{
if (hit.hit && hit.tag == 0)
if (hit.hit && hit.tag == nullptr)
{
if (mShapeEditTool == ShapeEditTool_Flatten)
setFlattenToolTargetHeight(hit);
@ -124,7 +124,7 @@ void CSVRender::TerrainShapeMode::primaryEditPressed(const WorldspaceHitResult&
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);
}
@ -132,7 +132,7 @@ void CSVRender::TerrainShapeMode::primarySelectPressed(const WorldspaceHitResult
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);
}
@ -144,7 +144,7 @@ bool CSVRender::TerrainShapeMode::primaryEditStartDrag (const QPoint& pos)
mDragMode = InteractionType_PrimaryEdit;
if (hit.hit && hit.tag == 0)
if (hit.hit && hit.tag == nullptr)
{
mEditingPos = hit.worldPos;
mIsEditing = true;
@ -164,7 +164,7 @@ bool CSVRender::TerrainShapeMode::primarySelectStartDrag (const QPoint& pos)
{
WorldspaceHitResult hit = getWorldspaceWidget().mousePick (pos, getWorldspaceWidget().getInteractionMask());
mDragMode = InteractionType_PrimarySelect;
if (!hit.hit || hit.tag != 0)
if (!hit.hit || hit.tag != nullptr)
{
mDragMode = InteractionType_None;
return false;
@ -177,7 +177,7 @@ bool CSVRender::TerrainShapeMode::secondarySelectStartDrag (const QPoint& pos)
{
WorldspaceHitResult hit = getWorldspaceWidget().mousePick (pos, getWorldspaceWidget().getInteractionMask());
mDragMode = InteractionType_SecondarySelect;
if (!hit.hit || hit.tag != 0)
if (!hit.hit || hit.tag != nullptr)
{
mDragMode = InteractionType_None;
return false;
@ -202,13 +202,13 @@ void CSVRender::TerrainShapeMode::drag (const QPoint& pos, int diffX, int diffY,
if (mDragMode == InteractionType_PrimarySelect)
{
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)
{
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();
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");
if(allowLandTextureEditing(mCellId))
@ -133,7 +133,7 @@ void CSVRender::TerrainTextureMode::primaryEditPressed(const WorldspaceHitResult
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);
}
@ -141,7 +141,7 @@ void CSVRender::TerrainTextureMode::primarySelectPressed(const WorldspaceHitResu
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);
}
@ -166,7 +166,7 @@ bool CSVRender::TerrainTextureMode::primaryEditStartDrag (const QPoint& pos)
CSMWorld::IdCollection<CSMWorld::LandTexture>& landtexturesCollection = document.getData().getLandTextures();
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");
mIsEditing = true;
@ -189,7 +189,7 @@ bool CSVRender::TerrainTextureMode::primarySelectStartDrag (const QPoint& pos)
{
WorldspaceHitResult hit = getWorldspaceWidget().mousePick (pos, getWorldspaceWidget().getInteractionMask());
mDragMode = InteractionType_PrimarySelect;
if (!hit.hit || hit.tag != 0)
if (!hit.hit || hit.tag != nullptr)
{
mDragMode = InteractionType_None;
return false;
@ -202,7 +202,7 @@ bool CSVRender::TerrainTextureMode::secondarySelectStartDrag (const QPoint& pos)
{
WorldspaceHitResult hit = getWorldspaceWidget().mousePick (pos, getWorldspaceWidget().getInteractionMask());
mDragMode = InteractionType_SecondarySelect;
if (!hit.hit || hit.tag != 0)
if (!hit.hit || hit.tag != nullptr)
{
mDragMode = InteractionType_None;
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();
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);
}
@ -231,13 +231,13 @@ void CSVRender::TerrainTextureMode::drag (const QPoint& pos, int diffX, int diff
if (mDragMode == InteractionType_PrimarySelect)
{
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)
{
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)
: SceneWidget (document.getData().getResourceSystem(), parent, Qt::WindowFlags(), false)
, mSceneElements(0)
, mRun(0)
, mSceneElements(nullptr)
, mRun(nullptr)
, mDocument(document)
, mInteractionMask (0)
, mEditMode (0)
, mEditMode (nullptr)
, mLocked (false)
, mDragMode(InteractionType_None)
, mDragging (false)
@ -435,7 +435,7 @@ CSVRender::WorldspaceHitResult CSVRender::WorldspaceWidget::mousePick (const QPo
}
// 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)
{
hit.index0 = intersection.indexList[0];
@ -449,7 +449,7 @@ CSVRender::WorldspaceHitResult CSVRender::WorldspaceWidget::mousePick (const QPo
direction.normalize();
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;
}

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

@ -27,7 +27,7 @@ void CSVTools::Merge::keyPressEvent (QKeyEvent *event)
}
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");
@ -117,7 +117,7 @@ CSMDoc::Document *CSVTools::Merge::getDocument() const
void CSVTools::Merge::cancel()
{
mDocument = 0;
mDocument = nullptr;
hide();
}

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

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

@ -62,7 +62,7 @@ namespace CSVTools
/// 0 no refresh function exists. If the document current has the specified state
/// the refresh function is disabled.
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;

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

@ -30,7 +30,7 @@ void CSVTools::SearchSubView::replace (bool selection)
bool autoDelete = CSMPrefs::get()["Search & Replace"]["auto-delete"].isTrue();
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
// in a single string.

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

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

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

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

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

@ -23,11 +23,11 @@ namespace CSVWidget
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
/// insert tool after \a insertPoint.
void addTool (SceneTool *tool, SceneTool *insertPoint = 0);
void addTool (SceneTool *tool, SceneTool *insertPoint = nullptr);
void removeTool (SceneTool *tool);

@ -33,7 +33,7 @@ void CSVWidget::SceneToolMode::adjustToolTip (const ModeButton *activeMode)
toolTip += "<p>(left click to change mode)";
if (createContextMenu (0))
if (createContextMenu (nullptr))
toolTip += "<br>(right click to access context menu)";
setToolTip (toolTip);
@ -62,7 +62,7 @@ void CSVWidget::SceneToolMode::setButton (std::map<ModeButton *, std::string>::i
CSVWidget::SceneToolMode::SceneToolMode (SceneToolbar *parent, const QString& toolTip)
: 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);

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

@ -57,7 +57,7 @@ namespace CSVWidget
Q_OBJECT
public:
TextureBrushWindow(CSMDoc::Document& document, QWidget *parent = 0);
TextureBrushWindow(CSMDoc::Document& document, QWidget *parent = nullptr);
void configureButtonInitialSettings(QPushButton *button);
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,
const std::string& emptyIcon)
: 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);

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

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

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

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

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

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

@ -57,7 +57,7 @@ namespace CSVWorld
public:
ExtendedCommandConfigurator(CSMDoc::Document &document,
const CSMWorld::UniversalId &id,
QWidget *parent = 0);
QWidget *parent = nullptr);
void configure(Mode mode, const std::vector<std::string> &selectedIds);
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,
const CSMWorld::UniversalId& id, bool relaxedIdRules)
: mData (data), mUndoStack (undoStack), mListId (id), mLocked (false),
mClonedType (CSMWorld::UniversalId::Type_None), mScopes (CSMWorld::Scope_Content), mScope (0),
mScopeLabel (0), mCloneMode (false)
mClonedType (CSMWorld::UniversalId::Type_None), mScopes (CSMWorld::Scope_Content), mScope (nullptr),
mScopeLabel (nullptr), mCloneMode (false)
{
// 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)
@ -322,10 +322,10 @@ void CSVWorld::GenericCreator::setScope (unsigned int scope)
else
{
delete mScope;
mScope = 0;
mScope = nullptr;
delete mScopeLabel;
mScopeLabel = 0;
mScopeLabel = nullptr;
}
updateNamespace();

@ -74,7 +74,7 @@ QWidget *CSVWorld::IdCompletionDelegate::createEditor(QWidget *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:
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
State validate (QString& input, int& pos) const override;

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

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

@ -61,7 +61,7 @@ namespace CSVWorld
public:
RegionMap (const CSMWorld::UniversalId& universalId, CSMDoc::Document& document,
QWidget *parent = 0);
QWidget *parent = nullptr);
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