Skip to content

Commit

Permalink
MainWindow: remove unused function "has_temporary_files ()"; Fix long…
Browse files Browse the repository at this point in the history
… line. (#919)
  • Loading branch information
Jeremy Wootten authored Dec 24, 2020
1 parent 98593de commit 7b6e331
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions src/MainWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,9 @@ namespace Scratch {

var provider = new Gtk.CssProvider ();
provider.load_from_resource ("io/elementary/code/Application.css");
Gtk.StyleContext.add_provider_for_screen (Gdk.Screen.get_default (), provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
Gtk.StyleContext.add_provider_for_screen (
Gdk.Screen.get_default (), provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION
);

Hdy.init ();
}
Expand Down Expand Up @@ -562,21 +564,6 @@ namespace Scratch {
document_view.close_document (doc);
}

public bool has_temporary_files () {
try {
var enumerator = File.new_for_path (app.data_home_folder_unsaved).enumerate_children (FileAttribute.STANDARD_NAME, 0, null);
for (var fileinfo = enumerator.next_file (null); fileinfo != null; fileinfo = enumerator.next_file (null)) {
if (!fileinfo.get_name ().has_suffix ("~")) {
return true;
}
}
} catch (Error e) {
critical (e.message);
}

return false;
}

// Check if there no unsaved changes
private bool check_unsaved_changes () {
document_view.is_closing = true;
Expand Down

0 comments on commit 7b6e331

Please sign in to comment.