kiwix / libkiwix

Common code base for all Kiwix ports
https://download.kiwix.org/release/libkiwix/
GNU General Public License v3.0
116 stars 55 forks source link

Fix return value for Manager::parseOpdsDom #1100

Open BPerlakiH opened 1 month ago

BPerlakiH commented 1 month ago

Fixes: #1099

mgautierfr commented 1 month ago

I am not sure what kiwix::Manager::parseOpdsDom() is supposed to return. I am also not sure why that method is declared protected.

It should probably be declared private and return void (at least with the current code).

I don't know why the m_hasSearchResult, m_totalBooks, m_startIndex, and m_itemsPerPage data members of kiwix::Manager are needed and why they are public.

It is not clear even to me :) As said, opds stream can be also for search result. There is this information in the stream and we must provide it to user one way or the other.

I suppose it was used somehow at a moment but I cannot found where/when. Maybe I was just (excessively) careful and simply parse it and put it here to have the value but we never used them.

kelson42 commented 4 weeks ago

@veloman-yunkan How should we know if parsing went well or not?

veloman-yunkan commented 4 weeks ago

@veloman-yunkan How should we know if parsing went well or not?

A higher level function kiwix::Manager::readOpds() is responsible for that. See my comment in the discussion of the issue.