lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] (no subject)


From: Greg Chicares
Subject: [lmi-commits] (no subject)
Date: Thu, 2 Jun 2016 14:35:13 +0000 (UTC)

branch: master
commit c98ef204a3c4bed96fc98f3aa2cbef7691c3200d
Author: Gregory W. Chicares <address@hidden>
Date:   Thu Jun 2 13:32:23 2016 +0000

    Expunge unneeded configurable_settings mutators [449]
    
    The expunged mutators did nothing but pass values through, and
    any_member::operator=(std::string const&) already does that.
    
    Removed an old defect marker that said the mutator for calculation-
    summary columns should validate the value it passes. Functions
    PreferencesModel::Save() and parse_calculation_summary_columns()
    already validate the column selection adequately, although the
    division of responsibilities between them is curious.
---
 configurable_settings.cpp |   27 ---------------------------
 configurable_settings.hpp |    4 ----
 preferences_model.cpp     |   10 ++++++----
 3 files changed, 6 insertions(+), 35 deletions(-)

diff --git a/configurable_settings.cpp b/configurable_settings.cpp
index 3bc58c6..a5a7d47 100644
--- a/configurable_settings.cpp
+++ b/configurable_settings.cpp
@@ -313,28 +313,6 @@ void configurable_settings::redintegrate_ex_post
         }
 }
 
-// TODO ?? CALCULATION_SUMMARY Address the validation issue:
-
-/// A whitespace-delimited list of columns to be shown on the
-/// calculation summary, unless overridden by
-/// use_builtin_calculation_summary(true).
-///
-/// Precondition: Argument is semantically valid; ultimately this will
-/// be validated elsewhere.
-
-void configurable_settings::calculation_summary_columns(std::string const& s)
-{
-    calculation_summary_columns_ = s;
-}
-
-/// If true, then use built-in default calculation-summary columns;
-/// otherwise, use calculation_summary_columns().
-
-void configurable_settings::use_builtin_calculation_summary(bool b)
-{
-    use_builtin_calculation_summary_ = b;
-}
-
 /// A whitespace-delimited list of columns to be shown on the
 /// calculation summary, unless overridden by
 /// use_builtin_calculation_summary(true).
@@ -422,11 +400,6 @@ int 
configurable_settings::seconds_to_pause_between_printouts() const
 
 /// Name of '.xrc' interface skin.
 
-void configurable_settings::skin_filename(std::string const& skin_filename)
-{
-    skin_filename_ = skin_filename;
-}
-
 std::string const& configurable_settings::skin_filename() const
 {
     return skin_filename_;
diff --git a/configurable_settings.hpp b/configurable_settings.hpp
index 8a93497..4ec0793 100644
--- a/configurable_settings.hpp
+++ b/configurable_settings.hpp
@@ -54,10 +54,6 @@ class LMI_SO configurable_settings
 
     void save() const;
 
-    void calculation_summary_columns(std::string const&);
-    void use_builtin_calculation_summary(bool);
-    void skin_filename(std::string const&);
-
     std::string const& calculation_summary_columns        () const;
     std::string const& cgi_bin_log_filename               () const;
     std::string const& custom_input_0_filename            () const;
diff --git a/preferences_model.cpp b/preferences_model.cpp
index d4ae12e..1bf7809 100644
--- a/preferences_model.cpp
+++ b/preferences_model.cpp
@@ -29,6 +29,7 @@
 #include "alert.hpp"
 #include "configurable_settings.hpp"
 #include "miscellany.hpp"               // begins_with()
+#include "value_cast.hpp"
 
 #include <cstddef>                      // std::size_t
 #include <sstream>
@@ -264,6 +265,8 @@ std::string PreferencesModel::string_of_column_names() const
 
 void PreferencesModel::Save() const
 {
+    configurable_settings& z = configurable_settings::instance();
+
     std::string s(string_of_column_names());
     if(s.empty() && "Yes" != UseBuiltinCalculationSummary)
         {
@@ -272,9 +275,8 @@ void PreferencesModel::Save() const
             << LMI_FLUSH
             ;
         }
-    configurable_settings& z = configurable_settings::instance();
-    z.calculation_summary_columns(s);
-    z.use_builtin_calculation_summary("Yes" == UseBuiltinCalculationSummary);
-    z.skin_filename(SkinFileName.value());
+    z["calculation_summary_columns"    ] = s;
+    z["use_builtin_calculation_summary"] = value_cast<std::string>("Yes" == 
UseBuiltinCalculationSummary);
+    z["skin_filename"                  ] = SkinFileName.value();
 }
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]