Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit ff5883b8 authored by Emmanuel Promayon's avatar Emmanuel Promayon
Browse files

UPDATED modernize use nullptr instead of NULL

parent f2ce04d0
......@@ -67,7 +67,7 @@ QStringList ItkImageComponentExtension::getFileExtensions() const {
// --------------- open -------------------
Component* ItkImageComponentExtension::open(const QString& fileName) throw (AbortException) {
ItkImageComponent* res = NULL;
ItkImageComponent* res = nullptr;
try {
res = new ItkImageComponent(fileName);
}
......
......@@ -76,7 +76,7 @@ Action::ApplyStatus GenerateModel::apply() {
QString originalFilename = targetMesh->getFileName();
if ( originalFilename.isEmpty() ) {
// ask the user
originalFilename = QFileDialog::getSaveFileName( NULL, "Generate Model", "", "ModelingML (*.mml)" );
originalFilename = QFileDialog::getSaveFileName( nullptr, "Generate Model", "", "ModelingML (*.mml)" );
if ( originalFilename.isNull() ) {
QApplication::restoreOverrideCursor();
CAMITK_WARNING(tr("Filename required. Action Aborted."))
......
......@@ -65,17 +65,17 @@ PMLExplorerWidget::PMLExplorerWidget ( PMLComponent* comp ) : QWidget() {
QObject::connect ( ui->addButton, SIGNAL ( clicked() ), this, SLOT ( createNewProperty() ) );
QObject::connect ( ui->showAtomGlyphCB, SIGNAL ( toggled ( bool ) ), this, SLOT ( showAtomGlyphToggled ( bool ) ) );
physicalModelItem = NULL;
atomsItem = NULL;
exclusiveComponentItem = NULL;
informativeComponentItem = NULL;
physicalModelItem = nullptr;
atomsItem = nullptr;
exclusiveComponentItem = nullptr;
informativeComponentItem = nullptr;
init ( comp );
}
// --------------- Destructor -------------------
PMLExplorerWidget::~PMLExplorerWidget() {
delete objectController;
objectController = NULL;
objectController = nullptr;
foreach ( QObject * o, widgetPropertiesMap ) {
delete o;
......@@ -91,7 +91,7 @@ void PMLExplorerWidget::buildPhysicalModelTreeWidgetItem() {
// This can't take time on big PML file
QApplication::setOverrideCursor ( Qt::WaitCursor );
editedItem = NULL;
editedItem = nullptr;
// create the main PhysicalModel node
physicalModelItem = new QTreeWidgetItem ( ui->treeWidget );
......@@ -255,7 +255,7 @@ void PMLExplorerWidget::selectItems() {
// --------------- updateTarget -------------------
void PMLExplorerWidget::updateTarget ( PMLComponent* comp ) {
editedItem = NULL;
editedItem = nullptr;
objectController->setObject ( NULL );
// Disconnect the selection changed signal, avoiding
// vicious bugs (Qt slots thread may call signal method while
......@@ -277,10 +277,10 @@ void PMLExplorerWidget::updateTarget ( PMLComponent* comp ) {
// Clear the tree content (remove items and delete them)
ui->treeWidget->clear();
physicalModelItem = NULL;
atomsItem = NULL;
exclusiveComponentItem = NULL;
informativeComponentItem = NULL;
physicalModelItem = nullptr;
atomsItem = nullptr;
exclusiveComponentItem = nullptr;
informativeComponentItem = nullptr;
init ( comp );
}
......@@ -360,7 +360,7 @@ void PMLExplorerWidget::updateProperty ( QTreeWidgetItem* item ) {
itemProperties = pmlComponent;
}
else {
editedItem = NULL;
editedItem = nullptr;
}
}
// update the ObjectController
......@@ -371,7 +371,7 @@ void PMLExplorerWidget::updateProperty ( QTreeWidgetItem* item ) {
// --------------- createNewProperty -------------------
void PMLExplorerWidget::createNewProperty() {
if ( editedItem != NULL ) {
if ( editedItem != nullptr ) {
QDialog* newPropertyDialog = new QDialog ( this );
Ui::ui_AddNewPropertyWidget addNewPropertyUI;
addNewPropertyUI.setupUi ( newPropertyDialog );
......
......@@ -101,12 +101,12 @@ MMLComponent::MMLComponent(const QString& fileName) throw(AbortException) : Comp
else {
if (display) {
delete display;
display = NULL;
display = nullptr;
}
if (mmlGUI) {
delete mmlGUI;
mmlGUI = NULL;
mmlGUI = nullptr;
}
throw AbortException("Cannot open " + myFileName.toStdString() + "\nThe given simulator is probably not supported");
}
......@@ -120,17 +120,17 @@ MMLComponent::MMLComponent(const QString& fileName) throw(AbortException) : Comp
MMLComponent::~MMLComponent() {
if (pmlComponent) {
delete pmlComponent;
pmlComponent = NULL;
pmlComponent = nullptr;
}
if (display) {
delete display;
display = NULL;
display = nullptr;
}
if (mmlGUI) {
delete mmlGUI;
mmlGUI = NULL;
mmlGUI = nullptr;
}
}
......@@ -168,7 +168,7 @@ MMLDisplay* MMLComponent::getDisplay() {
void MMLComponent::connectPml() {
removeChild(pmlComponent);
delete pmlComponent;
pmlComponent = NULL;
pmlComponent = nullptr;
deleteChildren();
refreshInterfaceNode();
// this gives the ownership of pml pointer to the PML Component, use takePml() not getPml()
......
......@@ -53,7 +53,7 @@ MMLDisplay::MMLDisplay( MMLComponent* mmlManager ): QObject() {
connect( qobj, SIGNAL( changed() ), this, SLOT( updateDisplay() ) );
connect( qobj2, SIGNAL( monitorsChanged() ), this, SLOT( updateMonitorsTable() ) );
connect( qobj, SIGNAL( reconnectPml() ), this, SLOT( connectPml() ) );
monitorDisplay = NULL;
monitorDisplay = nullptr;
// add two column in monitors table for displaying monitors
QTableWidget* table = mmlManager->getMonitoringGuiManager()->getDialog()->getMonitorsTableWidget();
......@@ -156,7 +156,7 @@ Monitor* MMLDisplay::getDisplayedMonitor() {
return mmlManager->getMonitoringGuiManager()->getMonitoringManager()->getMonitor( i );
}
}
return NULL;
return nullptr;
}
// -------------------- getDisplayedMonitorLine ---------------------
......
......@@ -25,7 +25,7 @@
#include "MMLMonitorDisplayFactory.h"
MMLMonitorDisplayFactory* MMLMonitorDisplayFactory::instance = NULL;
MMLMonitorDisplayFactory* MMLMonitorDisplayFactory::instance = nullptr;
MMLMonitorDisplayFactory::MMLMonitorDisplayFactory() {}
......@@ -38,7 +38,7 @@ bool MMLMonitorDisplayFactory::isRegistered(std::string id) {
MMLMonitorDisplay* MMLMonitorDisplayFactory::createMonitorDisplay(std::string id, Monitor* monitor, MMLComponent* manager) {
std::map<std::string, CreateMonitorDisplayFunctionPointer>::iterator iter = mapObjectCreator.find(id);
if (iter == mapObjectCreator.end()) {
return NULL;
return nullptr;
}
return ((*iter).second)(monitor, manager);
}
......
......@@ -46,7 +46,7 @@ Statistics::Statistics(Monitor* monitor, MMLComponent* manager): MMLMonitorDispl
item->setText(("Statistics"));
t->setHorizontalHeaderItem(j, item);
table = new QTableWidget;
table->setEditTriggers(0);
table->setEditTriggers(nullptr);
t->setCellWidget(line, j, table);
}
......
......@@ -47,7 +47,7 @@ Tabular::Tabular(Monitor* monitor, MMLComponent* manager): MMLMonitorDisplay(mon
item->setText(("Tabular"));
t->setHorizontalHeaderItem(j, item);
table = new QTableWidget;
table->setEditTriggers(0);
table->setEditTriggers(nullptr);
t->setCellWidget(line, j, table);
table->installEventFilter(this);
}
......@@ -55,7 +55,7 @@ Tabular::Tabular(Monitor* monitor, MMLComponent* manager): MMLMonitorDisplay(mon
Tabular::~Tabular() {
if (table) {
delete table;
table = NULL;
table = nullptr;
}
}
......
......@@ -95,7 +95,7 @@ PMLComponent::~PMLComponent() {
atomPointIdMap.clear();
delete physicalModel;
physicalModel = NULL;
physicalModel = nullptr;
}
//-------------------- init -------------------
......@@ -575,7 +575,7 @@ int PMLComponent::addSelection(const QString& name, int fieldType, int contentTy
//------------------------ getPixmap ---------------------
#include "physicalmodel_20x20.xpm"
QPixmap* PMLComponent::myPixmap = NULL;
QPixmap* PMLComponent::myPixmap = nullptr;
QPixmap PMLComponent::getIcon() {
if (!myPixmap) {
myPixmap = new QPixmap(physicalmodel_20x20);
......
......@@ -37,7 +37,7 @@
//--------- static factory -------------
Load* Load::LoadFactory(std::string type) {
Load* newOne = NULL;
Load* newOne = nullptr;
// instanciate depending on the load type
if (type == "Translation") {
......@@ -259,7 +259,7 @@ ValueEvent* Load::getValueEvent(const unsigned int i) const {
return eventList[i];
}
else {
return NULL;
return nullptr;
}
}
......
......@@ -251,7 +251,7 @@ Load* Loads::getLoad (const unsigned int i) const {
return loads[i];
}
else {
return NULL;
return nullptr;
}
}
......
......@@ -47,7 +47,7 @@ public:
* constructor
* @param m the xsdcxx generated MultipleCriterion
*/
AndMultipleCriterion(mml::MultipleCriteria* m, MonitoringManager* monitoringManager, MultipleCriterion* parent = NULL);
AndMultipleCriterion(mml::MultipleCriteria* m, MonitoringManager* monitoringManager, MultipleCriterion* parent = nullptr);
/// destructor
~AndMultipleCriterion() override;
......
......@@ -67,7 +67,7 @@ void Criterion::write() {
// -------------------- getChild --------------------
StoppingCriterion* Criterion::getChild(const unsigned int i) {
return NULL;
return nullptr;
}
// -------------------- getNumberOfChildren --------------------
......
......@@ -50,7 +50,7 @@ public:
* constructor
*@param c the xsdcxx generated criterion
*/
Criterion(mml::Criteria* c, MonitoringManager* monitoringManager, MultipleCriterion* parent = NULL);
Criterion(mml::Criteria* c, MonitoringManager* monitoringManager, MultipleCriterion* parent = nullptr);
/// destructor
~Criterion() override;
......
......@@ -48,7 +48,7 @@ public:
~CriterionFactory();
/// create a criterion according to the xsdcxx object criterion
static Criterion* createCriterion(mml::Criteria* c, MonitoringManager* monitoringManager, MultipleCriterion* parent = NULL);
static Criterion* createCriterion(mml::Criteria* c, MonitoringManager* monitoringManager, MultipleCriterion* parent = nullptr);
private:
/// constructor
......
......@@ -45,7 +45,7 @@ public:
* constructor
*@param c the xsdcxx generated Force criterion
*/
ForceCriterion(mml::Force* c, MonitoringManager* monitoringManager, MultipleCriterion* parent = NULL);
ForceCriterion(mml::Force* c, MonitoringManager* monitoringManager, MultipleCriterion* parent = nullptr);
/// destructor
~ForceCriterion() override;
......
......@@ -43,7 +43,7 @@ InteractiveMonitoringManager::InteractiveMonitoringManager(const char* mml): Mon
stop = StoppingCriterionFactory::createStoppingCriterion(s, this);
}
else {
stop = NULL;
stop = nullptr;
}
}
......
......@@ -44,7 +44,7 @@ public:
* constructor
*@param c the xsdcxx generated KineticEnergy criterion
*/
kineticEnergy(mml::KineticEnergy* c, MonitoringManager* monitoringManager, MultipleCriterion* parent = NULL);
kineticEnergy(mml::KineticEnergy* c, MonitoringManager* monitoringManager, MultipleCriterion* parent = nullptr);
/// destructor
~kineticEnergy() override;
......
......@@ -57,5 +57,5 @@ MonitoringManager* MonitoringManagerFactory::createManager(const char* mml) {
else {
std::cerr << "MonitoringManagerFactory: Simulator " << sim << " not registered" << std::endl;
}
return NULL;
return nullptr;
}
......@@ -65,7 +65,7 @@ StoppingCriterion* MultipleCriterion::getChild(const unsigned int i) {
return criterias[i];
}
else {
return NULL;
return nullptr;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment