[Kde-bindings] branches/KDE/4.4/kdebindings/ruby/qtruby/src/lib/Qt

Richard Dale Richard_Dale at tipitina.demon.co.uk
Mon Feb 1 17:39:29 UTC 2010


SVN commit 1083634 by rdale:

* Simplify the code to distiguish between methods overloaded only on const-ness

CCMAIL: kde-bindings at kde.org


 M  +3 -7      qtruby4.rb  


--- branches/KDE/4.4/kdebindings/ruby/qtruby/src/lib/Qt/qtruby4.rb #1083633:1083634
@@ -2698,7 +2698,7 @@
 				methodIds.each do
 					|id|
 					puts "matching => smoke: #{id.smoke} index: #{id.index}" if debug_level >= DebugLevel::High
-					current_match = 0
+					current_match = (isConstMethod(id) ? 1 : 0)
 					(0...args.length).each do
 						|i|
 						current_match += checkarg(get_value_type(args[i]), get_arg_type_name(id, i))
@@ -2712,12 +2712,8 @@
 					# If ambiguous matches occur the problem must be fixed be adjusting the relative
 					# ranking of the arg types involved in checkarg().
 					elsif current_match == best_match
-						if !isConstMethod(id) and isConstMethod(chosen)
-							chosen = id
-						elsif isConstMethod(id) == isConstMethod(chosen)
-							puts "multiple methods matching, this is an error" if debug_level >= DebugLevel::Minimal
-							chosen = nil
-						end
+						puts "multiple methods matching, this is an error" if debug_level >= DebugLevel::Minimal
+						chosen = nil
 					end
 					puts "match => #{id.index} score: #{current_match}" if debug_level >= DebugLevel::High
 				end



More information about the Kde-bindings mailing list