Commit 3c2ff58f authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Use nullptr

parent b262dbc5
......@@ -38,7 +38,7 @@ class CuttleFishPlugin : public KTextEditor::Plugin
Q_OBJECT
public:
explicit CuttleFishPlugin(QObject *parent = 0, const QList<QVariant> & = QList<QVariant>());
explicit CuttleFishPlugin(QObject *parent = nullptr, const QList<QVariant> & = QList<QVariant>());
virtual ~CuttleFishPlugin();
QObject *createView(KTextEditor::MainWindow *mainWindow) Q_DECL_OVERRIDE;
......
......@@ -57,7 +57,7 @@ public:
Theme
};
explicit IconModel(QObject *parent = 0);
explicit IconModel(QObject *parent = nullptr);
virtual QHash<int, QByteArray> roleNames() const;
......
......@@ -36,7 +36,7 @@ using namespace CuttleFish;
View::View(const QString &category, QCommandLineParser &parser, QWindow *parent)
: QQuickView(parent),
m_browserRootItem(0)
m_browserRootItem(nullptr)
{
setResizeMode(QQuickView::SizeRootObjectToView);
QQuickWindow::setDefaultAlphaBuffer(true);
......
......@@ -35,7 +35,7 @@ class View : public QQuickView
Q_OBJECT
public:
explicit View(const QString &category, QCommandLineParser &parser, QWindow *parent = 0 );
explicit View(const QString &category, QCommandLineParser &parser, QWindow *parent = nullptr);
~View();
Q_SIGNALS:
......
......@@ -49,7 +49,7 @@ Q_DECLARE_METATYPE(Plasma::DataEngine::Data)
EngineExplorer::EngineExplorer(QWidget* parent)
: QDialog(parent),
m_engine(0),
m_engine(nullptr),
m_sourceCount(0),
m_requestingSource(false),
m_expandButton(new QPushButton(i18n("Expand All"), this)),
......@@ -142,7 +142,7 @@ void EngineExplorer::setInterval(const int interval)
void EngineExplorer::dataUpdated(const QString& source, const Plasma::DataEngine::Data& data)
{
QList<QStandardItem*> items = m_dataModel->findItems(source, 0);
QList<QStandardItem*> items = m_dataModel->findItems(source, nullptr);
if (items.isEmpty()) {
return;
......@@ -182,7 +182,7 @@ void EngineExplorer::showEngine(const QString& name)
QStringList headers;
headers << i18n("DataSource") << i18n("Key") << i18n("Value") << i18n("Type");
m_dataModel->setHorizontalHeaderLabels(headers);
m_engine = 0;
m_engine = nullptr;
m_sourceCount = 0;
if (!m_engineName.isEmpty()) {
......@@ -223,7 +223,7 @@ void EngineExplorer::showEngine(const QString& name)
void EngineExplorer::addSource(const QString& source)
{
//qDebug() << "adding" << source;
QList<QStandardItem*> items = m_dataModel->findItems(source, 0);
QList<QStandardItem*> items = m_dataModel->findItems(source, nullptr);
if (!items.isEmpty()) {
//qDebug() << "er... already there?";
return;
......@@ -246,7 +246,7 @@ void EngineExplorer::addSource(const QString& source)
void EngineExplorer::removeSource(const QString& source)
{
QList<QStandardItem*> items = m_dataModel->findItems(source, 0);
QList<QStandardItem*> items = m_dataModel->findItems(source, nullptr);
if (items.count() < 1) {
return;
......
......@@ -43,7 +43,7 @@ class EngineExplorer : public QDialog, public Ui::EngineExplorer
Q_OBJECT
public:
explicit EngineExplorer(QWidget *parent = 0);
explicit EngineExplorer(QWidget *parent = nullptr);
~EngineExplorer();
void setApp(const QString &app);
......
......@@ -84,7 +84,7 @@ void KTreeViewSearchLinePrivate::rowsInserted( QAbstractItemModel *model, const
if ( !model )
return;
QTreeView* widget = 0L;
QTreeView* widget = nullptr;
foreach ( QTreeView* tree, treeViews )
if ( tree->model() == model ) {
widget = tree;
......@@ -264,7 +264,7 @@ QTreeView *KTreeViewSearchLine::treeView() const
if ( d->treeViews.count() == 1 )
return d->treeViews.first();
else
return 0;
return nullptr;
}
QList<QTreeView *> KTreeViewSearchLine::treeViews() const
......@@ -549,8 +549,8 @@ class KTreeViewSearchLineWidgetPrivate
{
public:
KTreeViewSearchLineWidgetPrivate()
: treeView( 0 ),
searchLine( 0 )
: treeView( nullptr ),
searchLine( nullptr )
{
}
......
......@@ -54,7 +54,7 @@ class KTreeViewSearchLine : public KLineEdit
* If \a treeView is null then the widget will be disabled until listviews
* are set with setTreeView(), setTreeViews() or added with addTreeView().
*/
explicit KTreeViewSearchLine( QWidget *parent = 0, QTreeView *treeView = 0 );
explicit KTreeViewSearchLine( QWidget *parent = nullptr, QTreeView *treeView = nullptr );
/**
* Constructs a KTreeViewSearchLine with \a treeViews being the list of
......@@ -280,7 +280,7 @@ class KTreeViewSearchLineWidget : public QWidget
* Creates a KTreeViewSearchLineWidget for \a treeView with \a parent as the
* parent.
*/
explicit KTreeViewSearchLineWidget( QWidget *parent = 0, QTreeView *treeView = 0 );
explicit KTreeViewSearchLineWidget( QWidget *parent = nullptr, QTreeView *treeView = nullptr );
/**
* Destroys the KTreeViewSearchLineWidget
......
......@@ -104,7 +104,7 @@ ModelViewer::ModelViewer(Plasma::DataEngine *engine, const QString &source, QWid
qDebug() << "########### CALLING SERVICE FOR SOURCE: " << m_source;
m_model = m_engine->modelForSource(m_source);
if (m_model != 0) {
if (m_model != nullptr) {
connect(m_engine, SIGNAL(destroyed(QObject*)), this, SLOT(engineDestroyed()));
m_view->setModel(m_model);
} else {
......@@ -118,14 +118,14 @@ ModelViewer::ModelViewer(Plasma::DataEngine *engine, const QString &source, QWid
ModelViewer::~ModelViewer()
{
m_engine = 0;
m_engine = nullptr;
}
void ModelViewer::engineDestroyed()
{
m_model = 0;
m_engine = 0;
m_model = nullptr;
m_engine = nullptr;
hide();
deleteLater();
}
......
......@@ -38,7 +38,7 @@ class Delegate : public QAbstractItemDelegate
Q_OBJECT
public:
Delegate(QObject *parent = 0);
Delegate(QObject *parent = nullptr);
virtual ~Delegate();
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option,
......@@ -54,7 +54,7 @@ class ModelViewer : public QDialog
Q_OBJECT
public:
ModelViewer(Plasma::DataEngine *engine, const QString &m_source, QWidget *parent = 0);
ModelViewer(Plasma::DataEngine *engine, const QString &m_source, QWidget *parent = nullptr);
~ModelViewer();
private Q_SLOTS:
......
......@@ -34,7 +34,7 @@
ServiceViewer::ServiceViewer(Plasma::DataEngine *engine, const QString &source, QWidget *parent)
: QDialog(parent),
m_engine(engine),
m_service(0),
m_service(nullptr),
m_source(source),
m_operationCount(0),
m_operationButton(new QPushButton(i18n("Start Operation"), this))
......@@ -72,7 +72,7 @@ ServiceViewer::ServiceViewer(Plasma::DataEngine *engine, const QString &source,
qDebug() << "########### CALLING SERVICE FOR SOURCE: " << m_source;
m_service = m_engine->serviceForSource(m_source);
if (m_service != 0) {
if (m_service != nullptr) {
serviceName = m_service->name();
updateOperations();
connect(m_service, SIGNAL(operationsChanged()), this, SLOT(updateOperations()));
......@@ -93,7 +93,7 @@ ServiceViewer::ServiceViewer(Plasma::DataEngine *engine, const QString &source,
ServiceViewer::~ServiceViewer()
{
delete m_service;
m_engine = 0;
m_engine = nullptr;
}
void ServiceViewer::updateOperations()
......@@ -214,8 +214,8 @@ void ServiceViewer::operationResult(KJob *j)
void ServiceViewer::engineDestroyed()
{
m_service = 0;
m_engine = 0;
m_service = nullptr;
m_engine = nullptr;
hide();
deleteLater();
}
......
......@@ -37,7 +37,7 @@ class ServiceViewer : public QDialog, public Ui::ServiceViewer
Q_OBJECT
public:
ServiceViewer(Plasma::DataEngine *engine, const QString &m_source, QWidget *parent = 0);
ServiceViewer(Plasma::DataEngine *engine, const QString &m_source, QWidget *parent = nullptr);
~ServiceViewer();
private:
......
......@@ -30,7 +30,7 @@
class TitleComboBox : public QComboBox
{
public:
TitleComboBox(QWidget *parent = 0)
TitleComboBox(QWidget *parent = nullptr)
: QComboBox(parent)
{
}
......
......@@ -59,7 +59,7 @@ public:
PackageVersionRole = Qt::UserRole + 3
};
LnfListModel(QObject *parent = 0);
LnfListModel(QObject *parent = nullptr);
virtual ~LnfListModel();
virtual QHash<int, QByteArray> roleNames() const;
......
......@@ -481,7 +481,7 @@ void LnfLogic::processThumbnail(const QString &path)
QString LnfLogic::openFile()
{
return QFileDialog::getOpenFileName(0,
return QFileDialog::getOpenFileName(nullptr,
i18n("Open Image"), QStandardPaths::writableLocation(QStandardPaths::HomeLocation), i18n("Image Files (*.png *.jpg *.bmp)"));
}
......
......@@ -57,7 +57,7 @@ public:
};
Q_ENUMS(ErrorLevel)
explicit LnfLogic(QObject *parent = 0);
explicit LnfLogic(QObject *parent = nullptr);
~LnfLogic();
LnfListModel *lnfList();
......
......@@ -52,7 +52,7 @@ public:
* @param corona the corona of this view
* @param parent the QWindow this ContainmentView is parented to
**/
explicit ContainmentView(Plasma::Corona *corona, QWindow *parent = 0);
explicit ContainmentView(Plasma::Corona *corona, QWindow *parent = nullptr);
virtual ~ContainmentView();
/**
......
......@@ -37,7 +37,7 @@ class ViewerCorona : public Plasma::Corona
public:
ViewerCorona()
: Plasma::Corona(),
m_view(0)
m_view(nullptr)
{}
void setView(View *view)
......@@ -98,7 +98,7 @@ void View::addApplet(const QString &applet)
return;
}
Plasma::Applet *a = 0;
Plasma::Applet *a = nullptr;
if (metadataPath.isEmpty()) {
a = containment()->createApplet(applet);
} else {
......@@ -313,7 +313,7 @@ void View::takeScreenShot()
return;
}
QString dest = QFileDialog::getSaveFileName(0, i18nc("@title:window", "Save Screenshot"),
QString dest = QFileDialog::getSaveFileName(nullptr, i18nc("@title:window", "Save Screenshot"),
QDir::homePath(), QStringLiteral("Images (*.png)"));
if (dest.isEmpty()) {
......
......@@ -29,7 +29,7 @@ class View : public PlasmaQuick::ContainmentView
Q_PROPERTY(bool konsoleVisible READ konsoleVisible CONSTANT);
public:
View(ViewerCorona *corona, bool konsoleVisible, QWindow *parent = 0);
View(ViewerCorona *corona, bool konsoleVisible, QWindow *parent = nullptr);
~View();
void addApplet(const QString &applet);
......
......@@ -51,7 +51,7 @@ class ColorEditor : public QObject
Q_PROPERTY(QColor complementaryFocusColor READ complementaryFocusColor WRITE setComplementaryFocusColor NOTIFY colorsChanged)
public:
explicit ColorEditor(QObject *parent = 0);
explicit ColorEditor(QObject *parent = nullptr);
~ColorEditor();
QString theme() const;
......
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