Commit b03382d5 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use nullptr

parent 607e6db6
......@@ -79,7 +79,7 @@ QVariant SensorBrowserModel::data( const QModelIndex & index, int role) const {
if(index.column() == 0) {
HostInfo *host = getHostInfo(index.internalId());
KSGRD::SensorAgent *agent;
if(host != NULL && (agent = host->sensorAgent())) {
if(host != nullptr && (agent = host->sensorAgent())) {
if(agent->daemonOnLine())
return QIcon::fromTheme(QStringLiteral("computer"));
else
......@@ -94,7 +94,7 @@ QVariant SensorBrowserModel::data( const QModelIndex & index, int role) const {
if(index.column() == 0) {
HostInfo *host = getHostInfo(index.internalId());
KSGRD::SensorAgent *agent;
if(host != NULL && (agent = host->sensorAgent())) {
if(host != nullptr && (agent = host->sensorAgent())) {
if(agent->daemonOnLine())
return agent->hostName();
else
......@@ -177,7 +177,7 @@ QStringList SensorBrowserModel::listSensors( int parentId) const
}
SensorInfo *SensorBrowserModel::getSensorInfo(QModelIndex index) const
{
if(!index.isValid()) return NULL;
if(!index.isValid()) return nullptr;
return mSensorInfoMap.value(index.internalId());
}
int SensorBrowserModel::makeSensor(HostInfo *hostInfo, int parentId, const QString &sensorName, const QString &name, const QString &sensorType) {
......@@ -518,13 +518,13 @@ void SensorBrowserModel::disconnectHost(const HostInfo *hostInfo)
void SensorBrowserModel::disconnectHost(const QString &hostname)
{
HostInfo* toDelete = findHostInfoByHostName(hostname);
if (toDelete != NULL)
if (toDelete != nullptr)
disconnectHost(toDelete);
}
HostInfo* SensorBrowserModel::findHostInfoByHostName(const QString &hostName) const {
HostInfo* toReturn = NULL;
HostInfo* toReturn = nullptr;
QMapIterator<int, HostInfo*> it( mHostInfoMap );
while (it.hasNext() && toReturn == NULL) {
while (it.hasNext() && toReturn == nullptr) {
it.next();
if (it.value()->hostName() == hostName) {
toReturn = it.value();
......@@ -539,7 +539,7 @@ void SensorBrowserModel::hostAdded(KSGRD::SensorAgent *sensorAgent, const QStrin
void SensorBrowserModel::hostRemoved(const QString &hostName) {
HostInfo* toRemove = findHostInfoByHostName(hostName);
if (toRemove != NULL) {
if (toRemove != nullptr) {
beginResetModel();
int hostId = toRemove->id();
removeAllSensorUnderBranch(toRemove,hostId);
......
......@@ -77,7 +77,7 @@ class FancyPlotterLabel : public QLabel {
void setValueText(const QString &value) {
//value can have multiple strings, separated with the 0x9c character
valueText = value.split(QChar(0x9c));
resizeEvent(NULL);
resizeEvent(nullptr);
update();
}
void resizeEvent( QResizeEvent * ) Q_DECL_OVERRIDE {
......@@ -160,7 +160,7 @@ FancyPlotter::FancyPlotter( QWidget* parent,
mSensorManualMax = mSensorManualMin = 0;
mUseManualRange = false;
mNumAnswers = 0;
mLabelsWidget = NULL;
mLabelsWidget = nullptr;
//The unicode character 0x25CF is a big filled in circle. We would prefer to use this in the tooltip.
//However it's maybe possible that the font used to draw the tooltip won't have it. So we fall back to a
......@@ -264,7 +264,7 @@ void FancyPlotter::configureSettings()
bool hasIntegerRange = true;
SensorModelEntry::List list;
for ( int i = 0; i < (int)mBeams; ++i ) {
FPSensorProperties *sensor = NULL;
FPSensorProperties *sensor = nullptr;
//find the first sensor for this beam, since one beam can have many sensors
for ( int j = 0; j < sensors().count(); ++j ) {
FPSensorProperties *sensor2 = static_cast<FPSensorProperties *>(sensors().at(j));
......
......@@ -142,11 +142,11 @@ void ListView::showColumnContextMenu(const QPoint &point)
}
}*/
QAction *actionAuto = NULL;
QAction *actionKB = NULL;
QAction *actionMB = NULL;
QAction *actionGB = NULL;
QAction *actionTB = NULL;
QAction *actionAuto = nullptr;
QAction *actionKB = nullptr;
QAction *actionMB = nullptr;
QAction *actionGB = nullptr;
QAction *actionTB = nullptr;
if (mColumnTypes[index] == KByte) {
menu->addSeparator()->setText(i18n("Display Units"));
QActionGroup *unitsGroup = new QActionGroup(menu);
......
......@@ -45,7 +45,7 @@ LogFile::LogFile(QWidget *parent, const QString& title, SharedSettings *workShee
{
qDebug() << "Making sensor logger";
logFileID= 0;
lfs = NULL;
lfs = nullptr;
QLayout *layout = new QHBoxLayout(this);
monitor = new QListWidget(this);
layout->addWidget(monitor);
......
......@@ -38,8 +38,8 @@
ProcessController::ProcessController(QWidget* parent, SharedSettings *workSheetSettings)
: KSGRD::SensorDisplay(parent, QString(), workSheetSettings)
{
mProcessList = NULL;
mProcesses = NULL;
mProcessList = nullptr;
mProcesses = nullptr;
}
void
......
......@@ -353,7 +353,7 @@ KSGRD::SensorDisplay* WorkSheet::insertDisplay( DisplayType displayType, QString
break;
default:
Q_ASSERT(false);
return NULL;
return nullptr;
}
newDisplay->applyStyle();
connect(&mTimer, &QTimer::timeout, newDisplay, &KSGRD::SensorDisplay::timerTick);
......@@ -748,7 +748,7 @@ KSGRD::SensorDisplay *WorkSheet::currentDisplay( int * row, int * column )
}
}
return NULL;
return nullptr;
}
void WorkSheet::fixTabOrder()
......
......@@ -75,11 +75,11 @@ static const char Description[] = I18N_NOOP( "KDE System Monitor" );
TopLevel* Toplevel;
TopLevel::TopLevel()
: KXmlGuiWindow( NULL, Qt::WindowFlags(KDE_DEFAULT_WINDOWFLAGS) | Qt::WindowContextHelpButtonHint)
: KXmlGuiWindow( nullptr, Qt::WindowFlags(KDE_DEFAULT_WINDOWFLAGS) | Qt::WindowContextHelpButtonHint)
{
QDBusConnection::sessionBus().registerObject(QStringLiteral("/"), this, QDBusConnection::ExportScriptableSlots);
mTimerId = -1;
mLocalProcessController = NULL;
mLocalProcessController = nullptr;
mSplitter = new QSplitter( this );
mSplitter->setOrientation( Qt::Horizontal );
......@@ -137,7 +137,7 @@ TopLevel::TopLevel()
mHotNewWorksheetUploadAction->setIcon( QIcon::fromTheme(QStringLiteral("network-server")) );
connect(mHotNewWorksheetUploadAction, &QAction::triggered, mWorkSpace, &Workspace::uploadHotNewWorksheet);
mQuitAction = NULL;
mQuitAction = nullptr;
mConfigureSheetAction = actionCollection()->addAction( QStringLiteral("configure_sheet") );
mConfigureSheetAction->setIcon( QIcon::fromTheme(QStringLiteral("configure")) );
......@@ -170,7 +170,7 @@ void TopLevel::retranslateUi()
mConfigureSheetAction->setText( i18n( "Tab &Properties" ) );
if(mQuitAction) {
QAction *tmpQuitAction = KStandardAction::quit( NULL, NULL, NULL );
QAction *tmpQuitAction = KStandardAction::quit( nullptr, nullptr, nullptr );
mQuitAction->setText(tmpQuitAction->text());
mQuitAction->setWhatsThis(tmpQuitAction->whatsThis());
mQuitAction->setToolTip(tmpQuitAction->toolTip());
......
Supports Markdown
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