[PyKDE] Runtime issues on SuSE 8.1

2002-10-14 Thread Eron Lloyd

Hello all,

I'm finally starting to work with PyQt, using the wonderful book by Boudewijn 
Rempt, and I can't seem to get the first example (hello1.py) to work. I 
apologize if this is the most basic, most obvious problem, but here is my 
dilemma:

SuSE 8.1 comes with PyQt & SIP 3.3.2, and Qt 3.0.5, which installed fine. I 
can import the qt module into the current namespace, and see all the objects. 
However, as soon as I try to instantiate a QApplication(sys.argv), I get a 
segmentation fault (with no error codes or anything). So next I download PyQt 
& SIP 3.4, and build from source against SuSE Qt3. Everything compiles 
beautifully, and I can from the Python shell again load the Qt module and 
touch all the classes. However, the minute I try to create a QApplication 
instance by passing it a list, it segfaults. Now, I trust the quality of 
Boudewjin's code, but I wanted to test another app just in case. So I tried 
to call eric, and got the same thing. Has anyone gotten PyQt to run 
successfully on SuSE 8.1? I've got gcc 3.2 and glibc 2.2.5 (out of the box). 
I'm no C++ coder, much less a real strong Python coder, so I can't really 
provide much more information...I hope this is helpful though. PyQt looks 
excellent, and I'm really excited about developing some applications, so I 
guess this is just a part of the learning process :-). I'll await your 
instruction from here.

Thanks,

Eron
---
[This E-mail scanned for viruses by Declude Virus]

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



Re: [PyKDE] Runtime issues on SuSE 8.1

2002-10-14 Thread Ricardo Javier Cardenes Medina

On Mon, Oct 14, 2002 at 09:14:29PM -0400, Eron Lloyd wrote:

Hi Eron.

This SuSE issue was discussed a couple of weeks ago. Please, read the end
of the thread, starting from:

 http://mats.gmd.de/pipermail/pykde/2002-October/003767.html

to see the causes and the solution. I don't know if Marc published at last
the fixed SuSE packages.

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



Re: [PyKDE] Runtime issues on SuSE 8.1

2002-10-15 Thread Hans-Peter Jansen

On Tuesday 15 October 2002 03:38, Ricardo Javier Cardenes Medina wrote:
> On Mon, Oct 14, 2002 at 09:14:29PM -0400, Eron Lloyd wrote:
>
> Hi Eron.
>
> This SuSE issue was discussed a couple of weeks ago. Please, read the end
> of the thread, starting from:
>
>  http://mats.gmd.de/pipermail/pykde/2002-October/003767.html
>
> to see the causes and the solution. I don't know if Marc published at last
> the fixed SuSE packages.

Well, SuSE fixed their qt3 package, which is available as online update.
Unfortunately their "yast online update", aka "you" has a problem.
If you run "you" the first time, it will force you to update some yast2
packages first. Before running "you" a second time, run this in a shell:

cd /var/adm/YaST
mkdir SelDB
cp InstSrcManager/IS_CACHE_0x0001/DATA/descr/default.sel SelDB
mkdir ProdDB
cp InstSrcManager/IS_CACHE_0x0001/DESCRIPTION/description ProdDB/prod_0001

see: http://sdb.suse.de/de/sdb/html/81_you.html
and: http://sdb.suse.de/de/sdb/html/81_you2.html

Hth,
Hans-Peter

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



Re: [PyKDE] Runtime issues on SuSE 8.1

2002-10-15 Thread Marc Schmitt

On Dienstag, 15. Oktober 2002 03:38, Ricardo Javier Cardenes Medina wrote:
> to see the causes and the solution. I don't know if Marc published at last
> the fixed SuSE packages.

Hi.

Sorry, there've been some communication problems within the last time, so to 
don't let you wait any longer, I've uploaded the latest SuSE 8.1 packages to 
sourceforge incomming.

Unfortunatly, I wasn't able to compile PyKDE for KDE3.0.4, the compilation 
broke while compiling about a missing extraH/kde304 dir. Simply setting a 
link from the kde303 dir didn't work.  Jim, any hints ?

