summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-09-14 08:00:53 +0200
committerMontel Laurent <[email protected]>2017-09-14 08:00:53 +0200
commitbd9feb738c8c9db07e65c7911ac27f5951115c52 (patch)
tree22384ec74ad404f98bfe714e71e04851a2355103
parent2bc134d1b002b4c5b430c837c888767e10e40fe1 (diff)
Rename variable. Prepare for creating autotest for bugs found by david
-rw-r--r--src/libkdepim/progresswidget/statusbarprogresswidget.cpp23
-rw-r--r--src/libkdepim/progresswidget/statusbarprogresswidget.h8
2 files changed, 14 insertions, 17 deletions
diff --git a/src/libkdepim/progresswidget/statusbarprogresswidget.cpp b/src/libkdepim/progresswidget/statusbarprogresswidget.cpp
index e29a2cc..22b5574 100644
--- a/src/libkdepim/progresswidget/statusbarprogresswidget.cpp
+++ b/src/libkdepim/progresswidget/statusbarprogresswidget.cpp
@@ -59,21 +59,16 @@ using namespace KPIM;
//-----------------------------------------------------------------------------
StatusbarProgressWidget::StatusbarProgressWidget(ProgressDialog *progressDialog, QWidget *parent, bool button)
: QFrame(parent)
- , mShowTypeProgressItem(0)
- , m_bShowDetailedProgress(false)
- , mCurrentItem(nullptr)
+ , m_bShowButton(button)
, mProgressDialog(progressDialog)
- , mDelayTimer(nullptr)
- , mBusyTimer(nullptr)
- , mCleanTimer(nullptr)
{
- m_bShowButton = button;
int w = fontMetrics().width(QStringLiteral(" 999.9 kB/s 00:00:01 ")) + 8;
QHBoxLayout *box = new QHBoxLayout(this);
box->setMargin(0);
box->setSpacing(0);
m_pButton = new QPushButton(this);
+ m_pButton->setObjectName(QStringLiteral("button"));
m_pButton->setSizePolicy(QSizePolicy(QSizePolicy::Minimum,
QSizePolicy::Minimum));
m_pButton->setIcon(QIcon::fromTheme(QStringLiteral("go-up")));
@@ -84,11 +79,13 @@ StatusbarProgressWidget::StatusbarProgressWidget(ProgressDialog *progressDialog,
box->addWidget(stack);
m_sslLabel = new SSLLabel(this);
+ m_sslLabel->setObjectName(QStringLiteral("ssllabel"));
box->addWidget(m_sslLabel);
m_pButton->setToolTip(i18n("Open detailed progress dialog"));
m_pProgressBar = new QProgressBar(this);
+ m_pProgressBar->setObjectName(QStringLiteral("progressbar"));
m_pProgressBar->installEventFilter(this);
m_pProgressBar->setMinimumWidth(w);
stack->insertWidget(1, m_pProgressBar);
@@ -101,7 +98,7 @@ StatusbarProgressWidget::StatusbarProgressWidget(ProgressDialog *progressDialog,
m_pButton->setMaximumHeight(maximumHeight);
setMinimumWidth(minimumSizeHint().width());
- mode = None;
+ mMode = None;
setMode();
connect(m_pButton, &QAbstractButton::clicked,
@@ -221,8 +218,8 @@ void StatusbarProgressWidget::slotShowItemDelayed()
}
}
- if (!noItems && mode == None) {
- mode = Progress;
+ if (!noItems && mMode == None) {
+ mMode = Progress;
setMode();
}
}
@@ -242,7 +239,7 @@ void StatusbarProgressWidget::slotProgressItemProgress(ProgressItem *item, unsig
void StatusbarProgressWidget::setMode()
{
- switch (mode) {
+ switch (mMode) {
case None:
if (m_bShowButton) {
m_pButton->hide();
@@ -270,7 +267,7 @@ void StatusbarProgressWidget::slotClean()
if (ProgressManager::instance()->isEmpty()) {
m_pProgressBar->setValue(0);
//m_pLabel->clear();
- mode = None;
+ mMode = None;
setMode();
}
}
@@ -280,7 +277,7 @@ bool StatusbarProgressWidget::eventFilter(QObject *obj, QEvent *ev)
if (ev->type() == QEvent::MouseButtonPress) {
QMouseEvent *e = (QMouseEvent *)ev;
- if (e->button() == Qt::LeftButton && mode != None) { // toggle view on left mouse button
+ if (e->button() == Qt::LeftButton && mMode != None) { // toggle view on left mouse button
// Consensus seems to be that we should show/hide the fancy dialog when the user
// clicks anywhere in the small one.
slotProgressButtonClicked();
diff --git a/src/libkdepim/progresswidget/statusbarprogresswidget.h b/src/libkdepim/progresswidget/statusbarprogresswidget.h
index 9f46979..fa3f944 100644
--- a/src/libkdepim/progresswidget/statusbarprogresswidget.h
+++ b/src/libkdepim/progresswidget/statusbarprogresswidget.h
@@ -85,7 +85,7 @@ protected:
bool eventFilter(QObject *, QEvent *) override;
private:
- unsigned int mShowTypeProgressItem;
+ unsigned int mShowTypeProgressItem = 0;
QProgressBar *m_pProgressBar = nullptr;
QLabel *m_pLabel = nullptr;
SSLLabel *m_sslLabel = nullptr;
@@ -95,9 +95,9 @@ private:
None, Progress
};
- uint mode;
- bool m_bShowButton;
- bool m_bShowDetailedProgress;
+ Mode mMode = None;
+ bool m_bShowButton = false;
+ bool m_bShowDetailedProgress = false;
QStackedWidget *stack = nullptr;
ProgressItem *mCurrentItem = nullptr;