From 5fc3fdb057a38c4c237a09c390871899dcfde24a Mon Sep 17 00:00:00 2001 From: Eric Hameleers Date: Mon, 22 Dec 2014 15:11:27 +0100 Subject: KDE 4.10.5 for Slackware 14.0 (02jul2013) --- kde/patch/kdelibs/kdelibs.nepomuk.unicode.patch | 65 ------------------------- 1 file changed, 65 deletions(-) delete mode 100644 kde/patch/kdelibs/kdelibs.nepomuk.unicode.patch (limited to 'kde/patch/kdelibs/kdelibs.nepomuk.unicode.patch') diff --git a/kde/patch/kdelibs/kdelibs.nepomuk.unicode.patch b/kde/patch/kdelibs/kdelibs.nepomuk.unicode.patch deleted file mode 100644 index 819a429..0000000 --- a/kde/patch/kdelibs/kdelibs.nepomuk.unicode.patch +++ /dev/null @@ -1,65 +0,0 @@ -diff --git a/nepomuk/query/querybuilderdata_p.h b/nepomuk/query/querybuilderdata_p.h -index 055482e..3880e13 100644 ---- 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::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(); -- cgit v1.2.3