This build was made for SuSE 8.1, compiled for i586 architecture. I merged all 
packages to a super-package (only sip/PyQt, no -devel, ...) anymore. This 
comes closer to the orig. SuSE packaging scheme. 
All probles about segfauling should be void now, as it was a problem with qt's 
fast malloc, which was fixed by Adrian in the lastest YOU update, so these 
packages contain no workaround anymore.

A PyKDE package will be there as soon as it compiles.

Have fun :)

-Marc

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



Re: [PyKDE] Runtime issues on SuSE 8.1

2002-10-15 Thread Jim Bublitz

On 15-Oct-02 Marc Schmitt wrote:

> Unfortunatly, I wasn't able to compile PyKDE for KDE3.0.4, the
> compilation broke while compiling about a missing extraH/kde304
> dir. Simply setting a link from the kde303 dir didn't work. 
> Jim, any hints ?

I registered the fact that KDE3.0.4 exists a few days ago, but for
some reason it never dawned on me that I might need to do something
about it ...

I'm in the middle of something I need to implement soon (rewriting
my mail handling top to bottom), so it will be a few days before I
can look at KDE3.0.4 - from the announcement it doesn't appear much
needs to be done. 

Setting a link seems like it *should* work - a quick and dirty
solution would simply be to create extraH/kde304 and copy all of the
files from extraH/kde303 into it. Those are (mostly) h files which
aren't normally found in kde*/include. The correct way would be to
copy the same set of files from a KDE3.0.4 kdelibs source
distribution to the new directory, EXCEPT for kicontheme.h, pct.h,
and pykdekshortcutlist.h, which you'd still want to copy from
extraH/kde303. pct.h is a hack to allow '%' type formatting in an
sprintf statement under sip, and the other two are (very slightly)
modified version of the corresponding kdelibs h files.

The other places you'd (probably) need to make changes are:

1. build.py - add 304 to KDEVers list (global, near top of file)
2. PyKDE-3.3.2/sip/kde30/dcop.sip - add KDE_3_0_4 to %Timeline
statement

>From the last couple of KDE releases, I'm guessing not much else
really needs to be changed, but don't hold me to that. KDE 3.1 will
have lots of changes, so don't expect to be able to build PyKDE (as
it is now) against that.

Bill Soudan also sent some patches for build.py for RH8.0
(thanks Bill!) which will be in the next release. I also have a hack
to allow building PyKDE as a user instead of requiring root
privileges (still need to be root to install of course), but I'm
not sure if that's worth releasing.


Jim

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



Re: [PyKDE] Runtime issues on SuSE 8.1

2002-10-15 Thread Marc Schmitt

On Dienstag, 15. Oktober 2002 18:57, Jim Bublitz wrote:
> Setting a link seems like it *should* work - a quick and dirty
> [...]
> The other places you'd (probably) need to make changes are:
>
> 1. build.py - add 304 to KDEVers list (global, near top of file)
> 2. PyKDE-3.3.2/sip/kde30/dcop.sip - add KDE_3_0_4 to %Timeline
> statement

Ok, I modified the points and it passes the initial setup, but when it tries 
to compile khtml, the following happens :


