Instead of a generic function to filter GLists, implement a simpler
and clearer filter function for file lists, since it was the only
use of that function.
In this way the ownership of files and directories are clearer
since it always returns a new allocated nautilus file list, and also
it always uses nautilus_file_ref instead of the generic g_object_ref
to match what we do everywhere else in nautilus, so it's not confusing
when breaking at nautilus_file_ref/unref for ref counting debugging.
This change fixes multiple leaks on nautilus files catched by valgrind.
Even if we wanted to always use the active window as the default
action to open locations, seems gtk_get_active_windows doesn't work
as expected for us. Until we figure out the problem, pass explicitly
the target slot that the caller provides so users don't experience
the location opening in a different window than the expected.
https://bugzilla.gnome.org/show_bug.cgi?id=756499
Shells can fix docks, panels and other similar things which reduce the
available space to draw on. This is called the canvas margin.
When positioning things relative to icons within containers we need to
adjust by this margin, otherwise they will be shifted away from the
target. Do this when we calculate the bounding box.
https://bugzilla.gnome.org/show_bug.cgi?id=759002
We were assuming trash and native_path as local, but not recent,
which is wrong.
So assume recent as local, with the benefit that we can use it
for mime type polling and remove some dead code now.
We were checking how many days ago the file was modified by
checking directly the current time with the file modification
time, which is wrong if the file was modified a few hours ago
but the day already passed.
What happened is that it was showing the time as in if it was
modified in the same day, instead of saying "Yesterday".
To fix it, check the time difference with the midnight time.
https://bugzilla.gnome.org/show_bug.cgi?id=757272
We were leaking it, causing that the view was not free if
there were some templates, since templates menu items were
holding a ref to the view and are only freed when the closure
of the action gets freed, which is the view action group.
This was making the view to get never finalized, and therefore
making all kind of problems afterwards.
Upcoming patch will also make template not hold a ref to the view,
even if the issue is fixed now, I think templates menu items holding
a reference to the view is wrong.
Since bgo#757826 introduced g_application_set_resource_base_path,
we don't need to use a GtkBuilder to load the appmenu.
GtkApplication automatically loads menus from the GtkBuilder resource
located at "gtk/menus.ui", relative to the application's resource
base path (see g_application_set_resource_base_path ()). The menu
with the ID "app-menu" is taken as the application's app menu.
https://bugzilla.gnome.org/show_bug.cgi?id=757946