From bd88cde4360d3395d8c5578010351987250ad3f1 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Thu, 19 Sep 2013 16:25:53 -0700 Subject: [PATCH] Remove agi::OptionValue::GetDefault* They aren't actually used for much of anything. --- .../libaegisub/include/libaegisub/option_value.h | 15 --------------- aegisub/src/preferences_base.cpp | 2 +- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/aegisub/libaegisub/include/libaegisub/option_value.h b/aegisub/libaegisub/include/libaegisub/option_value.h index 872c2735f..7d08f4fcc 100644 --- a/aegisub/libaegisub/include/libaegisub/option_value.h +++ b/aegisub/libaegisub/include/libaegisub/option_value.h @@ -83,13 +83,6 @@ public: virtual void SetColor(const Color) { throw TypeError("color", " set "); } virtual void SetBool(const bool) { throw TypeError("bool", " set "); } - virtual std::string GetDefaultString() const { throw TypeError("string"); } - virtual int64_t GetDefaultInt() const { throw TypeError("int"); } - virtual double GetDefaultDouble() const { throw TypeError("double"); } - virtual Color GetDefaultColor() const { throw TypeError("color"); } - virtual bool GetDefaultBool() const { throw TypeError("bool"); } - - virtual std::vector const& GetListString() const { throw ListTypeError("string"); } virtual std::vector const& GetListInt() const { throw ListTypeError("int"); } virtual std::vector const& GetListDouble() const { throw ListTypeError("double"); } @@ -102,12 +95,6 @@ public: virtual void SetListColor(const std::vector&) { throw ListTypeError("color", " set "); } virtual void SetListBool(const std::vector&) { throw ListTypeError("string", " set "); } - virtual std::vector const& GetDefaultListString() const { throw ListTypeError("string"); } - virtual std::vector const& GetDefaultListInt() const { throw ListTypeError("int"); } - virtual std::vector const& GetDefaultListDouble() const { throw ListTypeError("double"); } - virtual std::vector const& GetDefaultListColor() const { throw ListTypeError("color"); } - virtual std::vector const& GetDefaultListBool() const { throw ListTypeError("string"); } - virtual void Set(const OptionValue *new_value)=0; DEFINE_SIGNAL_ADDERS(ValueChanged, Subscribe) @@ -123,7 +110,6 @@ public: : value(member_value), value_default(member_value), name(member_name) {} \ type Get##type_name() const { return value; } \ void Set##type_name(const type new_val) { value = new_val; NotifyChanged(); } \ - type GetDefault##type_name() const { return value_default; } \ OptionType GetType() const { return OptionValue::Type_##type_name; } \ std::string GetName() const { return name; } \ void Reset() { value = value_default; NotifyChanged(); } \ @@ -147,7 +133,6 @@ CONFIG_OPTIONVALUE(Bool, bool) : array(value), array_default(value), name(name) { } \ std::vector const& GetList##type_name() const { return array; } \ void SetList##type_name(const std::vector& val) { array = val; NotifyChanged(); } \ - std::vector const& GetDefaultList##type_name() const { return array_default; } \ OptionType GetType() const { return OptionValue::Type_List_##type_name; } \ std::string GetName() const { return name; } \ void Reset() { array = array_default; NotifyChanged(); } \ diff --git a/aegisub/src/preferences_base.cpp b/aegisub/src/preferences_base.cpp index 3e3affba3..cae81045f 100644 --- a/aegisub/src/preferences_base.cpp +++ b/aegisub/src/preferences_base.cpp @@ -168,7 +168,7 @@ void OptionPage::OptionChoice(wxFlexGridSizer *flex, const wxString &name, const switch (opt->GetType()) { case agi::OptionValue::Type_Int: { int val = opt->GetInt(); - cb->Select(val < (int)choices.size() ? val : opt->GetDefaultInt()); + cb->Select(val < (int)choices.size() ? val : 0); cb->Bind(wxEVT_COMMAND_COMBOBOX_SELECTED, IntCBUpdater(opt_name, parent)); break; }