hellosiyan / Viewnior

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

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

Open sjoblomj opened 6 years ago

sjoblomj 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.