Modernize: Use nullptr everywhere

This commit is contained in:
Kevin Funk 2017-11-21 10:52:14 +01:00
parent 464b13f382
commit a6db5029ac
123 changed files with 388 additions and 388 deletions

View file

@ -66,14 +66,14 @@ DolphinContextMenu::DolphinContextMenu(DolphinMainWindow* parent,
m_mainWindow(parent), m_mainWindow(parent),
m_fileInfo(fileInfo), m_fileInfo(fileInfo),
m_baseUrl(baseUrl), m_baseUrl(baseUrl),
m_baseFileItem(0), m_baseFileItem(nullptr),
m_selectedItems(), m_selectedItems(),
m_selectedItemsProperties(nullptr), m_selectedItemsProperties(nullptr),
m_context(NoContext), m_context(NoContext),
m_copyToMenu(parent), m_copyToMenu(parent),
m_customActions(), m_customActions(),
m_command(None), m_command(None),
m_removeAction(0) m_removeAction(nullptr)
{ {
// The context menu either accesses the URLs of the selected items // The context menu either accesses the URLs of the selected items
// or the items itself. To increase the performance both lists are cached. // or the items itself. To increase the performance both lists are cached.
@ -337,7 +337,7 @@ void DolphinContextMenu::openViewportContextMenu()
addAction(m_mainWindow->actionCollection()->action(QStringLiteral("new_tab"))); addAction(m_mainWindow->actionCollection()->action(QStringLiteral("new_tab")));
// Insert 'Add to Places' entry if exactly one item is selected // Insert 'Add to Places' entry if exactly one item is selected
QAction* addToPlacesAction = 0; QAction* addToPlacesAction = nullptr;
if (!placeExists(m_mainWindow->activeViewContainer()->url())) { if (!placeExists(m_mainWindow->activeViewContainer()->url())) {
addToPlacesAction = addAction(QIcon::fromTheme(QStringLiteral("bookmark-new")), addToPlacesAction = addAction(QIcon::fromTheme(QStringLiteral("bookmark-new")),
i18nc("@action:inmenu Add current folder to places", "Add to Places")); i18nc("@action:inmenu Add current folder to places", "Add to Places"));
@ -408,7 +408,7 @@ void DolphinContextMenu::insertDefaultItemActions(const KFileItemListProperties&
if (showDeleteAction && showMoveToTrashAction) { if (showDeleteAction && showMoveToTrashAction) {
delete m_removeAction; delete m_removeAction;
m_removeAction = 0; m_removeAction = nullptr;
addAction(m_mainWindow->actionCollection()->action(KStandardAction::name(KStandardAction::MoveToTrash))); addAction(m_mainWindow->actionCollection()->action(KStandardAction::name(KStandardAction::MoveToTrash)));
addAction(m_mainWindow->actionCollection()->action(KStandardAction::name(KStandardAction::DeleteFile))); addAction(m_mainWindow->actionCollection()->action(KStandardAction::name(KStandardAction::DeleteFile)));
} else if (showDeleteAction && !showMoveToTrashAction) { } else if (showDeleteAction && !showMoveToTrashAction) {
@ -445,7 +445,7 @@ bool DolphinContextMenu::placeExists(const QUrl& url) const
QAction* DolphinContextMenu::createPasteAction() QAction* DolphinContextMenu::createPasteAction()
{ {
QAction* action = 0; QAction* action = nullptr;
const bool isDir = !m_fileInfo.isNull() && m_fileInfo.isDir(); const bool isDir = !m_fileInfo.isNull() && m_fileInfo.isDir();
if (isDir && (m_selectedItems.count() == 1)) { if (isDir && (m_selectedItems.count() == 1)) {
const QMimeData *mimeData = QApplication::clipboard()->mimeData(); const QMimeData *mimeData = QApplication::clipboard()->mimeData();

View file

@ -30,8 +30,8 @@ class DolphinDockWidget : public QDockWidget
Q_OBJECT Q_OBJECT
public: public:
explicit DolphinDockWidget(const QString& title, QWidget* parent = 0, Qt::WindowFlags flags = 0); explicit DolphinDockWidget(const QString& title, QWidget* parent = nullptr, Qt::WindowFlags flags = nullptr);
explicit DolphinDockWidget(QWidget* parent = 0, Qt::WindowFlags flags = 0); explicit DolphinDockWidget(QWidget* parent = nullptr, Qt::WindowFlags flags = nullptr);
~DolphinDockWidget() override; ~DolphinDockWidget() override;
/** /**

View file

@ -90,20 +90,20 @@ namespace {
} }
DolphinMainWindow::DolphinMainWindow() : DolphinMainWindow::DolphinMainWindow() :
KXmlGuiWindow(0), KXmlGuiWindow(nullptr),
m_newFileMenu(0), m_newFileMenu(nullptr),
m_tabWidget(0), m_tabWidget(nullptr),
m_activeViewContainer(0), m_activeViewContainer(nullptr),
m_actionHandler(0), m_actionHandler(nullptr),
m_remoteEncoding(0), m_remoteEncoding(nullptr),
m_settingsDialog(), m_settingsDialog(),
m_controlButton(0), m_controlButton(nullptr),
m_updateToolBarTimer(0), m_updateToolBarTimer(nullptr),
m_lastHandleUrlStatJob(0), m_lastHandleUrlStatJob(nullptr),
#ifndef Q_OS_WIN #ifndef Q_OS_WIN
m_terminalPanel(0), m_terminalPanel(nullptr),
#endif #endif
m_placesPanel(0), m_placesPanel(nullptr),
m_tearDownFromPlacesRequested(false) m_tearDownFromPlacesRequested(false)
{ {
Q_INIT_RESOURCE(dolphin); Q_INIT_RESOURCE(dolphin);
@ -751,7 +751,7 @@ void DolphinMainWindow::editSettings()
void DolphinMainWindow::handleUrl(const QUrl& url) void DolphinMainWindow::handleUrl(const QUrl& url)
{ {
delete m_lastHandleUrlStatJob; delete m_lastHandleUrlStatJob;
m_lastHandleUrlStatJob = 0; m_lastHandleUrlStatJob = nullptr;
if (url.isLocalFile() && QFileInfo(url.toLocalFile()).isDir()) { if (url.isLocalFile() && QFileInfo(url.toLocalFile()).isDir()) {
activeViewContainer()->setUrl(url); activeViewContainer()->setUrl(url);
@ -771,7 +771,7 @@ void DolphinMainWindow::handleUrl(const QUrl& url)
void DolphinMainWindow::slotHandleUrlStatFinished(KJob* job) void DolphinMainWindow::slotHandleUrlStatFinished(KJob* job)
{ {
m_lastHandleUrlStatJob = 0; m_lastHandleUrlStatJob = nullptr;
const KIO::UDSEntry entry = static_cast<KIO::StatJob*>(job)->statResult(); const KIO::UDSEntry entry = static_cast<KIO::StatJob*>(job)->statResult();
const QUrl url = static_cast<KIO::StatJob*>(job)->url(); const QUrl url = static_cast<KIO::StatJob*>(job)->url();
if (entry.isDir()) { if (entry.isDir()) {
@ -912,7 +912,7 @@ void DolphinMainWindow::updateToolBar()
void DolphinMainWindow::slotControlButtonDeleted() void DolphinMainWindow::slotControlButtonDeleted()
{ {
m_controlButton = 0; m_controlButton = nullptr;
m_updateToolBarTimer->start(); m_updateToolBarTimer->start();
} }
@ -1174,7 +1174,7 @@ void DolphinMainWindow::setupActions()
} }
// setup 'Settings' menu // setup 'Settings' menu
KToggleAction* showMenuBar = KStandardAction::showMenubar(0, 0, actionCollection()); KToggleAction* showMenuBar = KStandardAction::showMenubar(nullptr, nullptr, actionCollection());
connect(showMenuBar, &KToggleAction::triggered, // Fixes #286822 connect(showMenuBar, &KToggleAction::triggered, // Fixes #286822
this, &DolphinMainWindow::toggleShowMenuBar, Qt::QueuedConnection); this, &DolphinMainWindow::toggleShowMenuBar, Qt::QueuedConnection);
KStandardAction::preferences(this, SLOT(editSettings()), actionCollection()); KStandardAction::preferences(this, SLOT(editSettings()), actionCollection());
@ -1436,10 +1436,10 @@ void DolphinMainWindow::createControlButton()
void DolphinMainWindow::deleteControlButton() void DolphinMainWindow::deleteControlButton()
{ {
delete m_controlButton; delete m_controlButton;
m_controlButton = 0; m_controlButton = nullptr;
delete m_updateToolBarTimer; delete m_updateToolBarTimer;
m_updateToolBarTimer = 0; m_updateToolBarTimer = nullptr;
} }
bool DolphinMainWindow::addActionToMenu(QAction* action, QMenu* menu) bool DolphinMainWindow::addActionToMenu(QAction* action, QMenu* menu)

View file

@ -60,8 +60,8 @@ K_PLUGIN_FACTORY(DolphinPartFactory, registerPlugin<DolphinPart>();)
DolphinPart::DolphinPart(QWidget* parentWidget, QObject* parent, const QVariantList& args) DolphinPart::DolphinPart(QWidget* parentWidget, QObject* parent, const QVariantList& args)
: KParts::ReadOnlyPart(parent) : KParts::ReadOnlyPart(parent)
,m_openTerminalAction(0) ,m_openTerminalAction(nullptr)
,m_removeAction(0) ,m_removeAction(nullptr)
{ {
Q_UNUSED(args) Q_UNUSED(args)
setComponentData(*createAboutData(), false); setComponentData(*createAboutData(), false);
@ -316,7 +316,7 @@ bool DolphinPart::openUrl(const QUrl &url)
QString prettyUrl = visibleUrl.toDisplayString(QUrl::PreferLocalFile); QString prettyUrl = visibleUrl.toDisplayString(QUrl::PreferLocalFile);
emit setWindowCaption(prettyUrl); emit setWindowCaption(prettyUrl);
emit m_extension->setLocationBarUrl(prettyUrl); emit m_extension->setLocationBarUrl(prettyUrl);
emit started(0); // get the wheel to spin emit started(nullptr); // get the wheel to spin
m_view->setNameFilter(m_nameFilter); m_view->setNameFilter(m_nameFilter);
m_view->setUrl(url); m_view->setUrl(url);
updatePasteAction(); updatePasteAction();
@ -431,7 +431,7 @@ void DolphinPart::slotOpenContextMenu(const QPoint& pos,
if (showDeleteAction && showMoveToTrashAction) { if (showDeleteAction && showMoveToTrashAction) {
delete m_removeAction; delete m_removeAction;
m_removeAction = 0; m_removeAction = nullptr;
editActions.append(actionCollection()->action(KStandardAction::name(KStandardAction::MoveToTrash))); editActions.append(actionCollection()->action(KStandardAction::name(KStandardAction::MoveToTrash)));
editActions.append(actionCollection()->action(KStandardAction::name(KStandardAction::DeleteFile))); editActions.append(actionCollection()->action(KStandardAction::name(KStandardAction::DeleteFile)));
} else if (showDeleteAction && !showMoveToTrashAction) { } else if (showDeleteAction && !showMoveToTrashAction) {

View file

@ -86,7 +86,7 @@ void DolphinRecentTabsMenu::handleAction(QAction* action)
const QByteArray state = action->data().toByteArray(); const QByteArray state = action->data().toByteArray();
removeAction(action); removeAction(action);
delete action; delete action;
action = 0; action = nullptr;
emit restoreClosedTab(state); emit restoreClosedTab(state);
emit closedTabsCountChanged(menu()->actions().size() - 2); emit closedTabsCountChanged(menu()->actions().size() - 2);
} }

View file

@ -33,7 +33,7 @@ class DolphinTabPage : public QWidget
Q_OBJECT Q_OBJECT
public: public:
explicit DolphinTabPage(const QUrl& primaryUrl, const QUrl& secondaryUrl = QUrl(), QWidget* parent = 0); explicit DolphinTabPage(const QUrl& primaryUrl, const QUrl& secondaryUrl = QUrl(), QWidget* parent = nullptr);
/** /**
* @return True if primary view is the active view in this tab. * @return True if primary view is the active view in this tab.

View file

@ -52,14 +52,14 @@
DolphinViewContainer::DolphinViewContainer(const QUrl& url, QWidget* parent) : DolphinViewContainer::DolphinViewContainer(const QUrl& url, QWidget* parent) :
QWidget(parent), QWidget(parent),
m_topLayout(0), m_topLayout(nullptr),
m_urlNavigator(0), m_urlNavigator(nullptr),
m_searchBox(0), m_searchBox(nullptr),
m_messageWidget(0), m_messageWidget(nullptr),
m_view(0), m_view(nullptr),
m_filterBar(0), m_filterBar(nullptr),
m_statusBar(0), m_statusBar(nullptr),
m_statusBarTimer(0), m_statusBarTimer(nullptr),
m_statusBarTimestamp(), m_statusBarTimestamp(),
m_autoGrabFocus(true) m_autoGrabFocus(true)
#ifdef KActivities_FOUND #ifdef KActivities_FOUND

View file

@ -37,7 +37,7 @@ class FilterBar : public QWidget
Q_OBJECT Q_OBJECT
public: public:
explicit FilterBar(QWidget* parent = 0); explicit FilterBar(QWidget* parent = nullptr);
~FilterBar() override; ~FilterBar() override;
/** Called by view container to hide this **/ /** Called by view container to hide this **/

View file

@ -49,9 +49,9 @@ namespace {
KFileItemListView::KFileItemListView(QGraphicsWidget* parent) : KFileItemListView::KFileItemListView(QGraphicsWidget* parent) :
KStandardItemListView(parent), KStandardItemListView(parent),
m_modelRolesUpdater(0), m_modelRolesUpdater(nullptr),
m_updateVisibleIndexRangeTimer(0), m_updateVisibleIndexRangeTimer(nullptr),
m_updateIconSizeTimer(0) m_updateIconSizeTimer(nullptr)
{ {
setAcceptDrops(true); setAcceptDrops(true);
@ -229,7 +229,7 @@ void KFileItemListView::onModelChanged(KItemModelBase* current, KItemModelBase*
KStandardItemListView::onModelChanged(current, previous); KStandardItemListView::onModelChanged(current, previous);
delete m_modelRolesUpdater; delete m_modelRolesUpdater;
m_modelRolesUpdater = 0; m_modelRolesUpdater = nullptr;
if (current) { if (current) {
m_modelRolesUpdater = new KFileItemModelRolesUpdater(static_cast<KFileItemModel*>(current), this); m_modelRolesUpdater = new KFileItemModelRolesUpdater(static_cast<KFileItemModel*>(current), this);

View file

@ -41,7 +41,7 @@ class DOLPHIN_EXPORT KFileItemListView : public KStandardItemListView
Q_OBJECT Q_OBJECT
public: public:
KFileItemListView(QGraphicsWidget* parent = 0); KFileItemListView(QGraphicsWidget* parent = nullptr);
~KFileItemListView() override; ~KFileItemListView() override;
void setPreviewsShown(bool show); void setPreviewsShown(bool show);

View file

@ -42,7 +42,7 @@
KFileItemModel::KFileItemModel(QObject* parent) : KFileItemModel::KFileItemModel(QObject* parent) :
KItemModelBase("text", parent), KItemModelBase("text", parent),
m_dirLister(0), m_dirLister(nullptr),
m_sortDirsFirst(true), m_sortDirsFirst(true),
m_sortRole(NameRole), m_sortRole(NameRole),
m_sortingProgressPercent(-1), m_sortingProgressPercent(-1),
@ -52,8 +52,8 @@ KFileItemModel::KFileItemModel(QObject* parent) :
m_filter(), m_filter(),
m_filteredItems(), m_filteredItems(),
m_requestRole(), m_requestRole(),
m_maximumUpdateIntervalTimer(0), m_maximumUpdateIntervalTimer(nullptr),
m_resortAllItemsTimer(0), m_resortAllItemsTimer(nullptr),
m_pendingItemsToInsert(), m_pendingItemsToInsert(),
m_groups(), m_groups(),
m_expandedDirs(), m_expandedDirs(),
@ -251,7 +251,7 @@ QMimeData* KFileItemModel::createMimeData(const KItemSet& indexes) const
QList<QUrl> urls; QList<QUrl> urls;
QList<QUrl> mostLocalUrls; QList<QUrl> mostLocalUrls;
bool canUseMostLocalUrls = true; bool canUseMostLocalUrls = true;
const ItemData* lastAddedItem = 0; const ItemData* lastAddedItem = nullptr;
for (int index : indexes) { for (int index : indexes) {
const ItemData* itemData = m_itemData.at(index); const ItemData* itemData = m_itemData.at(index);
@ -2295,16 +2295,16 @@ const KFileItemModel::RoleInfoMap* KFileItemModel::rolesInfoMap(int& count)
{ {
static const RoleInfoMap rolesInfoMap[] = { static const RoleInfoMap rolesInfoMap[] = {
// | role | roleType | role translation | group translation | requires Baloo | requires indexer // | role | roleType | role translation | group translation | requires Baloo | requires indexer
{ 0, NoRole, 0, 0, 0, 0, false, false }, { nullptr, NoRole, nullptr, nullptr, nullptr, nullptr, false, false },
{ "text", NameRole, I18N_NOOP2_NOSTRIP("@label", "Name"), 0, 0, false, false }, { "text", NameRole, I18N_NOOP2_NOSTRIP("@label", "Name"), nullptr, nullptr, false, false },
{ "size", SizeRole, I18N_NOOP2_NOSTRIP("@label", "Size"), 0, 0, false, false }, { "size", SizeRole, I18N_NOOP2_NOSTRIP("@label", "Size"), nullptr, nullptr, false, false },
{ "modificationtime", ModificationTimeRole, I18N_NOOP2_NOSTRIP("@label", "Modified"), 0, 0, false, false }, { "modificationtime", ModificationTimeRole, I18N_NOOP2_NOSTRIP("@label", "Modified"), nullptr, nullptr, false, false },
{ "creationtime", CreationTimeRole, I18N_NOOP2_NOSTRIP("@label", "Created"), 0, 0, false, false }, { "creationtime", CreationTimeRole, I18N_NOOP2_NOSTRIP("@label", "Created"), nullptr, nullptr, false, false },
{ "accesstime", AccessTimeRole, I18N_NOOP2_NOSTRIP("@label", "Accessed"), 0, 0, false, false }, { "accesstime", AccessTimeRole, I18N_NOOP2_NOSTRIP("@label", "Accessed"), nullptr, nullptr, false, false },
{ "type", TypeRole, I18N_NOOP2_NOSTRIP("@label", "Type"), 0, 0, false, false }, { "type", TypeRole, I18N_NOOP2_NOSTRIP("@label", "Type"), nullptr, nullptr, false, false },
{ "rating", RatingRole, I18N_NOOP2_NOSTRIP("@label", "Rating"), 0, 0, true, false }, { "rating", RatingRole, I18N_NOOP2_NOSTRIP("@label", "Rating"), nullptr, nullptr, true, false },
{ "tags", TagsRole, I18N_NOOP2_NOSTRIP("@label", "Tags"), 0, 0, true, false }, { "tags", TagsRole, I18N_NOOP2_NOSTRIP("@label", "Tags"), nullptr, nullptr, true, false },
{ "comment", CommentRole, I18N_NOOP2_NOSTRIP("@label", "Comment"), 0, 0, true, false }, { "comment", CommentRole, I18N_NOOP2_NOSTRIP("@label", "Comment"), nullptr, nullptr, true, false },
{ "title", TitleRole, I18N_NOOP2_NOSTRIP("@label", "Title"), I18N_NOOP2_NOSTRIP("@label", "Document"), true, true }, { "title", TitleRole, I18N_NOOP2_NOSTRIP("@label", "Title"), I18N_NOOP2_NOSTRIP("@label", "Document"), true, true },
{ "wordCount", WordCountRole, I18N_NOOP2_NOSTRIP("@label", "Word Count"), I18N_NOOP2_NOSTRIP("@label", "Document"), true, true }, { "wordCount", WordCountRole, I18N_NOOP2_NOSTRIP("@label", "Word Count"), I18N_NOOP2_NOSTRIP("@label", "Document"), true, true },
{ "lineCount", LineCountRole, I18N_NOOP2_NOSTRIP("@label", "Line Count"), I18N_NOOP2_NOSTRIP("@label", "Document"), true, true }, { "lineCount", LineCountRole, I18N_NOOP2_NOSTRIP("@label", "Line Count"), I18N_NOOP2_NOSTRIP("@label", "Document"), true, true },

View file

@ -50,7 +50,7 @@ class DOLPHIN_EXPORT KFileItemModel : public KItemModelBase
Q_OBJECT Q_OBJECT
public: public:
explicit KFileItemModel(QObject* parent = 0); explicit KFileItemModel(QObject* parent = nullptr);
~KFileItemModel() override; ~KFileItemModel() override;
/** /**

View file

@ -88,12 +88,12 @@ KFileItemModelRolesUpdater::KFileItemModelRolesUpdater(KFileItemModel* model, QO
m_pendingIndexes(), m_pendingIndexes(),
m_pendingPreviewItems(), m_pendingPreviewItems(),
m_previewJob(), m_previewJob(),
m_recentlyChangedItemsTimer(0), m_recentlyChangedItemsTimer(nullptr),
m_recentlyChangedItems(), m_recentlyChangedItems(),
m_changedItems(), m_changedItems(),
m_directoryContentsCounter(0) m_directoryContentsCounter(nullptr)
#ifdef HAVE_BALOO #ifdef HAVE_BALOO
, m_balooFileMonitor(0) , m_balooFileMonitor(nullptr)
#endif #endif
{ {
Q_ASSERT(model); Q_ASSERT(model);
@ -296,7 +296,7 @@ void KFileItemModelRolesUpdater::setRoles(const QSet<QByteArray>& roles)
this, &KFileItemModelRolesUpdater::applyChangedBalooRoles); this, &KFileItemModelRolesUpdater::applyChangedBalooRoles);
} else if (!hasBalooRole && m_balooFileMonitor) { } else if (!hasBalooRole && m_balooFileMonitor) {
delete m_balooFileMonitor; delete m_balooFileMonitor;
m_balooFileMonitor = 0; m_balooFileMonitor = nullptr;
} }
#endif #endif
@ -594,7 +594,7 @@ void KFileItemModelRolesUpdater::slotPreviewFailed(const KFileItem& item)
void KFileItemModelRolesUpdater::slotPreviewJobFinished() void KFileItemModelRolesUpdater::slotPreviewJobFinished()
{ {
m_previewJob = 0; m_previewJob = nullptr;
if (m_state != PreviewJobRunning) { if (m_state != PreviewJobRunning) {
return; return;
@ -1138,7 +1138,7 @@ void KFileItemModelRolesUpdater::killPreviewJob()
disconnect(m_previewJob, &KIO::PreviewJob::finished, disconnect(m_previewJob, &KIO::PreviewJob::finished,
this, &KFileItemModelRolesUpdater::slotPreviewJobFinished); this, &KFileItemModelRolesUpdater::slotPreviewJobFinished);
m_previewJob->kill(); m_previewJob->kill();
m_previewJob = 0; m_previewJob = nullptr;
m_pendingPreviewItems.clear(); m_pendingPreviewItems.clear();
} }
} }

View file

@ -94,7 +94,7 @@ class DOLPHIN_EXPORT KFileItemModelRolesUpdater : public QObject
Q_OBJECT Q_OBJECT
public: public:
explicit KFileItemModelRolesUpdater(KFileItemModel* model, QObject* parent = 0); explicit KFileItemModelRolesUpdater(KFileItemModel* model, QObject* parent = nullptr);
~KFileItemModelRolesUpdater() override; ~KFileItemModelRolesUpdater() override;
void setIconSize(const QSize& size); void setIconSize(const QSize& size);

View file

@ -70,8 +70,8 @@ void KItemListContainerViewport::wheelEvent(QWheelEvent* event)
KItemListContainer::KItemListContainer(KItemListController* controller, QWidget* parent) : KItemListContainer::KItemListContainer(KItemListController* controller, QWidget* parent) :
QAbstractScrollArea(parent), QAbstractScrollArea(parent),
m_controller(controller), m_controller(controller),
m_horizontalSmoothScroller(0), m_horizontalSmoothScroller(nullptr),
m_verticalSmoothScroller(0) m_verticalSmoothScroller(nullptr)
{ {
Q_ASSERT(controller); Q_ASSERT(controller);
controller->setParent(this); controller->setParent(this);
@ -83,10 +83,10 @@ KItemListContainer::KItemListContainer(KItemListController* controller, QWidget*
m_verticalSmoothScroller = new KItemListSmoothScroller(verticalScrollBar(), this); m_verticalSmoothScroller = new KItemListSmoothScroller(verticalScrollBar(), this);
if (controller->model()) { if (controller->model()) {
slotModelChanged(controller->model(), 0); slotModelChanged(controller->model(), nullptr);
} }
if (controller->view()) { if (controller->view()) {
slotViewChanged(controller->view(), 0); slotViewChanged(controller->view(), nullptr);
} }
connect(controller, &KItemListController::modelChanged, connect(controller, &KItemListController::modelChanged,
@ -100,7 +100,7 @@ KItemListContainer::~KItemListContainer()
// Don't rely on the QObject-order to delete the controller, otherwise // Don't rely on the QObject-order to delete the controller, otherwise
// the QGraphicsScene might get deleted before the view. // the QGraphicsScene might get deleted before the view.
delete m_controller; delete m_controller;
m_controller = 0; m_controller = nullptr;
} }
KItemListController* KItemListContainer::controller() const KItemListController* KItemListContainer::controller() const
@ -216,8 +216,8 @@ void KItemListContainer::slotViewChanged(KItemListView* current, KItemListView*
disconnect(previous, &KItemListView::maximumItemOffsetChanged, disconnect(previous, &KItemListView::maximumItemOffsetChanged,
this, &KItemListContainer::updateItemOffsetScrollBar); this, &KItemListContainer::updateItemOffsetScrollBar);
disconnect(previous, &KItemListView::scrollTo, this, &KItemListContainer::scrollTo); disconnect(previous, &KItemListView::scrollTo, this, &KItemListContainer::scrollTo);
m_horizontalSmoothScroller->setTargetObject(0); m_horizontalSmoothScroller->setTargetObject(nullptr);
m_verticalSmoothScroller->setTargetObject(0); m_verticalSmoothScroller->setTargetObject(nullptr);
} }
if (current) { if (current) {
scene->addItem(current); scene->addItem(current);
@ -257,8 +257,8 @@ void KItemListContainer::updateScrollOffsetScrollBar()
return; return;
} }
KItemListSmoothScroller* smoothScroller = 0; KItemListSmoothScroller* smoothScroller = nullptr;
QScrollBar* scrollOffsetScrollBar = 0; QScrollBar* scrollOffsetScrollBar = nullptr;
int singleStep = 0; int singleStep = 0;
int pageStep = 0; int pageStep = 0;
int maximum = 0; int maximum = 0;
@ -308,8 +308,8 @@ void KItemListContainer::updateItemOffsetScrollBar()
return; return;
} }
KItemListSmoothScroller* smoothScroller = 0; KItemListSmoothScroller* smoothScroller = nullptr;
QScrollBar* itemOffsetScrollBar = 0; QScrollBar* itemOffsetScrollBar = nullptr;
int singleStep = 0; int singleStep = 0;
int pageStep = 0; int pageStep = 0;
if (view->scrollOrientation() == Qt::Vertical) { if (view->scrollOrientation() == Qt::Vertical) {

View file

@ -50,7 +50,7 @@ public:
* (the parent will be set to the KItemListContainer). * (the parent will be set to the KItemListContainer).
* @param parent Optional parent widget. * @param parent Optional parent widget.
*/ */
explicit KItemListContainer(KItemListController* controller, QWidget* parent = 0); explicit KItemListContainer(KItemListController* controller, QWidget* parent = nullptr);
~KItemListContainer() override; ~KItemListContainer() override;
KItemListController* controller() const; KItemListController* controller() const;

View file

@ -49,13 +49,13 @@ KItemListController::KItemListController(KItemModelBase* model, KItemListView* v
m_selectionBehavior(NoSelection), m_selectionBehavior(NoSelection),
m_autoActivationBehavior(ActivationAndExpansion), m_autoActivationBehavior(ActivationAndExpansion),
m_mouseDoubleClickAction(ActivateItemOnly), m_mouseDoubleClickAction(ActivateItemOnly),
m_model(0), m_model(nullptr),
m_view(0), m_view(nullptr),
m_selectionManager(new KItemListSelectionManager(this)), m_selectionManager(new KItemListSelectionManager(this)),
m_keyboardManager(new KItemListKeyboardSearchManager(this)), m_keyboardManager(new KItemListKeyboardSearchManager(this)),
m_pressedIndex(-1), m_pressedIndex(-1),
m_pressedMousePos(), m_pressedMousePos(),
m_autoActivationTimer(0), m_autoActivationTimer(nullptr),
m_oldSelection(), m_oldSelection(),
m_keyboardAnchorIndex(-1), m_keyboardAnchorIndex(-1),
m_keyboardAnchorPos(0) m_keyboardAnchorPos(0)
@ -76,10 +76,10 @@ KItemListController::KItemListController(KItemModelBase* model, KItemListView* v
KItemListController::~KItemListController() KItemListController::~KItemListController()
{ {
setView(0); setView(nullptr);
Q_ASSERT(!m_view); Q_ASSERT(!m_view);
setModel(0); setModel(nullptr);
Q_ASSERT(!m_model); Q_ASSERT(!m_model);
} }
@ -1216,7 +1216,7 @@ KItemListWidget* KItemListController::hoveredWidget() const
} }
} }
return 0; return nullptr;
} }
KItemListWidget* KItemListController::widgetForPos(const QPointF& pos) const KItemListWidget* KItemListController::widgetForPos(const QPointF& pos) const
@ -1233,7 +1233,7 @@ KItemListWidget* KItemListController::widgetForPos(const QPointF& pos) const
} }
} }
return 0; return nullptr;
} }
void KItemListController::updateKeyboardAnchor() void KItemListController::updateKeyboardAnchor()

View file

@ -88,7 +88,7 @@ public:
* @param view View of the controller. The ownership is passed to the controller. * @param view View of the controller. The ownership is passed to the controller.
* @param parent Optional parent object. * @param parent Optional parent object.
*/ */
KItemListController(KItemModelBase* model, KItemListView* view, QObject* parent = 0); KItemListController(KItemModelBase* model, KItemListView* view, QObject* parent = nullptr);
~KItemListController() override; ~KItemListController() override;
void setModel(KItemModelBase* model); void setModel(KItemModelBase* model);

View file

@ -29,7 +29,7 @@
#include <QStyleOptionGraphicsItem> #include <QStyleOptionGraphicsItem>
KItemListGroupHeader::KItemListGroupHeader(QGraphicsWidget* parent) : KItemListGroupHeader::KItemListGroupHeader(QGraphicsWidget* parent) :
QGraphicsWidget(parent, 0), QGraphicsWidget(parent, nullptr),
m_dirtyCache(true), m_dirtyCache(true),
m_role(), m_role(),
m_data(), m_data(),

View file

@ -42,7 +42,7 @@ class DOLPHIN_EXPORT KItemListGroupHeader : public QGraphicsWidget
Q_OBJECT Q_OBJECT
public: public:
KItemListGroupHeader(QGraphicsWidget* parent = 0); KItemListGroupHeader(QGraphicsWidget* parent = nullptr);
~KItemListGroupHeader() override; ~KItemListGroupHeader() override;
void setRole(const QByteArray& role); void setRole(const QByteArray& role);
@ -65,7 +65,7 @@ public:
void setItemIndex(int index); void setItemIndex(int index);
int itemIndex() const; int itemIndex() const;
void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0) override; void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = nullptr) override;
protected: protected:
virtual void paintRole(QPainter* painter, const QRectF& roleBounds, const QColor& color) = 0; virtual void paintRole(QPainter* painter, const QRectF& roleBounds, const QColor& color) = 0;

View file

@ -31,7 +31,7 @@ KItemListSelectionManager::KItemListSelectionManager(QObject* parent) :
m_anchorItem(-1), m_anchorItem(-1),
m_selectedItems(), m_selectedItems(),
m_isAnchoredSelectionActive(false), m_isAnchoredSelectionActive(false),
m_model(0) m_model(nullptr)
{ {
} }

View file

@ -51,7 +51,7 @@ public:
Toggle Toggle
}; };
KItemListSelectionManager(QObject* parent = 0); KItemListSelectionManager(QObject* parent = nullptr);
~KItemListSelectionManager() override; ~KItemListSelectionManager() override;
void setCurrentItem(int current); void setCurrentItem(int current);

View file

@ -67,7 +67,7 @@ QAccessibleInterface* accessibleInterfaceFactory(const QString& key, QObject* ob
return new KItemListViewAccessible(view); return new KItemListViewAccessible(view);
} }
return 0; return nullptr;
} }
#endif #endif
@ -80,30 +80,30 @@ KItemListView::KItemListView(QGraphicsWidget* parent) :
m_activeTransactions(0), m_activeTransactions(0),
m_endTransactionAnimationHint(Animation), m_endTransactionAnimationHint(Animation),
m_itemSize(), m_itemSize(),
m_controller(0), m_controller(nullptr),
m_model(0), m_model(nullptr),
m_visibleRoles(), m_visibleRoles(),
m_widgetCreator(0), m_widgetCreator(nullptr),
m_groupHeaderCreator(0), m_groupHeaderCreator(nullptr),
m_styleOption(), m_styleOption(),
m_visibleItems(), m_visibleItems(),
m_visibleGroups(), m_visibleGroups(),
m_visibleCells(), m_visibleCells(),
m_sizeHintResolver(0), m_sizeHintResolver(nullptr),
m_layouter(0), m_layouter(nullptr),
m_animation(0), m_animation(nullptr),
m_layoutTimer(0), m_layoutTimer(nullptr),
m_oldScrollOffset(0), m_oldScrollOffset(0),
m_oldMaximumScrollOffset(0), m_oldMaximumScrollOffset(0),
m_oldItemOffset(0), m_oldItemOffset(0),
m_oldMaximumItemOffset(0), m_oldMaximumItemOffset(0),
m_skipAutoScrollForRubberBand(false), m_skipAutoScrollForRubberBand(false),
m_rubberBand(0), m_rubberBand(nullptr),
m_mousePos(), m_mousePos(),
m_autoScrollIncrement(0), m_autoScrollIncrement(0),
m_autoScrollTimer(0), m_autoScrollTimer(nullptr),
m_header(0), m_header(nullptr),
m_headerWidget(0), m_headerWidget(nullptr),
m_dropIndicator() m_dropIndicator()
{ {
setAcceptHoverEvents(true); setAcceptHoverEvents(true);
@ -141,13 +141,13 @@ KItemListView::~KItemListView()
// widgetCreator(). So it is mandatory to delete the group headers // widgetCreator(). So it is mandatory to delete the group headers
// first. // first.
delete m_groupHeaderCreator; delete m_groupHeaderCreator;
m_groupHeaderCreator = 0; m_groupHeaderCreator = nullptr;
delete m_widgetCreator; delete m_widgetCreator;
m_widgetCreator = 0; m_widgetCreator = nullptr;
delete m_sizeHintResolver; delete m_sizeHintResolver;
m_sizeHintResolver = 0; m_sizeHintResolver = nullptr;
} }
void KItemListView::setScrollOffset(qreal offset) void KItemListView::setScrollOffset(qreal offset)
@ -270,13 +270,13 @@ void KItemListView::setAutoScroll(bool enabled)
m_autoScrollTimer->start(InitialAutoScrollDelay); m_autoScrollTimer->start(InitialAutoScrollDelay);
} else if (!enabled && m_autoScrollTimer) { } else if (!enabled && m_autoScrollTimer) {
delete m_autoScrollTimer; delete m_autoScrollTimer;
m_autoScrollTimer = 0; m_autoScrollTimer = nullptr;
} }
} }
bool KItemListView::autoScroll() const bool KItemListView::autoScroll() const
{ {
return m_autoScrollTimer != 0; return m_autoScrollTimer != nullptr;
} }
void KItemListView::setEnabledSelectionToggles(bool enabled) void KItemListView::setEnabledSelectionToggles(bool enabled)
@ -629,7 +629,7 @@ QPixmap KItemListView::createDragPixmap(const KItemSet& indexes) const
KItemListWidget* item = m_visibleItems.value(indexes.first()); KItemListWidget* item = m_visibleItems.value(indexes.first());
QGraphicsView* graphicsView = scene()->views()[0]; QGraphicsView* graphicsView = scene()->views()[0];
if (item && graphicsView) { if (item && graphicsView) {
pixmap = item->createDragPixmap(0, graphicsView); pixmap = item->createDragPixmap(nullptr, graphicsView);
} }
} else { } else {
// TODO: Not implemented yet. Probably extend the interface // TODO: Not implemented yet. Probably extend the interface
@ -834,12 +834,12 @@ Qt::Orientation KItemListView::scrollOrientation() const
KItemListWidgetCreatorBase* KItemListView::defaultWidgetCreator() const KItemListWidgetCreatorBase* KItemListView::defaultWidgetCreator() const
{ {
return 0; return nullptr;
} }
KItemListGroupHeaderCreatorBase* KItemListView::defaultGroupHeaderCreator() const KItemListGroupHeaderCreatorBase* KItemListView::defaultGroupHeaderCreator() const
{ {
return 0; return nullptr;
} }
void KItemListView::initializeItemListWidget(KItemListWidget* item) void KItemListView::initializeItemListWidget(KItemListWidget* item)
@ -2090,7 +2090,7 @@ void KItemListView::recycleGroupHeaderForWidget(KItemListWidget* widget)
{ {
KItemListGroupHeader* header = m_visibleGroups.value(widget); KItemListGroupHeader* header = m_visibleGroups.value(widget);
if (header) { if (header) {
header->setParentItem(0); header->setParentItem(nullptr);
groupHeaderCreator()->recycle(header); groupHeaderCreator()->recycle(header);
m_visibleGroups.remove(widget); m_visibleGroups.remove(widget);
disconnect(widget, &KItemListWidget::geometryChanged, this, &KItemListView::slotGeometryOfGroupHeaderParentChanged); disconnect(widget, &KItemListWidget::geometryChanged, this, &KItemListView::slotGeometryOfGroupHeaderParentChanged);
@ -2551,7 +2551,7 @@ void KItemListView::updateSiblingsInformation(int firstIndex, int lastIndex)
const int parents = m_model->expandedParentsCount(lastIndex + 1); const int parents = m_model->expandedParentsCount(lastIndex + 1);
for (int i = lastIndex; i >= firstIndex; --i) { for (int i = lastIndex; i >= firstIndex; --i) {
if (m_model->expandedParentsCount(i) != parents) { if (m_model->expandedParentsCount(i) != parents) {
widget = 0; widget = nullptr;
break; break;
} }
} }
@ -2714,7 +2714,7 @@ void KItemListCreatorBase::pushRecycleableWidget(QGraphicsWidget* widget)
QGraphicsWidget* KItemListCreatorBase::popRecycleableWidget() QGraphicsWidget* KItemListCreatorBase::popRecycleableWidget()
{ {
if (m_recycleableWidgets.isEmpty()) { if (m_recycleableWidgets.isEmpty()) {
return 0; return nullptr;
} }
QGraphicsWidget* widget = m_recycleableWidgets.takeLast(); QGraphicsWidget* widget = m_recycleableWidgets.takeLast();
@ -2728,7 +2728,7 @@ KItemListWidgetCreatorBase::~KItemListWidgetCreatorBase()
void KItemListWidgetCreatorBase::recycle(KItemListWidget* widget) void KItemListWidgetCreatorBase::recycle(KItemListWidget* widget)
{ {
widget->setParentItem(0); widget->setParentItem(nullptr);
widget->setOpacity(1.0); widget->setOpacity(1.0);
pushRecycleableWidget(widget); pushRecycleableWidget(widget);
} }

View file

@ -67,7 +67,7 @@ class DOLPHIN_EXPORT KItemListView : public QGraphicsWidget
Q_PROPERTY(qreal itemOffset READ itemOffset WRITE setItemOffset) Q_PROPERTY(qreal itemOffset READ itemOffset WRITE setItemOffset)
public: public:
KItemListView(QGraphicsWidget* parent = 0); KItemListView(QGraphicsWidget* parent = nullptr);
~KItemListView() override; ~KItemListView() override;
/** /**
@ -285,7 +285,7 @@ public:
*/ */
void editRole(int index, const QByteArray& role); void editRole(int index, const QByteArray& role);
void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0) override; void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = nullptr) override;
signals: signals:
void scrollOrientationChanged(Qt::Orientation current, Qt::Orientation previous); void scrollOrientationChanged(Qt::Orientation current, Qt::Orientation previous);

View file

@ -60,7 +60,7 @@ void* KItemListViewAccessible::interface_cast(QAccessible::InterfaceType type)
if (type == QAccessible::TableInterface) { if (type == QAccessible::TableInterface) {
return static_cast<QAccessibleTableInterface*>(this); return static_cast<QAccessibleTableInterface*>(this);
} }
return Q_NULLPTR; return nullptr;
} }
void KItemListViewAccessible::modelReset() void KItemListViewAccessible::modelReset()
@ -70,7 +70,7 @@ void KItemListViewAccessible::modelReset()
QAccessibleInterface* KItemListViewAccessible::cell(int index) const QAccessibleInterface* KItemListViewAccessible::cell(int index) const
{ {
if (index < 0 || index >= view()->model()->count()) { if (index < 0 || index >= view()->model()->count()) {
return 0; return nullptr;
} }
if (m_cells.size() <= index) { if (m_cells.size() <= index) {
@ -93,7 +93,7 @@ QAccessibleInterface* KItemListViewAccessible::cellAt(int row, int column) const
QAccessibleInterface* KItemListViewAccessible::caption() const QAccessibleInterface* KItemListViewAccessible::caption() const
{ {
return 0; return nullptr;
} }
QString KItemListViewAccessible::columnDescription(int) const QString KItemListViewAccessible::columnDescription(int) const
@ -168,7 +168,7 @@ QList<int> KItemListViewAccessible::selectedRows() const
QAccessibleInterface* KItemListViewAccessible::summary() const QAccessibleInterface* KItemListViewAccessible::summary() const
{ {
return 0; return nullptr;
} }
bool KItemListViewAccessible::isColumnSelected(int) const bool KItemListViewAccessible::isColumnSelected(int) const
@ -225,7 +225,7 @@ QAccessibleInterface* KItemListViewAccessible::childAt(int x, int y) const
QAccessibleInterface* KItemListViewAccessible::parent() const QAccessibleInterface* KItemListViewAccessible::parent() const
{ {
// FIXME: return KItemListContainerAccessible here // FIXME: return KItemListContainerAccessible here
return Q_NULLPTR; return nullptr;
} }
int KItemListViewAccessible::childCount() const int KItemListViewAccessible::childCount() const
@ -265,7 +265,7 @@ QAccessibleInterface* KItemListViewAccessible::child(int index) const
if (index >= 0 && index < childCount()) { if (index >= 0 && index < childCount()) {
return cell(index); return cell(index);
} }
return Q_NULLPTR; return nullptr;
} }
// Table Cell // Table Cell
@ -282,7 +282,7 @@ void* KItemListAccessibleCell::interface_cast(QAccessible::InterfaceType type)
if (type == QAccessible::TableCellInterface) { if (type == QAccessible::TableCellInterface) {
return static_cast<QAccessibleTableCellInterface*>(this); return static_cast<QAccessibleTableCellInterface*>(this);
} }
return Q_NULLPTR; return nullptr;
} }
int KItemListAccessibleCell::columnExtent() const int KItemListAccessibleCell::columnExtent() const
@ -398,7 +398,7 @@ void KItemListAccessibleCell::setText(QAccessible::Text, const QString&)
QAccessibleInterface* KItemListAccessibleCell::child(int) const QAccessibleInterface* KItemListAccessibleCell::child(int) const
{ {
return Q_NULLPTR; return nullptr;
} }
bool KItemListAccessibleCell::isValid() const bool KItemListAccessibleCell::isValid() const
@ -408,7 +408,7 @@ bool KItemListAccessibleCell::isValid() const
QAccessibleInterface* KItemListAccessibleCell::childAt(int, int) const QAccessibleInterface* KItemListAccessibleCell::childAt(int, int) const
{ {
return Q_NULLPTR; return nullptr;
} }
int KItemListAccessibleCell::childCount() const int KItemListAccessibleCell::childCount() const
@ -434,7 +434,7 @@ int KItemListAccessibleCell::index() const
QObject* KItemListAccessibleCell::object() const QObject* KItemListAccessibleCell::object() const
{ {
return 0; return nullptr;
} }
// Container Interface // Container Interface
@ -465,7 +465,7 @@ QAccessibleInterface* KItemListContainerAccessible::child(int index) const
if (index == 0) { if (index == 0) {
return QAccessible::queryAccessibleInterface(container()->controller()->view()); return QAccessible::queryAccessibleInterface(container()->controller()->view());
} }
return Q_NULLPTR; return nullptr;
} }
const KItemListContainer* KItemListContainerAccessible::container() const const KItemListContainer* KItemListContainerAccessible::container() const

View file

@ -42,7 +42,7 @@ KItemListWidgetInformant::~KItemListWidgetInformant()
} }
KItemListWidget::KItemListWidget(KItemListWidgetInformant* informant, QGraphicsItem* parent) : KItemListWidget::KItemListWidget(KItemListWidgetInformant* informant, QGraphicsItem* parent) :
QGraphicsWidget(parent, 0), QGraphicsWidget(parent, nullptr),
m_informant(informant), m_informant(informant),
m_index(-1), m_index(-1),
m_selected(false), m_selected(false),
@ -56,9 +56,9 @@ KItemListWidget::KItemListWidget(KItemListWidgetInformant* informant, QGraphicsI
m_styleOption(), m_styleOption(),
m_siblingsInfo(), m_siblingsInfo(),
m_hoverOpacity(0), m_hoverOpacity(0),
m_hoverCache(0), m_hoverCache(nullptr),
m_hoverAnimation(0), m_hoverAnimation(nullptr),
m_selectionToggle(0), m_selectionToggle(nullptr),
m_editedRole() m_editedRole()
{ {
} }
@ -72,7 +72,7 @@ void KItemListWidget::setIndex(int index)
{ {
if (m_index != index) { if (m_index != index) {
delete m_selectionToggle; delete m_selectionToggle;
m_selectionToggle = 0; m_selectionToggle = nullptr;
if (m_hoverAnimation) { if (m_hoverAnimation) {
m_hoverAnimation->stop(); m_hoverAnimation->stop();
@ -474,7 +474,7 @@ void KItemListWidget::slotHoverAnimationFinished()
{ {
if (!m_hovered && m_selectionToggle) { if (!m_hovered && m_selectionToggle) {
m_selectionToggle->deleteLater(); m_selectionToggle->deleteLater();
m_selectionToggle = 0; m_selectionToggle = nullptr;
} }
} }
@ -502,7 +502,7 @@ void KItemListWidget::setHoverOpacity(qreal opacity)
if (m_hoverOpacity <= 0.0) { if (m_hoverOpacity <= 0.0) {
delete m_hoverCache; delete m_hoverCache;
m_hoverCache = 0; m_hoverCache = nullptr;
} }
update(); update();
@ -511,7 +511,7 @@ void KItemListWidget::setHoverOpacity(qreal opacity)
void KItemListWidget::clearHoverCache() void KItemListWidget::clearHoverCache()
{ {
delete m_hoverCache; delete m_hoverCache;
m_hoverCache = 0; m_hoverCache = nullptr;
} }
void KItemListWidget::drawItemStyleOption(QPainter* painter, QWidget* widget, QStyle::State styleState) void KItemListWidget::drawItemStyleOption(QPainter* painter, QWidget* widget, QStyle::State styleState)

View file

@ -82,7 +82,7 @@ public:
* to show the data of the custom model provided by KItemListWidget::data(). * to show the data of the custom model provided by KItemListWidget::data().
* @reimp * @reimp
*/ */
void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0) override; void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = nullptr) override;
void setVisibleRoles(const QList<QByteArray>& roles); void setVisibleRoles(const QList<QByteArray>& roles);
QList<QByteArray> visibleRoles() const; QList<QByteArray> visibleRoles() const;
@ -186,7 +186,7 @@ public:
* @return Pixmap that is used when dragging an item. Per default the current state of the * @return Pixmap that is used when dragging an item. Per default the current state of the
* widget is returned as pixmap. * widget is returned as pixmap.
*/ */
virtual QPixmap createDragPixmap(const QStyleOptionGraphicsItem* option, QWidget* widget = 0); virtual QPixmap createDragPixmap(const QStyleOptionGraphicsItem* option, QWidget* widget = nullptr);
signals: signals:
void roleEditingCanceled(int index, const QByteArray& role, const QVariant& value); void roleEditingCanceled(int index, const QByteArray& role, const QVariant& value);

View file

@ -126,7 +126,7 @@ int KItemModelBase::expandedParentsCount(int index) const
QMimeData* KItemModelBase::createMimeData(const KItemSet& indexes) const QMimeData* KItemModelBase::createMimeData(const KItemSet& indexes) const
{ {
Q_UNUSED(indexes); Q_UNUSED(indexes);
return 0; return nullptr;
} }
int KItemModelBase::indexForKeyboardSearch(const QString& text, int startFromIndex) const int KItemModelBase::indexForKeyboardSearch(const QString& text, int startFromIndex) const

View file

@ -55,8 +55,8 @@ class DOLPHIN_EXPORT KItemModelBase : public QObject
Q_OBJECT Q_OBJECT
public: public:
KItemModelBase(QObject* parent = 0); KItemModelBase(QObject* parent = nullptr);
explicit KItemModelBase(const QByteArray& sortRole, QObject* parent = 0); explicit KItemModelBase(const QByteArray& sortRole, QObject* parent = nullptr);
~KItemModelBase() override; ~KItemModelBase() override;
/** @return The number of items. */ /** @return The number of items. */

View file

@ -25,7 +25,7 @@
KStandardItem::KStandardItem(KStandardItem* parent) : KStandardItem::KStandardItem(KStandardItem* parent) :
m_parent(parent), m_parent(parent),
m_children(), m_children(),
m_model(0), m_model(nullptr),
m_data() m_data()
{ {
} }
@ -33,7 +33,7 @@ KStandardItem::KStandardItem(KStandardItem* parent) :
KStandardItem::KStandardItem(const QString& text, KStandardItem* parent) : KStandardItem::KStandardItem(const QString& text, KStandardItem* parent) :
m_parent(parent), m_parent(parent),
m_children(), m_children(),
m_model(0), m_model(nullptr),
m_data() m_data()
{ {
setText(text); setText(text);
@ -42,7 +42,7 @@ KStandardItem::KStandardItem(const QString& text, KStandardItem* parent) :
KStandardItem::KStandardItem(const QString& icon, const QString& text, KStandardItem* parent) : KStandardItem::KStandardItem(const QString& icon, const QString& text, KStandardItem* parent) :
m_parent(parent), m_parent(parent),
m_children(), m_children(),
m_model(0), m_model(nullptr),
m_data() m_data()
{ {
setIcon(icon); setIcon(icon);

View file

@ -40,9 +40,9 @@ class DOLPHIN_EXPORT KStandardItem
{ {
public: public:
explicit KStandardItem(KStandardItem* parent = 0); explicit KStandardItem(KStandardItem* parent = nullptr);
explicit KStandardItem(const QString& text, KStandardItem* parent = 0); explicit KStandardItem(const QString& text, KStandardItem* parent = nullptr);
KStandardItem(const QString& icon, const QString& text, KStandardItem* parent = 0); KStandardItem(const QString& icon, const QString& text, KStandardItem* parent = nullptr);
KStandardItem(const KStandardItem& item); KStandardItem(const KStandardItem& item);
virtual ~KStandardItem(); virtual ~KStandardItem();

View file

@ -32,10 +32,10 @@ class DOLPHIN_EXPORT KStandardItemListGroupHeader : public KItemListGroupHeader
Q_OBJECT Q_OBJECT
public: public:
KStandardItemListGroupHeader(QGraphicsWidget* parent = 0); KStandardItemListGroupHeader(QGraphicsWidget* parent = nullptr);
~KStandardItemListGroupHeader() override; ~KStandardItemListGroupHeader() override;
void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0) override; void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = nullptr) override;
protected: protected:
void paintRole(QPainter* painter, const QRectF& roleBounds, const QColor& color) override; void paintRole(QPainter* painter, const QRectF& roleBounds, const QColor& color) override;

View file

@ -52,7 +52,7 @@ public:
DetailsLayout DetailsLayout
}; };
KStandardItemListView(QGraphicsWidget* parent = 0); KStandardItemListView(QGraphicsWidget* parent = nullptr);
~KStandardItemListView() override; ~KStandardItemListView() override;
void setItemLayout(ItemLayout layout); void setItemLayout(ItemLayout layout);

View file

@ -273,8 +273,8 @@ KStandardItemListWidget::KStandardItemListWidget(KItemListWidgetInformant* infor
m_additionalInfoTextColor(), m_additionalInfoTextColor(),
m_overlay(), m_overlay(),
m_rating(), m_rating(),
m_roleEditor(0), m_roleEditor(nullptr),
m_oldRoleEditor(0) m_oldRoleEditor(nullptr)
{ {
} }
@ -770,7 +770,7 @@ void KStandardItemListWidget::editedRoleChanged(const QByteArray& current, const
} }
m_oldRoleEditor = m_roleEditor; m_oldRoleEditor = m_roleEditor;
m_roleEditor->hide(); m_roleEditor->hide();
m_roleEditor = 0; m_roleEditor = nullptr;
} }
return; return;
} }
@ -1452,7 +1452,7 @@ void KStandardItemListWidget::closeRoleEditor()
} }
m_oldRoleEditor = m_roleEditor; m_oldRoleEditor = m_roleEditor;
m_roleEditor->hide(); m_roleEditor->hide();
m_roleEditor = 0; m_roleEditor = nullptr;
} }
QPixmap KStandardItemListWidget::pixmapForIcon(const QString& name, const QStringList& overlays, int size, QIcon::Mode mode) QPixmap KStandardItemListWidget::pixmapForIcon(const QString& name, const QStringList& overlays, int size, QIcon::Mode mode)

