Commit d25b0fb
Fix command line export waning messages
Changed files (4)
modifiedlibbirdfont/BirdFont.valamodifiedlibbirdfont/Glyph.valamodifiedlibbirdfont/Preferences.valamodifiedlibbirdfont/SearchPaths.vala
Diff
@@ -199,7 +199,8 @@ public static int run_export (string[] arg) { bool write_svg = false; File directory; Font font;- + MainWindow main_window;+ stdout.printf ("birdfont-export version %s\n", VERSION); stdout.printf ("built on %s\n", BUILD_TIMESTAMP); @@ -207,6 +208,10 @@ public static int run_export (string[] arg) { print_export_help (arg); return -1; }++ BirdFont.current_font = BirdFont.new_font ();+ BirdFont.current_glyph = new Glyph ("null", '\0');+ main_window = new MainWindow (); // FIXME: create a option for this and structure the log messages // init_logfile ();@@ -266,7 +271,6 @@ public static int run_export (string[] arg) { Preferences.load (); BirdFont.args = new Argument ("");- BirdFont.current_font = new Font (); BirdFont.current_glyph = new Glyph (""); file_name = build_absoulute_path (file_name);@@ -593,7 +597,6 @@ public class BirdFont { public static bool has_argument (string param) { if (is_null (args)) {- warning ("args is null"); return false; } @@ -403,7 +403,7 @@ public class Glyph : FontDisplay { public void add_help_lines () { remove_lines (); - assert (!is_null (BirdFont.get_current_font ()));+ return_if_fail (!is_null (BirdFont.get_current_font ())); double bgt = BirdFont.get_current_font ().top_limit; Line top_margin_line = new Line ("top margin", bgt, false);@@ -31,12 +31,21 @@ public class Preferences { public static string @get (string k) { string? s;++ if (is_null (data)) {+ data = new Gee.HashMap<string, string> ();+ }+ s = data.get (k); return (s != null) ? (!) s : ""; } public static void @set (string k, string v) {+ if (is_null (data)) {+ data = new Gee.HashMap<string, string> ();+ }+ data.set (k, v); save (); }@@ -73,7 +73,13 @@ public class SearchPaths { f = get_file (@"$PREFIX/share/birdfont/" + d + "/", name); if (likely (f.query_exists ())) return f;- ++ f = get_file (@"/usr/local/share/birdfont/" + d + "/", name);+ if (likely (f.query_exists ())) return f;++ f = get_file (@"/usr/share/birdfont/" + d + "/", name);+ if (likely (f.query_exists ())) return f;+ warning (@"Did not find file $name in $d (resources: $resources)"); return f;