From c4e6d5f47a876ac7e6446531005665d6547fafb5 Mon Sep 17 00:00:00 2001 From: Jeffrey Armstrong Date: Tue, 11 Aug 2020 11:18:40 -0400 Subject: Favorites can be removed too. Added some robustness to loading favorites, especially when there are none remaining. --- main.F90 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'main.F90') diff --git a/main.F90 b/main.F90 index 9af9708..0926192 100644 --- a/main.F90 +++ b/main.F90 @@ -256,7 +256,13 @@ implicit none loaded = .false. case (render_action_favorite) - call add_favorite(faves, current_url, current_url) + if(is_favorite(faves, current_url)) then + call remove_favorite(faves, current_url) + call r%report_status(trim(current_url)//" removed as favorite") + else + call add_favorite(faves, current_url, current_url) + call r%report_status("Added favorite: "//trim(current_url)) + end if call save_favorites(faves) end select @@ -345,7 +351,7 @@ contains use favorite_handling, only: write_favorites, favorite implicit none - type(favorite), dimension(:)::faves + type(favorite), dimension(:), intent(in), pointer::faves character(260)::filename integer::ios, loadunit -- cgit v1.2.3