View file

@ -104,7 +104,7 @@ public:
void setSupportsItemExpanding(bool supportsItemExpanding); void setSupportsItemExpanding(bool supportsItemExpanding);
bool supportsItemExpanding() const; bool supportsItemExpanding() const;
void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0) override; void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = nullptr) override;
QRectF iconRect() const override; QRectF iconRect() const override;
QRectF textRect() const override; QRectF textRect() const override;
@ -112,7 +112,7 @@ public:
QRectF selectionRect() const override; QRectF selectionRect() const override;
QRectF expansionToggleRect() const override; QRectF expansionToggleRect() const override;
QRectF selectionToggleRect() const override; QRectF selectionToggleRect() const override;
QPixmap createDragPixmap(const QStyleOptionGraphicsItem* option, QWidget* widget = 0) override; QPixmap createDragPixmap(const QStyleOptionGraphicsItem* option, QWidget* widget = nullptr) override;
static KItemListWidgetInformant* createInformant(); static KItemListWidgetInformant* createInformant();

View file

@ -89,7 +89,7 @@ void KStandardItemModel::changeItem(int index, KStandardItem* item)
m_indexesForItems.remove(oldItem); m_indexesForItems.remove(oldItem);
delete oldItem; delete oldItem;
oldItem = 0; oldItem = nullptr;
m_items[index] = item; m_items[index] = item;
m_indexesForItems.insert(item, index); m_indexesForItems.insert(item, index);
@ -114,7 +114,7 @@ void KStandardItemModel::removeItem(int index)
onItemRemoved(index, item); onItemRemoved(index, item);
delete item; delete item;
item = 0; item = nullptr;
emit itemsRemoved(KItemRangeList() << KItemRange(index, 1)); emit itemsRemoved(KItemRangeList() << KItemRange(index, 1));
@ -134,7 +134,7 @@ void KStandardItemModel::clear()
KStandardItem* KStandardItemModel::item(int index) const KStandardItem* KStandardItemModel::item(int index) const
{ {
if (index < 0 || index >= m_items.count()) { if (index < 0 || index >= m_items.count()) {
return 0; return nullptr;
} }
return m_items[index]; return m_items[index];
} }
@ -178,7 +178,7 @@ bool KStandardItemModel::setData(int index, const QHash<QByteArray, QVariant>& v
QMimeData* KStandardItemModel::createMimeData(const KItemSet& indexes) const QMimeData* KStandardItemModel::createMimeData(const KItemSet& indexes) const
{ {
Q_UNUSED(indexes); Q_UNUSED(indexes);
return 0; return nullptr;
} }
int KStandardItemModel::indexForKeyboardSearch(const QString& text, int startFromIndex) const int KStandardItemModel::indexForKeyboardSearch(const QString& text, int startFromIndex) const

View file

@ -40,7 +40,7 @@ class DOLPHIN_EXPORT KStandardItemModel : public KItemModelBase
Q_OBJECT Q_OBJECT
public: public:
explicit KStandardItemModel(QObject* parent = 0); explicit KStandardItemModel(QObject* parent = nullptr);
~KStandardItemModel() override; ~KStandardItemModel() override;
/** /**

View file

@ -30,9 +30,9 @@ KDirectoryContentsCounter::KDirectoryContentsCounter(KFileItemModel* model, QObj
QObject(parent), QObject(parent),
m_model(model), m_model(model),
m_queue(), m_queue(),
m_worker(0), m_worker(nullptr),
m_workerIsBusy(false), m_workerIsBusy(false),
m_dirWatcher(0), m_dirWatcher(nullptr),
m_watchedDirs() m_watchedDirs()
{ {
connect(m_model, &KFileItemModel::itemsRemoved, connect(m_model, &KFileItemModel::itemsRemoved,
@ -70,7 +70,7 @@ KDirectoryContentsCounter::~KDirectoryContentsCounter()
m_workerThread->quit(); m_workerThread->quit();
m_workerThread->wait(); m_workerThread->wait();
delete m_workerThread; delete m_workerThread;
m_workerThread = 0; m_workerThread = nullptr;
// The worker thread has finished running now, so it's safe to delete // The worker thread has finished running now, so it's safe to delete
// m_worker. deleteLater() would not work at all because the event loop // m_worker. deleteLater() would not work at all because the event loop
@ -180,5 +180,5 @@ void KDirectoryContentsCounter::startWorker(const QString& path)
} }
} }
QThread* KDirectoryContentsCounter::m_workerThread = 0; QThread* KDirectoryContentsCounter::m_workerThread = nullptr;
int KDirectoryContentsCounter::m_workersCount = 0; int KDirectoryContentsCounter::m_workersCount = 0;

View file

@ -35,7 +35,7 @@ class KDirectoryContentsCounter : public QObject
Q_OBJECT Q_OBJECT
public: public:
explicit KDirectoryContentsCounter(KFileItemModel* model, QObject* parent = 0); explicit KDirectoryContentsCounter(KFileItemModel* model, QObject* parent = nullptr);
~KDirectoryContentsCounter() override; ~KDirectoryContentsCounter() override;
/** /**

View file

@ -59,7 +59,7 @@ int KDirectoryContentsCounterWorker::subItemsCount(const QString& path, Options
DIR* dir = ::opendir(QFile::encodeName(path)); DIR* dir = ::opendir(QFile::encodeName(path));
if (dir) { // krazy:exclude=syscalls if (dir) { // krazy:exclude=syscalls
count = 0; count = 0;
struct dirent *dirEntry = 0; struct dirent *dirEntry = nullptr;
while ((dirEntry = ::readdir(dir))) { while ((dirEntry = ::readdir(dir))) {
if (dirEntry->d_name[0] == '.') { if (dirEntry->d_name[0] == '.') {
if (dirEntry->d_name[1] == '\0' || !countHiddenFiles) { if (dirEntry->d_name[1] == '\0' || !countHiddenFiles) {

View file

@ -37,7 +37,7 @@ public:
}; };
Q_DECLARE_FLAGS(Options, Option) Q_DECLARE_FLAGS(Options, Option)
explicit KDirectoryContentsCounterWorker(QObject* parent = 0); explicit KDirectoryContentsCounterWorker(QObject* parent = nullptr);
/** /**
* Counts the items inside the directory \a path using the options * Counts the items inside the directory \a path using the options

View file

@ -74,7 +74,7 @@ void KFileItemClipboard::updateCutItems()
} }
KFileItemClipboard::KFileItemClipboard() : KFileItemClipboard::KFileItemClipboard() :
QObject(0), QObject(nullptr),
m_cutItems() m_cutItems()
{ {
updateCutItems(); updateCutItems();

View file

@ -24,7 +24,7 @@
KFileItemModelDirLister::KFileItemModelDirLister(QObject* parent) : KFileItemModelDirLister::KFileItemModelDirLister(QObject* parent) :
KDirLister(parent) KDirLister(parent)
{ {
setAutoErrorHandlingEnabled(false, 0); setAutoErrorHandlingEnabled(false, nullptr);
} }
KFileItemModelDirLister::~KFileItemModelDirLister() KFileItemModelDirLister::~KFileItemModelDirLister()

View file

@ -34,7 +34,7 @@ class DOLPHIN_EXPORT KFileItemModelDirLister : public KDirLister
Q_OBJECT Q_OBJECT
public: public:
KFileItemModelDirLister(QObject* parent = 0); KFileItemModelDirLister(QObject* parent = nullptr);
~KFileItemModelDirLister() override; ~KFileItemModelDirLister() override;
signals: signals:

View file

@ -26,7 +26,7 @@
KFileItemModelFilter::KFileItemModelFilter() : KFileItemModelFilter::KFileItemModelFilter() :
m_useRegExp(false), m_useRegExp(false),
m_regExp(0), m_regExp(nullptr),
m_lowerCasePattern(), m_lowerCasePattern(),
m_pattern() m_pattern()
{ {
@ -35,7 +35,7 @@ KFileItemModelFilter::KFileItemModelFilter() :
KFileItemModelFilter::~KFileItemModelFilter() KFileItemModelFilter::~KFileItemModelFilter()
{ {
delete m_regExp; delete m_regExp;
m_regExp = 0; m_regExp = nullptr;
} }
void KFileItemModelFilter::setPattern(const QString& filter) void KFileItemModelFilter::setPattern(const QString& filter)

View file

@ -30,7 +30,7 @@
KItemListHeaderWidget::KItemListHeaderWidget(QGraphicsWidget* parent) : KItemListHeaderWidget::KItemListHeaderWidget(QGraphicsWidget* parent) :
QGraphicsWidget(parent), QGraphicsWidget(parent),
m_automaticColumnResizing(true), m_automaticColumnResizing(true),
m_model(0), m_model(nullptr),
m_offset(0), m_offset(0),
m_columns(), m_columns(),
m_columnWidths(), m_columnWidths(),

View file

@ -38,7 +38,7 @@ class DOLPHIN_EXPORT KItemListHeaderWidget : public QGraphicsWidget
Q_OBJECT Q_OBJECT
public: public:
KItemListHeaderWidget(QGraphicsWidget* parent = 0); KItemListHeaderWidget(QGraphicsWidget* parent = nullptr);
~KItemListHeaderWidget() override; ~KItemListHeaderWidget() override;
void setModel(KItemModelBase* model); void setModel(KItemModelBase* model);
@ -64,7 +64,7 @@ public:
qreal minimumColumnWidth() const; qreal minimumColumnWidth() const;
void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0) override; void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = nullptr) override;
signals: signals:
/** /**
@ -121,7 +121,7 @@ private:
const QByteArray& role, const QByteArray& role,
const QRectF& rect, const QRectF& rect,
int orderIndex, int orderIndex,
QWidget* widget = 0) const; QWidget* widget = nullptr) const;
void updatePressedRoleIndex(const QPointF& pos); void updatePressedRoleIndex(const QPointF& pos);
void updateHoveredRoleIndex(const QPointF& pos); void updateHoveredRoleIndex(const QPointF& pos);

View file

@ -41,7 +41,7 @@ class DOLPHIN_EXPORT KItemListKeyboardSearchManager : public QObject
public: public:
KItemListKeyboardSearchManager(QObject* parent = 0); KItemListKeyboardSearchManager(QObject* parent = nullptr);
~KItemListKeyboardSearchManager() override; ~KItemListKeyboardSearchManager() override;
/** /**

View file

@ -32,7 +32,7 @@ class DOLPHIN_EXPORT KItemListRubberBand : public QObject
Q_OBJECT Q_OBJECT
public: public:
explicit KItemListRubberBand(QObject* parent = 0); explicit KItemListRubberBand(QObject* parent = nullptr);
~KItemListRubberBand() override; ~KItemListRubberBand() override;
void setStartPosition(const QPointF& pos); void setStartPosition(const QPointF& pos);

View file

@ -24,7 +24,7 @@
KItemListSelectionToggle::KItemListSelectionToggle(QGraphicsItem* parent) : KItemListSelectionToggle::KItemListSelectionToggle(QGraphicsItem* parent) :
QGraphicsWidget(parent, 0), QGraphicsWidget(parent, nullptr),
m_checked(false), m_checked(false),
m_hovered(false) m_hovered(false)
{ {

View file

@ -42,7 +42,7 @@ public:
void setHovered(bool hovered); void setHovered(bool hovered);
void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0) override; void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = nullptr) override;
protected: protected:
void resizeEvent(QGraphicsSceneResizeEvent* event) override; void resizeEvent(QGraphicsSceneResizeEvent* event) override;

View file

@ -32,7 +32,7 @@ KItemListSmoothScroller::KItemListSmoothScroller(QScrollBar* scrollBar,
m_scrollBarPressed(false), m_scrollBarPressed(false),
m_smoothScrolling(true), m_smoothScrolling(true),
m_scrollBar(scrollBar), m_scrollBar(scrollBar),
m_animation(0) m_animation(nullptr)
{ {
m_animation = new QPropertyAnimation(this); m_animation = new QPropertyAnimation(this);
const int duration = m_scrollBar->style()->styleHint(QStyle::SH_Widget_Animate, nullptr, m_scrollBar) ? 100 : 1; const int duration = m_scrollBar->style()->styleHint(QStyle::SH_Widget_Animate, nullptr, m_scrollBar) ? 100 : 1;

View file

@ -39,7 +39,7 @@ class DOLPHIN_EXPORT KItemListSmoothScroller : public QObject
public: public:
explicit KItemListSmoothScroller(QScrollBar* scrollBar, explicit KItemListSmoothScroller(QScrollBar* scrollBar,
QObject* parent = 0); QObject* parent = nullptr);
~KItemListSmoothScroller() override; ~KItemListSmoothScroller() override;
void setScrollBar(QScrollBar* scrollBar); void setScrollBar(QScrollBar* scrollBar);

View file

@ -116,7 +116,7 @@ void KItemListViewAnimation::start(QGraphicsWidget* widget, AnimationType type,
{ {
stop(widget, type); stop(widget, type);
QPropertyAnimation* propertyAnim = 0; QPropertyAnimation* propertyAnim = nullptr;
const int animationDuration = widget->style()->styleHint(QStyle::SH_Widget_Animate) ? 200 : 1; const int animationDuration = widget->style()->styleHint(QStyle::SH_Widget_Animate) ? 200 : 1;
switch (type) { switch (type) {

View file

@ -48,7 +48,7 @@ public:
ResizeAnimation ResizeAnimation
}; };
KItemListViewAnimation(QObject* parent = 0); KItemListViewAnimation(QObject* parent = nullptr);
~KItemListViewAnimation() override; ~KItemListViewAnimation() override;
void setScrollOrientation(Qt::Orientation orientation); void setScrollOrientation(Qt::Orientation orientation);

View file

@ -35,7 +35,7 @@ KItemListViewLayouter::KItemListViewLayouter(KItemListSizeHintResolver* sizeHint
m_itemSize(128, 128), m_itemSize(128, 128),
m_itemMargin(), m_itemMargin(),
m_headerHeight(0), m_headerHeight(0),
m_model(0), m_model(nullptr),
m_sizeHintResolver(sizeHintResolver), m_sizeHintResolver(sizeHintResolver),
m_scrollOffset(0), m_scrollOffset(0),
m_maximumScrollOffset(0), m_maximumScrollOffset(0),

View file

@ -50,7 +50,7 @@ class DOLPHIN_EXPORT KItemListViewLayouter : public QObject
Q_OBJECT Q_OBJECT
public: public:
KItemListViewLayouter(KItemListSizeHintResolver* sizeHintResolver, QObject* parent = 0); KItemListViewLayouter(KItemListSizeHintResolver* sizeHintResolver, QObject* parent = nullptr);
~KItemListViewLayouter() override; ~KItemListViewLayouter() override;
void setScrollOrientation(Qt::Orientation orientation); void setScrollOrientation(Qt::Orientation orientation);

View file

@ -43,7 +43,7 @@ class FileMetaDataConfigurationDialog : public QDialog
Q_OBJECT Q_OBJECT
public: public:
explicit FileMetaDataConfigurationDialog(QWidget* parent = 0); explicit FileMetaDataConfigurationDialog(QWidget* parent = nullptr);
~FileMetaDataConfigurationDialog() override; ~FileMetaDataConfigurationDialog() override;
/** /**

View file

@ -198,7 +198,7 @@ void InformationPanel::showItemInfo()
void InformationPanel::slotFolderStatFinished(KJob* job) void InformationPanel::slotFolderStatFinished(KJob* job)
{ {
m_folderStatJob = 0; m_folderStatJob = nullptr;
const KIO::UDSEntry entry = static_cast<KIO::StatJob*>(job)->statResult(); const KIO::UDSEntry entry = static_cast<KIO::StatJob*>(job)->statResult();
m_content->showItem(KFileItem(entry, m_shownUrl)); m_content->showItem(KFileItem(entry, m_shownUrl));
} }
@ -296,7 +296,7 @@ void InformationPanel::slotLeftDirectory(const QString& directory)
void InformationPanel::cancelRequest() void InformationPanel::cancelRequest()
{ {
delete m_folderStatJob; delete m_folderStatJob;
m_folderStatJob = 0; m_folderStatJob = nullptr;
m_infoTimer->stop(); m_infoTimer->stop();
m_resetUrlTimer->stop(); m_resetUrlTimer->stop();

View file

@ -65,14 +65,14 @@
InformationPanelContent::InformationPanelContent(QWidget* parent) : InformationPanelContent::InformationPanelContent(QWidget* parent) :
QWidget(parent), QWidget(parent),
m_item(), m_item(),
m_previewJob(0), m_previewJob(nullptr),
m_outdatedPreviewTimer(0), m_outdatedPreviewTimer(nullptr),
m_preview(0), m_preview(nullptr),
m_phononWidget(0), m_phononWidget(nullptr),
m_nameLabel(0), m_nameLabel(nullptr),
m_metaDataWidget(0), m_metaDataWidget(nullptr),
m_metaDataArea(0), m_metaDataArea(nullptr),
m_placesItemModel(0) m_placesItemModel(nullptr)
{ {
parent->installEventFilter(this); parent->installEventFilter(this);

View file

@ -57,7 +57,7 @@ class InformationPanelContent : public QWidget
Q_OBJECT Q_OBJECT
public: public:
explicit InformationPanelContent(QWidget* parent = 0); explicit InformationPanelContent(QWidget* parent = nullptr);
~InformationPanelContent() override; ~InformationPanelContent() override;
/** /**

View file

@ -43,7 +43,7 @@ class PhononWidget : public QWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
PhononWidget(QWidget *parent = 0); PhononWidget(QWidget *parent = nullptr);
void setUrl(const QUrl &url); void setUrl(const QUrl &url);
QUrl url() const; QUrl url() const;

View file

@ -35,7 +35,7 @@ class Panel : public QWidget
Q_OBJECT Q_OBJECT
public: public:
explicit Panel(QWidget* parent = 0); explicit Panel(QWidget* parent = nullptr);
~Panel() override; ~Panel() override;
/** Returns the current set URL of the active Dolphin view. */ /** Returns the current set URL of the active Dolphin view. */

View file

@ -66,7 +66,7 @@ void PlacesItem::setUrl(const QUrl &url)
// watches for changes if the number of items has been changed. // watches for changes if the number of items has been changed.
// The update of the icon is handled in onTrashDirListerCompleted(). // The update of the icon is handled in onTrashDirListerCompleted().
m_trashDirLister = new KDirLister(); m_trashDirLister = new KDirLister();
m_trashDirLister->setAutoErrorHandlingEnabled(false, 0); m_trashDirLister->setAutoErrorHandlingEnabled(false, nullptr);
m_trashDirLister->setDelayedMimeTypes(true); m_trashDirLister->setDelayedMimeTypes(true);
QObject::connect(m_trashDirLister.data(), static_cast<void(KDirLister::*)()>(&KDirLister::completed), QObject::connect(m_trashDirLister.data(), static_cast<void(KDirLister::*)()>(&KDirLister::completed),
m_signalHandler.data(), &PlacesItemSignalHandler::onTrashDirListerCompleted); m_signalHandler.data(), &PlacesItemSignalHandler::onTrashDirListerCompleted);

View file

@ -48,7 +48,7 @@ public:
DevicesType DevicesType
}; };
explicit PlacesItem(const KBookmark& bookmark, PlacesItem* parent = 0); explicit PlacesItem(const KBookmark& bookmark, PlacesItem* parent = nullptr);
~PlacesItem() override; ~PlacesItem() override;
void setUrl(const QUrl& url); void setUrl(const QUrl& url);

