hellosiyan / Viewnior

Elegant Image Viewer
https://siyanpanayotov.com/project/viewnior/
GNU General Public License v3.0
320 stars 54 forks source link

Adding file monitoring and the ability to recursively open folders #38

Closed ghost closed 6 years ago

ghost commented 6 years ago

Introducing file and folder monitoring. Regardless if a single uri or a uri list was opened, Viewnior will now use file monitors to automatically update when related files are added, deleted or updated.

Also adding the optional ability to open folders recursively (i.e. open all images in a folder as well as its subfolders). This is done via a checkbox in the Open File / Open Folder dialogs. Where there used to be a GList *file_list that stored all opened files, there is now a GNode *tree that can be arbitrarily deep. When traversing the tree, it will go from image to image, possibly from one branch of the tree to another.

Adding an extensive test suite for the changed code. This can be run with ninja test. If a suitable tool, such as gcovr is installed, one can also generate a code coverage report with ninja coverage:

meson builddir -Db_coverage=true
cd builddir
ninja test
ninja coverage

gcovr reports that vnr-tree.c and vnr-file.c both have 100% line coverage and over 90% branch coverage.

ghost commented 6 years ago

Closing as the commits for another pull request made its way in here. Will reopen another pull request