Gui: fix some lint warnings

This commit is contained in:
wmayer
2023-03-27 12:40:38 +02:00
committed by wwmayer
parent 23f7c163f5
commit c3f7d4f377
2 changed files with 16 additions and 12 deletions

View File

@@ -76,18 +76,22 @@ DlgGeneralImp::DlgGeneralImp( QWidget* parent )
QPixmap px = Application::Instance->workbenchIcon(QString::fromLatin1("NoneWorkbench"));
QString key = QString::fromLatin1("<last>");
QString value = QString::fromLatin1("$LastModule");
if (px.isNull())
if (px.isNull()) {
ui->AutoloadModuleCombo->addItem(key, QVariant(value));
else
}
else {
ui->AutoloadModuleCombo->addItem(px, key, QVariant(value));
}
}
for (QMap<QString, QString>::Iterator it = menuText.begin(); it != menuText.end(); ++it) {
QPixmap px = Application::Instance->workbenchIcon(it.value());
if (px.isNull())
if (px.isNull()) {
ui->AutoloadModuleCombo->addItem(it.key(), QVariant(it.value()));
else
}
else {
ui->AutoloadModuleCombo->addItem(px, it.key(), QVariant(it.value()));
}
}
recreatePreferencePackMenu();
@@ -100,10 +104,7 @@ DlgGeneralImp::DlgGeneralImp( QWidget* parent )
// If there are any saved config file backs, show the revert button, otherwise hide it:
const auto & backups = Application::Instance->prefPackManager()->configBackups();
if (backups.empty())
ui->RevertToSavedConfig->setEnabled(false);
else
ui->RevertToSavedConfig->setEnabled(true);
ui->RevertToSavedConfig->setEnabled(backups.empty());
connect(ui->RevertToSavedConfig, &QPushButton::clicked, this, &DlgGeneralImp::revertToSavedConfig);
}
@@ -148,8 +149,9 @@ void DlgGeneralImp::setNumberLocale(bool force/* = false*/)
// Only make the change if locale setting has changed or if forced
// Except if format is "OS" where we don't want to run setLocale
if (localeIndex == localeFormat && (!force || localeFormat == 0))
if (localeIndex == localeFormat && (!force || localeFormat == 0)) {
return;
}
if (localeFormat == 0) {
Translator::instance()->setLocale(); // Defaults to system locale
@@ -200,11 +202,13 @@ void DlgGeneralImp::saveSettings()
hGrp->SetInt("ToolbarIconSize", pixel);
getMainWindow()->setIconSize(QSize(pixel,pixel));
int blinkTime = hGrp->GetBool("EnableCursorBlinking", true) ? -1 : 0;
int blinkTime{hGrp->GetBool("EnableCursorBlinking", true) ? -1 : 0};
qApp->setCursorFlashTime(blinkTime);
hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/DockWindows");
bool treeView=false, propertyView=false, comboView=true;
bool treeView=false;
bool propertyView=false;
bool comboView=true;
switch(ui->treeMode->currentIndex()) {
case 1:
treeView = propertyView = true;

View File

@@ -280,7 +280,7 @@ void Translator::setLocale(const std::string& language) const
void Translator::updateLocaleChange() const
{
for (auto &topLevelWidget: qApp->topLevelWidgets()) {
for (auto &topLevelWidget : qApp->topLevelWidgets()) {
topLevelWidget->setLocale(QLocale());
}
}