Clone in a terminal:
Commit 5015063
Johan Mattsson - 2015-10-06T19:13:23+00:00
501506336fda3e87f64161be09c8591e619f3923johan.mattsson.m@gmail.com

Lock small segment in logging lock

Changed files (5)

Diff

diff --git a/libbirdfont/BirdFont.vala b/libbirdfont/BirdFont.valaindex 4f9ed13..932a5ce 100644--- a/libbirdfont/BirdFont.vala+++ b/libbirdfont/BirdFont.vala@@ -260,6 +260,16 @@ public class BirdFont { 		} 	} +	public static bool has_logging () {+		bool log;+		+		lock (BirdFont.logging) {+			log = BirdFont.logging;+		}+		+		return log;+	}+	 	public static Argument get_arguments () { 		return args; 	}@@ -406,19 +416,17 @@ public class BirdFont { 	} 	 	public static void debug_message (string s) {-		lock (BirdFont.logging) {-			if (unlikely (BirdFont.logging)) {-				try {-					if (BirdFont.logstream != null) {-						((!)BirdFont.logstream).put_string (s);-					} else {-						warning ("No logstream.");-					}-					-					stderr.printf (s);-				} catch (GLib.Error e) {-					warning (e.message);+		if (unlikely (has_logging ())) {+			try {+				if (BirdFont.logstream != null) {+					((!)BirdFont.logstream).put_string (s);+				} else {+					warning ("No logstream."); 				}+				+				stderr.printf (s);+			} catch (GLib.Error e) {+				warning (e.message); 			} 		} 	}diff --git a/libbirdfont/ExportUtils.vala b/libbirdfont/ExportUtils.valaindex 2587a93..c4307d7 100644--- a/libbirdfont/ExportUtils.vala+++ b/libbirdfont/ExportUtils.vala@@ -11,8 +11,6 @@     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      Lesser General Public License for more details. */-using BirdFont;- namespace BirdFont {  static void print_export_help (string[] arg) {@@ -51,7 +49,7 @@ public static int run_export (string[] arg) { 	 	// FIXME: create a option for this and add structure the log messages 	-	if (BirdFont.logging) {+	if (BirdFont.has_logging ()) { 		init_logfile (); 	} 	diff --git a/libbirdfont/ImportUtils.vala b/libbirdfont/ImportUtils.valaindex f6178e9..0c45601 100644--- a/libbirdfont/ImportUtils.vala+++ b/libbirdfont/ImportUtils.vala@@ -11,8 +11,6 @@     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      Lesser General Public License for more details. */-using BirdFont;- namespace BirdFont {  static void print_import_help (string[] arg) {diff --git a/libbirdfont/OverviewTools.vala b/libbirdfont/OverviewTools.valaindex e0c10ca..ab5ef0e 100644--- a/libbirdfont/OverviewTools.vala+++ b/libbirdfont/OverviewTools.vala@@ -128,11 +128,9 @@ public class OverviewTools : ToolCollection  { 		transform.set_persistent (false); 		transform_expander.add_tool (transform); 		-		if (BirdFont.has_argument ("--test")) {-			Tool alternate = new Tool ("alternate", t_("Create alternate"));-			alternate.select_action.connect (add_new_alternate);-			glyph_expander.add_tool (alternate);-		}+		Tool alternate = new Tool ("alternate", t_("Create alternate"));+		alternate.select_action.connect (add_new_alternate);+		glyph_expander.add_tool (alternate); 		 		expanders.add (font_name); 		expanders.add (zoom_expander);diff --git a/scripts/version.py b/scripts/version.pyindex f356583..e8c8555 100644--- a/scripts/version.py+++ b/scripts/version.py@@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. """ -VERSION = '2.12.0'+VERSION = '2.13.0-beta3' SO_VERSION_MAJOR = '36' SO_VERSION_MINOR = '0' SO_VERSION = SO_VERSION_MAJOR + '.' + SO_VERSION_MINOR

Contact

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