[patch] qlibrary_win.cpp

Thiago A. Corrêa thiagoacorrea at uol.com.br
Thu Oct 9 20:24:03 CEST 2003


Just recently I found the QT_WA* macros.

if you define UNICODE during compile time, compiler will tell you the
difference *smile*
basically, it's different signatures... one is char* the other is sth like
ushort*

For filenames ( and most other calls ) it's fine to use the A version... as
long as you don't use unicode characters in the filenames... ie, writting
them in russian or japanese hiragana. To handle those correctly, we should
do sth like:

QT_WA( LoadLibraryA( filename.latin1() ) , LoadLibraryW(
filename.ucs2() ) );

But that's not the only place where there will be issues... I fixed some
myself from kde-cygwin's version merging them into mine ( as I have UNICODE
defined by default )


About license: I belive we can choose to only release the _win.cpp under
GPL... the rest says that ppl who own a TT license can produce commercial
stuff... I belive those who do have a license won't want our "bugged
version" *smile*. But I guess it would be nice to TT if we keep their same
license, allowing those with a license from TT to produce commercial apps,
this way, they can merge our code into their code base, if we happen to do
sth better than theirs.... honestly it's not very likely to happen soon, I
read an article saying they have sth like 60 programmers working on Qt,
while we have... some 3 (?).

Notice however that sometimes we change just a couple of lines ( or doesn't
change at all, as in QFile ) of the _unix.cpp or _x11.cpp to port, and those
original files are GPL + QPL, so, I suppose we can't take out QPL of
those.... I think the safer approach is to simply copy the license header
from the _x11.cpp we are porting.

Anyway, I like the idea that TrollTech could benefit from our efforts
anyway... And it should, at least it should attract more programmers who
don't have 2k dollars to spend.

----- Original Message ----- 
From: "Andy Goossens" <andygoossens at pandora.be>
To: "For developers interested in porting KDE to Windows using Cygwin"
<kde-cygwin at mail.kde.org>
Sent: Thursday, October 09, 2003 5:48 PM
Subject: Re: [patch] qlibrary_win.cpp


Hi,

On Friday 03 October 2003 02:57, Thiago A. Corrêa wrote:
>     This is from my port, I'm not quite sure how I'm supposed to send the
> patches in, so, trying with this smaller one first *smile*.

I was porting a totally different class to Windows and now I have some
general
questions about porting. I'm not a Win32 API wizzard myself and I was just
wondering how some things are done.


* In Thiago's patch, I saw the use of "LoadLibraryA". I know that several
Win32 functions have *A and *W variants. (e.g. LoadLibraryA <->
LoadLibraryW)
Which one should be used? Or... is it better to just use the "LoadLibrary"
define here? (see /usr/include/w32api/winbase.h:
#ifdef UNICODE
#define LoadLibrary LoadLibraryW
#else
#define LoadLibrary LoadLibraryA
#endif
)
or should the QT_WA/QT_WA_INCLUDE macro be used? (see src/tools/global.h)

* What should be best suited for filenames? I saw Thiago used
filename.latin1() for the LoadLibraryA function. But doesn't this give
problems on NT-based systems with a unicode filesystem? Or should we depend
on QFile::encodeName(filename)?
This part of the Qt's QFile::encodeName(filename) documentation worries me
though:
"On Windows NT/2000, Unicode file names are supported directly in the file
system and this function should be avoided. On Windows 95, non-Latin1
locales
are not supported."
I'm just afraid I code something for a certain Windows version that breaks
for
someone else :-)

* Which license clauses do we need to have at the start of each file?
Obviously we need to have the GPL clause since that is our starting point.
But what about QPL, aren't we obliged too? Until now, I've seen some
*_win.cpp files with GPL, GPL+QPL or even no license at all.


Greets,
-- 
// Andy Goossens

// Quote of the moment:
A horse!  A horse!  My kingdom for a horse!
-- Wm. Shakespeare, "Henry VI"

_______________________________________________
kde-cygwin mailing list
kde-cygwin at mail.kde.org
http://mail.kde.org/mailman/listinfo/kde-cygwin



More information about the kde-cygwin mailing list