Commit 33f7c637 authored by Laurent Montel's avatar Laurent Montel 😁

Modernize: use nullptr

Reviewers: afiestas, sebas, apol

Reviewed By: apol

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D8380
parent a2d3cfb2
......@@ -29,7 +29,7 @@ class CollapsableButton : public QWidget
Q_OBJECT
public:
explicit CollapsableButton(const QString &text, QWidget *parent = 0);
explicit CollapsableButton(const QString &text, QWidget *parent = nullptr);
virtual ~CollapsableButton();
void setCollapsed(bool collapsed);
......
......@@ -30,7 +30,7 @@
ControlPanel::ControlPanel(QWidget *parent)
: QFrame(parent)
, mUnifiedOutputCfg(0)
, mUnifiedOutputCfg(nullptr)
{
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
setFrameStyle(QFrame::StyledPanel | QFrame::Sunken);
......@@ -46,7 +46,7 @@ void ControlPanel::setConfig(const KScreen::ConfigPtr &config)
qDeleteAll(mOutputConfigs);
mOutputConfigs.clear();
delete mUnifiedOutputCfg;
mUnifiedOutputCfg = 0;
mUnifiedOutputCfg = nullptr;
if (mConfig) {
mConfig->disconnect(this);
......@@ -108,12 +108,12 @@ void ControlPanel::setUnifiedOutput(const KScreen::OutputPtr &output)
continue;
}
config->setVisible(output == 0);
config->setVisible(output == nullptr);
}
if (output.isNull()) {
mUnifiedOutputCfg->deleteLater();
mUnifiedOutputCfg = 0;
mUnifiedOutputCfg = nullptr;
} else {
mUnifiedOutputCfg = new UnifiedOutputConfig(mConfig, this);
mUnifiedOutputCfg->setOutput(output);
......
......@@ -49,7 +49,7 @@ Q_DECLARE_METATYPE(KScreen::ScreenPtr)
KCMKScreen::KCMKScreen(QWidget* parent, const QVariantList& args)
: KCModule(parent, args)
, mKScreenWidget(0)
, mKScreenWidget(nullptr)
{
Log::instance();
......@@ -74,7 +74,7 @@ void KCMKScreen::configReady(ConfigOperation* op)
mMainLayout->setMargin(0);
if (op->hasError()) {
mKScreenWidget = 0;
mKScreenWidget = nullptr;
delete mKScreenWidget;
QLabel *errorLabel = new QLabel(this);
mMainLayout->addWidget(errorLabel);
......
......@@ -42,7 +42,7 @@
OutputConfig::OutputConfig(QWidget *parent)
: QWidget(parent)
, mOutput(0)
, mOutput(nullptr)
{
}
......
......@@ -33,7 +33,7 @@ PreviewWidget::PreviewWidget(QWidget *parent):
m_internalPreview(new QWidget) // deliberately no parent, we don't want it to have a screen
{
Ui::StylePreview ui;
ui.setupUi(m_internalPreview );
ui.setupUi(m_internalPreview);
}
PreviewWidget::~PreviewWidget()
......
......@@ -39,11 +39,11 @@ static bool sizeLessThan(const QSize &sizeA, const QSize &sizeB)
ResolutionSlider::ResolutionSlider(const KScreen::OutputPtr &output, QWidget *parent)
: QWidget(parent)
, mOutput(output)
, mSmallestLabel(0)
, mBiggestLabel(0)
, mCurrentLabel(0)
, mSlider(0)
, mComboBox(0)
, mSmallestLabel(nullptr)
, mBiggestLabel(nullptr)
, mCurrentLabel(nullptr)
, mSlider(nullptr)
, mComboBox(nullptr)
{
connect(output.data(), &KScreen::Output::currentModeIdChanged,
this, &ResolutionSlider::slotOutputModeChanged);
......
......@@ -53,9 +53,9 @@
Widget::Widget(QWidget *parent):
QWidget(parent),
mScreen(0),
mConfig(0),
mPrevConfig(0)
mScreen(nullptr),
mConfig(nullptr),
mPrevConfig(nullptr)
{
qRegisterMetaType<QQuickView*>();
......
......@@ -46,7 +46,7 @@ K_PLUGIN_FACTORY_WITH_JSON(KScreenDaemonFactory,
KScreenDaemon::KScreenDaemon(QObject* parent, const QList< QVariant >& )
: KDEDModule(parent)
, m_monitoredConfig(0)
, m_monitoredConfig(nullptr)
, m_iteration(Generator::None)
, m_monitoring(false)
, m_changeCompressor(new QTimer(this))
......
......@@ -23,7 +23,7 @@
#include <QLoggingCategory>
Device* Device::m_instance = 0;
Device* Device::m_instance = nullptr;
Device* Device::self()
{
......@@ -37,7 +37,7 @@ Device* Device::self()
void Device::destroy()
{
delete m_instance;
m_instance = 0;
m_instance = nullptr;
}
Device::Device(QObject* parent)
......
......@@ -41,7 +41,7 @@
}
#endif
Generator* Generator::instance = 0;
Generator* Generator::instance = nullptr;
bool operator<(const QSize &s1, const QSize &s2)
{
......@@ -69,7 +69,7 @@ Generator::Generator()
void Generator::destroy()
{
delete Generator::instance;
Generator::instance = 0;
Generator::instance = nullptr;
}
Generator::~Generator()
......@@ -298,7 +298,6 @@ void Generator::cloneScreens(KScreen::OutputList &connectedOutputs)
QSet<QSize> commonSizes;
const QSize maxScreenSize = m_currentConfig->screen()->maxSize();
QList<QSet<QSize>> modes;
Q_FOREACH(const KScreen::OutputPtr &output, connectedOutputs) {
QSet<QSize> modeSizes;
Q_FOREACH(const KScreen::ModePtr &mode, output->modes()) {
......
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