lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master ed63bee 2/9: Enable GUI test to preserve 'con


From: Greg Chicares
Subject: [lmi-commits] [lmi] master ed63bee 2/9: Enable GUI test to preserve 'configurable_settings.xml'
Date: Thu, 12 Jul 2018 13:12:57 -0400 (EDT)

branch: master
commit ed63bee3e2502a71c3d2b1950cdabd2d05d0d19c
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Enable GUI test to preserve 'configurable_settings.xml'
    
    See:
      https://lists.nongnu.org/archive/html/lmi/2018-07/msg00005.html
---
 configurable_settings.cpp | 36 ++++++++++++++++--------------------
 configurable_settings.hpp |  2 ++
 2 files changed, 18 insertions(+), 20 deletions(-)

diff --git a/configurable_settings.cpp b/configurable_settings.cpp
index 7aa56a0..9ea4186 100644
--- a/configurable_settings.cpp
+++ b/configurable_settings.cpp
@@ -46,11 +46,17 @@ template class xml_serializable<configurable_settings>;
 
 namespace
 {
-std::string const& configuration_filename()
+std::string const& default_calculation_summary_columns()
 {
-    static std::string s("configurable_settings.xml");
+    static std::string s
+        ("Outlay"
+        " AcctVal_Current"
+        " CSVNet_Current"
+        " EOYDeathBft_Current"
+        );
     return s;
 }
+} // Unnamed namespace.
 
 /// Store the complete configuration-file path at startup, in case
 /// it's non-complete--as is typical msw usage.
@@ -79,23 +85,25 @@ std::string const& configuration_filename()
 /// most appropriate. (A knowledgeable user could of course move it
 /// aside if it is desired to use the file on the read-only medium.)
 
-fs::path const& configuration_filepath()
+std::string const& configuration_filepath()
 {
-    static fs::path complete_path;
+    static std::string complete_path;
     if(!complete_path.empty())
         {
         return complete_path;
         }
 
-    std::string filename = "/etc/opt/lmi/" + configuration_filename();
+    static std::string const basename {"configurable_settings.xml"};
+
+    std::string filename = "/etc/opt/lmi/" + basename;
     if(0 != access(filename.c_str(), R_OK))
         {
-        filename = AddDataDir(configuration_filename());
+        filename = AddDataDir(basename);
         if(0 != access(filename.c_str(), R_OK))
             {
             alarum()
                 << "No readable file '"
-                << configuration_filename()
+                << basename
                 << "' exists."
                 << LMI_FLUSH
                 ;
@@ -114,22 +122,10 @@ fs::path const& configuration_filepath()
         }
 
     validate_filepath(filename, "Configurable-settings file");
-    complete_path = fs::system_complete(filename);
+    complete_path = fs::system_complete(filename).string();
     return complete_path;
 }
 
-std::string const& default_calculation_summary_columns()
-{
-    static std::string s
-        ("Outlay"
-        " AcctVal_Current"
-        " CSVNet_Current"
-        " EOYDeathBft_Current"
-        );
-    return s;
-}
-} // Unnamed namespace.
-
 configurable_settings::configurable_settings()
     :calculation_summary_columns_        
(default_calculation_summary_columns())
     ,census_paste_palimpsestically_      (true                                 
)
diff --git a/configurable_settings.hpp b/configurable_settings.hpp
index b1cbead..c5c19b9 100644
--- a/configurable_settings.hpp
+++ b/configurable_settings.hpp
@@ -112,6 +112,8 @@ class LMI_SO configurable_settings final
     std::string xsl_fo_command_;
 };
 
+std::string const& LMI_SO configuration_filepath();
+
 std::vector<std::string>        input_calculation_summary_columns();
 // This function must be visible to 'wx_test_calculation_summary.cpp'.
 std::vector<std::string> LMI_SO effective_calculation_summary_columns();



reply via email to

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