Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions src/Application.vala
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,17 @@ public class Files.Application : Gtk.Application {
prefs, "sort-directories-first", GLib.SettingsBindFlags.DEFAULT);
}

public View.Window? create_empty_window () {
if (this.get_windows ().length () >= MAX_WINDOWS) { //Can be assumed to be limited in length
return null;
}

var win = new View.Window (this);
add_window (win as Gtk.Window);
plugins.interface_loaded (win as Gtk.Widget);
return win;
}

public View.Window? create_window (GLib.File? location = null,
ViewMode viewmode = ViewMode.PREFERRED) {

Expand All @@ -308,13 +319,7 @@ public class Files.Application : Gtk.Application {
private View.Window? create_window_with_tabs (GLib.File[] locations = {},
ViewMode viewmode = ViewMode.PREFERRED) {

if (this.get_windows ().length () >= MAX_WINDOWS) { //Can be assumed to be limited in length
return null;
}

var win = new View.Window (this);
add_window (win as Gtk.Window);
plugins.interface_loaded (win as Gtk.Widget);
var win = create_empty_window ();
win.open_tabs (locations, viewmode);

return win;
Expand Down
Loading