Improve function match regex

This commit is contained in:
Florian Bruhin 2014-06-03 17:24:12 +02:00
parent 282874cc80
commit 5a6eb2bec3

View File

@ -142,9 +142,9 @@ def qt_message_handler(msg_type, context, msg):
level = qt_to_logging[msg_type]
# We get something like "void qt_png_warning(png_structp, png_const_charp)"
# from Qt, but only want "qt_png_warning".
match = re.match(r'.* (\w*)\(.*\)', context.function)
match = re.match(r'.*( |::)(\w*)\(.*\)', context.function)
if match is not None:
func = match.group(1)
func = match.group(2)
else:
func = context.function
name = 'qt' if context.category == 'default' else 'qt-' + context.category