X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fmsgprocessorstatuswidget.cpp;h=4973709356116dfb9c1485ae153ce6803c6da874;hp=9118778dc173c53a7e4bc2c84c5538947b4939a9;hb=HEAD;hpb=f824db0e31b54969e0b7fa0b5405b1e9173d482c diff --git a/src/qtui/msgprocessorstatuswidget.cpp b/src/qtui/msgprocessorstatuswidget.cpp index 9118778d..b27876c1 100644 --- a/src/qtui/msgprocessorstatuswidget.cpp +++ b/src/qtui/msgprocessorstatuswidget.cpp @@ -1,37 +1,41 @@ /*************************************************************************** -* Copyright (C) 2005-09 by the Quassel Project * -* devel@quassel-irc.org * -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) version 3. * -* * -* This program is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * -* GNU General Public License for more details. * -* * -* You should have received a copy of the GNU General Public License * -* along with this program; if not, write to the * -* Free Software Foundation, Inc., * -* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * -***************************************************************************/ + * Copyright (C) 2005-2022 by the Quassel Project * + * devel@quassel-irc.org * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) version 3. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ #include "msgprocessorstatuswidget.h" -MsgProcessorStatusWidget::MsgProcessorStatusWidget(QWidget *parent) : QWidget(parent) { - ui.setupUi(this); - - hide(); +MsgProcessorStatusWidget::MsgProcessorStatusWidget(QWidget* parent) + : QWidget(parent) +{ + ui.setupUi(this); + hide(); } -void MsgProcessorStatusWidget::setProgress(int value, int max) { - if(max <= 0) { - hide(); - } else { - if(isHidden()) show(); - ui.progressBar->setMaximum(max); - ui.progressBar->setValue(value); - } +void MsgProcessorStatusWidget::setProgress(int value, int max) +{ + if (max <= 0 || value == max) { + hide(); + } + else { + if (isHidden()) + show(); + ui.progressBar->setMaximum(max); + ui.progressBar->setValue(value); + } }