diff libinterp/corefcn/ft-text-renderer.cc @ 25460:627d6bde9b8d

solve installation info initialization problem differently Back out changesets 893344cee100 and 69fc8935020b. * defaults.h, defaults.cc: Instead of storing installation info like include_dir, data_dir, info_dir, etc., in file-scope static variables or a class object owned by the interpreter, store the initialized values as constants inside the functions that return them. This way they are initialized on demand and we don't have to worry about initialization order of static data. It's OK for these to be static because even though they may require some computation to intialize (looking at environment variables or substituting the value of OCTAVE_HOME), they are constants for any given installation of Octave and will be the same for any instantiation of the interpreter. Only include defaults.h in files that actually need it.
author John W. Eaton <jwe@octave.org>
date Tue, 12 Jun 2018 13:03:04 -0400
parents 893344cee100
children b68c41cb0f99
line wrap: on
line diff
--- a/libinterp/corefcn/ft-text-renderer.cc	Tue Jun 12 10:31:13 2018 -0700
+++ b/libinterp/corefcn/ft-text-renderer.cc	Tue Jun 12 13:03:04 2018 -0400
@@ -54,10 +54,9 @@
 #include "singleton-cleanup.h"
 #include "unistr-wrappers.h"
 
+#include "defaults.h"
 #include "error.h"
 #include "file-ops.h"
-#include "installation-data.h"
-#include "interpreter-private.h"
 #include "oct-env.h"
 #include "pr-output.h"
 #include "text-renderer.h"
@@ -214,15 +213,10 @@
           fonts_dir = sys::env::getenv ("OCTAVE_FONTS_DIR");
 
           if (fonts_dir.empty ())
-            {
 #if defined (SYSTEM_FREEFONT_DIR)
-              fonts_dir = SYSTEM_FREEFONT_DIR;
+            fonts_dir = SYSTEM_FREEFONT_DIR;
 #else
-              installation_data& inst_data
-                = __get_installation_data__ ("do_get_font");
-
-              fonts_dir = inst_data.oct_fonts_dir ();
-            }
+            fonts_dir = config::oct_fonts_dir ();
 #endif
         }