mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
media: use table instead of linked list for media
For consistency with equipment, use our table macros for pictures. Generally tables (arrays) are preferred over linked lists, because they allow random access. This is mostly copy & paste of the equipment code. Sadly, our table macros are quite messy and need some revamping. Therefore, the resulting code is likewise somewhat messy. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
282041e228
commit
989d6a3f96
15 changed files with 136 additions and 106 deletions
|
@ -116,8 +116,10 @@ static bool removePictureFromSelectedDive(const char *fileUrl)
|
|||
int i;
|
||||
struct dive *dive;
|
||||
for_each_dive (i, dive) {
|
||||
if (dive->selected && dive_remove_picture(dive, fileUrl))
|
||||
if (dive->selected && remove_picture(&dive->pictures, fileUrl)) {
|
||||
invalidate_dive_cache(dive);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue