Use default destructor, and add move/copy operators to settings impls

This commit is contained in:
AdenKoperczak 2025-01-29 10:18:26 -05:00
parent f84a86a3a3
commit 05c05fec5c
17 changed files with 90 additions and 20 deletions

View file

@ -135,7 +135,12 @@ public:
SetDefaultLineData(inactive_, kInactivePalettes_.at(phenomenon));
}
~Impl() {}
~Impl() = default;
Impl(const Impl&) = delete;
Impl& operator=(const Impl&) = delete;
Impl(const Impl&&) = delete;
Impl& operator=(const Impl&&) = delete;
static void SetDefaultLineData(LineSettings& lineSettings,
const LineData& lineData);

View file

@ -92,7 +92,11 @@ public:
SettingsVariable<bool> {"alert_disabled"});
}
~Impl() {}
~Impl() = default;
Impl(const Impl&) = delete;
Impl& operator=(const Impl&) = delete;
Impl(const Impl&&) = delete;
Impl& operator=(const Impl&&) = delete;
SettingsVariable<std::string> alertSoundFile_ {"alert_sound_file"};
SettingsVariable<std::string> alertLocationMethod_ {"alert_location_method"};

View file

@ -140,7 +140,11 @@ public:
{ return QUrl {QString::fromStdString(value)}.isValid(); });
}
~Impl() {}
~Impl() = default;
Impl(const Impl&) = delete;
Impl& operator=(const Impl&) = delete;
Impl(const Impl&&) = delete;
Impl& operator=(const Impl&&) = delete;
SettingsVariable<bool> antiAliasingEnabled_ {"anti_aliasing_enabled"};
SettingsVariable<std::string> clockFormat_ {"clock_format"};

View file

@ -90,7 +90,11 @@ public:
SettingsVariable<std::string> {"?"});
}
~Impl() {}
~Impl() = default;
Impl(const Impl&) = delete;
Impl& operator=(const Impl&) = delete;
Impl(const Impl&&) = delete;
Impl& operator=(const Impl&&) = delete;
std::unordered_map<types::Hotkey, SettingsVariable<std::string>> hotkey_ {};
std::vector<SettingsVariableBase*> variables_ {};

View file

@ -46,7 +46,12 @@ public:
highlightColor_.SetValidator(&util::color::ValidateArgbString);
borderColor_.SetValidator(&util::color::ValidateArgbString);
}
~Impl() {}
~Impl() = default;
Impl(const Impl&) = delete;
Impl& operator=(const Impl&) = delete;
Impl(const Impl&&) = delete;
Impl& operator=(const Impl&&) = delete;
SettingsVariable<std::string> lineColor_ {"line_color"};
SettingsVariable<std::string> highlightColor_ {"highlight_color"};

View file

@ -100,7 +100,11 @@ public:
}
}
~Impl() {}
~Impl() = default;
Impl(const Impl&) = delete;
Impl& operator=(const Impl&) = delete;
Impl(const Impl&&) = delete;
Impl& operator=(const Impl&&) = delete;
void SetDefaults(std::size_t i)
{

View file

@ -79,7 +79,11 @@ public:
InitializeAlerts();
}
~Impl() {}
~Impl() = default;
Impl(const Impl&) = delete;
Impl& operator=(const Impl&) = delete;
Impl(const Impl&&) = delete;
Impl& operator=(const Impl&&) = delete;
void InitializeColorTables();
void InitializeLegacyAlerts();

View file

@ -19,7 +19,11 @@ public:
// NOLINTEND(cppcoreguidelines-avoid-magic-numbers)
}
~Impl() {}
~Impl() = default;
Impl(const Impl&) = delete;
Impl& operator=(const Impl&) = delete;
Impl(const Impl&&) = delete;
Impl& operator=(const Impl&&) = delete;
SettingsVariable<bool> showSmoothedRangeFolding_ {
"show_smoothed_range_folding"};

View file

