From kde-devel Sat Sep 29 06:21:51 2007 From: "Pattara Kiatisevi \(list\)" Date: Sat, 29 Sep 2007 06:21:51 +0000 To: kde-devel Subject: Re: KDE3 thai word break: KLibLoader --> QLibrary Message-Id: <46FDEEFF.3070003 () mm ! co ! th> X-MARC-Message: https://marc.info/?l=kde-devel&m=119104701912905 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--------------000809060702090601070902" This is a multi-part message in MIME format. --------------000809060702090601070902 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Gary L. Greene Jr. wrote: [...] >> >> The attached patch is tested against kdelibs-3.5.6 on Ubuntu 7.04. Or >> you can grab it here: >> http://www.suriyan.in.th/patches/kdelibs-3.5.6-thai-break-qlibrary-instead- >> off-klibloader.patch >> >> Are we gonna have another release of KDE3? Is it possible to include >> this patch? >> >> Cheers, >> Pattara >> > > This is a Debian specific packaging bug. Many distributions are still shipping > libtool archive files. Please contact the packagers of KDE for Debian via > http://bugs.debian.org/. > We did that. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=444284 . However, without considering about distributions, wouldn't it be technically better to not require libthai.la? And for Qt4/KDE4, isn't it better to use QLibrary::resolve("thai", 0, "th_brk") so that it will go for libthai.so.0 directly, eliminating the need to have libthai.so (which is normally in development package)? Patch for KDE4 (tested against KDE4beta2) attached. Pattara --------------000809060702090601070902 Content-Type: text/plain; name*0="kdelibs-kde4beta2-thai-break-qlibrary-instead-off-klibloader_pat"; name*1="ch.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename*0="kdelibs-kde4beta2-thai-break-qlibrary-instead-off-klibloader"; filename*1="_patch.txt" --- kdelibs.org/khtml/rendering/break_lines.cpp 2007-09-29 12:58:14.000000000 +0700 +++ kdelibs/khtml/rendering/break_lines.cpp 2007-09-29 13:03:14.000000000 +0700 @@ -1,6 +1,7 @@ #include -#include +//#include #include +#include #include #include #include @@ -31,19 +32,19 @@ numwbrpos = 0; numisbreakable = 0x400; isbreakable = (int *) malloc(numisbreakable*sizeof(int)); - library = 0; + //library = 0; } ~ThaiCache() { free(wbrpos); free(isbreakable); - if (library) library->unload(); + //if (library) library->unload(); } const QChar *string; int *wbrpos; int *isbreakable; int allocated; int numwbrpos,numisbreakable; - KLibrary *library; + //KLibrary *library; }; static ThaiCache *cache = 0; @@ -51,9 +52,9 @@ { delete cache; cache = 0; -#ifndef HAVE_LIBTHAI - th_brk = 0; -#endif +//#ifndef HAVE_LIBTHAI +// th_brk = 0; +//#endif } bool isBreakableThai( const QChar *string, const int pos, const int len) @@ -63,9 +64,12 @@ #ifndef HAVE_LIBTHAI + /* KLibrary *lib = 0; + */ /* load libthai dynamically */ + /* if (( !th_brk ) && thaiCodec ) { printf("Try to load libthai dynamically...\n"); KLibLoader *loader = KLibLoader::self(); @@ -80,6 +84,16 @@ lib->unload(); } } + */ + + if (!th_brk && thaiCodec) { + printf("Try to load libthai dynamically...\n"); + th_brk = (th_brk_def)QLibrary::resolve("thai", 0, "th_brk"); + if (!th_brk) { + printf("Error, can't load libthai...\n"); + thaiCodec = 0; + } + } if (!th_brk ) { return true; @@ -88,9 +102,9 @@ if (!cache ) { cache = new ThaiCache; -#ifndef HAVE_LIBTHAI - cache->library = lib; -#endif +//#ifndef HAVE_LIBTHAI +// cache->library = lib; +//#endif } // build up string of thai chars --------------000809060702090601070902 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe << --------------000809060702090601070902--