libkiwix icon indicating copy to clipboard operation
libkiwix copied to clipboard

Fix return value for Manager::parseOpdsDom

Open BPerlakiH opened this issue 1 year ago • 3 comments

Fixes: #1099

BPerlakiH avatar Jul 12 '24 14:07 BPerlakiH

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.

mgautierfr avatar Jul 15 '24 09:07 mgautierfr

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

kelson42 avatar Jul 28 '24 09:07 kelson42

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

veloman-yunkan avatar Jul 28 '24 09:07 veloman-yunkan