[texworks] Backward compatibility of the Qt bindings in poppler

Stefan Löffler st.loeffler at gmail.com
Sun Mar 28 21:41:05 CEST 2021


Dear Oliver,

thanks for reaching out to me in this matter!

On 26.03.21 09:02, Oliver Sander wrote:
> The idea is to return std::unique_ptr objects instead of plain C pointers
> whenever Poppler yields object ownership to the caller (which it does
> in almost all cases).

As a fan of RAII (and objects that clean up after themselves), I am
generally very much in favor of such a move.

> Now, we are aware that you have files that compile with both poppler-qt5
> and poppler-qt6, and before making the change we wanted to reach out
> and ask
> how much of a hassle such an interface change would be to you.

I can't say for sure off the top of my head, but I am convinced that it
will be manageable.
Of course, such a change will introduce another level of "complexity" /
another set of #ifdef's, but I believe it is worth it if it improves
overall code quality and stability.
That being said, I assume that we can migrate to using std::unique_ptr
everywhere in our (poppler-related) codebase, either as returned (when
using poppler-qt6) or by creating them with std::make_unique (from raw
pointers returned by poppler-qt5)?

Best regards,
Stefan


More information about the texworks mailing list.