Sylvain Stanchina
2018-01-01 20:04:46 UTC
hello,
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
crashes.
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 !!
Sylvain
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
crashes.
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 !!
Sylvain