Fix cppcheck warnings and cleanup suppression config

- redundantAssignment
- knownConditionTrueFalse
This commit is contained in:
Roland Winklmeier
2018-08-07 14:41:05 +02:00
committed by Klaus Basan
parent 000bdee457
commit 3774f2b60f
7 changed files with 17 additions and 23 deletions

View File

@@ -237,9 +237,10 @@ namespace BlackGui
const int all = models.size();
// maximum
int max = CDbStashComponent::MaxModelPublished;
const QString maxStr(ui->le_MaxModelsStashed->text());
bool okMaxStr = true;
int max = maxStr.isEmpty() ? CDbStashComponent::MaxModelPublished : maxStr.toInt(&okMaxStr);
if (!maxStr.isEmpty()) { max = maxStr.toInt(&okMaxStr); }
if (!okMaxStr || max > all) { max = all; }
// override description

View File

@@ -74,8 +74,7 @@ namespace BlackGui
void CSettingsComponent::initActions()
{
QAction *a = nullptr;
a = new QAction(this);
QAction *a = new QAction(this);
a->setObjectName("overview");
a->setShortcut(QKeySequence(Qt::ALT + Qt::Key_S, Qt::Key_O));
connect(a, &QAction::triggered, this, &CSettingsComponent::onActionTriggered);