diff options
author | Nicolas Reynolds <fauno@kiwwwi.com.ar> | 2011-11-15 11:37:21 -0300 |
---|---|---|
committer | Nicolas Reynolds <fauno@kiwwwi.com.ar> | 2011-11-15 11:37:21 -0300 |
commit | a1ae9076f18ec51553e17dfe867f95b6b4931362 (patch) | |
tree | c0ca52078abd65c9f3d4c40cf871bbae7d17d5c2 /extra/kdelibs/kdelibs-nepomuk-unicode.diff | |
parent | 7caeeae33fd491dbea5044168bbc50197963118c (diff) | |
parent | 28b13b7e8e6e1e4fa1593f0dfb1c37569f2f90a8 (diff) |
Merge branch 'master' of ssh://vparabola/home/parabola/abslibre-pre-mips64el
Conflicts:
community/asunder/PKGBUILD
community/gshare/PKGBUILD
community/kim4/PKGBUILD
community/listen/PKGBUILD
community/mercury/PKGBUILD
core/eglibc/nscd
Diffstat (limited to 'extra/kdelibs/kdelibs-nepomuk-unicode.diff')
-rw-r--r-- | extra/kdelibs/kdelibs-nepomuk-unicode.diff | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/extra/kdelibs/kdelibs-nepomuk-unicode.diff b/extra/kdelibs/kdelibs-nepomuk-unicode.diff deleted file mode 100644 index 1c85d6fc9..000000000 --- a/extra/kdelibs/kdelibs-nepomuk-unicode.diff +++ /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<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();
\ No newline at end of file |