[education/rkward] rkward: Modify compat solution to please clazy
Thomas Friedrichsmeier
null at kde.org
Mon Oct 13 15:23:56 BST 2025
Git commit 3690917487df0bffd59f50b6d8ca10895f836f4e by Thomas Friedrichsmeier.
Committed on 13/10/2025 at 14:10.
Pushed by tfry into branch 'master'.
Modify compat solution to please clazy
M +1 -1 rkward/dialogs/rkloadlibsdialog.cpp
M +5 -4 rkward/misc/rkcompatibility.h
M +1 -1 rkward/misc/rkfindbar.cpp
M +1 -1 rkward/misc/rksaveobjectchooser.cpp
M +1 -1 rkward/plugin/rkcheckbox.cpp
M +1 -1 rkward/settings/rksettingsmodule.cpp
M +1 -1 rkward/settings/rksettingsmoduleconsole.cpp
M +1 -1 rkward/settings/rksettingsmoduleoutput.cpp
M +4 -4 rkward/settings/rksettingsmodulewatch.cpp
https://invent.kde.org/education/rkward/-/commit/3690917487df0bffd59f50b6d8ca10895f836f4e
diff --git a/rkward/dialogs/rkloadlibsdialog.cpp b/rkward/dialogs/rkloadlibsdialog.cpp
index 0e16c626d..53de8b58d 100644
--- a/rkward/dialogs/rkloadlibsdialog.cpp
+++ b/rkward/dialogs/rkloadlibsdialog.cpp
@@ -662,7 +662,7 @@ InstallPackagesWidget::InstallPackagesWidget(RKLoadLibsDialog *dialog) : RKLoadL
connect(filter_edit, &RKDynamicSearchLine::searchChanged, this, &InstallPackagesWidget::filterChanged);
rkward_packages_only = new QCheckBox(i18n("Show only packages providing RKWard dialogs"), this);
RKCommonFunctions::setTips(i18n("<p>Some but not all R packages come with plugins for RKWard. That means they provide a graphical user-interface in addition to R functions. Check this box to show only such packages.</p>"), rkward_packages_only);
- connect(rkward_packages_only, RKCompatibility::QCheckBox_checkStateChanged(), this, &InstallPackagesWidget::filterChanged);
+ connect(rkward_packages_only, RKCompatibility_QCheckBox_checkStateChanged, this, &InstallPackagesWidget::filterChanged);
filterChanged();
horizontalSeparator = new QFrame(this);
diff --git a/rkward/misc/rkcompatibility.h b/rkward/misc/rkcompatibility.h
index 1004a881c..711b49efe 100644
--- a/rkward/misc/rkcompatibility.h
+++ b/rkward/misc/rkcompatibility.h
@@ -14,12 +14,13 @@ This namespace holds helpers for supporting different versions of Q6/KF6, withou
@author Thomas Friedrichsmeier
*/
namespace RKCompatibility {
-#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
+}; //namespace RKCompatibility
+
// NOTE: defining this as a plain (non-function) constant produces incorrect results on MSVC
-inline const constexpr auto QCheckBox_checkStateChanged() { return &QCheckBox::checkStateChanged; };
+#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
+# define RKCompatibility_QCheckBox_checkStateChanged &QCheckBox::checkStateChanged
#else
-inline const constexpr auto QCheckBox_checkStateChanged() { return &QCheckBox::stateChanged; };
+# define RKCompatibility_QCheckBox_checkStateChanged &QCheckBox::stateChanged
#endif
-}; //namespace RKCompatibility
#endif
diff --git a/rkward/misc/rkfindbar.cpp b/rkward/misc/rkfindbar.cpp
index d73ac29fe..50530e3bf 100644
--- a/rkward/misc/rkfindbar.cpp
+++ b/rkward/misc/rkfindbar.cpp
@@ -97,7 +97,7 @@ QCheckBox *RKFindBar::getOption(const RKFindBar::FindOptions option) {
RK_ASSERT(false);
return nullptr;
}
- connect(action, RKCompatibility::QCheckBox_checkStateChanged(), this, &RKFindBar::searchChanged);
+ connect(action, RKCompatibility_QCheckBox_checkStateChanged, this, &RKFindBar::searchChanged);
default_actions.insert(option, action);
}
diff --git a/rkward/misc/rksaveobjectchooser.cpp b/rkward/misc/rksaveobjectchooser.cpp
index 888024e73..9ffe6d2a3 100644
--- a/rkward/misc/rksaveobjectchooser.cpp
+++ b/rkward/misc/rksaveobjectchooser.cpp
@@ -53,7 +53,7 @@ RKSaveObjectChooser::RKSaveObjectChooser(QWidget *parent, const QString &initial
layout->addWidget(name_edit);
overwrite_confirm = new QCheckBox(i18n("Overwrite"), this);
- connect(overwrite_confirm, RKCompatibility::QCheckBox_checkStateChanged(), this, &RKSaveObjectChooser::updateState);
+ connect(overwrite_confirm, RKCompatibility_QCheckBox_checkStateChanged, this, &RKSaveObjectChooser::updateState);
overwrite_warn = new KMessageWidget(i18n("The given object name already exists"));
overwrite_warn->setCloseButtonVisible(false);
hlayout = new QHBoxLayout();
diff --git a/rkward/plugin/rkcheckbox.cpp b/rkward/plugin/rkcheckbox.cpp
index b8dea9a02..42d596330 100644
--- a/rkward/plugin/rkcheckbox.cpp
+++ b/rkward/plugin/rkcheckbox.cpp
@@ -30,7 +30,7 @@ RKCheckBox::RKCheckBox(const QDomElement &element, RKComponent *parent_component
checkbox = new QCheckBox(xml->i18nStringAttribute(element, QStringLiteral("label"), QString(), DL_WARNING), this);
vbox->addWidget(checkbox);
checkbox->setChecked(xml->getBoolAttribute(element, QStringLiteral("checked"), false, DL_INFO));
- connect(checkbox, RKCompatibility::QCheckBox_checkStateChanged(), this, &RKCheckBox::changedStateFromUi);
+ connect(checkbox, RKCompatibility_QCheckBox_checkStateChanged, this, &RKCheckBox::changedStateFromUi);
// initialize
updating = false;
diff --git a/rkward/settings/rksettingsmodule.cpp b/rkward/settings/rksettingsmodule.cpp
index 22a4d078f..f122f4f36 100644
--- a/rkward/settings/rksettingsmodule.cpp
+++ b/rkward/settings/rksettingsmodule.cpp
@@ -47,7 +47,7 @@ template <>
QCheckBox *RKConfigValue<bool, bool>::makeCheckbox(const QString &label, RKSettingsModuleWidget *module) {
QCheckBox *ret = new QCheckBox(label);
ret->setChecked(value);
- QObject::connect(ret, RKCompatibility::QCheckBox_checkStateChanged(), module, &RKSettingsModuleWidget::change);
+ QObject::connect(ret, RKCompatibility_QCheckBox_checkStateChanged, module, &RKSettingsModuleWidget::change);
QObject::connect(module, &RKSettingsModuleWidget::apply, module, [ret, this]() { this->value = ret->isChecked(); });
return ret;
}
diff --git a/rkward/settings/rksettingsmoduleconsole.cpp b/rkward/settings/rksettingsmoduleconsole.cpp
index 0f2bff923..b4bc37d6e 100644
--- a/rkward/settings/rksettingsmoduleconsole.cpp
+++ b/rkward/settings/rksettingsmoduleconsole.cpp
@@ -71,7 +71,7 @@ class RKSettingsPageConsole : public RKSettingsModuleWidget {
{(int)RKSettingsModuleConsole::AlwaysAdd, i18n("Add all commands")}}),
this);
add_piped_commands_to_history_box->setEnabled(pipe_user_commands_through_console_box->isChecked());
- connect(pipe_user_commands_through_console_box, RKCompatibility::QCheckBox_checkStateChanged(), add_piped_commands_to_history_box, [add_piped_commands_to_history_box](int state) {
+ connect(pipe_user_commands_through_console_box, RKCompatibility_QCheckBox_checkStateChanged, add_piped_commands_to_history_box, [add_piped_commands_to_history_box](int state) {
add_piped_commands_to_history_box->setEnabled(state);
});
vbox->addWidget(add_piped_commands_to_history_box);
diff --git a/rkward/settings/rksettingsmoduleoutput.cpp b/rkward/settings/rksettingsmoduleoutput.cpp
index 91f81683a..ac4bdce45 100644
--- a/rkward/settings/rksettingsmoduleoutput.cpp
+++ b/rkward/settings/rksettingsmoduleoutput.cpp
@@ -116,7 +116,7 @@ class RKSettingsPageOutput : public RKSettingsModuleWidget {
auto auto_raise_box = RKSettingsModuleOutput::auto_raise.makeCheckbox(i18n("raise window on new output"), this);
group_layout->addWidget(auto_raise_box);
auto_raise_box->setEnabled(RKSettingsModuleOutput::auto_show);
- connect(auto_show_box, RKCompatibility::QCheckBox_checkStateChanged(), auto_raise_box, [auto_raise_box](int state) {
+ connect(auto_show_box, RKCompatibility_QCheckBox_checkStateChanged, auto_raise_box, [auto_raise_box](int state) {
auto_raise_box->setEnabled(state);
});
diff --git a/rkward/settings/rksettingsmodulewatch.cpp b/rkward/settings/rksettingsmodulewatch.cpp
index 38f0419c9..3707935a8 100644
--- a/rkward/settings/rksettingsmodulewatch.cpp
+++ b/rkward/settings/rksettingsmodulewatch.cpp
@@ -207,22 +207,22 @@ class RKSettingsPageWatch : public RKSettingsModuleWidget {
filter_boxes.input = new QCheckBox();
filter_boxes.input->setChecked(state & RKSettingsModuleWatch::ShowInput);
- connect(filter_boxes.input, RKCompatibility::QCheckBox_checkStateChanged(), this, &RKSettingsPageWatch::changedSetting);
+ connect(filter_boxes.input, RKCompatibility_QCheckBox_checkStateChanged, this, &RKSettingsPageWatch::changedSetting);
layout->addWidget(filter_boxes.input, row, 1);
filter_boxes.output = new QCheckBox();
filter_boxes.output->setChecked(state & RKSettingsModuleWatch::ShowOutput);
- connect(filter_boxes.output, RKCompatibility::QCheckBox_checkStateChanged(), this, &RKSettingsPageWatch::changedSetting);
+ connect(filter_boxes.output, RKCompatibility_QCheckBox_checkStateChanged, this, &RKSettingsPageWatch::changedSetting);
layout->addWidget(filter_boxes.output, row, 2);
filter_boxes.error = new QCheckBox();
filter_boxes.error->setChecked(state & RKSettingsModuleWatch::ShowError);
- connect(filter_boxes.error, RKCompatibility::QCheckBox_checkStateChanged(), this, &RKSettingsPageWatch::changedSetting);
+ connect(filter_boxes.error, RKCompatibility_QCheckBox_checkStateChanged, this, &RKSettingsPageWatch::changedSetting);
layout->addWidget(filter_boxes.error, row, 3);
filter_boxes.raise = new QCheckBox();
filter_boxes.raise->setChecked(state & RKSettingsModuleWatch::RaiseWindow);
- connect(filter_boxes.raise, RKCompatibility::QCheckBox_checkStateChanged(), this, &RKSettingsPageWatch::changedSetting);
+ connect(filter_boxes.raise, RKCompatibility_QCheckBox_checkStateChanged, this, &RKSettingsPageWatch::changedSetting);
layout->addWidget(filter_boxes.raise, row, 4);
return filter_boxes;
More information about the rkward-tracker
mailing list