Commit 1951c126 authored by Elvis Angelaccio's avatar Elvis Angelaccio
Browse files

Use nullptr everywhere

Patch generated by:

cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ..
run-clang-tidy.py -header-filter='.*' -checks='-*,modernize-use-nullptr' -fix
parent aaf2ad20
......@@ -139,7 +139,7 @@ void BatchExtract::slotStartJob()
void BatchExtract::showFailedFiles()
{
if (!m_failedFiles.isEmpty()) {
KMessageBox::informationList(0, i18n("The following files could not be extracted:"), m_failedFiles);
KMessageBox::informationList(nullptr, i18n("The following files could not be extracted:"), m_failedFiles);
}
}
......
......@@ -56,7 +56,7 @@ public:
/**
* Creates a new BatchExtract object.
*/
explicit BatchExtract(QObject* parent = 0);
explicit BatchExtract(QObject* parent = nullptr);
/**
* Destroys a BatchExtract object.
......
......@@ -72,7 +72,7 @@ QList<QAction *> ExtractHereDndPlugin::setup(const KFileItemListProperties& popu
qCDebug(ARK) << "Plugin executed";
QAction *action = new QAction(QIcon::fromTheme(QStringLiteral("archive-extract")),
extractHereMessage, NULL);
extractHereMessage, nullptr);
connect(action, &QAction::triggered, this, &ExtractHereDndPlugin::slotTriggered);
actionList.append(action);
......
......@@ -74,7 +74,7 @@ MainWindow::~MainWindow()
guiFactory()->removeClient(m_part);
delete m_part;
m_part = 0;
m_part = nullptr;
}
void MainWindow::dragEnterEvent(QDragEnterEvent * event)
......@@ -101,7 +101,7 @@ void MainWindow::dropEvent(QDropEvent * event)
return;
}
if ((event->source() == NULL) &&
if ((event->source() == nullptr) &&
(isValidArchiveDrag(event->mimeData()))) {
event->acceptProposedAction();
}
......@@ -120,7 +120,7 @@ void MainWindow::dragMoveEvent(QDragMoveEvent * event)
return;
}
if ((event->source() == NULL) &&
if ((event->source() == nullptr) &&
(isValidArchiveDrag(event->mimeData()))) {
event->acceptProposedAction();
}
......
......@@ -36,7 +36,7 @@ class MainWindow: public KParts::MainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
explicit MainWindow(QWidget *parent = nullptr);
~MainWindow();
bool loadPart();
......
......@@ -146,7 +146,7 @@ bool AddToArchive::doKill()
void AddToArchive::slotStartJob()
{
if (m_entries.isEmpty()) {
KMessageBox::error(NULL, i18n("No input files were given."));
KMessageBox::error(nullptr, i18n("No input files were given."));
emitResult();
return;
}
......
......@@ -55,7 +55,7 @@ class KERFUFFLE_EXPORT AddToArchive : public KJob
Q_OBJECT
public:
explicit AddToArchive(QObject *parent = 0);
explicit AddToArchive(QObject *parent = nullptr);
~AddToArchive();
bool showAddDialog();
......
......@@ -391,7 +391,7 @@ DeleteJob* Archive::deleteFiles(QVector<Archive::Entry*> &entries)
qCDebug(ARK) << "Going to delete" << entries.size() << "entries";
if (m_iface->isReadOnly()) {
return 0;
return nullptr;
}
DeleteJob *newJob = new DeleteJob(entries, static_cast<ReadWriteArchiveInterface*>(m_iface));
......
......@@ -222,11 +222,11 @@ private slots:
void onEncryptionMethodFound(const QString &method);
private:
Archive(ReadOnlyArchiveInterface *archiveInterface, bool isReadOnly, QObject *parent = 0);
Archive(ArchiveError errorCode, QObject *parent = 0);
Archive(ReadOnlyArchiveInterface *archiveInterface, bool isReadOnly, QObject *parent = nullptr);
Archive(ArchiveError errorCode, QObject *parent = nullptr);
static Archive *create(const QString &fileName, QObject *parent = 0);
static Archive *create(const QString &fileName, const QString &fixedMimeType, QObject *parent = 0);
static Archive *create(const QString &fileName, QObject *parent = nullptr);
static Archive *create(const QString &fileName, const QString &fixedMimeType, QObject *parent = nullptr);
/**
* Create an archive instance from a given @p plugin.
......
......@@ -49,7 +49,7 @@ class CreateDialogUI: public QWidget, public Ui::CreateDialog
Q_OBJECT
public:
CreateDialogUI(QWidget *parent = 0)
CreateDialogUI(QWidget *parent = nullptr)
: QWidget(parent) {
setupUi(this);
}
......
......@@ -49,7 +49,7 @@ class ExtractionDialogUI: public QFrame, public Ui::ExtractionDialog
Q_OBJECT
public:
ExtractionDialogUI(QWidget *parent = 0)
ExtractionDialogUI(QWidget *parent = nullptr)
: QFrame(parent) {
setupUi(this);
}
......@@ -218,7 +218,7 @@ void ExtractionDialog::setReadyGui()
ExtractionDialog::~ExtractionDialog()
{
delete m_ui;
m_ui = 0;
m_ui = nullptr;
}
void ExtractionDialog::setShowSelectedFiles(bool value)
......
......@@ -42,7 +42,7 @@ class KERFUFFLE_EXPORT ExtractionDialog : public QDialog
{
Q_OBJECT
public:
explicit ExtractionDialog(QWidget *parent = 0);
explicit ExtractionDialog(QWidget *parent = nullptr);
virtual ~ExtractionDialog();
void setShowSelectedFiles(bool);
......
......@@ -38,7 +38,7 @@ class KERFUFFLE_EXPORT ExtractionSettingsPage : public SettingsPage, public Ui::
Q_OBJECT
public:
explicit ExtractionSettingsPage(QWidget *parent = 0, const QString &name = QString(), const QString &iconName = QString());
explicit ExtractionSettingsPage(QWidget *parent = nullptr, const QString &name = QString(), const QString &iconName = QString());
};
}
......
......@@ -38,7 +38,7 @@ class KERFUFFLE_EXPORT GeneralSettingsPage : public SettingsPage, public Ui::Gen
Q_OBJECT
public:
explicit GeneralSettingsPage(QWidget *parent = 0, const QString &name = QString(), const QString &iconName = QString());
explicit GeneralSettingsPage(QWidget *parent = nullptr, const QString &name = QString(), const QString &iconName = QString());
};
}
......
......@@ -49,7 +49,7 @@ class Job::Private : public QThread
Q_OBJECT
public:
Private(Job *job, QObject *parent = 0)
Private(Job *job, QObject *parent = nullptr)
: QThread(parent)
, q(job)
{
......
......@@ -38,7 +38,7 @@ class KERFUFFLE_EXPORT PreviewSettingsPage : public SettingsPage, public Ui::Pre
Q_OBJECT
public:
explicit PreviewSettingsPage(QWidget *parent = 0, const QString &name = QString(), const QString &iconName = QString());
explicit PreviewSettingsPage(QWidget *parent = nullptr, const QString &name = QString(), const QString &iconName = QString());
private slots:
void slotToggled(bool enabled);
......
......@@ -46,7 +46,7 @@ class PropertiesDialogUI: public QWidget, public Ui::PropertiesDialog
Q_OBJECT
public:
PropertiesDialogUI(QWidget *parent = 0)
PropertiesDialogUI(QWidget *parent = nullptr)
: QWidget(parent) {
setupUi(this);
}
......
......@@ -39,7 +39,7 @@ class KERFUFFLE_EXPORT SettingsPage : public QWidget
Q_OBJECT
public:
explicit SettingsPage(QWidget *parent = 0, const QString &name = QString(), const QString &iconName = QString());
explicit SettingsPage(QWidget *parent = nullptr, const QString &name = QString(), const QString &iconName = QString());
QString name() const;
QString iconName() const;
......
......@@ -152,7 +152,7 @@ Qt::ItemFlags ArchiveModel::flags(const QModelIndex &index) const
return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | defaultFlags;
}
return 0;
return nullptr;
}
QVariant ArchiveModel::headerData(int section, Qt::Orientation, int role) const
......
......@@ -61,7 +61,7 @@ class ArchiveModel: public QAbstractItemModel
{
Q_OBJECT
public:
explicit ArchiveModel(const QString &dbusPathName, QObject *parent = 0);
explicit ArchiveModel(const QString &dbusPathName, QObject *parent = nullptr);
~ArchiveModel();
QVariant data(const QModelIndex &index, int role) const Q_DECL_OVERRIDE;
......
......@@ -28,7 +28,7 @@ class ArchiveSortFilterModel: public KRecursiveFilterProxyModel
Q_OBJECT
public:
explicit ArchiveSortFilterModel(QObject *parent = 0);
explicit ArchiveSortFilterModel(QObject *parent = nullptr);
~ArchiveSortFilterModel();
bool lessThan(const QModelIndex &leftIndex, const QModelIndex &rightIndex) const Q_DECL_OVERRIDE;
......
......@@ -32,7 +32,7 @@ class ArchiveView : public QTreeView
Q_OBJECT
public:
explicit ArchiveView(QWidget *parent = 0);
explicit ArchiveView(QWidget *parent = nullptr);
virtual void dragEnterEvent(class QDragEnterEvent * event) Q_DECL_OVERRIDE;
virtual void dropEvent(class QDropEvent * event) Q_DECL_OVERRIDE;
virtual void dragMoveEvent(class QDragMoveEvent * event) Q_DECL_OVERRIDE;
......
......@@ -31,7 +31,7 @@ class InfoPanel: public QFrame, Ui::InformationPanel
{
Q_OBJECT
public:
explicit InfoPanel(ArchiveModel *model, QWidget *parent = 0);
explicit InfoPanel(ArchiveModel *model, QWidget *parent = nullptr);
virtual ~InfoPanel();
void setIndex(const QModelIndex &);
......
......@@ -33,7 +33,7 @@ class JobTrackerWidget: public QFrame, public Ui::JobTrackerWidget
Q_OBJECT
public:
explicit JobTrackerWidget(QWidget *parent = 0);
explicit JobTrackerWidget(QWidget *parent = nullptr);
};
class JobTracker: public KAbstractWidgetJobTracker
......@@ -41,7 +41,7 @@ class JobTracker: public KAbstractWidgetJobTracker
Q_OBJECT
public:
explicit JobTracker(QWidget *parent = 0);
explicit JobTracker(QWidget *parent = nullptr);
~JobTracker();
QWidget *widget(KJob *) Q_DECL_OVERRIDE;
......
......@@ -254,7 +254,7 @@ void Part::registerJob(KJob* job)
{
if (!m_jobTracker) {
m_jobTracker = new JobTracker(widget());
m_statusBarExtension->addStatusBarItem(m_jobTracker->widget(0), 0, true);
m_statusBarExtension->addStatusBarItem(m_jobTracker->widget(nullptr), 0, true);
m_jobTracker->widget(job)->show();
}
m_jobTracker->registerJob(job);
......
......@@ -365,7 +365,7 @@ bool ReadWriteLibarchivePlugin::initializeNewFileWriterFilters(const Compression
// Set compression level if passed in CompressionOptions.
if (options.isCompressionLevelSet()) {
qCDebug(ARK) << "Using compression level:" << options.compressionLevel();
ret = archive_write_set_filter_option(m_archiveWriter.data(), NULL, "compression-level", QString::number(options.compressionLevel()).toUtf8());
ret = archive_write_set_filter_option(m_archiveWriter.data(), nullptr, "compression-level", QString::number(options.compressionLevel()).toUtf8());
if (ret != ARCHIVE_OK) {
qCWarning(ARK) << "Failed to set compression level" << archive_error_string(m_archiveWriter.data());
emit error(i18nc("@info", "Could not set the compression level."));
......
......@@ -89,7 +89,7 @@ bool LibzipPlugin::list()
}
// Fetch archive comment.
m_comment = QString::fromUtf8(zip_get_archive_comment(archive, 0, ZIP_FL_ENC_GUESS));
m_comment = QString::fromUtf8(zip_get_archive_comment(archive, nullptr, ZIP_FL_ENC_GUESS));
// Get number of archive entries.
int nofEntries = zip_get_num_entries(archive, 0);
......
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