View file

@ -44,10 +44,10 @@ PlacesItemEditDialog::PlacesItemEditDialog(QWidget* parent) :
m_text(), m_text(),
m_url(), m_url(),
m_allowGlobal(false), m_allowGlobal(false),
m_urlEdit(0), m_urlEdit(nullptr),
m_textEdit(0), m_textEdit(nullptr),
m_iconButton(0), m_iconButton(nullptr),
m_appLocal(0), m_appLocal(nullptr),
m_buttonBox(nullptr) m_buttonBox(nullptr)
{ {
} }

View file

@ -38,7 +38,7 @@ class PlacesItemEditDialog: public QDialog
Q_OBJECT Q_OBJECT
public: public:
explicit PlacesItemEditDialog(QWidget* parent = 0); explicit PlacesItemEditDialog(QWidget* parent = nullptr);
~PlacesItemEditDialog() override; ~PlacesItemEditDialog() override;
void setIcon(const QString& icon); void setIcon(const QString& icon);

View file

@ -27,7 +27,7 @@ class PlacesItemListGroupHeader : public KStandardItemListGroupHeader
Q_OBJECT Q_OBJECT
public: public:
PlacesItemListGroupHeader(QGraphicsWidget* parent = 0); PlacesItemListGroupHeader(QGraphicsWidget* parent = nullptr);
~PlacesItemListGroupHeader() override; ~PlacesItemListGroupHeader() override;
protected: protected:

