mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 10:22:48 +00:00
kdeui: format and indent
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
5de263ddca
commit
10783de5e2
4 changed files with 32 additions and 26 deletions
|
@ -34,7 +34,10 @@
|
|||
class KDialogJobUiDelegate::Private
|
||||
{
|
||||
public:
|
||||
Private() : userTimestamp(0) { }
|
||||
Private()
|
||||
: userTimestamp(0)
|
||||
{
|
||||
}
|
||||
|
||||
QPointer<QWidget> errorParentWidget;
|
||||
unsigned long userTimestamp;
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -34,7 +34,8 @@
|
|||
#include <kglobal.h>
|
||||
|
||||
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<QMouseEvent*>(event);
|
||||
|
|
|
@ -23,18 +23,18 @@
|
|||
|
||||
#include <QWidget>
|
||||
#include <QMap>
|
||||
#include <QtCore/qdatetime.h>
|
||||
#include <QDateTime>
|
||||
#include <QBoxLayout>
|
||||
#include <QStackedWidget>
|
||||
#include <QCheckBox>
|
||||
#include <QLabel>
|
||||
#include <QProgressBar>
|
||||
|
||||
#include <kdebug.h>
|
||||
#include <kurl.h>
|
||||
|
||||
class KPushButton;
|
||||
#include <QCheckBox>
|
||||
class KLineEdit;
|
||||
#include <QLabel>
|
||||
#include <QProgressBar>
|
||||
|
||||
|
||||
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() {
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue