Commit 33fd999
Only store files lodad from the GUI in recent fonts
Changed files (4)
modifiedlibbirdfont/FileTab.valamodifiedlibbirdfont/Font.valamodifiedlibbirdfont/LoadCallback.valamodifiedlibbirdfont/SaveCallback.vala
Diff
@@ -76,6 +76,8 @@ public class FileTab : FontDisplay { MainWindow.close_all_tabs (); f.set_file (fn);+ Preferences.add_recent_files (fn);+ MainWindow.native_window.load (); // background thread }); @@ -597,7 +597,6 @@ public class Font : GLib.Object { bfp_file.create_directory (directory); bfp_file.save (); this.bfp = true;- Preferences.add_recent_files (bfp_file.get_path ()); } catch (GLib.Error e) { warning (e.message); // FIXME: notify user@@ -656,7 +655,6 @@ public class Font : GLib.Object { } modified = false;- Preferences.add_recent_files (get_path ()); } public void set_font_file (string path) {@@ -672,7 +670,7 @@ public class Font : GLib.Object { return (glyph_name.length () == 0); } - public void set_file (string path, bool recent = true) {+ public void set_file (string path) { font_file = path; } @@ -755,9 +753,7 @@ public class Font : GLib.Object { format = FontFormat.FREETYPE; font_file = null;- } -- Preferences.add_recent_files (get_path ());+ } return loaded; }@@ -793,9 +789,7 @@ public class Font : GLib.Object { font_data = ((!) data).str; parsed = bf_font.load_data (font_data); - if (parsed) {- Preferences.add_recent_files (path);- } else {+ if (!parsed) { warning ("Failed to parse loaded freetype font."); } @@ -76,6 +76,7 @@ public class LoadCallback : GLib.Object { file_loaded.connect (() => { KerningTools.update_kerning_classes (); MenuTab.show_all_available_characters ();+ Preferences.add_recent_files (fn); }); } });@@ -56,6 +56,8 @@ public class SaveCallback : GLib.Object { i++; } + Preferences.add_recent_files (file_name);+ font.font_file = file_name; save (); saved = true;