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

Fix warning

parent e1f61968
......@@ -37,7 +37,7 @@ class HostConnector : public QDialog
Q_OBJECT
public:
explicit HostConnector( QWidget *parent, const char *name = 0 );
explicit HostConnector( QWidget *parent, const char *name = nullptr );
~HostConnector();
void setHostNames( const QStringList &list );
......
......@@ -45,7 +45,7 @@ class SensorBrowserModel : public QAbstractItemModel, private KSGRD::SensorClien
Q_OBJECT
public:
SensorBrowserModel();
~SensorBrowserModel();
~SensorBrowserModel() Q_DECL_OVERRIDE;
int columnCount( const QModelIndex &) const Q_DECL_OVERRIDE;
QVariant data( const QModelIndex & parent, int role) const Q_DECL_OVERRIDE;
QVariant headerData ( int section, Qt::Orientation orientation, int role) const Q_DECL_OVERRIDE;
......
......@@ -34,7 +34,7 @@ class BarGraph : public QWidget
public:
explicit BarGraph( QWidget *parent );
~BarGraph();
~BarGraph() Q_DECL_OVERRIDE;
bool addBar( const QString &footer );
bool removeBar( uint idx );
......@@ -76,7 +76,7 @@ class BarGraph : public QWidget
double minValue;
double maxValue;
double lowerLimit;
double lowerLimitActive;
bool lowerLimitActive;
double upperLimit;
bool upperLimitActive;
bool autoRange;
......
......@@ -84,7 +84,7 @@ void DancingBars::configureSettings()
dlg.setFontSize( mPlotter->fontSize );
SensorModelEntry::List list;
for(uint i = 0; i < mBars; i++){
for(int i = 0; i < mBars; i++){
SensorModelEntry entry;
entry.setId( i );
entry.setHostName( sensors().at( i )->hostName() );
......@@ -154,7 +154,7 @@ bool DancingBars::addSensor( const QString &hostName, const QString &name,
mSampleBuffer.resize( mBars );
QString tooltip;
for ( uint i = 0; i < mBars; ++i ) {
for ( int i = 0; i < mBars; ++i ) {
tooltip += QStringLiteral( "%1%2:%3" ).arg( i != 0 ? QLatin1Literal("\n") : QString() )
.arg( sensors().at( i )->hostName() )
.arg( sensors().at( i )->name() );
......@@ -177,7 +177,7 @@ bool DancingBars::removeSensor( uint pos )
KSGRD::SensorDisplay::removeSensor( pos );
QString tooltip;
for ( uint i = 0; i < mBars; ++i ) {
for ( int i = 0; i < mBars; ++i ) {
tooltip += QStringLiteral( "%1%2:%3" ).arg( i != 0 ? QStringLiteral("\n") : QString() )
.arg( sensors().at( i )->hostName() )
.arg( sensors().at( i )->name() );
......@@ -214,7 +214,7 @@ void DancingBars::answerReceived( int id, const QList<QByteArray> &answerlist )
mFlags.setBit( id, true );
bool allBitsAvailable = true;
for ( uint i = 0; i < mBars; ++i )
for ( int i = 0; i < mBars; ++i )
allBitsAvailable &= mFlags.testBit( i );
if ( allBitsAvailable ) {
......@@ -286,7 +286,7 @@ bool DancingBars::saveSettings( QDomDocument &doc, QDomElement &element)
saveColor( element, QStringLiteral("backgroundColor"), mPlotter->mBackgroundColor );
element.setAttribute( QStringLiteral("fontSize"), mPlotter->fontSize );
for ( uint i = 0; i < mBars; ++i ) {
for ( int i = 0; i < mBars; ++i ) {
QDomElement beam = doc.createElement( QStringLiteral("beam") );
element.appendChild( beam );
beam.setAttribute( QStringLiteral("hostName"), sensors().at( i )->hostName() );
......
......@@ -59,7 +59,7 @@ class DancingBars : public KSGRD::SensorDisplay
void applyStyle() Q_DECL_OVERRIDE;
private:
uint mBars;
int mBars;
BarGraph* mPlotter;
......
......@@ -41,7 +41,7 @@ class DancingBarsSettings : public KPageDialog
Q_OBJECT
public:
explicit DancingBarsSettings( QWidget* parent = 0, const QString &name = QString() );
explicit DancingBarsSettings( QWidget* parent = nullptr, const QString &name = QString() );
~DancingBarsSettings();
void setTitle( const QString& title );
......
......@@ -32,7 +32,7 @@ class DummyDisplay : public KSGRD::SensorDisplay
public:
DummyDisplay( QWidget* parent, SharedSettings *workSheetSettings);
virtual ~DummyDisplay() {}
~DummyDisplay() Q_DECL_OVERRIDE {}
bool eventFilter( QObject*, QEvent* ) Q_DECL_OVERRIDE;
};
......
......@@ -60,7 +60,7 @@ class FancyPlotterLabel : public QLabel {
textMargin = 0;
setLayoutDirection(Qt::LeftToRight); //We do this because we organise the strings ourselves.. is this going to muck it up though for RTL languages?
}
~FancyPlotterLabel() {
~FancyPlotterLabel() Q_DECL_OVERRIDE {
}
void setLabel(const QString &name, const QColor &color) {
labelName = name;
......@@ -299,7 +299,7 @@ void FancyPlotter::settingsFinished()
applySettings();
mSettingsDialog->hide();
mSettingsDialog->deleteLater();
mSettingsDialog = 0;
mSettingsDialog = nullptr;
}
void FancyPlotter::applySettings() {
......
......@@ -64,7 +64,7 @@ class FancyPlotter : public KSGRD::SensorDisplay
public:
FancyPlotter( QWidget* parent, const QString& title, SharedSettings *workSheetSettings);
virtual ~FancyPlotter();
~FancyPlotter() Q_DECL_OVERRIDE;
void configureSettings() Q_DECL_OVERRIDE;
......
......@@ -40,7 +40,7 @@ class FancyPlotterSettings : public KPageDialog
Q_OBJECT
public:
FancyPlotterSettings( QWidget* parent, bool locked );
explicit FancyPlotterSettings( QWidget* parent, bool locked );
~FancyPlotterSettings();
void setTitle( const QString &title );
......
......@@ -357,7 +357,7 @@ ListView::restoreSettings(QDomElement& element)
//At this stage, we don't have the heading information, so we cannot setup the headers yet.
//Save the info, the restore later.
mHeaderSettings = QByteArray::fromBase64(element.attribute(QStringLiteral("treeViewHeader")).toLatin1());
mUnits = (ListView::Units)element.attribute(QStringLiteral("units"), QStringLiteral("0")).toInt();
mUnits = static_cast<ListView::Units>(element.attribute(QStringLiteral("units"), QStringLiteral("0")).toInt());
/* QPalette pal = monitor->palette();
pal.setColor(QPalette::Link, restoreColor(element, "gridColor",
......@@ -411,7 +411,7 @@ ListView::configureSettings()
applySettings();
delete lvs;
lvs = 0;
lvs = nullptr;
}
void
......
......@@ -22,7 +22,7 @@
#include <KLocalizedString>
ListViewSettings::ListViewSettings( QWidget *parent, const char *name )
ListViewSettings::ListViewSettings(QWidget *parent, const QString &name )
: QDialog( parent )
{
setObjectName( name );
......
......@@ -34,7 +34,7 @@ class ListViewSettings : public QDialog
public:
explicit ListViewSettings( QWidget *parent=0, const char *name=0 );
explicit ListViewSettings( QWidget *parent=nullptr, const QString &name=QString() );
~ListViewSettings();
QString title() const;
......
......@@ -37,7 +37,7 @@ class LogFile : public KSGRD::SensorDisplay
Q_OBJECT
public:
LogFile(QWidget *parent, const QString& title, SharedSettings *workSheetSettings);
~LogFile(void);
~LogFile() Q_DECL_OVERRIDE;
bool addSensor(const QString& hostName, const QString& sensorName,
const QString& sensorType, const QString& sensorDescr) Q_DECL_OVERRIDE;
......
......@@ -34,7 +34,7 @@ class MultiMeter : public KSGRD::SensorDisplay
public:
MultiMeter(QWidget* parent, const QString& title, SharedSettings *workSheetSettings);
virtual ~MultiMeter()
~MultiMeter() Q_DECL_OVERRIDE
{
}
......
......@@ -25,7 +25,7 @@
#include <KLocalizedString>
MultiMeterSettings::MultiMeterSettings( QWidget *parent, const char *name )
MultiMeterSettings::MultiMeterSettings(QWidget *parent, const QString &name )
: QDialog( parent )
{
setObjectName( name );
......
......@@ -33,7 +33,7 @@ class MultiMeterSettings : public QDialog
public:
explicit MultiMeterSettings( QWidget *parent=0, const char *name=0 );
explicit MultiMeterSettings( QWidget *parent=nullptr, const QString &name=QString() );
~MultiMeterSettings();
QString title();
......
......@@ -47,7 +47,7 @@ class ProcessController : public KSGRD::SensorDisplay
public:
ProcessController(QWidget* parent, SharedSettings *workSheetSettings);
virtual ~ProcessController() { }
~ProcessController() Q_DECL_OVERRIDE { }
/* Functions for SensorDisplay*/
......
......@@ -61,8 +61,8 @@ SensorDisplay::SensorDisplay( QWidget *parent, const QString &title, SharedSetti
mShowUnit = false;
mTimerId = NONE;
mErrorIndicator = 0;
mPlotterWdg = 0;
mErrorIndicator = nullptr;
mPlotterWdg = nullptr;
this->setWhatsThis( QStringLiteral("dummy") );
......@@ -78,7 +78,7 @@ SensorDisplay::SensorDisplay( QWidget *parent, const QString &title, SharedSetti
SensorDisplay::~SensorDisplay()
{
if ( SensorMgr != 0 )
if ( SensorMgr != nullptr )
SensorMgr->disconnectClient( this );
if ( mTimerId > 0 )
......@@ -109,7 +109,7 @@ void SensorDisplay::timerTick()
void SensorDisplay::showContextMenu(const QPoint &pos)
{
QMenu pm;
QAction *action = 0;
QAction *action = nullptr;
bool menuEmpty = true;
if ( hasSettingsDialog() ) {
......@@ -312,7 +312,7 @@ void SensorDisplay::setSensorOk( bool ok )
{
if ( ok ) {
delete mErrorIndicator;
mErrorIndicator = 0;
mErrorIndicator = nullptr;
} else {
if ( mErrorIndicator )
return;
......
......@@ -67,7 +67,7 @@ class SensorDisplay : public QWidget, public SensorClient
/**
Destructor.
*/
virtual ~SensorDisplay();
~SensorDisplay() Q_DECL_OVERRIDE;
/**
Sets the title of the display. If you override, please call this
......
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