packages: kde4-kdelibs/kde4-kdelibs-branch.diff, kde4-kdelibs/kde4-kdelibs....
arekm
arekm at pld-linux.org
Sun Oct 9 19:46:18 CEST 2011
Author: arekm Date: Sun Oct 9 17:46:18 2011 GMT
Module: packages Tag: HEAD
---- Log message:
- rel 2; fix nepomuk utf8 queries
---- Files affected:
packages/kde4-kdelibs:
kde4-kdelibs-branch.diff (1.26 -> 1.27) , kde4-kdelibs.spec (1.257 -> 1.258)
---- Diffs:
================================================================
Index: packages/kde4-kdelibs/kde4-kdelibs-branch.diff
diff -u packages/kde4-kdelibs/kde4-kdelibs-branch.diff:1.26 packages/kde4-kdelibs/kde4-kdelibs-branch.diff:1.27
--- packages/kde4-kdelibs/kde4-kdelibs-branch.diff:1.26 Sun Sep 11 06:58:24 2011
+++ packages/kde4-kdelibs/kde4-kdelibs-branch.diff Sun Oct 9 19:46:12 2011
@@ -1,24 +1,65 @@
-From: Marijn Kruisselbrink <mkruisselbrink at kde.org>
-Date: Mon, 01 Aug 2011 16:02:21 +0000
-Subject: Fix bug introduced with svn revision 1023186 (git f62946276067d0a4b28e2039cfb506d7e8d678e4).
-X-Git-Url: http://quickgit.kde.org/?p=kdelibs.git&a=commitdiff&h=d7daf264b9e8d2c98f210f2717c375026d585481
----
-Fix bug introduced with svn revision 1023186 (git f62946276067d0a4b28e2039cfb506d7e8d678e4).
-Don't produce an infinite loop when trying to get an invalid unit.
-CCMAIL: petri.damsten at kdemail.net
----
-
-
---- a/kunitconversion/converter.cpp
-+++ b/kunitconversion/converter.cpp
-@@ -165,7 +165,7 @@ UnitPtr Converter::unit(int unitId) cons
- return unitClass;
- }
- }
-- return unit(InvalidUnit);
-+ return category[InvalidCategory]->defaultUnit();
- }
+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"
- UnitCategory* Converter::category(const QString& category) const
-
-
++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();
================================================================
Index: packages/kde4-kdelibs/kde4-kdelibs.spec
diff -u packages/kde4-kdelibs/kde4-kdelibs.spec:1.257 packages/kde4-kdelibs/kde4-kdelibs.spec:1.258
--- packages/kde4-kdelibs/kde4-kdelibs.spec:1.257 Mon Oct 3 10:38:32 2011
+++ packages/kde4-kdelibs/kde4-kdelibs.spec Sun Oct 9 19:46:12 2011
@@ -18,7 +18,7 @@
Summary(uk.UTF-8): K Desktop Environment - Бібліотеки
Name: kde4-kdelibs
Version: 4.7.2
-Release: 1
+Release: 2
License: LGPL
Group: X11/Libraries
Source0: ftp://ftp.kde.org/pub/kde/%{_state}/%{version}/src/%{orgname}-%{version}.tar.bz2
@@ -232,7 +232,7 @@
%prep
%setup -q -n %{orgname}-%{version}
-#%patch100 -p0
+%patch100 -p1
%patch0 -p1
%patch1 -p0
%patch2 -p0
@@ -1119,6 +1119,9 @@
All persons listed below can be reached at <cvs_login>@pld-linux.org
$Log$
+Revision 1.258 2011/10/09 17:46:12 arekm
+- rel 2; fix nepomuk utf8 queries
+
Revision 1.257 2011/10/03 08:38:32 arekm
- up to 4.7.2
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/kde4-kdelibs/kde4-kdelibs-branch.diff?r1=1.26&r2=1.27&f=u
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/kde4-kdelibs/kde4-kdelibs.spec?r1=1.257&r2=1.258&f=u
More information about the pld-cvs-commit
mailing list