]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Use nullptr + add explicit keyword
authorMontel Laurent <montel@kde.org>
Fri, 3 Nov 2017 07:01:02 +0000 (08:01 +0100)
committerMontel Laurent <montel@kde.org>
Fri, 3 Nov 2017 13:54:06 +0000 (14:54 +0100)
Test Plan: compile

Reviewers: #dolphin, broulik

Reviewed By: broulik

Subscribers: #dolphin

Differential Revision: https://phabricator.kde.org/D8637

19 files changed:
src/dolphincontextmenu.cpp
src/dolphindockwidget.cpp
src/panels/folders/folderspanel.cpp
src/panels/folders/folderspanel.h
src/panels/information/filemetadataconfigurationdialog.cpp
src/panels/information/informationpanel.cpp
src/panels/information/informationpanel.h
src/panels/information/phononwidget.cpp
src/panels/places/placesitem.cpp
src/panels/places/placesitemsignalhandler.h
src/panels/places/placespanel.cpp
src/panels/places/placespanel.h
src/panels/places/placesview.h
src/panels/terminal/terminalpanel.h
src/search/dolphinfacetswidget.cpp
src/search/dolphinfacetswidget.h
src/settings/general/behaviorsettingspage.cpp
src/settings/general/statusbarsettingspage.cpp
src/settings/startup/startupsettingspage.cpp

index 881ef34b410d8befa000e7e4f5f163d242f50467..d4cf196b7cd05e3d7d5a5ff7919d534a6dec14b6 100644 (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) {
index ccbecb0d666b48d3b5e310f7d4c1e93174b9d627..c7beb1689b8c6ec8c1c86ba4aedf7f2a81ff6424 100644 (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);
         }
     }
index cb35fd2185aae555cfd77d11fa23c5a3bac6bfdb..eef27ce4725c0cb363302a8e760eb3523b6541d9 100644 (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;
     }
 }
index 5f0b9a37881a8abd56cc7bb14cb5e437cb9a3c92..ab6c41b3454dc2dedd5e341f6c309458cc47a624 100644 (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);
index 5671d34efa94f1beb4aa064445d8720df389cc2f..050e78cfdc4d70cf4c408d7f03c252a95e8e42fe 100644 (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"));
index 16dc721b2eb4a0c928bc29634fce0387938c747f..850d94d92234ace1a7b1b8fe4f758d1647a2b2ac 100644 (file)
 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)
 {
 }
 
index 78e2d71ff89b82fe7e3752cd9f170abb0d9b7c5f..a698e544fbb51c9f5cec03012dbd39fe8fb74de9 100644 (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:
index ac4a32506d179eb3a869b52dab8e5d63cfd94856..3a3268cb3da3726332e66f5ff644019da466139d 100644 (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)
 {
 }
 
index 5b8e5dbefb05c15064e438aae5a573da78396463..93cc4d5c3d9be14c02c22f06dcff86e7af6c28d4 100644 (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);
index f65b57fe1e39e24204f62c08b5bd2a55feffe291..6110f717d6638c26e1dd2f8b0f2c1b61d1335ab9 100644 (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:
index 0ce6d69a5f1c72e21446f69432dfc026610d1281..0b76f18d3b43b2bdc425e1788494150211063672 100644 (file)
 
 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)
 {
 }
 
index 13a38df2d2cf6650b4bd184b2becac6be28cf809..4e525a0372d51c98897c16f87049214552d5e524 100644 (file)
@@ -39,7 +39,7 @@ class PlacesPanel : public Panel
     Q_OBJECT
 
 public:
-    PlacesPanel(QWidget* parent);
+    explicit PlacesPanel(QWidget* parent);
     virtual ~PlacesPanel();
     void proceedWithTearDown();
 
index 19c99c39bf1a16a55620510f2607d07f5ce03c4c..ba7193525644e50cb9b1e2c1d90d8b5532c73d57 100644 (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;
index 3de3b6d305720015538302aa595b4597f5e7b21e..db5658e53c3bfb73e0767ee2a23183a42f467561 100644 (file)
@@ -45,7 +45,7 @@ class TerminalPanel : public Panel
     Q_OBJECT
 
 public:
-    TerminalPanel(QWidget* parent = 0);
+    explicit TerminalPanel(QWidget* parent = nullptr);
     virtual ~TerminalPanel();
 
     /**
index 7831d4c127b8ac9e68d6be1930df4dd249985c73..cf0134f4e373cc7dfd796b54c3ecf3c3ab04c560 100644 (file)
 
 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);
index 1c041a2f924e567d5eea6b37d2bb396749f0ddcf..996829ee3024c4c76c215e00bfb829f0bc84a504 100644 (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;
index 6d1e8bb104c110445e06f1fb3e835f9f85cf93a2..b600c2be602a66f831f54c593a25a98aa85bf7a3 100644 (file)
 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);
 
index 03846253ba68c942304cd5f49cbf6cb42e6b637d..85195cb637d154884efb904995931c62fbca3314 100644 (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);
index f076f16c74e56c04acfb59de9a5b2be4c06dfbf6..b216181d882e51ea83142a63354f6f1b1ad05be5 100644 (file)
 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);