Hello community, here is the log from the commit of package kerry checked in at Fri May 19 16:51:11 CEST 2006. -------- --- KDE/kerry/kerry.changes 2006-04-24 12:51:32.000000000 +0200 +++ kerry/kerry.changes 2006-05-19 15:39:50.000000000 +0200 @@ -1,0 +2,5 @@ +Fri May 19 15:39:05 CEST 2006 - stbinner@suse.de + +- try to detect file uris with other encoding (#176053) + +------------------------------------------------------------------- New: ---- decoding-workaround.diff ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kerry.spec ++++++ --- /var/tmp/diff_new_pack.loE2TI/_old 2006-05-19 16:50:56.000000000 +0200 +++ /var/tmp/diff_new_pack.loE2TI/_new 2006-05-19 16:50:56.000000000 +0200 @@ -17,8 +17,9 @@ Summary: Desktop search tool BuildRoot: %{_tmppath}/%{name}-%{version}-build Version: 0.1.1 -Release: 1 +Release: 6 Source: %{name}-%{version}.tar.bz2 +Patch: decoding-workaround.diff Requires: beagle >= 0.2.0 Requires: libbeagle >= 0.2.0 @@ -33,6 +34,7 @@ %prep %setup -q -n kerry +%patch . /etc/opt/kde3/common_options update_admin @@ -62,6 +64,8 @@ /opt/kde3/shutdown/beagled-shutdown.sh %changelog -n kerry +* Fri May 19 2006 - stbinner@suse.de +- try to detect file uris with other encoding (#176053) * Mon Apr 24 2006 - stbinner@suse.de - work around initially shown tips not being properly formatted - beagled.desktop: --autostarted now to be considered harmful ++++++ decoding-workaround.diff ++++++ Index: beaglesearch.cpp =================================================================== --- src/beaglesearch.cpp (revision 6031) +++ src/beaglesearch.cpp (revision 6032) @@ -24,6 +24,7 @@ #include <klocale.h> #include <qtimer.h> #include <qtextcodec.h> +#include <kurl.h> struct PropertyInfo { @@ -162,6 +163,8 @@ timer = new QTimer( this ); connect( timer, SIGNAL(timeout()), this, SLOT(updateResults())); QTextCodec::setCodecForCStrings(QTextCodec::codecForName( "utf8" )); + encodingRegexp = QRegExp("%[\\dA-F][\\dA-F]"); + mibenum = QTextCodec::codecForName("iso 8859-15")->mibEnum(); } bool BeagleSearch::initBeagle() @@ -262,7 +265,12 @@ QString *BeagleSearch::get_uri_from_file_hit(BeagleHit *hit) { - return new QString (beagle_hit_get_uri (hit)); + QCString uri = beagle_hit_get_uri (hit); + if (uri.find(encodingRegexp)>0) { + KURL kurl(uri, mibenum); + return new QString (kurl.url()); + } + return new QString (uri); } QString *BeagleSearch::get_parent_uri_from_file_hit(BeagleHit *hit) @@ -309,7 +317,8 @@ result->mime_type = new QString(mime_type); result->score = beagle_hit_get_score(BEAGLE_HIT (l->data)); - result->uri = get_uri_from_file_hit (BEAGLE_HIT (l->data)); + if (current_instance != NULL) + result->uri = current_instance->get_uri_from_file_hit (BEAGLE_HIT (l->data)); result->tilegroup = Unknown; result->parent_uri = get_parent_uri_from_file_hit (BEAGLE_HIT (l->data)); result->source = get_source_from_file_hit (BEAGLE_HIT (l->data)); Index: beaglesearch.h =================================================================== --- src/beaglesearch.h (revision 6031) +++ src/beaglesearch.h (revision 6032) @@ -24,6 +24,7 @@ #include <qobject.h> #include <qtimer.h> #include <qstringlist.h> +#include <qregexp.h> extern "C" { #include <glib.h> @@ -96,7 +97,7 @@ static void finished_cb (BeagleQuery *, BeagleFinishedResponse *, GMainLoop *); static BeagleSearch *current_instance; static QString *get_uri_from_feed_hit (BeagleHit *); - static QString *get_uri_from_file_hit (BeagleHit *); + QString *get_uri_from_file_hit (BeagleHit *); static QString *get_parent_uri_from_file_hit (BeagleHit *); static QString *get_source_from_file_hit (BeagleHit *); @@ -105,6 +106,9 @@ GMainLoop *main_loop; QTimer *timer; + int mibenum; + QRegExp encodingRegexp; + bool initBeagle(); void stopBeagle(); bool query_running; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun...
participants (1)
-
root@suse.de