From 7779e2fd368470e53ba93b8cc6e2cfc07926c4f0 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sat, 9 Apr 2022 10:22:45 -0700 Subject: [PATCH] gvedit: standardize on more modern 'nullptr' --- cmd/gvedit/csettings.cpp | 10 +++++----- cmd/gvedit/imageviewer.cpp | 2 +- cmd/gvedit/main.cpp | 2 +- cmd/gvedit/mainwindow.cpp | 10 +++++----- cmd/gvedit/mainwindow.h | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/cmd/gvedit/csettings.cpp b/cmd/gvedit/csettings.cpp index e1f8746ab..7bfcc39d5 100644 --- a/cmd/gvedit/csettings.cpp +++ b/cmd/gvedit/csettings.cpp @@ -113,8 +113,8 @@ CFrmSettings::CFrmSettings() this->gvc = gvContext(); Ui_Dialog tempDia; tempDia.setupUi(this); - graph = NULL; - activeWindow = NULL; + graph = nullptr; + activeWindow = nullptr; QString path; #ifndef _WIN32 char *s = getenv("GVEDIT_PATH"); @@ -301,7 +301,7 @@ bool CFrmSettings::loadGraph(MdiChild * m) { if (graph) { agclose(graph); - graph = NULL; + graph = nullptr; } graphData.clear(); graphData.append(m->toPlainText()); @@ -332,7 +332,7 @@ bool CFrmSettings::createLayout() return false; if (agerrors()) { agclose(graph); - graph = NULL; + graph = nullptr; return false; } Agraph_t *G = this->graph; @@ -360,7 +360,7 @@ void CFrmSettings::doPreview(QString fileName) if (getActiveWindow()->previewFrm != nullptr) { getActiveWindow()->parentFrm->mdiArea-> removeSubWindow(getActiveWindow()->previewFrm->subWindowRef); - getActiveWindow()->previewFrm = NULL; + getActiveWindow()->previewFrm = nullptr; } if ((fileName.isNull()) || !(getActiveWindow()->loadPreview(fileName))) { //create preview diff --git a/cmd/gvedit/imageviewer.cpp b/cmd/gvedit/imageviewer.cpp index 434826892..e8ef3a60f 100644 --- a/cmd/gvedit/imageviewer.cpp +++ b/cmd/gvedit/imageviewer.cpp @@ -198,7 +198,7 @@ void ImageViewer::adjustScrollBar(QScrollBar * scrollBar, double factor) void ImageViewer::closeEvent(QCloseEvent * event) { - this->graphWindow->previewFrm = NULL; + this->graphWindow->previewFrm = nullptr; event->accept(); } diff --git a/cmd/gvedit/main.cpp b/cmd/gvedit/main.cpp index 5bd608fb9..bcb6498ff 100644 --- a/cmd/gvedit/main.cpp +++ b/cmd/gvedit/main.cpp @@ -77,7 +77,7 @@ static char **parseArgs(int argc, char *argv[]) if (argc) return argv; else - return NULL; + return nullptr; } int main(int argc, char *argv[]) diff --git a/cmd/gvedit/mainwindow.cpp b/cmd/gvedit/mainwindow.cpp index 9a4ce981d..b36656dab 100644 --- a/cmd/gvedit/mainwindow.cpp +++ b/cmd/gvedit/mainwindow.cpp @@ -36,7 +36,7 @@ static int LoadPlugins(QComboBox * cb, GVC_t * gvc, const char *kind, const char *more[], const char *prefer) { int count; - char **lp = gvPluginList(gvc, kind, &count, NULL); + char **lp = gvPluginList(gvc, kind, &count, nullptr); int idx = -1; cb->clear(); @@ -66,7 +66,7 @@ static int LoadPlugins(QComboBox * cb, GVC_t * gvc, const char *kind, void CMainWindow::createConsole() { - QDockWidget *dock = new QDockWidget(tr("Output Console"), NULL); + QDockWidget *dock = new QDockWidget(tr("Output Console"), nullptr); QTextEdit *textEdit = new QTextEdit(dock); dock-> @@ -111,7 +111,7 @@ void CMainWindow::createConsole() static const char *xtra[] = { "NONE", - (const char *) NULL + nullptr }; CMainWindow::CMainWindow(char*** Files) @@ -131,7 +131,7 @@ CMainWindow::CMainWindow(char*** Files) verticalLayout_2->addLayout(verticalLayout); setCentralWidget(centralwidget); centralwidget->layout()->setContentsMargins(1, 1, 1, 1); - prevChild = NULL; + prevChild = nullptr; createConsole(); @@ -157,7 +157,7 @@ CMainWindow::CMainWindow(char*** Files) setUnifiedTitleAndToolBarOnMac(true); QComboBox *cb = (QComboBox *) frmSettings->findChild < QComboBox * >("cbLayout"); - dfltLayoutIdx = LoadPlugins(cb, frmSettings->gvc, "layout", NULL, "dot"); + dfltLayoutIdx = LoadPlugins(cb, frmSettings->gvc, "layout", nullptr, "dot"); cb = (QComboBox *) frmSettings->findChild < QComboBox * >("cbExtension"); dfltRenderIdx = diff --git a/cmd/gvedit/mainwindow.h b/cmd/gvedit/mainwindow.h index af47c0d15..fc3202516 100644 --- a/cmd/gvedit/mainwindow.h +++ b/cmd/gvedit/mainwindow.h @@ -37,13 +37,13 @@ class CMainWindow : public QMainWindow Q_OBJECT public: - CMainWindow(char*** Files=NULL); + CMainWindow(char*** Files = nullptr); QMdiArea *mdiArea; void addFile (QString fileName); std::vector initFiles; private slots: void slotSettings(); - void slotRun(MdiChild * m=NULL); + void slotRun(MdiChild* m = nullptr); void slotNew(); void slotOpen(); void slotSave(); -- 2.40.0