[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: Re: KDE3 thai word break: KLibLoader --> QLibrary
From: "Pattara Kiatisevi \(list\)" <pattara-list () mm ! co ! th>
Date: 2007-09-29 6:21:51
Message-ID: 46FDEEFF.3070003 () mm ! co ! th
[Download RAW message or body]
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
--- 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 <break_lines.h>
-#include <klibloader.h>
+//#include <klibloader.h>
#include <QtCore/QTextCodec>
+#include <QtCore/QLibrary>
#include <stdio.h>
#include <stdlib.h>
#include <config.h>
@@ -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
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic