[SCM] KDE Development Platform Libraries module packaging branch, master, updated. debian/4.6.5-2-30-g9c67cbf
José Manuel Santamaría Lema
santa-guest at alioth.debian.org
Sat Oct 22 00:36:32 UTC 2011
The following commit has been merged in the master branch:
commit 0f66a7512b2d4075a3970a73244f06d57621ae6e
Author: José Manuel Santamaría Lema <panfaust at gmail.com>
Date: Sat Oct 22 02:17:24 2011 +0200
Add nepomuk_unicode.diff
---
debian/changelog | 1 +
debian/patches/nepomuk_unicode.diff | 67 +++++++++++++++++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 69 insertions(+), 0 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 16421a9..1af0d08 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,7 @@ kde4libs (4:4.7.2-0r1) UNRELEASED; urgency=low
[ José Manuel Santamaría Lema ]
* Update patches:
+ - Add nepomuk_unicode.diff.
- Remove kded4_deadlock.patch, applied upstream.
- Update kfreebsd_support.diff.
- Refreshed other patches to make them apply without offsets.
diff --git a/debian/patches/nepomuk_unicode.diff b/debian/patches/nepomuk_unicode.diff
new file mode 100644
index 0000000..162ff67
--- /dev/null
+++ b/debian/patches/nepomuk_unicode.diff
@@ -0,0 +1,67 @@
+Author: Sebastian Trüg <trueg at kde.org>
+Applied-Upstream: 4.7.3
+Description: Fix a bug that prevents any query which does NOT use wide unicode
+ characters to fail.
+--- a/nepomuk/query/querybuilderdata_p.h
++++ b/nepomuk/query/querybuilderdata_p.h
+@@ -32,6 +32,28 @@
+ #include "query_p.h"
+ #include "groupterm_p.h"
+
++namespace {
++/// A hack to avoid passing extended chars to the bif:search_excerpts method which cannot handle
++/// utf8 chars which use more than one char, ie. wide chars.
++/// Thus, we simply truncate each term at the first wide char.
++QStringList stripExtendedCharsHack(const QStringList& terms) {
++ QStringList newTerms;
++ foreach(const QString& term, terms) {
++ int i = 0;
++ while(i < term.length()) {
++ if(term[i].unicode() > 0x7f) {
++ break;
++ }
++ ++i;
++ }
++ if(i > 0) {
++ newTerms.append(term.left(i));
++ }
++ }
++ return newTerms;
++}
++}
++
+ namespace Nepomuk {
+ namespace Query {
+ class QueryBuilderData
+@@ -246,16 +268,23 @@ namespace Nepomuk {
+ for( QHash<QString, QStringList>::const_iterator it = m_fullTextSearchTerms.constBegin();
+ it != m_fullTextSearchTerms.constEnd(); ++it ) {
+ const QString& varName = it.key();
+- const QStringList& terms = it.value();
+- // bif:search_excerpt wants a vector of all search terms
+- excerptParts
+- << QString::fromLatin1("bif:search_excerpt(bif:vector(bif:charset_recode('%1', '_WIDE_', 'UTF-8')), %2)")
+- .arg( terms.join(QLatin1String("','")),
+- varName );
++ const QStringList terms = stripExtendedCharsHack(it.value());
++ if(terms.count()) {
++ // bif:search_excerpt wants a vector of all search terms
++ excerptParts
++ << QString::fromLatin1("bif:search_excerpt(bif:vector('%1'), %2)")
++ .arg( terms.join(QLatin1String("','")),
++ varName );
++ }
+ }
+
+- return QString::fromLatin1("(bif:concat(%1)) as ?_n_f_t_m_ex_")
+- .arg(excerptParts.join(QLatin1String(",")));
++ if(excerptParts.count()) {
++ return QString::fromLatin1("(bif:concat(%1)) as ?_n_f_t_m_ex_")
++ .arg(excerptParts.join(QLatin1String(",")));
++ }
++ else {
++ return QString();
++ }
+ }
+ else {
+ return QString();
diff --git a/debian/patches/series b/debian/patches/series
index 76005a4..e8e9f45 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -20,3 +20,4 @@ add_dlrestrictions_support.diff
findpythonlibrary_layout_deb_on_debian.diff
ktar_header_checksum_fix.diff
ktar_longlink_length_in_bytes.diff
+nepomuk_unicode.diff
--
KDE Development Platform Libraries module packaging
More information about the pkg-kde-commits
mailing list