Commit fbc2d39e authored by Clint Rogers's avatar Clint Rogers

Closes #4302 by adding a workaround to suppress the warning.

parent 0b07cabc
......@@ -49,6 +49,15 @@ public bool confirm_delete_face(Face face) {
namespace ExportUI {
private static File current_export_dir = null;
// Dummy function for suppressing 'could not stat file' errors
// generated when saving into a previously non-existant file -
// please see https://bugzilla.gnome.org/show_bug.cgi?id=662814
// This should be removed once GTK 3.4 is widely available, as
// it is slated to correct the problem.
public void suppress_warnings(string? log_domain, LogLevelFlags log_levels, string message) {
// do nothing.
}
public File? choose_file(string current_file_basename) {
if (current_export_dir == null)
current_export_dir = File.new_for_path(Environment.get_home_dir());
......@@ -63,13 +72,16 @@ public File? choose_file(string current_file_basename) {
chooser.set_current_folder(current_export_dir.get_path());
chooser.set_current_name(current_file_basename);
chooser.set_local_only(false);
// The log handler reset should be removed once GTK 3.4 becomes widely available;
// please see https://bugzilla.gnome.org/show_bug.cgi?id=662814 for details.
Log.set_handler("Gtk", LogLevelFlags.LEVEL_WARNING, suppress_warnings);
File file = null;
if (chooser.run() == Gtk.ResponseType.ACCEPT) {
file = File.new_for_path(chooser.get_filename());
current_export_dir = file.get_parent();
}
Log.set_handler("Gtk", LogLevelFlags.LEVEL_WARNING, Log.default_handler);
chooser.destroy();
return file;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment