Bug 109180

Summary: [GTK][Introspection] GObject bindings for DataTransferItemList - one add() method must be removed from .idl
Product: WebKit Reporter: Tomas Popela <tpopela>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, haraken, japhet, mrobinson, ojan.autocc, webkit.review.bot, xan.lopez, zan
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Proposed patch
none
Disabled the add(File) function in CodeGeneratorGObject.pm
xan.lopez: review-
Disabled the webkit_dom_data_transfer_item_list_add function in CodeGeneratorGObject.pm none

Description Tomas Popela 2013-02-07 05:44:08 PST
When compiling WebKit with --enable-introspection and generating GObject bindings for DataTransferItemList we must remove one add() method, because GObject is based on C and C does not allow two functions with the same name.
Comment 1 Tomas Popela 2013-02-07 05:50:55 PST
Created attachment 187077 [details]
Proposed patch
Comment 2 Zan Dobersek 2013-02-07 07:52:35 PST
Comment on attachment 187077 [details]
Proposed patch

Rather than changing the IDL file you should skip the function in the CodeGeneratorGObject.pm module, in the SkipFunction method.

Given the name of the function you're trying to avoid is quite generic, I'd recommend expanding the SkipFunction method to also accept the name of the interface the function belongs to. It's pretty straightforward from there on, returning 1 from that method (and thus skipping the function) if the function from the 'DataTransferItemList' interface has the name 'add' and the number of parameters equals 1.
Comment 3 Tomas Popela 2013-02-08 01:06:02 PST
Created attachment 187263 [details]
Disabled the add(File) function in CodeGeneratorGObject.pm

Disabled the add(File) function in CodeGeneratorGObject.pm instead of in DataTransferItemList.idl
Comment 4 Xan Lopez 2013-02-08 06:23:42 PST
Comment on attachment 187263 [details]
Disabled the add(File) function in CodeGeneratorGObject.pm

As Zan says I think 'add' is too generic to skip it merely by its name, so we should expand the method to check for the interface name and only do this for the DataTransferItemList case.
Comment 5 Tomas Popela 2013-02-09 05:35:02 PST
Created attachment 187427 [details]
Disabled the webkit_dom_data_transfer_item_list_add function in CodeGeneratorGObject.pm
Comment 6 Xan Lopez 2013-02-12 11:20:08 PST
Comment on attachment 187427 [details]
Disabled the webkit_dom_data_transfer_item_list_add function in CodeGeneratorGObject.pm

OK, good enough.
Comment 7 WebKit Review Bot 2013-02-12 11:28:55 PST
Comment on attachment 187427 [details]
Disabled the webkit_dom_data_transfer_item_list_add function in CodeGeneratorGObject.pm

Clearing flags on attachment: 187427

Committed r142646: <http://trac.webkit.org/changeset/142646>
Comment 8 WebKit Review Bot 2013-02-12 11:28:59 PST
All reviewed patches have been landed.  Closing bug.