View file

@ -73,13 +73,13 @@ PlacesItemModel::PlacesItemModel(QObject* parent) :
m_hiddenItemsShown(false), m_hiddenItemsShown(false),
m_availableDevices(), m_availableDevices(),
m_predicate(), m_predicate(),
m_bookmarkManager(0), m_bookmarkManager(nullptr),
m_systemBookmarks(), m_systemBookmarks(),
m_systemBookmarksIndexes(), m_systemBookmarksIndexes(),
m_bookmarkedItems(), m_bookmarkedItems(),
m_hiddenItemToRemove(-1), m_hiddenItemToRemove(-1),
m_deviceToTearDown(0), m_deviceToTearDown(nullptr),
m_updateBookmarksTimer(0), m_updateBookmarksTimer(nullptr),
m_storageSetupInProgress() m_storageSetupInProgress()
{ {
#ifdef HAVE_BALOO #ifdef HAVE_BALOO
@ -250,24 +250,24 @@ QAction* PlacesItemModel::ejectAction(int index) const
{ {
const PlacesItem* item = placesItem(index); const PlacesItem* item = placesItem(index);
if (item && item->device().is<Solid::OpticalDisc>()) { if (item && item->device().is<Solid::OpticalDisc>()) {
return new QAction(QIcon::fromTheme(QStringLiteral("media-eject")), i18nc("@item", "Eject"), 0); return new QAction(QIcon::fromTheme(QStringLiteral("media-eject")), i18nc("@item", "Eject"), nullptr);
} }
return 0; return nullptr;
} }
QAction* PlacesItemModel::teardownAction(int index) const QAction* PlacesItemModel::teardownAction(int index) const
{ {
const PlacesItem* item = placesItem(index); const PlacesItem* item = placesItem(index);
if (!item) { if (!item) {
return 0; return nullptr;
} }
Solid::Device device = item->device(); Solid::Device device = item->device();
const bool providesTearDown = device.is<Solid::StorageAccess>() && const bool providesTearDown = device.is<Solid::StorageAccess>() &&
device.as<Solid::StorageAccess>()->isAccessible(); device.as<Solid::StorageAccess>()->isAccessible();
if (!providesTearDown) { if (!providesTearDown) {
return 0; return nullptr;
} }
Solid::StorageDrive* drive = device.as<Solid::StorageDrive>(); Solid::StorageDrive* drive = device.as<Solid::StorageDrive>();
@ -295,10 +295,10 @@ QAction* PlacesItemModel::teardownAction(int index) const
} }
if (iconName.isEmpty()) { if (iconName.isEmpty()) {
return new QAction(text, 0); return new QAction(text, nullptr);
} }
return new QAction(QIcon::fromTheme(iconName), text, 0); return new QAction(QIcon::fromTheme(iconName), text, nullptr);
} }
void PlacesItemModel::requestEject(int index) void PlacesItemModel::requestEject(int index)
@ -687,7 +687,7 @@ void PlacesItemModel::updateBookmarks()
int modelIndex = 0; int modelIndex = 0;
for (int i = m_bookmarkedItems.count() - 1; i >= 0; --i) { for (int i = m_bookmarkedItems.count() - 1; i >= 0; --i) {
PlacesItem* item = m_bookmarkedItems[i]; PlacesItem* item = m_bookmarkedItems[i];
const bool itemIsPartOfModel = (item == 0); const bool itemIsPartOfModel = (item == nullptr);
if (itemIsPartOfModel) { if (itemIsPartOfModel) {
item = placesItem(modelIndex); item = placesItem(modelIndex);
} }

View file

@ -50,7 +50,7 @@ class PlacesItemModel: public KStandardItemModel
Q_OBJECT Q_OBJECT
public: public:
explicit PlacesItemModel(QObject* parent = 0); explicit PlacesItemModel(QObject* parent = nullptr);
~PlacesItemModel() override; ~PlacesItemModel() override;
/** /**

View file

@ -170,10 +170,10 @@ void PlacesPanel::slotItemContextMenuRequested(int index, const QPointF& pos)
QMenu menu(this); QMenu menu(this);
QAction* emptyTrashAction = 0; QAction* emptyTrashAction = nullptr;
QAction* editAction = 0; QAction* editAction = nullptr;
QAction* teardownAction = 0; QAction* teardownAction = nullptr;
QAction* ejectAction = 0; QAction* ejectAction = nullptr;
const QString label = item->text(); const QString label = item->text();
@ -213,7 +213,7 @@ void PlacesPanel::slotItemContextMenuRequested(int index, const QPointF& pos)
editAction = menu.addAction(QIcon::fromTheme("document-properties"), i18nc("@item:inmenu", "Edit...")); editAction = menu.addAction(QIcon::fromTheme("document-properties"), i18nc("@item:inmenu", "Edit..."));
} }
QAction* removeAction = 0; QAction* removeAction = nullptr;
if (!isDevice && !item->isSystemItem()) { if (!isDevice && !item->isSystemItem()) {
removeAction = menu.addAction(QIcon::fromTheme(QStringLiteral("edit-delete")), i18nc("@item:inmenu", "Remove")); removeAction = menu.addAction(QIcon::fromTheme(QStringLiteral("edit-delete")), i18nc("@item:inmenu", "Remove"));
} }
@ -267,7 +267,7 @@ void PlacesPanel::slotViewContextMenuRequested(const QPointF& pos)
QAction* addAction = menu.addAction(QIcon::fromTheme(QStringLiteral("document-new")), i18nc("@item:inmenu", "Add Entry...")); QAction* addAction = menu.addAction(QIcon::fromTheme(QStringLiteral("document-new")), i18nc("@item:inmenu", "Add Entry..."));
QAction* showAllAction = 0; QAction* showAllAction = nullptr;
if (m_model->hiddenCount() > 0) { if (m_model->hiddenCount() > 0) {
showAllAction = menu.addAction(i18nc("@item:inmenu", "Show All Entries")); showAllAction = menu.addAction(i18nc("@item:inmenu", "Show All Entries"));
showAllAction->setCheckable(true); showAllAction->setCheckable(true);
@ -388,8 +388,8 @@ void PlacesPanel::slotItemDropEventStorageSetupDone(int index, bool success)
delete m_itemDropEvent; delete m_itemDropEvent;
m_itemDropEventIndex = -1; m_itemDropEventIndex = -1;
m_itemDropEventMimeData = 0; m_itemDropEventMimeData = nullptr;
m_itemDropEvent = 0; m_itemDropEvent = nullptr;
} }
} }
@ -413,7 +413,7 @@ void PlacesPanel::slotTrashUpdated(KJob* job)
emit errorMessage(job->errorString()); emit errorMessage(job->errorString());
} }
// as long as KIO doesn't do this, do it ourselves // as long as KIO doesn't do this, do it ourselves
KNotification::event(QStringLiteral("Trash: emptied"), QString(), QPixmap(), 0, KNotification::DefaultEvent); KNotification::event(QStringLiteral("Trash: emptied"), QString(), QPixmap(), nullptr, KNotification::DefaultEvent);
} }
void PlacesPanel::slotStorageSetupDone(int index, bool success) void PlacesPanel::slotStorageSetupDone(int index, bool success)

View file

@ -38,11 +38,11 @@
TerminalPanel::TerminalPanel(QWidget* parent) : TerminalPanel::TerminalPanel(QWidget* parent) :
Panel(parent), Panel(parent),
m_clearTerminal(true), m_clearTerminal(true),
m_mostLocalUrlJob(0), m_mostLocalUrlJob(nullptr),
m_layout(0), m_layout(nullptr),
m_terminal(0), m_terminal(nullptr),
m_terminalWidget(0), m_terminalWidget(nullptr),
m_konsolePart(0), m_konsolePart(nullptr),
m_konsolePartCurrentDirectory(), m_konsolePartCurrentDirectory(),
m_sendCdToTerminalHistory() m_sendCdToTerminalHistory()
{ {
@ -69,7 +69,7 @@ QString TerminalPanel::currentWorkingDirectory()
void TerminalPanel::terminalExited() void TerminalPanel::terminalExited()
{ {
m_terminal = 0; m_terminal = nullptr;
emit hideTerminalPanel(); emit hideTerminalPanel();
} }
@ -117,12 +117,12 @@ void TerminalPanel::showEvent(QShowEvent* event)
if (!m_terminal) { if (!m_terminal) {
m_clearTerminal = true; m_clearTerminal = true;
KPluginFactory* factory = 0; KPluginFactory* factory = nullptr;
KService::Ptr service = KService::serviceByDesktopName(QStringLiteral("konsolepart")); KService::Ptr service = KService::serviceByDesktopName(QStringLiteral("konsolepart"));
if (service) { if (service) {
factory = KPluginLoader(service->library()).factory(); factory = KPluginLoader(service->library()).factory();
} }
m_konsolePart = factory ? (factory->create<KParts::ReadOnlyPart>(this)) : 0; m_konsolePart = factory ? (factory->create<KParts::ReadOnlyPart>(this)) : nullptr;
if (m_konsolePart) { if (m_konsolePart) {
connect(m_konsolePart, &KParts::ReadOnlyPart::destroyed, this, &TerminalPanel::terminalExited); connect(m_konsolePart, &KParts::ReadOnlyPart::destroyed, this, &TerminalPanel::terminalExited);
m_terminalWidget = m_konsolePart->widget(); m_terminalWidget = m_konsolePart->widget();
@ -144,7 +144,7 @@ void TerminalPanel::showEvent(QShowEvent* event)
void TerminalPanel::changeDir(const QUrl& url) void TerminalPanel::changeDir(const QUrl& url)
{ {
delete m_mostLocalUrlJob; delete m_mostLocalUrlJob;
m_mostLocalUrlJob = 0; m_mostLocalUrlJob = nullptr;
if (url.isLocalFile()) { if (url.isLocalFile()) {
sendCdToTerminal(url.toLocalFile()); sendCdToTerminal(url.toLocalFile());
@ -198,7 +198,7 @@ void TerminalPanel::slotMostLocalUrlResult(KJob* job)
sendCdToTerminal(url.toLocalFile()); sendCdToTerminal(url.toLocalFile());
} }
m_mostLocalUrlJob = 0; m_mostLocalUrlJob = nullptr;
} }
void TerminalPanel::slotKonsolePartCurrentDirectoryChanged(const QString& dir) void TerminalPanel::slotKonsolePartCurrentDirectoryChanged(const QString& dir)

View file

@ -53,20 +53,20 @@ DolphinSearchBox::DolphinSearchBox(QWidget* parent) :
QWidget(parent), QWidget(parent),
m_startedSearching(false), m_startedSearching(false),
m_active(true), m_active(true),
m_topLayout(0), m_topLayout(nullptr),
m_searchLabel(0), m_searchLabel(nullptr),
m_searchInput(0), m_searchInput(nullptr),
m_saveSearchAction(0), m_saveSearchAction(nullptr),
m_optionsScrollArea(0), m_optionsScrollArea(nullptr),
m_fileNameButton(0), m_fileNameButton(nullptr),
m_contentButton(0), m_contentButton(nullptr),
m_separator(0), m_separator(nullptr),
m_fromHereButton(0), m_fromHereButton(nullptr),
m_everywhereButton(0), m_everywhereButton(nullptr),
m_facetsToggleButton(0), m_facetsToggleButton(nullptr),
m_facetsWidget(0), m_facetsWidget(nullptr),
m_searchPath(), m_searchPath(),
m_startSearchTimer(0) m_startSearchTimer(nullptr)
{ {
} }

View file

@ -46,7 +46,7 @@ class DolphinSearchBox : public QWidget {
Q_OBJECT Q_OBJECT
public: public:
explicit DolphinSearchBox(QWidget* parent = 0); explicit DolphinSearchBox(QWidget* parent = nullptr);
~DolphinSearchBox() override; ~DolphinSearchBox() override;
/** /**

View file

@ -41,7 +41,7 @@ AdditionalInfoDialog::AdditionalInfoDialog(QWidget* parent,
const QList<QByteArray>& visibleRoles) : const QList<QByteArray>& visibleRoles) :
QDialog(parent), QDialog(parent),
m_visibleRoles(visibleRoles), m_visibleRoles(visibleRoles),
m_listWidget(0) m_listWidget(nullptr)
{ {
setWindowTitle(i18nc("@title:window", "Additional Information")); setWindowTitle(i18nc("@title:window", "Additional Information"));
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum); setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum);

View file

@ -26,7 +26,7 @@
ApplyViewPropsJob::ApplyViewPropsJob(const QUrl& dir, ApplyViewPropsJob::ApplyViewPropsJob(const QUrl& dir,
const ViewProperties& viewProps) : const ViewProperties& viewProps) :
KIO::Job(), KIO::Job(),
m_viewProps(0), m_viewProps(nullptr),
m_progress(0), m_progress(0),
m_dir(dir) m_dir(dir)
{ {
@ -46,7 +46,7 @@ ApplyViewPropsJob::ApplyViewPropsJob(const QUrl& dir,
ApplyViewPropsJob::~ApplyViewPropsJob() ApplyViewPropsJob::~ApplyViewPropsJob()
{ {
delete m_viewProps; // the properties are written by the destructor delete m_viewProps; // the properties are written by the destructor
m_viewProps = 0; m_viewProps = nullptr;
} }
void ApplyViewPropsJob::slotEntries(KIO::Job*, const KIO::UDSEntryList& list) void ApplyViewPropsJob::slotEntries(KIO::Job*, const KIO::UDSEntryList& list)

View file

@ -36,7 +36,7 @@ class DolphinSettingsDialog : public KPageDialog
Q_OBJECT Q_OBJECT
public: public:
explicit DolphinSettingsDialog(const QUrl& url, QWidget* parent = 0); explicit DolphinSettingsDialog(const QUrl& url, QWidget* parent = nullptr);
~DolphinSettingsDialog() override; ~DolphinSettingsDialog() override;
signals: signals:

View file

@ -35,9 +35,9 @@ namespace {
ConfirmationsSettingsPage::ConfirmationsSettingsPage(QWidget* parent) : ConfirmationsSettingsPage::ConfirmationsSettingsPage(QWidget* parent) :
SettingsPageBase(parent), SettingsPageBase(parent),
m_confirmMoveToTrash(0), m_confirmMoveToTrash(nullptr),
m_confirmDelete(0), m_confirmDelete(nullptr),
m_confirmClosingMultipleTabs(0) m_confirmClosingMultipleTabs(nullptr)
{ {
QVBoxLayout* topLayout = new QVBoxLayout(this); QVBoxLayout* topLayout = new QVBoxLayout(this);

View file

@ -65,7 +65,7 @@ GeneralSettingsPage::GeneralSettingsPage(const QUrl& url, QWidget* parent) :
m_pages.append(confirmationsPage); m_pages.append(confirmationsPage);
m_pages.append(statusBarPage); m_pages.append(statusBarPage);
topLayout->addWidget(tabWidget, 0, 0); topLayout->addWidget(tabWidget, 0, nullptr);
} }
GeneralSettingsPage::~GeneralSettingsPage() GeneralSettingsPage::~GeneralSettingsPage()

View file

@ -52,9 +52,9 @@ namespace {
PreviewsSettingsPage::PreviewsSettingsPage(QWidget* parent) : PreviewsSettingsPage::PreviewsSettingsPage(QWidget* parent) :
SettingsPageBase(parent), SettingsPageBase(parent),
m_initialized(false), m_initialized(false),
m_listView(0), m_listView(nullptr),
m_enabledPreviewPlugins(), m_enabledPreviewPlugins(),
m_remoteFileSizeBox(0) m_remoteFileSizeBox(nullptr)
{ {
QVBoxLayout* topLayout = new QVBoxLayout(this); QVBoxLayout* topLayout = new QVBoxLayout(this);

View file

@ -65,7 +65,7 @@ DolphinGeneralConfigModule::DolphinGeneralConfigModule(QWidget* parent, const QV
m_pages.append(previewsPage); m_pages.append(previewsPage);
m_pages.append(confirmationsPage); m_pages.append(confirmationsPage);
topLayout->addWidget(tabWidget, 0, 0); topLayout->addWidget(tabWidget, 0, nullptr);
} }
DolphinGeneralConfigModule::~DolphinGeneralConfigModule() DolphinGeneralConfigModule::~DolphinGeneralConfigModule()

View file

@ -30,7 +30,7 @@ K_PLUGIN_FACTORY(KCMDolphinNavigationConfigFactory, registerPlugin<DolphinNaviga
DolphinNavigationConfigModule::DolphinNavigationConfigModule(QWidget* parent, const QVariantList& args) : DolphinNavigationConfigModule::DolphinNavigationConfigModule(QWidget* parent, const QVariantList& args) :
KCModule(parent), KCModule(parent),
m_navigation(0) m_navigation(nullptr)
{ {
Q_UNUSED(args); Q_UNUSED(args);
@ -41,7 +41,7 @@ DolphinNavigationConfigModule::DolphinNavigationConfigModule(QWidget* parent, co
m_navigation = new NavigationSettingsPage(this); m_navigation = new NavigationSettingsPage(this);
connect(m_navigation, &NavigationSettingsPage::changed, this, static_cast<void(DolphinNavigationConfigModule::*)()>(&DolphinNavigationConfigModule::changed)); connect(m_navigation, &NavigationSettingsPage::changed, this, static_cast<void(DolphinNavigationConfigModule::*)()>(&DolphinNavigationConfigModule::changed));
topLayout->addWidget(m_navigation, 0, 0); topLayout->addWidget(m_navigation, 0, nullptr);
} }
DolphinNavigationConfigModule::~DolphinNavigationConfigModule() DolphinNavigationConfigModule::~DolphinNavigationConfigModule()

View file

@ -30,7 +30,7 @@ K_PLUGIN_FACTORY(KCMDolphinServicesConfigFactory, registerPlugin<DolphinServices
DolphinServicesConfigModule::DolphinServicesConfigModule(QWidget* parent, const QVariantList& args) : DolphinServicesConfigModule::DolphinServicesConfigModule(QWidget* parent, const QVariantList& args) :
KCModule(parent), KCModule(parent),
m_services(0) m_services(nullptr)
{ {
Q_UNUSED(args); Q_UNUSED(args);
@ -41,7 +41,7 @@ DolphinServicesConfigModule::DolphinServicesConfigModule(QWidget* parent, const
m_services = new ServicesSettingsPage(this); m_services = new ServicesSettingsPage(this);
connect(m_services, &ServicesSettingsPage::changed, this, static_cast<void(DolphinServicesConfigModule::*)()>(&DolphinServicesConfigModule::changed)); connect(m_services, &ServicesSettingsPage::changed, this, static_cast<void(DolphinServicesConfigModule::*)()>(&DolphinServicesConfigModule::changed));
topLayout->addWidget(m_services, 0, 0); topLayout->addWidget(m_services, 0, nullptr);
} }
DolphinServicesConfigModule::~DolphinServicesConfigModule() DolphinServicesConfigModule::~DolphinServicesConfigModule()

View file

@ -66,7 +66,7 @@ DolphinViewModesConfigModule::DolphinViewModesConfigModule(QWidget* parent, cons
m_tabs.append(compactTab); m_tabs.append(compactTab);
m_tabs.append(detailsTab); m_tabs.append(detailsTab);
topLayout->addWidget(tabWidget, 0, 0); topLayout->addWidget(tabWidget, 0, nullptr);
} }
DolphinViewModesConfigModule::~DolphinViewModesConfigModule() DolphinViewModesConfigModule::~DolphinViewModesConfigModule()

View file

@ -28,8 +28,8 @@
NavigationSettingsPage::NavigationSettingsPage(QWidget* parent) : NavigationSettingsPage::NavigationSettingsPage(QWidget* parent) :
SettingsPageBase(parent), SettingsPageBase(parent),
m_openArchivesAsFolder(0), m_openArchivesAsFolder(nullptr),
m_autoExpandFolders(0) m_autoExpandFolders(nullptr)
{ {
QVBoxLayout* topLayout = new QVBoxLayout(this); QVBoxLayout* topLayout = new QVBoxLayout(this);
QWidget* vBox = new QWidget(this); QWidget* vBox = new QWidget(this);

View file

@ -33,7 +33,7 @@ class ServiceItemDelegate : public KWidgetItemDelegate
Q_OBJECT Q_OBJECT
public: public:
explicit ServiceItemDelegate(QAbstractItemView* itemView, QObject* parent = 0); explicit ServiceItemDelegate(QAbstractItemView* itemView, QObject* parent = nullptr);
~ServiceItemDelegate() override; ~ServiceItemDelegate() override;
QSize sizeHint(const QStyleOptionViewItem &option, QSize sizeHint(const QStyleOptionViewItem &option,

View file

@ -44,7 +44,7 @@ public:
ConfigurableRole ConfigurableRole
}; };
explicit ServiceModel(QObject* parent = 0); explicit ServiceModel(QObject* parent = nullptr);
~ServiceModel() override; ~ServiceModel() override;
bool insertRows(int row, int count, const QModelIndex & parent = QModelIndex()) override; bool insertRows(int row, int count, const QModelIndex & parent = QModelIndex()) override;

View file

@ -58,9 +58,9 @@ namespace
ServicesSettingsPage::ServicesSettingsPage(QWidget* parent) : ServicesSettingsPage::ServicesSettingsPage(QWidget* parent) :
SettingsPageBase(parent), SettingsPageBase(parent),
m_initialized(false), m_initialized(false),
m_serviceModel(0), m_serviceModel(nullptr),
m_sortModel(0), m_sortModel(nullptr),
m_listView(0), m_listView(nullptr),
m_enabledVcsPlugins() m_enabledVcsPlugins()
{ {
QVBoxLayout* topLayout = new QVBoxLayout(this); QVBoxLayout* topLayout = new QVBoxLayout(this);

View file

@ -31,7 +31,7 @@ class SettingsPageBase : public QWidget
Q_OBJECT Q_OBJECT
public: public:
explicit SettingsPageBase(QWidget* parent = 0); explicit SettingsPageBase(QWidget* parent = nullptr);
~SettingsPageBase() override; ~SettingsPageBase() override;
/** /**

View file

@ -29,8 +29,8 @@
DolphinFontRequester::DolphinFontRequester(QWidget* parent) : DolphinFontRequester::DolphinFontRequester(QWidget* parent) :
QWidget(parent), QWidget(parent),
m_modeCombo(0), m_modeCombo(nullptr),
m_chooseFontButton(0), m_chooseFontButton(nullptr),
m_mode(SystemFont), m_mode(SystemFont),
m_customFont() m_customFont()
{ {

View file

@ -56,7 +56,7 @@ ViewSettingsPage::ViewSettingsPage(QWidget* parent) :
m_tabs.append(compactTab); m_tabs.append(compactTab);
m_tabs.append(detailsTab); m_tabs.append(detailsTab);
topLayout->addWidget(tabWidget, 0, 0); topLayout->addWidget(tabWidget, 0, nullptr);
} }
ViewSettingsPage::~ViewSettingsPage() ViewSettingsPage::~ViewSettingsPage()

View file

@ -40,12 +40,12 @@
ViewSettingsTab::ViewSettingsTab(Mode mode, QWidget* parent) : ViewSettingsTab::ViewSettingsTab(Mode mode, QWidget* parent) :
QWidget(parent), QWidget(parent),
m_mode(mode), m_mode(mode),
m_defaultSizeSlider(0), m_defaultSizeSlider(nullptr),
m_previewSizeSlider(0), m_previewSizeSlider(nullptr),
m_fontRequester(0), m_fontRequester(nullptr),
m_widthBox(0), m_widthBox(nullptr),
m_maxLinesBox(0), m_maxLinesBox(nullptr),
m_expandableFolders(0) m_expandableFolders(nullptr)
{ {
QVBoxLayout* topLayout = new QVBoxLayout(this); QVBoxLayout* topLayout = new QVBoxLayout(this);
@ -202,7 +202,7 @@ void ViewSettingsTab::applySettings()
void ViewSettingsTab::restoreDefaultSettings() void ViewSettingsTab::restoreDefaultSettings()
{ {
KConfigSkeleton* settings = 0; KConfigSkeleton* settings = nullptr;
switch (m_mode) { switch (m_mode) {
case IconsMode: settings = IconsModeSettings::self(); break; case IconsMode: settings = IconsModeSettings::self(); break;
case CompactMode: settings = CompactModeSettings::self(); break; case CompactMode: settings = CompactModeSettings::self(); break;

View file

@ -43,7 +43,7 @@ public:
DetailsMode DetailsMode
}; };
explicit ViewSettingsTab(Mode mode, QWidget* parent = 0); explicit ViewSettingsTab(Mode mode, QWidget* parent = nullptr);
~ViewSettingsTab() override; ~ViewSettingsTab() override;
void applySettings(); void applySettings();

View file

@ -52,19 +52,19 @@ ViewPropertiesDialog::ViewPropertiesDialog(DolphinView* dolphinView) :
QDialog(dolphinView), QDialog(dolphinView),
m_isDirty(false), m_isDirty(false),
m_dolphinView(dolphinView), m_dolphinView(dolphinView),
m_viewProps(0), m_viewProps(nullptr),
m_viewMode(0), m_viewMode(nullptr),
m_sortOrder(0), m_sortOrder(nullptr),
m_sorting(0), m_sorting(nullptr),
m_sortFoldersFirst(0), m_sortFoldersFirst(nullptr),
m_previewsShown(0), m_previewsShown(nullptr),
m_showInGroups(0), m_showInGroups(nullptr),
m_showHiddenFiles(0), m_showHiddenFiles(nullptr),
m_additionalInfo(0), m_additionalInfo(nullptr),
m_applyToCurrentFolder(0), m_applyToCurrentFolder(nullptr),
m_applyToSubFolders(0), m_applyToSubFolders(nullptr),
m_applyToAllFolders(0), m_applyToAllFolders(nullptr),
m_useAsDefault(0) m_useAsDefault(nullptr)
{ {
Q_ASSERT(dolphinView); Q_ASSERT(dolphinView);
const bool useGlobalViewProps = GeneralSettings::globalViewProps(); const bool useGlobalViewProps = GeneralSettings::globalViewProps();
@ -217,7 +217,7 @@ ViewPropertiesDialog::~ViewPropertiesDialog()
{ {
m_isDirty = false; m_isDirty = false;
delete m_viewProps; delete m_viewProps;
m_viewProps = 0; m_viewProps = nullptr;
KConfigGroup dialogConfig(KSharedConfig::openConfig(QStringLiteral("dolphinrc")), "ViewPropertiesDialog"); KConfigGroup dialogConfig(KSharedConfig::openConfig(QStringLiteral("dolphinrc")), "ViewPropertiesDialog");
KWindowConfig::saveWindowSize(windowHandle(), dialogConfig); KWindowConfig::saveWindowSize(windowHandle(), dialogConfig);

View file

@ -39,12 +39,12 @@ ViewPropsProgressInfo::ViewPropsProgressInfo(QWidget* parent,
const ViewProperties& viewProps) : const ViewProperties& viewProps) :
QDialog(parent), QDialog(parent),
m_dir(dir), m_dir(dir),
m_viewProps(0), m_viewProps(nullptr),
m_label(0), m_label(nullptr),
m_progressBar(0), m_progressBar(nullptr),
m_dirSizeJob(0), m_dirSizeJob(nullptr),
m_applyViewPropsJob(0), m_applyViewPropsJob(nullptr),
m_timer(0) m_timer(nullptr)
{ {
const QSize minSize = minimumSize(); const QSize minSize = minimumSize();
setMinimumSize(QSize(320, minSize.height())); setMinimumSize(QSize(320, minSize.height()));
@ -96,13 +96,13 @@ ViewPropsProgressInfo::ViewPropsProgressInfo(QWidget* parent,
ViewPropsProgressInfo::~ViewPropsProgressInfo() ViewPropsProgressInfo::~ViewPropsProgressInfo()
{ {
delete m_viewProps; delete m_viewProps;
m_viewProps = 0; m_viewProps = nullptr;
} }
void ViewPropsProgressInfo::closeEvent(QCloseEvent* event) void ViewPropsProgressInfo::closeEvent(QCloseEvent* event)
{ {
m_timer->stop(); m_timer->stop();
m_applyViewPropsJob = 0; m_applyViewPropsJob = nullptr;
QDialog::closeEvent(event); QDialog::closeEvent(event);
} }
@ -110,12 +110,12 @@ void ViewPropsProgressInfo::reject()
{ {
if (m_dirSizeJob) { if (m_dirSizeJob) {
m_dirSizeJob->kill(); m_dirSizeJob->kill();
m_dirSizeJob = 0; m_dirSizeJob = nullptr;
} }
if (m_applyViewPropsJob) { if (m_applyViewPropsJob) {
m_applyViewPropsJob->kill(); m_applyViewPropsJob->kill();
m_applyViewPropsJob = 0; m_applyViewPropsJob = nullptr;
} }
QDialog::reject(); QDialog::reject();
@ -144,7 +144,7 @@ void ViewPropsProgressInfo::applyViewProperties()
m_label->setText(i18nc("@info:progress", "Folders: %1", subdirs)); m_label->setText(i18nc("@info:progress", "Folders: %1", subdirs));
m_progressBar->setMaximum(subdirs); m_progressBar->setMaximum(subdirs);
m_dirSizeJob = 0; m_dirSizeJob = nullptr;
m_applyViewPropsJob = new ApplyViewPropsJob(m_dir, *m_viewProps); m_applyViewPropsJob = new ApplyViewPropsJob(m_dir, *m_viewProps);
connect(m_applyViewPropsJob, &ApplyViewPropsJob::result, connect(m_applyViewPropsJob, &ApplyViewPropsJob::result,

View file

@ -49,14 +49,14 @@ DolphinStatusBar::DolphinStatusBar(QWidget* parent) :
QWidget(parent), QWidget(parent),
m_text(), m_text(),
m_defaultText(), m_defaultText(),
m_label(0), m_label(nullptr),
m_spaceInfo(0), m_spaceInfo(nullptr),
m_zoomSlider(0), m_zoomSlider(nullptr),
m_progressBar(0), m_progressBar(nullptr),
m_stopButton(0), m_stopButton(nullptr),
m_progress(100), m_progress(100),
m_showProgressBarTimer(0), m_showProgressBarTimer(nullptr),
m_resetToDefaultTextTimer(0), m_resetToDefaultTextTimer(nullptr),
m_textTimestamp() m_textTimestamp()
{ {
// Initialize text label // Initialize text label

View file

@ -53,7 +53,7 @@ class MountPointObserver : public QObject
{ {
Q_OBJECT Q_OBJECT
explicit MountPointObserver(const QUrl& url, QObject* parent = 0); explicit MountPointObserver(const QUrl& url, QObject* parent = nullptr);
~MountPointObserver() override {} ~MountPointObserver() override {}
public: public:

View file

@ -36,7 +36,7 @@ Q_GLOBAL_STATIC(MountPointObserverCacheSingleton, s_MountPointObserverCache)
MountPointObserverCache::MountPointObserverCache() : MountPointObserverCache::MountPointObserverCache() :
m_observerForMountPoint(), m_observerForMountPoint(),
m_mountPointForObserver(), m_mountPointForObserver(),
m_updateTimer(0) m_updateTimer(nullptr)
{ {
m_updateTimer = new QTimer(this); m_updateTimer = new QTimer(this);
} }

View file

@ -25,7 +25,7 @@
SpaceInfoObserver::SpaceInfoObserver(const QUrl& url, QObject* parent) : SpaceInfoObserver::SpaceInfoObserver(const QUrl& url, QObject* parent) :
QObject(parent), QObject(parent),
m_mountPointObserver(0), m_mountPointObserver(nullptr),
m_dataSize(0), m_dataSize(0),
m_dataAvailable(0) m_dataAvailable(0)
{ {
@ -39,7 +39,7 @@ SpaceInfoObserver::~SpaceInfoObserver()
{ {
if (m_mountPointObserver) { if (m_mountPointObserver) {
m_mountPointObserver->deref(); m_mountPointObserver->deref();
m_mountPointObserver = 0; m_mountPointObserver = nullptr;
} }
} }
@ -60,7 +60,7 @@ void SpaceInfoObserver::setUrl(const QUrl& url)
if (m_mountPointObserver) { if (m_mountPointObserver) {
disconnect(m_mountPointObserver, &MountPointObserver::spaceInfoChanged, this, &SpaceInfoObserver::spaceInfoChanged); disconnect(m_mountPointObserver, &MountPointObserver::spaceInfoChanged, this, &SpaceInfoObserver::spaceInfoChanged);
m_mountPointObserver->deref(); m_mountPointObserver->deref();
m_mountPointObserver = 0; m_mountPointObserver = nullptr;
} }
m_mountPointObserver = newObserver; m_mountPointObserver = newObserver;

View file

@ -32,7 +32,7 @@ class SpaceInfoObserver : public QObject
Q_OBJECT Q_OBJECT
public: public:
explicit SpaceInfoObserver(const QUrl& url, QObject* parent = 0); explicit SpaceInfoObserver(const QUrl& url, QObject* parent = nullptr);
~SpaceInfoObserver() override; ~SpaceInfoObserver() override;
quint64 size() const; quint64 size() const;

Some files were not shown because too many files have changed in this diff Show more