make[1]: Entering directory `/usr/src/packages/BUILD/PyKDE-3.3.2/khtml'
g++ -c -pipe -w -O2 -march=i586 -mcpu=i686 -fmessage-length=0 -DNO_DEBUG 
-D_REENTRAN   T -fPIC  -DSIP_MAKE_MODULE_DLL 
-DQT_NO_DEBUG -DQT_THREAD_SUPPORT -fno-exceptions -I-   
I -I../extraH -I. -I../../../../../include/python2.2 -I/opt/kde3/include -I-I 
-I/opt   /kde3/include/khtml -I-I 
-I/opt/kde3/include/dom -I-I -I/opt/kde3/include/kparts -I-   
I -I/opt/kde3/include/kio -I-I -I../kdecore -I-I -I../kio 
-I/usr/lib/qt3/include -I/   
usr/lib/qt3/mkspecs/default -o khtmlhuge.o khtmlhuge.cpp
sip/khtml_part.sip: In function `PyObject* sipDo_KHTMLPart_paint(PyObject*, 
PyObject   *)':
sip/khtml_part.sip:128: cannot pass objects of non-POD type `class QRect' 
through `.   ..'
make[1]: *** [khtmlhuge.o] Error 1
make[1]: Leaving directory `/usr/src/packages/BUILD/PyKDE-3.3.2/khtml'
make: *** [sub-khtml] Error 2
Bad exit status from /var/tmp/rpm-tmp.2774 (%build)


Any hints ?

-Marc

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



Re: [PyKDE] Runtime issues on SuSE 8.1

2002-10-15 Thread Jim Bublitz

On 15-Oct-02 Marc Schmitt wrote:
> On Dienstag, 15. Oktober 2002 18:57, Jim Bublitz wrote:
>> Setting a link seems like it *should* work - a quick and dirty
>> [...]
>> The other places you'd (probably) need to make changes are:
>>
>> 1. build.py - add 304 to KDEVers list (global, near top of file)
>> 2. PyKDE-3.3.2/sip/kde30/dcop.sip - add KDE_3_0_4 to %Timeline
>> statement
> 
> Ok, I modified the points and it passes the initial setup, but
> when it tries 
> to compile khtml, the following happens :
> 
> 
> make[1]: Entering directory
> `/usr/src/packages/BUILD/PyKDE-3.3.2/khtml'
> g++ -c -pipe -w -O2 -march=i586 -mcpu=i686 -fmessage-length=0
> -DNO_DEBUG 
> -D_REENTRAN   T -fPIC 
> -DSIP_MAKE_MODULE_DLL 
> -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -fno-exceptions -I-
> I -I../extraH -I. -I../../../../../include/python2.2
> -I/opt/kde3/include -I-I 
> -I/opt   /kde3/include/khtml -I-I 
> -I/opt/kde3/include/dom -I-I -I/opt/kde3/include/kparts -I-  
> I -I/opt/kde3/include/kio -I-I -I../kdecore -I-I -I../kio 
> -I/usr/lib/qt3/include -I/   
> usr/lib/qt3/mkspecs/default -o khtmlhuge.o khtmlhuge.cpp
> sip/khtml_part.sip: In function `PyObject*
> sipDo_KHTMLPart_paint(PyObject*, 
> PyObject   *)':
> sip/khtml_part.sip:128: cannot pass objects of non-POD type
> `class QRect' 
> through `.   ..'
> make[1]: *** [khtmlhuge.o] Error 1
> make[1]: Leaving directory
> `/usr/src/packages/BUILD/PyKDE-3.3.2/khtml'
> make: *** [sub-khtml] Error 2
> Bad exit status from /var/tmp/rpm-tmp.2774 (%build)
> 
> 
> Any hints ?

I don't know if this is causing the problem, but in khtmlview.sip,
line 87 is:

if (sipParseArgs(&sipArgsParsed, sipArgs, "mJ0J0ii",
   sipThisObj,sipClass_ KHTMLView,&ptr, sipClass_QPainter, p,
   sipClass_QRect, r, i))

The string "mJ0J0ii" should be "mJ0J0i".

I'm not sure why this error wasn't caught before. It should cause a
runtime error at the very least. If that doesn't fix it (and I
don't see why it would), you can try commenting out (//) the paint
method and everything between and including %MemberCode -- %End
after paint in the same file and see what happens.

