Skip to content

Comments

Fix epub files with toc using relative file path.#76

Open
gonwan wants to merge 2 commits intoeBookProjects:masterfrom
gonwan:fix-epub-path
Open

Fix epub files with toc using relative file path.#76
gonwan wants to merge 2 commits intoeBookProjects:masterfrom
gonwan:fix-epub-path

Conversation

@gonwan
Copy link
Contributor

@gonwan gonwan commented Feb 20, 2026

Fixes #75.

@u-235
Copy link
Member

u-235 commented Feb 22, 2026

Hi. Your solution works, but I think it could be improved. The HelperXmlHandler_EpubContent and HelperXmlHandler_EpubTOC classes should contain the correct paths relative to the root directory after loading. This will make the EBook_EPUB code more understandable and predictable.

EBookTocEntry entry;
entry.name = m_lastTitle;
entry.url = m_epub->pathToUrl( m_lastId );
QString combined = QDir( m_documentRoot ).filePath( m_lastId );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The EBook_EPUB::combinePath function would be appropriate here.

@gonwan
Copy link
Contributor Author

gonwan commented Feb 22, 2026

Fixed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Fail to open epub files with toc using relative path

2 participants