Mercurial > octave
diff libinterp/corefcn/ft-text-renderer.cc @ 25439:69fc8935020b
move some static configuration variables inside a class
* defaults.h, defaults.cc: Move static configuration variables inside
a new installation_data class with access methods instead of a set of
global functions to access the static data.
* interpreter.h, interpreter.cc (interpreter::m_installation_data,
interpreter::get_installation_data): New data member and access
method. Change all uses of these configuration values to access them
through the interpreter object.
* interpreter-private.h, interpreter-private.cc
(__get_installation_data__): New function.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 08 Jun 2018 13:42:34 -0400 |
parents | cb1606f78f6b |
children | 893344cee100 |
line wrap: on
line diff
--- a/libinterp/corefcn/ft-text-renderer.cc Thu Jun 07 10:11:54 2018 -0400 +++ b/libinterp/corefcn/ft-text-renderer.cc Fri Jun 08 13:42:34 2018 -0400 @@ -57,6 +57,7 @@ #include "defaults.h" #include "error.h" #include "file-ops.h" +#include "interpreter-private.h" #include "oct-env.h" #include "pr-output.h" #include "text-renderer.h" @@ -213,10 +214,15 @@ 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 - fonts_dir = config::oct_fonts_dir (); + installation_data& inst_data + = __get_installation_data__ ("do_get_font"); + + fonts_dir = inst_data.oct_fonts_dir (); + } #endif }