When compressing a pdf most users want the compressed pdf to be saved in the same directory. Before this PR the root directory was always set as default by the filechooser after selecting the compress button. However instead of being forced to always click through your whole filesystem tree to the original location it is now set by default.
When compressing a pdf most users want the compressed pdf to be saved in the same directory. Before this PR the root directory was always set as default by the filechooser after selecting the compress button. However instead of being forced to always click through your whole filesystem tree to the original location it is now set by default.
Before: After:
This was done by parsing the directory name instead of the filename filename to the
set_current_folder
function (https://valadoc.org/gtk+-3.0/Gtk.FileChooser.set_current_folder.html) using theget_dirname
function (https://valadoc.org/glib-2.0/GLib.Path.get_dirname.html)