From 10783de5e2271eb22e516059b736ff9697beb170 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Tue, 27 Jun 2023 07:58:16 +0300 Subject: [PATCH] kdeui: format and indent Signed-off-by: Ivailo Monev --- kdeui/jobs/kdialogjobuidelegate.cpp | 5 ++++- kdeui/jobs/kdynamicjobtracker.cpp | 14 ++++++++------ kdeui/jobs/kstatusbarjobtracker.cpp | 26 +++++++++++++------------- kdeui/jobs/kstatusbarjobtracker_p.h | 13 +++++++------ 4 files changed, 32 insertions(+), 26 deletions(-) diff --git a/kdeui/jobs/kdialogjobuidelegate.cpp b/kdeui/jobs/kdialogjobuidelegate.cpp index 4b71d5d6..674ef67c 100644 --- a/kdeui/jobs/kdialogjobuidelegate.cpp +++ b/kdeui/jobs/kdialogjobuidelegate.cpp @@ -34,7 +34,10 @@ class KDialogJobUiDelegate::Private { public: - Private() : userTimestamp(0) { } + Private() + : userTimestamp(0) + { + } QPointer errorParentWidget; unsigned long userTimestamp; diff --git a/kdeui/jobs/kdynamicjobtracker.cpp b/kdeui/jobs/kdynamicjobtracker.cpp index 008b5bd4..12e431d4 100644 --- a/kdeui/jobs/kdynamicjobtracker.cpp +++ b/kdeui/jobs/kdynamicjobtracker.cpp @@ -39,8 +39,9 @@ struct AllTrackers class KDynamicJobTracker::Private { public: - Private() : kuiserverTracker(0), - widgetTracker(0) + Private() + : kuiserverTracker(nullptr), + widgetTracker(nullptr) { } @@ -57,7 +58,7 @@ public: KDynamicJobTracker::KDynamicJobTracker(QObject *parent) : KJobTrackerInterface(parent), - d(new Private) + d(new Private()) { } @@ -101,11 +102,12 @@ void KDynamicJobTracker::unregisterJob(KJob *job) return; } - if(kuiserverTracker) + if (kuiserverTracker) { kuiserverTracker->unregisterJob(job); - - if(widgetTracker) + } + if (widgetTracker) { widgetTracker->unregisterJob(job); + } } #include "moc_kdynamicjobtracker.cpp" diff --git a/kdeui/jobs/kstatusbarjobtracker.cpp b/kdeui/jobs/kstatusbarjobtracker.cpp index 3e2db9c6..5cfb2823 100644 --- a/kdeui/jobs/kstatusbarjobtracker.cpp +++ b/kdeui/jobs/kstatusbarjobtracker.cpp @@ -34,7 +34,8 @@ #include KStatusBarJobTracker::KStatusBarJobTracker(QWidget *parent, bool button) - : KAbstractWidgetJobTracker(parent), d(new Private(parent, button)) + : KAbstractWidgetJobTracker(parent), + d(new Private(parent, button)) { } @@ -64,11 +65,13 @@ void KStatusBarJobTracker::unregisterJob(KJob *job) if (!d->progressWidget.contains(job)) return; - if (d->currentProgressWidget == d->progressWidget[job]) - d->currentProgressWidget = 0; + if (d->currentProgressWidget == d->progressWidget[job]) { + d->currentProgressWidget = nullptr; + } - if (!d->progressWidget[job]->beingDeleted) + if (!d->progressWidget[job]->beingDeleted) { delete d->progressWidget[job]; + } d->progressWidget.remove(job); } @@ -76,7 +79,7 @@ void KStatusBarJobTracker::unregisterJob(KJob *job) QWidget *KStatusBarJobTracker::widget(KJob *job) { if (!d->progressWidget.contains(job)) { - return 0; + return nullptr; } return d->progressWidget[job]; @@ -162,7 +165,7 @@ void KStatusBarJobTracker::Private::ProgressWidget::init(KJob *job, QWidget *par connect(button, SIGNAL(clicked(bool)), this, SLOT(killJob())); } else { - button = 0; + button = nullptr; } progressBar = new QProgressBar(widget); @@ -190,23 +193,20 @@ void KStatusBarJobTracker::Private::ProgressWidget::setMode(StatusBarModes newMo { mode = newMode; - if (newMode == KStatusBarJobTracker::NoInformation) - { + if (newMode == KStatusBarJobTracker::NoInformation) { stack->hide(); return; } - if (newMode & KStatusBarJobTracker::LabelOnly) - { + if (newMode & KStatusBarJobTracker::LabelOnly) { stack->show(); stack->setCurrentWidget(label); return; // TODO: we should make possible to show an informative label and the progress bar } - if (newMode & KStatusBarJobTracker::ProgressOnly) - { + if (newMode & KStatusBarJobTracker::ProgressOnly) { stack->show(); stack->setCurrentWidget(progressBar); } @@ -258,7 +258,7 @@ void KStatusBarJobTracker::Private::ProgressWidget::slotClean() bool KStatusBarJobTracker::Private::ProgressWidget::eventFilter(QObject *obj, QEvent *event) { - if (obj==progressBar || obj==label) { + if (obj == progressBar || obj == label) { if (event->type() == QEvent::MouseButtonPress) { QMouseEvent *e = static_cast(event); diff --git a/kdeui/jobs/kstatusbarjobtracker_p.h b/kdeui/jobs/kstatusbarjobtracker_p.h index 3517f9f0..c3605e5a 100644 --- a/kdeui/jobs/kstatusbarjobtracker_p.h +++ b/kdeui/jobs/kstatusbarjobtracker_p.h @@ -23,18 +23,18 @@ #include #include -#include +#include #include #include +#include +#include +#include #include #include class KPushButton; -#include class KLineEdit; -#include -#include class KStatusBarJobTracker::Private @@ -42,9 +42,10 @@ class KStatusBarJobTracker::Private public: Private(QWidget *parent, bool withStopButton) : parent(parent) - , currentProgressWidget(0) + , currentProgressWidget(nullptr) , showStopButton(withStopButton) - { } + { + } ~Private() { }