@ -15,7 +15,11 @@ class SettingsCategory::Impl
public:
explicit Impl(const std::string& name) : name_ {name} {}
~Impl() {}
~Impl() = default;
Impl(const Impl&) = delete;
Impl& operator=(const Impl&) = delete;
Impl(const Impl&&) = delete;
Impl& operator=(const Impl&&) = delete;
void ConnectSubcategory(SettingsCategory& category);
void ConnectVariable(SettingsVariableBase* variable);

View file

@ -11,9 +11,13 @@ template<class Container>
class SettingsContainer<Container>::Impl
{
public:
explicit Impl() {}
explicit Impl() = default;
~Impl() {}
~Impl() = default;
Impl(const Impl&) = delete;
Impl& operator=(const Impl&) = delete;
Impl(const Impl&&) = delete;
Impl& operator=(const Impl&&) = delete;
T elementDefault_ {};
std::optional<T> elementMinimum_ {};

View file

@ -27,7 +27,11 @@ public:
context_->moveToThread(QCoreApplication::instance()->thread());
}
~Impl() {}
~Impl() = default;
Impl(const Impl&) = delete;
Impl& operator=(const Impl&) = delete;
Impl(const Impl&&) = delete;
Impl& operator=(const Impl&&) = delete;
template<class U>
void SetWidgetText(U* widget, const T& currentValue);

View file

@ -11,8 +11,12 @@ static const std::string logPrefix_ =
class SettingsInterfaceBase::Impl
{
public:
explicit Impl() {}
~Impl() {}
explicit Impl() = default;
~Impl() = default;
Impl(const Impl&) = delete;
Impl& operator=(const Impl&) = delete;
Impl(const Impl&&) = delete;
Impl& operator=(const Impl&&) = delete;
};
SettingsInterfaceBase::SettingsInterfaceBase() : p(std::make_unique<Impl>()) {}

View file

@ -17,8 +17,12 @@ template<class T>
class SettingsVariable<T>::Impl
{
public:
explicit Impl() {}
~Impl() {}
explicit Impl() = default;
~Impl() = default;
Impl(const Impl&) = delete;
Impl& operator=(const Impl&) = delete;
Impl(const Impl&&) = delete;
Impl& operator=(const Impl&&) = delete;
T value_ {};
T default_ {};

View file

@ -11,7 +11,11 @@ class SettingsVariableBase::Impl
public:
explicit Impl(const std::string& name) : name_ {name} {}
~Impl() {}
~Impl() = default;
Impl(const Impl&) = delete;
Impl& operator=(const Impl&) = delete;
Impl(const Impl&&) = delete;
Impl& operator=(const Impl&&) = delete;
const std::string name_;

View file

@ -80,7 +80,11 @@ public:
InitializeFontVariables();
}
~Impl() {}
~Impl() = default;
Impl(const Impl&) = delete;
Impl& operator=(const Impl&) = delete;
Impl(const Impl&&) = delete;
Impl& operator=(const Impl&&) = delete;
void InitializeFontVariables();

View file

@ -22,7 +22,11 @@ public:
// NOLINTEND(cppcoreguidelines-avoid-magic-numbers)
}
~UiSettingsImpl() {}
~UiSettingsImpl() = default;
UiSettingsImpl(const UiSettingsImpl&) = delete;
UiSettingsImpl& operator=(const UiSettingsImpl&) = delete;
UiSettingsImpl(const UiSettingsImpl&&) = delete;
UiSettingsImpl& operator=(const UiSettingsImpl&&) = delete;
SettingsVariable<bool> level2ProductsExpanded_ {"level2_products_expanded"};
SettingsVariable<bool> level2SettingsExpanded_ {"level2_settings_expanded"};

View file

@ -62,7 +62,11 @@ public:
types::GetDistanceUnitsName));
}
~Impl() {}
~Impl() = default;
Impl(const Impl&) = delete;
Impl& operator=(const Impl&) = delete;
Impl(const Impl&&) = delete;
Impl& operator=(const Impl&&) = delete;
SettingsVariable<std::string> accumulationUnits_ {"accumulation_units"};
SettingsVariable<std::string> echoTopsUnits_ {"echo_tops_units"};