[education/rkward] rkward/settings: Simplify (hoping to fix compile issue). Mis-usage will fail at link-stage, anyway.

Thomas Friedrichsmeier null at kde.org
Sun Mar 13 08:09:10 GMT 2022


Git commit 2990b0664ba4f8ff1bf5877c07eb7f9abcb44d6f by Thomas Friedrichsmeier.
Committed on 13/03/2022 at 08:09.
Pushed by tfry into branch 'master'.

Simplify (hoping to fix compile issue). Mis-usage will fail at link-stage, anyway.

M  +1    -1    rkward/settings/rksettingsmodule.cpp
M  +1    -1    rkward/settings/rksettingsmodule.h

https://invent.kde.org/education/rkward/commit/2990b0664ba4f8ff1bf5877c07eb7f9abcb44d6f

diff --git a/rkward/settings/rksettingsmodule.cpp b/rkward/settings/rksettingsmodule.cpp
index 2f6abce7..4758e219 100644
--- a/rkward/settings/rksettingsmodule.cpp
+++ b/rkward/settings/rksettingsmodule.cpp
@@ -50,7 +50,7 @@ void RKSettingsModuleWidget::change() {
 
 
 template<>
-template<typename TT, typename std::enable_if<std::is_same<TT, bool>::value>::type* = nullptr> QCheckBox* RKConfigValue<bool>::makeCheckbox(const QString& label, RKSettingsModuleWidget* module) {
+QCheckBox* RKConfigValue<bool, bool>::makeCheckbox(const QString& label, RKSettingsModuleWidget* module) {
 	QCheckBox *ret = new QCheckBox(label);
 	ret->setChecked(value);
 	QObject::connect(ret, &QCheckBox::stateChanged, module, &RKSettingsModuleWidget::change);
diff --git a/rkward/settings/rksettingsmodule.h b/rkward/settings/rksettingsmodule.h
index fce49500..4075ca20 100644
--- a/rkward/settings/rksettingsmodule.h
+++ b/rkward/settings/rksettingsmodule.h
@@ -84,7 +84,7 @@ public:
 	RKConfigValue& operator= (const T v) { value = v; return *this; };
 
 /** Only for bool values: convenience function to create a fully connected checkbox for this option */
-	template<typename TT = T, typename std::enable_if<std::is_same<TT, bool>::value>::type* = nullptr> QCheckBox* makeCheckbox(const QString& label, RKSettingsModuleWidget* module);
+	QCheckBox* makeCheckbox(const QString& label, RKSettingsModuleWidget* module);
 /** Currently only for boolean or int options: Make a dropdown selector (QComboBox). If bit_flag_mask is set, the selector operates on (part of) an OR-able set of flags, instead of
  *  plain values. */
 	QComboBox* makeDropDown(const LabelList &entries, RKSettingsModuleWidget* _module, int bit_flag_mask = 0) {


More information about the rkward-tracker mailing list