result << "en"; // Add default language to the set
// Remove file extensions
- for (QString file : files)
+ for (const QString& file : files)
result << file.split(".").front();
result.sort(Qt::CaseInsensitive);
Application* a = qobject_cast<Application*>(QApplication::instance());
QString current_language = settings.value(GlobalSettings::Key_General_Language).toString();
- for (QString language : a->get_languages()) {
+ for (const QString& language : a->get_languages()) {
QLocale locale = QLocale(language);
QString desc = locale.languageToString(locale.language());
language_cb->addItem(desc, language);
GlobalSettings settings;
Application* a = qobject_cast<Application*>(QApplication::instance());
- for (QString language : a->get_languages()) {
+ for (const QString& language : a->get_languages()) {
QLocale locale = QLocale(language);
QString desc = locale.languageToString(locale.language());
{
if (!contains(Key_General_Language)) {
// Determine and set default UI language
- QString language = QLocale().uiLanguages().first(); // May return e.g. en-Latn-US
+ QString language = QLocale().uiLanguages().first(); // May return e.g. en-Latn-US // clazy:exclude=detaching-temporary
language = language.split("-").first();
setValue(Key_General_Language, language);
if (sigs.size() > 8) {
QPushButton *row_enable_button = new QPushButton(tr("All"), this);
grid->addWidget(row_enable_button, row, 8);
- connect(row_enable_button, &QPushButton::clicked,
- [this_row]() {
- for (QCheckBox *box : this_row)
- box->setChecked(true);
+ connect(row_enable_button, &QPushButton::clicked, row_enable_button,
+ [this_row]() {
+ for (QCheckBox *box : this_row)
+ box->setChecked(true);
});
QPushButton *row_disable_button = new QPushButton(tr("None"), this);
- connect(row_disable_button, &QPushButton::clicked,
+ connect(row_disable_button, &QPushButton::clicked, row_disable_button,
[this_row]() {
for (QCheckBox *box : this_row)
box->setChecked(false);
group_layout->addWidget(btn_enable_all);
group_layout->addWidget(btn_disable_all);
- connect(btn_enable_all, &QPushButton::clicked, [group_checkboxes](){
- for (QCheckBox *box: group_checkboxes)
- box->setChecked(true);
+ connect(btn_enable_all, &QPushButton::clicked, btn_enable_all,
+ [group_checkboxes](){
+ for (QCheckBox *box: group_checkboxes)
+ box->setChecked(true);
});
- connect(btn_disable_all, &QPushButton::clicked, [group_checkboxes](){
- for (QCheckBox *box: group_checkboxes)
- box->setChecked(false);
+ connect(btn_disable_all, &QPushButton::clicked, btn_disable_all,
+ [group_checkboxes](){
+ for (QCheckBox *box: group_checkboxes)
+ box->setChecked(false);
});
}
int view_id = 0;
i = 0;
- for (const shared_ptr<views::ViewBase> vb : views_) {
+ for (const shared_ptr<views::ViewBase>& vb : views_) {
shared_ptr<views::trace::View> tv = dynamic_pointer_cast<views::trace::View>(vb);
if (tv) {
for (const shared_ptr<views::trace::TimeItem>& time_item : tv->time_items()) {
displayIntervalAction->setChecked(show_interval_);
menu->addAction(displayIntervalAction);
- connect(displayIntervalAction, &QAction::toggled, [=]{
- GlobalSettings settings;
- settings.setValue(GlobalSettings::Key_View_CursorShowInterval,
- !settings.value(GlobalSettings::Key_View_CursorShowInterval).value<bool>());
+ connect(displayIntervalAction, &QAction::toggled, displayIntervalAction,
+ [=]{
+ GlobalSettings settings;
+ settings.setValue(GlobalSettings::Key_View_CursorShowInterval,
+ !settings.value(GlobalSettings::Key_View_CursorShowInterval).value<bool>());
});
QAction *displayFrequencyAction = new QAction(tr("Display frequency"), this);
displayFrequencyAction->setChecked(show_frequency_);
menu->addAction(displayFrequencyAction);
- connect(displayFrequencyAction, &QAction::toggled, [=]{
- GlobalSettings settings;
- settings.setValue(GlobalSettings::Key_View_CursorShowFrequency,
- !settings.value(GlobalSettings::Key_View_CursorShowFrequency).value<bool>());
+ connect(displayFrequencyAction, &QAction::toggled, displayFrequencyAction,
+ [=]{
+ GlobalSettings settings;
+ settings.setValue(GlobalSettings::Key_View_CursorShowFrequency,
+ !settings.value(GlobalSettings::Key_View_CursorShowFrequency).value<bool>());
});
QAction *displaySamplesAction = new QAction(tr("Display samples"), this);
displaySamplesAction->setChecked(show_samples_);
menu->addAction(displaySamplesAction);
- connect(displaySamplesAction, &QAction::toggled, [=]{
- GlobalSettings settings;
- settings.setValue(GlobalSettings::Key_View_CursorShowSamples,
- !settings.value(GlobalSettings::Key_View_CursorShowSamples).value<bool>());
+ connect(displaySamplesAction, &QAction::toggled, displaySamplesAction,
+ [=]{
+ GlobalSettings settings;
+ settings.setValue(GlobalSettings::Key_View_CursorShowSamples,
+ !settings.value(GlobalSettings::Key_View_CursorShowSamples).value<bool>());
});
return menu;