I don't know what a 'non-POD type' is, so the error msg isn't very
helpful at the moment. Generally, you couldn't have gone that far
unless almost everything else was working - this is one of the last
few modules in the build. It could also be due to a change in KDE
3.0.4 (I don't have the source to check yet), in which case
commenting out the paint method should take care of it temporarily.

Sorry I can't be of more help. Don't spend a lot more time on it if
you can't work around it easily - I should have the update
available by the end of the week or early next week.


Jim

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



Re: [PyKDE] Runtime issues on SuSE 8.1

2002-10-15 Thread Marc Schmitt

On Dienstag, 15. Oktober 2002 21:37, Jim Bublitz wrote:
> The string "mJ0J0ii" should be "mJ0J0i".
>
> I'm not sure why this error wasn't caught before. It should cause a
> runtime error at the very least. If that doesn't fix it (and I
> don't see why it would), you can try commenting out (//) the paint
> method and everything between and including %MemberCode -- %End
> after paint in the same file and see what happens.

Nope. I changed that (and some randomly some other permutation of that 
occurance within khtml*.sip) but without success.

> I don't know what a 'non-POD type' is, so the error msg isn't very
> helpful at the moment. Generally, you couldn't have gone that far
> unless almost everything else was working - this is one of the last
> few modules in the build. It could also be due to a change in KDE
> 3.0.4 (I don't have the source to check yet), in which case
> commenting out the paint method should take care of it temporarily.

Also did that, or at least tried to but the error remains. But with this point 
I'm not quite sure if it was in the right file, as I modified

PyKDE-3.3.2/sip/khtmlview.sip,

but it complains about khtml_part.sip.

I'll give it another try tomorrow,
but this night I have to wait in sorrow. 

Eeeehh  :)

Sorry anyway :/

-Marc


___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



Re: [PyKDE] Runtime issues on SuSE 8.1

2002-10-15 Thread Jim Bublitz

On 15-Oct-02 Marc Schmitt wrote:
> On Dienstag, 15. Oktober 2002 21:37, Jim Bublitz wrote:
>> The string "mJ0J0ii" should be "mJ0J0i".
 
> Nope. I changed that (and some randomly some other permutation of
> that occurance within khtml*.sip) but without success.

I'm not sure what you mean here - the 'ii' means it's looking for
two ints passed in, but only one is passed in PyKDE (the second from
the original declaration was a bool *, which PyKDE *returns* as a
value in a tuple). "ii" is only wrong if only one int is expected
in the arg list; it would be correct for two ints in the arglist,
which isn't the case here.
 
>> I don't know what a 'non-POD type' is, so the error msg isn't
>> very helpful at the moment. Generally, you couldn't have gone
>> that far unless almost everything else was working - this is
>> one of the last few modules in the build. It could also be due
>> to a change in KDE 3.0.4 (I don't have the source to check
>> yet), in which case commenting out the paint method should
>> take care of it temporarily.
 
> Also did that, or at least tried to but the error remains. But
> with this point I'm not quite sure if it was in the right file,
> as I modified
 
> PyKDE-3.3.2/sip/khtmlview.sip,

> but it complains about khtml_part.sip.

Ooops! My mistake (in more ways than one). The exact same code is
in khtml_part.sip (cut and pasted, I'm sure), so you might try
another iteration of the same fixes but on khtml_part.sip instead.
It doesn't seem likely that the extra 'i' is the problem though -
I'm not sure what is. Anybody recognize the meaning of "non-POD
type"??

I was looking in the concatenated file and grabbed the wrong paint
method, but both have the error.
 
> I'll give it another try tomorrow,
> but this night I have to wait in sorrow. 

I just recompiled on SuSE8.0/KDE3.0.3 for a Python update and had
no errors. I'll pick up KDE 3.0.4 tomorrow and see what's involved
in doing the update - probably not much. Then again, since I don't
know the real problem for certain, I may not get it fixed that way
either :(

Jim
 

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



Re: [PyKDE] Runtime issues on SuSE 8.1

2002-10-16 Thread Marc Schmitt

On Mittwoch, 16. Oktober 2002 02:48, Jim Bublitz wrote:
> > Nope. I changed that (and some randomly some other permutation of
> > that occurance within khtml*.sip) but without success.
>
> I'm not sure what you mean here - the 'ii' means it's looking for
> two ints passed in, but only one is passed in PyKDE (the second from
> the original declaration was a bool *, which PyKDE *returns* as a
> value in a tuple). "ii" is only wrong if only one int is expected
> in the arg list; it would be correct for two ints in the arglist,
> which isn't the case here.

I first assumed replacing the (to me mysterious) string "mJ0J0ii" had helped 
and brought me further (which was a mistake, I just looked at the wrong 
lines) so I thought, "Hey, if this helpes lets edit some others too" :)

About the internals of sip I know not much. I've read a bit about swig, and 
used it once but not sip.

> Ooops! My mistake (in more ways than one). The exact same code is
> in khtml_part.sip (cut and pasted, I'm sure), so you might try
> another iteration of the same fixes but on khtml_part.sip instead.
> It doesn't seem likely that the extra 'i' is the problem though -
> I'm not sure what is. Anybody recognize the meaning of "non-POD
> type"??

I found this :

http://www.boost.org/libs/python/doc/v2/definitions.html

POD: A technical term from the C++ standard. Short for "Plain Ol'Data": A 
POD-struct is an aggregate class that has no non-static data members of type 
pointer to member, non-POD-struct, non-POD-union (or array of such types) or 
reference, and has no user-defined copy assign- ment operator and no 
user-defined destructor. Similarly, a POD-union is an aggregate union that 
has no non-static data members of type pointer to member, non-POD-struct, 
non-POD-union (or array of such types) or reference, and has no user-defined 
copy assignment operator and no user-defined destructor. A POD class is a 
class that is either a POD-struct or a POD-union. An aggregate is an array or 
a class (clause 9) with no user-declared constructors (12.1), no private or 
protected non-static data members (clause 11), no base classes (clause 10), 
and no virtual functions (10.3).

and especially this one :

http://lists.trolltech.com/qt-interest/2002-03/thread4-0.html :

[Q:]
I'm trying to use QString::sprintf with little luck. 
During compilation I get the following warnings:

g++ -c -pipe -Wall -W -O2  -DQT_NO_DEBUG -I/var/tmp/qt/include
-I/var/tmp/qt/mkspecs/default -o main.o main.cpp
main.cpp: In function `int main (int, char **)':
main.cpp:50: warning: cannot pass objects of non-POD type `class 
QString' through `...'
main.cpp:50: warning: cannot pass objects of non-POD type `class 
QString' through `...'

[A:]

You can't pass QStrings through QString::sprintf().

[A2:]

Yes, you can, but you'll lose some Unicode information:
sprintf("%s", string.latin1())
or just
sprintf("%s", (const char*)string)


This leas me to the following conclusion : Its not KDE3.0.4 that changed, but 
GCC3.2 ! Before it has been just a warning, now it's an error ... So, what do 
you think ?

That's exactly the reason why I stopped developing C(++) and started python.

c-compiler-developer : "Hey, compiling is just too easy. Lets do some 
education on our users and show them how -officially- standarized code must 
look like ..."


-Marc

ps: I'm just compliling without the paint method. Let's see.

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



Re: [PyKDE] Runtime issues on SuSE 8.1

2002-10-16 Thread Hans-Peter Jansen

Hi Marc, hi Jim,

I finally touched the khtml_part problem. Here is my mod:

--- ../PyKDE-3.3.2.orig/sip/khtml_part.sip  2002-08-21 20:08:45.0 +0200
+++ ./sip/khtml_part.sip2002-10-16 13:02:32.0 +0200
@@ -124,8 +124,8 @@
QRect r;
int i = 0;
 
-   if 
(sipParseArgs(&sipArgsParsed,sipArgs,"mJ0J0ii",sipThisObj,sipClass_KHTMLPart,&ptr, 
sipClass_QPainter, p,
-   sipClass_QRect, r, i))
+   if 
+(sipParseArgs(&sipArgsParsed,sipArgs,"mJ0J0JOi",sipThisObj,sipClass_KHTMLPart,&ptr, 
+sipClass_QPainter, p,
+   sipClass_QRect, &r, i))
{
bool b;

At least, it compiles, but does this make sense also? 
I moderately sure about the missing &, which fixes the compiler complaint, 
but what about this sip argument format string?

Please comment!

Thanks,
Hans-Peter

On Wednesday 16 October 2002 11:10, Marc Schmitt wrote:
> On Mittwoch, 16. Oktober 2002 02:48, Jim Bublitz wrote:
> > > Nope. I changed that (and some randomly some other permutation of
> > > that occurance within khtml*.sip) but without success.
> >
> > I'm not sure what you mean here - the 'ii' means it's looking for
> > two ints passed in, but only one is passed in PyKDE (the second from
> > the original declaration was a bool *, which PyKDE *returns* as a
> > value in a tuple). "ii" is only wrong if only one int is expected
> > in the arg list; it would be correct for two ints in the arglist,
> > which isn't the case here.
>
> I first assumed replacing the (to me mysterious) string "mJ0J0ii" had
> helped and brought me further (which was a mistake, I just looked at the
> wrong lines) so I thought, "Hey, if this helpes lets edit some others too"
> :)
>
> About the internals of sip I know not much. I've read a bit about swig, and
> used it once but not sip.
>
> > Ooops! My mistake (in more ways than one). The exact same code is
> > in khtml_part.sip (cut and pasted, I'm sure), so you might try
> > another iteration of the same fixes but on khtml_part.sip instead.
> > It doesn't seem likely that the extra 'i' is the problem though -
> > I'm not sure what is. Anybody recognize the meaning of "non-POD
> > type"??
>
> I found this :
>
> http://www.boost.org/libs/python/doc/v2/definitions.html
>
> POD: A technical term from the C++ standard. Short for "Plain Ol'Data": A
> POD-struct is an aggregate class that has no non-static data members of
> type pointer to member, non-POD-struct, non-POD-union (or array of such
> types) or reference, and has no user-defined copy assign- ment operator and
> no user-defined destructor. Similarly, a POD-union is an aggregate union
> that has no non-static data members of type pointer to member,
> non-POD-struct, non-POD-union (or array of such types) or reference, and
> has no user-defined copy assignment operator and no user-defined
> destructor. A POD class is a class that is either a POD-struct or a
> POD-union. An aggregate is an array or a class (clause 9) with no
> user-declared constructors (12.1), no private or protected non-static data
> members (clause 11), no base classes (clause 10), and no virtual functions
> (10.3).
>
> and especially this one :
>
> http://lists.trolltech.com/qt-interest/2002-03/thread4-0.html :
>
> [Q:]
> I'm trying to use QString::sprintf with little luck.
> During compilation I get the following warnings:
>
> g++ -c -pipe -Wall -W -O2  -DQT_NO_DEBUG -I/var/tmp/qt/include
> -I/var/tmp/qt/mkspecs/default -o main.o main.cpp
> main.cpp: In function `int main (int, char **)':
> main.cpp:50: warning: cannot pass objects of non-POD type `class
> QString' through `...'
> main.cpp:50: warning: cannot pass objects of non-POD type `class
> QString' through `...'
>
> [A:]
>
> You can't pass QStrings through QString::sprintf().
>
> [A2:]
>
> Yes, you can, but you'll lose some Unicode information:
> sprintf("%s", string.latin1())
> or just
> sprintf("%s", (const char*)string)
>
>
> This leas me to the following conclusion : Its not KDE3.0.4 that changed,
> but GCC3.2 ! Before it has been just a warning, now it's an error ... So,
> what do you think ?
>
> That's exactly the reason why I stopped developing C(++) and started
> python.
>
> c-compiler-developer : "Hey, compiling is just too easy. Lets do some
> education on our users and show them how -officially- standarized code must
> look like ..."
>
>
> -Marc
>
> ps: I'm just compliling without the paint method. Let's see.
>
> ___
> PyKDE mailing list[EMAIL PROTECTED]
> http://mats.gmd.de/mailman/listinfo/pykde

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



Re: [PyKDE] Runtime issues on SuSE 8.1

2002-10-16 Thread Jim Bublitz

On 16-Oct-02 Marc Schmitt wrote:
> On Mittwoch, 16. Oktober 2002 02:48, Jim Bublitz wrote:
>> > Nope. I changed that (and some randomly some other permutation
>> > of that occurance within khtml*.sip) but without success.

>> I'm not sure what you mean here - the 'ii' means it's looking
>> for two ints passed in, but only one is passed in PyKDE (the
>> second from the original declaration was a bool *, which PyKDE
>> *returns* as a value in a tuple). "ii" is only wrong if only
>> one int is expected in the arg list; it would be correct for
>> two ints in the arglist, which isn't the case here.
> 
> I first assumed replacing the (to me mysterious) string "mJ0J0ii"
> had helped and brought me further (which was a mistake, I just
> looked at the wrong lines) so I thought, "Hey, if this helpes
> lets edit some others too" :)

Yeah, I was afraid of that :) (I tend to think the same way)

>> Ooops! My mistake (in more ways than one). The exact same code
>> is in khtml_part.sip (cut and pasted, I'm sure), so you might
>> try another iteration of the same fixes but on khtml_part.sip
>> instead. It doesn't seem likely that the extra 'i' is the
>> problem though - I'm not sure what is. Anybody recognize the
>> meaning of "non-POD type"??
 
> I found this :

Thanks for the research and explanations.

> This leas me to the following conclusion : Its not KDE3.0.4 that
> changed, but GCC3.2 ! Before it has been just a warning, now
> it's an error ... So, what do  you think ?

Might be gcc version-related - I'm not sure, but there definitely
was an error in my code. I don't think it was an error the compiler
would have found though, so maybe something else is going on. Looks
like I better set up a box with gcc 3.2 :(
 
> That's exactly the reason why I stopped developing C(++) and
> started python.

One of *many* reasons.
 
> c-compiler-developer : "Hey, compiling is just too easy. Lets do
> some education on our users and show them how -officially-
> standarized code must look like ..."

The problems PyKDE had with gcc 2.95->2.96 were (mostly) genuine
errors in the code (like promoting private stuff to public
unintentionally) that gcc 2.95 let by. There was one problem with
'const' or 'void' (I forget which) that fit your description above
pretty well though.

> ps: I'm just compliling without the paint method. Let's see.

I noticed from your followup to this that it worked without the
paint method - shouldn't be a problem for most people. The actual
calls made to paint are handled on the C++ side (in the libs), so
the missing paint method is only a problem if you wanted to
subclass and override the method in Python. It wouldn't have worked
in earlier versions anyway, so your rpms are no more "crippled" than
previous versions.

Just as a plug for the recent build system changes - it would have
been a lot more difficult to do a workaround like this with the
older build system, and a lot slower too.

An 'official' PyKDE/KDE 3.0.4 release will probably wait now until I
get a copy of SuSE 8.1 and find a box to put it on (so I can test
gcc 3.2) - probably a week to 10 days. I'll probably also switch
to sip/PyQt 3.4, but that shouldn't cause any problems for 3.3.2
users as far as I can see. KDE 3.1 isn't too far away either.


Persistence in fixing bugs is always appreciated - thanks.


Jim







___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



Re: [PyKDE] Runtime issues on SuSE 8.1

2002-10-16 Thread Jim Bublitz

On 16-Oct-02 Hans-Peter Jansen wrote:
> Hi Marc, hi Jim,
 
> I finally touched the khtml_part problem. Here is my mod:
 
> --- ../PyKDE-3.3.2.orig/sip/khtml_part.sip  2002-08-21
> 20:08:45.0 +0200
> +++ ./sip/khtml_part.sip2002-10-16 13:02:32.0 +0200
> @@ -124,8 +124,8 @@
> QRect r;
> int i = 0;
  
> -   if
> (sipParseArgs(&sipArgsParsed,sipArgs,"mJ0J0ii",sipThisObj,sipClass
> _KHTMLPart,&ptr, sipClass_QPainter, p,
> -   sipClass_QRect, r, i))
> +   if
> (sipParseArgs(&sipArgsParsed,sipArgs,"mJ0J0JOi",sipThisObj,sipClas
> s_KHTMLPart,&ptr, sipClass_QPainter, p,
> +   sipClass_QRect, &r, i))
> {
> bool b;
 
> At least, it compiles, but does this make sense also? 
> I moderately sure about the missing &, which fixes the compiler
> complaint, but what about this sip argument format string?

Thanks!

Sloppy coding on my part - it definitely wants a pointer there.
This goes in the "mistakes I made that gcc 2.95 didn't catch"
category.

The format string should be:

m - for the KHTMLPart 'this' pointer (equivalent to self in
  Python)

J0 - for the QPainter arg
J0 - for the QRect arg
i  - for the int arg

or "mJ0J0i"

The bool* arg isn't passed in under Python; it's the return value
of the paint call instead (yes, sip will let you turn a void method
call into a call that returns a value under Python). In this case,
the contents of the location pointed to by the bool* is modified by
the call to paint, it isn't a parameter that paint uses itself to do
something. That's why the second 'i' in the format string was
incorrect. It's the same thing in both khtmlview.sip and
khtml_part.sip.

In the docs this should read "TAKES a QPainter, QRect, int and
RETURNS an int" (Python not having a bool type for the return value
prior to 2.2.1)

I probably would have spent a week looking for this silly error
(and it's one I've made before too). Thanks again (both Marc and
Hans-Peter)!


Jim

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde