kdeui: format and indent

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2023-06-27 07:58:16 +03:00
parent 5de263ddca
commit 10783de5e2
4 changed files with 32 additions and 26 deletions

View file

@ -34,7 +34,10 @@
class KDialogJobUiDelegate::Private class KDialogJobUiDelegate::Private
{ {
public: public:
Private() : userTimestamp(0) { } Private()
: userTimestamp(0)
{
}
QPointer<QWidget> errorParentWidget; QPointer<QWidget> errorParentWidget;
unsigned long userTimestamp; unsigned long userTimestamp;

View file

@ -39,8 +39,9 @@ struct AllTrackers
class KDynamicJobTracker::Private class KDynamicJobTracker::Private
{ {
public: public:
Private() : kuiserverTracker(0), Private()
widgetTracker(0) : kuiserverTracker(nullptr),
widgetTracker(nullptr)
{ {
} }
@ -57,7 +58,7 @@ public:
KDynamicJobTracker::KDynamicJobTracker(QObject *parent) KDynamicJobTracker::KDynamicJobTracker(QObject *parent)
: KJobTrackerInterface(parent), : KJobTrackerInterface(parent),
d(new Private) d(new Private())
{ {
} }
@ -101,11 +102,12 @@ void KDynamicJobTracker::unregisterJob(KJob *job)
return; return;
} }
if(kuiserverTracker) if (kuiserverTracker) {
kuiserverTracker->unregisterJob(job); kuiserverTracker->unregisterJob(job);
}
if(widgetTracker) if (widgetTracker) {
widgetTracker->unregisterJob(job); widgetTracker->unregisterJob(job);
}
} }
#include "moc_kdynamicjobtracker.cpp" #include "moc_kdynamicjobtracker.cpp"

View file

@ -34,7 +34,8 @@
#include <kglobal.h> #include <kglobal.h>
KStatusBarJobTracker::KStatusBarJobTracker(QWidget *parent, bool button) 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)) if (!d->progressWidget.contains(job))
return; return;
if (d->currentProgressWidget == d->progressWidget[job]) if (d->currentProgressWidget == d->progressWidget[job]) {
d->currentProgressWidget = 0; d->currentProgressWidget = nullptr;
}
if (!d->progressWidget[job]->beingDeleted) if (!d->progressWidget[job]->beingDeleted) {
delete d->progressWidget[job]; delete d->progressWidget[job];
}
d->progressWidget.remove(job); d->progressWidget.remove(job);
} }
@ -76,7 +79,7 @@ void KStatusBarJobTracker::unregisterJob(KJob *job)
QWidget *KStatusBarJobTracker::widget(KJob *job) QWidget *KStatusBarJobTracker::widget(KJob *job)
{ {
if (!d->progressWidget.contains(job)) { if (!d->progressWidget.contains(job)) {
return 0; return nullptr;
} }
return d->progressWidget[job]; return d->progressWidget[job];
@ -162,7 +165,7 @@ void KStatusBarJobTracker::Private::ProgressWidget::init(KJob *job, QWidget *par
connect(button, SIGNAL(clicked(bool)), connect(button, SIGNAL(clicked(bool)),
this, SLOT(killJob())); this, SLOT(killJob()));
} else { } else {
button = 0; button = nullptr;
} }
progressBar = new QProgressBar(widget); progressBar = new QProgressBar(widget);
@ -190,23 +193,20 @@ void KStatusBarJobTracker::Private::ProgressWidget::setMode(StatusBarModes newMo
{ {
mode = newMode; mode = newMode;
if (newMode == KStatusBarJobTracker::NoInformation) if (newMode == KStatusBarJobTracker::NoInformation) {
{
stack->hide(); stack->hide();
return; return;
} }
if (newMode & KStatusBarJobTracker::LabelOnly) if (newMode & KStatusBarJobTracker::LabelOnly) {
{
stack->show(); stack->show();
stack->setCurrentWidget(label); stack->setCurrentWidget(label);
return; // TODO: we should make possible to show an informative label and the progress bar 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->show();
stack->setCurrentWidget(progressBar); stack->setCurrentWidget(progressBar);
} }
@ -258,7 +258,7 @@ void KStatusBarJobTracker::Private::ProgressWidget::slotClean()
bool KStatusBarJobTracker::Private::ProgressWidget::eventFilter(QObject *obj, QEvent *event) bool KStatusBarJobTracker::Private::ProgressWidget::eventFilter(QObject *obj, QEvent *event)
{ {
if (obj==progressBar || obj==label) { if (obj == progressBar || obj == label) {
if (event->type() == QEvent::MouseButtonPress) { if (event->type() == QEvent::MouseButtonPress) {
QMouseEvent *e = static_cast<QMouseEvent*>(event); QMouseEvent *e = static_cast<QMouseEvent*>(event);

View file

@ -23,18 +23,18 @@
#include <QWidget> #include <QWidget>
#include <QMap> #include <QMap>
#include <QtCore/qdatetime.h> #include <QDateTime>
#include <QBoxLayout> #include <QBoxLayout>
#include <QStackedWidget> #include <QStackedWidget>
#include <QCheckBox>
#include <QLabel>
#include <QProgressBar>
#include <kdebug.h> #include <kdebug.h>
#include <kurl.h> #include <kurl.h>
class KPushButton; class KPushButton;
#include <QCheckBox>
class KLineEdit; class KLineEdit;
#include <QLabel>
#include <QProgressBar>
class KStatusBarJobTracker::Private class KStatusBarJobTracker::Private
@ -42,9 +42,10 @@ class KStatusBarJobTracker::Private
public: public:
Private(QWidget *parent, bool withStopButton) Private(QWidget *parent, bool withStopButton)
: parent(parent) : parent(parent)
, currentProgressWidget(0) , currentProgressWidget(nullptr)
, showStopButton(withStopButton) , showStopButton(withStopButton)
{ } {
}
~Private() { ~Private() {
} }