Clone in a terminal:
Commit d25b0fb
Johan Mattsson - 2014-09-13T16:06:46+00:00
d25b0fb6cbfa7e9d1b147b33ca8700f05d9f9a73johan.mattsson.m@gmail.com

Fix command line export waning messages

Changed files (4)

Diff

diff --git a/libbirdfont/BirdFont.vala b/libbirdfont/BirdFont.valaindex 863b446..c0a58af 100644--- a/libbirdfont/BirdFont.vala+++ b/libbirdfont/BirdFont.vala@@ -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; 		} 		diff --git a/libbirdfont/Glyph.vala b/libbirdfont/Glyph.valaindex 13963a1..9302d10 100644--- a/libbirdfont/Glyph.vala+++ b/libbirdfont/Glyph.vala@@ -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);diff --git a/libbirdfont/Preferences.vala b/libbirdfont/Preferences.valaindex efb8d2f..63959e4 100644--- a/libbirdfont/Preferences.vala+++ b/libbirdfont/Preferences.vala@@ -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 (); 	}diff --git a/libbirdfont/SearchPaths.vala b/libbirdfont/SearchPaths.valaindex 6ad17cc..9ad34a4 100644--- a/libbirdfont/SearchPaths.vala+++ b/libbirdfont/SearchPaths.vala@@ -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;		

Contact

Email: johan.mattsson.m@gmail.com
Mastodon: typo.social/@birdfont
GitHub: johanmattssonm
LinkedIn: johan-mattsson-2ab324112