[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-perl
Subject:    Re: [Kde-perl] Tutorials done
From:       Germain Garand <germain () ebooksfrance ! com>
Date:       2002-05-30 23:10:20
[Download RAW message or body]

Hello Ashley,

I've tried today to port some Perl code I did with PerlQt-2, and that was 
interesting - gave me more clues about how the new code work.

I noticed the Perl code is hard to debug because of the quite layered function 
call mechanism.
If you've got a wrong method call lost in a 1kl file, having a "No method call 
for..." statement pointing to Qt.pm is not that much informative ;-)

Croak has no idea, confess is far too verbose, so what would you think about 
the attached patch ? It point to the correct line/file using (caller(1))[1,2]

Otherwise, if I'm not mistaken, the current code only handles limited signal 
types (int)... do you plan interfacing it with the marshaller or extending 
QUType_In/Out ? In either case may I give it a try ?


Germain

["Qt.pm.patch" (text/x-diff)]

Index: Qt.pm
===================================================================
RCS file: /cvsroot/perlqt/PerlQt-3/Qt.pm,v
retrieving revision 1.15
diff -u -p -r1.15 Qt.pm
--- Qt.pm	28 May 2002 21:12:03 -0000	1.15
+++ Qt.pm	30 May 2002 22:54:15 -0000
@@ -111,11 +111,12 @@ sub autoloaded {
 	    my @matching = argmatch(\@methodids, $args, $i);
 	    @methodids = @matching if @matching;
 	}
-	warn "Possibly fatal: Ambiguous method call for $_[1]"
+	print STDERR "Possibly fatal: Ambiguous method call for $_[1] at ".(caller(1))[1]." \
line ".(caller(1))[2].".\n"  if @methodids > 1;
     }
     unless(@methodids) {
-	die "No method to call for $_[1]";
+	print STDERR "No method to call for $_[1] at ".(caller(1))[1]." line \
".(caller(1))[2].".\n"; +	die;
     }
     
     setCurrentMethod($methodids[0]);



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic