Use nullptr + add explicit keyword

Test Plan: compile

Reviewers: #dolphin, broulik

Reviewed By: broulik

Subscribers: #dolphin

Differential Revision: https://phabricator.kde.org/D8637
This commit is contained in:
Montel Laurent 2017-11-03 08:01:02 +01:00
parent d1acb1d56e
commit ff3f476ed8
19 changed files with 76 additions and 75 deletions

View file

@ -68,7 +68,7 @@ DolphinContextMenu::DolphinContextMenu(DolphinMainWindow* parent,
m_baseUrl(baseUrl),
m_baseFileItem(0),
m_selectedItems(),
m_selectedItemsProperties(0),
m_selectedItemsProperties(nullptr),
m_context(NoContext),
m_copyToMenu(parent),
m_customActions(),
@ -84,7 +84,7 @@ DolphinContextMenu::DolphinContextMenu(DolphinMainWindow* parent,
DolphinContextMenu::~DolphinContextMenu()
{
delete m_selectedItemsProperties;
m_selectedItemsProperties = 0;
m_selectedItemsProperties = nullptr;
}
void DolphinContextMenu::setCustomActions(const QList<QAction*>& actions)
@ -195,10 +195,10 @@ void DolphinContextMenu::openItemContextMenu()
{
Q_ASSERT(!m_fileInfo.isNull());
QAction* openParentAction = 0;
QAction* openParentInNewWindowAction = 0;
QAction* openParentInNewTabAction = 0;
QAction* addToPlacesAction = 0;
QAction* openParentAction = nullptr;
QAction* openParentInNewWindowAction = nullptr;
QAction* openParentInNewTabAction = nullptr;
QAction* addToPlacesAction = nullptr;
const KFileItemListProperties& selectedItemsProps = selectedItemsProperties();
if (m_selectedItems.count() == 1) {

View file

@ -35,7 +35,7 @@ class DolphinDockTitleBar : public QWidget
Q_OBJECT
public:
DolphinDockTitleBar(QWidget* parent = 0) : QWidget(parent) {}
explicit DolphinDockTitleBar(QWidget* parent = nullptr) : QWidget(parent) {}
virtual ~DolphinDockTitleBar() {}
QSize minimumSizeHint() const Q_DECL_OVERRIDE
@ -53,7 +53,7 @@ public:
DolphinDockWidget::DolphinDockWidget(const QString& title, QWidget* parent, Qt::WindowFlags flags) :
QDockWidget(title, parent, flags),
m_locked(false),
m_dockTitleBar(0)
m_dockTitleBar(nullptr)
{
setFeatures(DefaultDockWidgetFeatures);
}
@ -61,7 +61,7 @@ DolphinDockWidget::DolphinDockWidget(const QString& title, QWidget* parent, Qt::
DolphinDockWidget::DolphinDockWidget(QWidget* parent, Qt::WindowFlags flags) :
QDockWidget(parent, flags),
m_locked(false),
m_dockTitleBar(0)
m_dockTitleBar(nullptr)
{
setFeatures(DefaultDockWidgetFeatures);
}
@ -82,7 +82,7 @@ void DolphinDockWidget::setLocked(bool lock)
setTitleBarWidget(m_dockTitleBar);
setFeatures(QDockWidget::NoDockWidgetFeatures);
} else {
setTitleBarWidget(0);
setTitleBarWidget(nullptr);
setFeatures(DefaultDockWidgetFeatures);
}
}

View file

@ -55,8 +55,8 @@
FoldersPanel::FoldersPanel(QWidget* parent) :
Panel(parent),
m_updateCurrentItem(false),
m_controller(0),
m_model(0)
m_controller(nullptr),
m_model(nullptr)
{
setLayoutDirection(Qt::LeftToRight);
}
@ -67,7 +67,7 @@ FoldersPanel::~FoldersPanel()
if (m_controller) {
KItemListView* view = m_controller->view();
m_controller->setView(0);
m_controller->setView(nullptr);
delete view;
}
}

View file

@ -39,7 +39,7 @@ class FoldersPanel : public Panel
Q_OBJECT
public:
FoldersPanel(QWidget* parent = 0);
explicit FoldersPanel(QWidget* parent = nullptr);
virtual ~FoldersPanel();
void setShowHiddenFiles(bool show);

View file

@ -35,8 +35,8 @@
FileMetaDataConfigurationDialog::FileMetaDataConfigurationDialog(QWidget* parent) :
QDialog(parent),
m_descriptionLabel(0),
m_configWidget(0)
m_descriptionLabel(nullptr),
m_configWidget(nullptr)
{
setWindowTitle(i18nc("@title:window", "Configure Shown Data"));

View file

@ -32,16 +32,16 @@
InformationPanel::InformationPanel(QWidget* parent) :
Panel(parent),
m_initialized(false),
m_infoTimer(0),
m_urlChangedTimer(0),
m_resetUrlTimer(0),
m_infoTimer(nullptr),
m_urlChangedTimer(nullptr),
m_resetUrlTimer(nullptr),
m_shownUrl(),
m_urlCandidate(),
m_invalidUrlCandidate(),
m_fileItem(),
m_selection(),
m_folderStatJob(0),
m_content(0)
m_folderStatJob(nullptr),
m_content(nullptr)
{
}

View file

@ -36,7 +36,7 @@ class InformationPanel : public Panel
Q_OBJECT
public:
explicit InformationPanel(QWidget* parent = 0);
explicit InformationPanel(QWidget* parent = nullptr);
virtual ~InformationPanel();
signals:

View file

@ -41,7 +41,7 @@ class EmbeddedVideoPlayer : public Phonon::VideoWidget
Q_OBJECT
public:
EmbeddedVideoPlayer(QWidget *parent = 0) :
EmbeddedVideoPlayer(QWidget *parent = nullptr) :
Phonon::VideoWidget(parent)
{
}
@ -64,13 +64,13 @@ class EmbeddedVideoPlayer : public Phonon::VideoWidget
PhononWidget::PhononWidget(QWidget *parent)
: QWidget(parent),
m_url(),
m_playButton(0),
m_stopButton(0),
m_topLayout(0),
m_media(0),
m_seekSlider(0),
m_audioOutput(0),
m_videoPlayer(0)
m_playButton(nullptr),
m_stopButton(nullptr),
m_topLayout(nullptr),
m_media(nullptr),
m_seekSlider(nullptr),
m_audioOutput(nullptr),
m_videoPlayer(nullptr)
{
}

View file

@ -37,8 +37,8 @@ PlacesItem::PlacesItem(const KBookmark& bookmark, PlacesItem* parent) :
m_volume(),
m_disc(),
m_mtp(),
m_signalHandler(0),
m_trashDirLister(0),
m_signalHandler(nullptr),
m_trashDirLister(nullptr),
m_bookmark()
{
m_signalHandler = new PlacesItemSignalHandler(this);

View file

@ -47,7 +47,7 @@ class PlacesItemSignalHandler: public QObject
Q_OBJECT
public:
explicit PlacesItemSignalHandler(PlacesItem* item, QObject* parent = 0);
explicit PlacesItemSignalHandler(PlacesItem* item, QObject* parent = nullptr);
virtual ~PlacesItemSignalHandler();
public slots:

View file

@ -58,13 +58,14 @@
PlacesPanel::PlacesPanel(QWidget* parent) :
Panel(parent),
m_controller(0),
m_model(0),
m_controller(nullptr),
m_model(nullptr),
m_view(nullptr),
m_storageSetupFailedUrl(),
m_triggerStorageSetupButton(),
m_itemDropEventIndex(-1),
m_itemDropEventMimeData(0),
m_itemDropEvent(0)
m_itemDropEventMimeData(nullptr),
m_itemDropEvent(nullptr)
{
}

View file

@ -39,7 +39,7 @@ class PlacesPanel : public Panel
Q_OBJECT
public:
PlacesPanel(QWidget* parent);
explicit PlacesPanel(QWidget* parent);
virtual ~PlacesPanel();
void proceedWithTearDown();

View file

@ -32,7 +32,7 @@ class PlacesView : public KStandardItemListView
Q_OBJECT
public:
explicit PlacesView(QGraphicsWidget* parent = 0);
explicit PlacesView(QGraphicsWidget* parent = nullptr);
void setIconSize(int size);
int iconSize() const;

View file

@ -45,7 +45,7 @@ class TerminalPanel : public Panel
Q_OBJECT
public:
TerminalPanel(QWidget* parent = 0);
explicit TerminalPanel(QWidget* parent = nullptr);
virtual ~TerminalPanel();
/**

View file

@ -29,23 +29,23 @@
DolphinFacetsWidget::DolphinFacetsWidget(QWidget* parent) :
QWidget(parent),
m_folders(0),
m_documents(0),
m_images(0),
m_audio(0),
m_videos(0),
m_anytime(0),
m_today(0),
m_yesterday(0),
m_thisWeek(0),
m_thisMonth(0),
m_thisYear(0),
m_anyRating(0),
m_oneOrMore(0),
m_twoOrMore(0),
m_threeOrMore(0),
m_fourOrMore(0),
m_maxRating(0)
m_folders(nullptr),
m_documents(nullptr),
m_images(nullptr),
m_audio(nullptr),
m_videos(nullptr),
m_anytime(nullptr),
m_today(nullptr),
m_yesterday(nullptr),
m_thisWeek(nullptr),
m_thisMonth(nullptr),
m_thisYear(nullptr),
m_anyRating(nullptr),
m_oneOrMore(nullptr),
m_twoOrMore(nullptr),
m_threeOrMore(nullptr),
m_fourOrMore(nullptr),
m_maxRating(nullptr)
{
QButtonGroup* filetypeGroup = new QButtonGroup(this);
m_anyType = createRadioButton(i18nc("@option:check", "Any"), filetypeGroup);

View file

@ -47,7 +47,7 @@ class DolphinFacetsWidget : public QWidget
Q_OBJECT
public:
explicit DolphinFacetsWidget(QWidget* parent = 0);
explicit DolphinFacetsWidget(QWidget* parent = nullptr);
virtual ~DolphinFacetsWidget();
QString ratingTerm() const;

View file

@ -34,15 +34,15 @@
BehaviorSettingsPage::BehaviorSettingsPage(const QUrl& url, QWidget* parent) :
SettingsPageBase(parent),
m_url(url),
m_localViewProps(0),
m_globalViewProps(0),
m_showToolTips(0),
m_showSelectionToggle(0),
m_naturalSorting(0),
m_caseSensitiveSorting(0),
m_caseInsensitiveSorting(0),
m_renameInline(0),
m_useTabForSplitViewSwitch(0)
m_localViewProps(nullptr),
m_globalViewProps(nullptr),
m_showToolTips(nullptr),
m_showSelectionToggle(nullptr),
m_naturalSorting(nullptr),
m_caseSensitiveSorting(nullptr),
m_caseInsensitiveSorting(nullptr),
m_renameInline(nullptr),
m_useTabForSplitViewSwitch(nullptr)
{
QVBoxLayout* topLayout = new QVBoxLayout(this);

View file

@ -28,8 +28,8 @@
StatusBarSettingsPage::StatusBarSettingsPage(QWidget* parent) :
SettingsPageBase(parent),
m_showZoomSlider(0),
m_showSpaceInfo(0)
m_showZoomSlider(nullptr),
m_showSpaceInfo(nullptr)
{
m_showZoomSlider = new QCheckBox(i18nc("@option:check", "Show zoom slider"), this);
m_showSpaceInfo = new QCheckBox(i18nc("@option:check", "Show space information"), this);

View file

@ -42,12 +42,12 @@
StartupSettingsPage::StartupSettingsPage(const QUrl& url, QWidget* parent) :
SettingsPageBase(parent),
m_url(url),
m_homeUrl(0),
m_splitView(0),
m_editableUrl(0),
m_showFullPath(0),
m_filterBar(0),
m_showFullPathInTitlebar(0)
m_homeUrl(nullptr),
m_splitView(nullptr),
m_editableUrl(nullptr),
m_showFullPath(nullptr),
m_filterBar(nullptr),
m_showFullPathInTitlebar(nullptr)
{
QVBoxLayout* topLayout = new QVBoxLayout(this);
QWidget* vBox = new QWidget(this);