QStringList: restore binary compatibility with Qt 5.11

Commit 8b6100d512 removed
bool QtPrivate::QStringList_contains(const QStringList *that, const QString &str, ...)
(in favor of a QStringView overload). However this was used inline in
qstringlist.h, so apps were referencing that symbol directly.

As a result, upgrading to Qt 5.12 gave errors like
libKF5ConfigCore.so.5.50.0: undefined reference to `QtPrivate::QStringList_contains(QStringList const*, QString const&, Qt::CaseSensitivity)@Qt_5'
collect2: error: ld returned 1 exit status

Change-Id: I862263a9b06157052df894a201dfd86df8c3f4fe
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
This commit is contained in:
David Faure 2018-09-07 23:31:51 +02:00 committed by Andreas Hartmetz
parent d09d99af22
commit 5175824f15
2 changed files with 12 additions and 0 deletions

View File

@ -335,6 +335,15 @@ static bool stringList_contains(const QStringList &stringList, const T &str, Qt:
*/
#endif
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
/// Not really needed anymore, but kept for binary compatibility
bool QtPrivate::QStringList_contains(const QStringList *that, const QString &str,
Qt::CaseSensitivity cs)
{
return stringList_contains(*that, str, cs);
}
#endif
/*!
\fn bool QStringList::contains(QStringView str, Qt::CaseSensitivity cs) const
\overload

View File

@ -164,6 +164,9 @@ namespace QtPrivate {
QStringList Q_CORE_EXPORT QStringList_filter(const QStringList *that, const QString &str,
Qt::CaseSensitivity cs);
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
bool Q_CORE_EXPORT QStringList_contains(const QStringList *that, const QString &str, Qt::CaseSensitivity cs);
#endif
bool Q_CORE_EXPORT QStringList_contains(const QStringList *that, QStringView str, Qt::CaseSensitivity cs);
bool Q_CORE_EXPORT QStringList_contains(const QStringList *that, QLatin1String str, Qt::CaseSensitivity cs);
void Q_CORE_EXPORT QStringList_replaceInStrings(QStringList *that, const QString &before, const QString &after,