[KPhotoAlbum] fix crash with QT 5.10 on Archlinux

Sylvain Stanchina sylvain at stanchina.fr
Mon Jan 1 20:04:46 GMT 2018


On Archlinux (using QT5.10), KPA always crashes when it imports new
pictures.  The patch in attachment solves the issue.

Some explanations: The issue is related to SQL queries containing
placeholders ("?"). In Exif.Database.cpp, some queries are built using
the statement "QSqlQuery query( _queryString, m_db );" (or equivalent).
However, according to QT5.10 documentation, the queries are immediately
executed when constructed like that. If they contain one or more
placeholders "?", they are thus executed before their arguments have
been bound (by calls of bindValue()). In such cases, the application

That's why I replaced such constructs by two statements:
First:  QSqlQuery query( m_db );  which doesn't execute the query
Second: query.prepare(_queryString);
The query is executed later by a call of exec();

I hope this patch has no side effect.

Happy New Year !!


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-sql-queries-containing-with-placeholder-query-st.patch
Type: text/x-patch
Size: 1913 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kphotoalbum/attachments/20180101/5c3377ed/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: OpenPGP digital signature
URL: <http://mail.kde.org/pipermail/kphotoalbum/attachments/20180101/5c3377ed/attachment.sig>

More information about the Kphotoalbum mailing list