summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/corelib/global/qlogging.cpp5
-rw-r--r--tests/auto/corelib/global/qlogging/tst_qlogging.cpp16
2 files changed, 19 insertions, 2 deletions
diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp
index 2a4f2dd4d6..f356bab42d 100644
--- a/src/corelib/global/qlogging.cpp
+++ b/src/corelib/global/qlogging.cpp
@@ -653,9 +653,10 @@ Q_AUTOTEST_EXPORT QByteArray qCleanupFuncinfo(QByteArray info)
int pos;
- // skip trailing [with XXX] for templates (gcc)
+ // Skip trailing [with XXX] for templates (gcc), but make
+ // sure to not affect Objective-C message names.
pos = info.size() - 1;
- if (info.endsWith(']')) {
+ if (info.endsWith(']') && !(info.startsWith('+') || info.startsWith('-'))) {
while (--pos) {
if (info.at(pos) == '[')
info.truncate(pos);
diff --git a/tests/auto/corelib/global/qlogging/tst_qlogging.cpp b/tests/auto/corelib/global/qlogging/tst_qlogging.cpp
index f7d8bda190..35bd518b3a 100644
--- a/tests/auto/corelib/global/qlogging/tst_qlogging.cpp
+++ b/tests/auto/corelib/global/qlogging/tst_qlogging.cpp
@@ -670,6 +670,22 @@ void tst_qmessagehandler::cleanupFuncinfo_data()
QTest::newRow("gcc_39")
<< "int TestClass1::operator>(int)"
<< "TestClass1::operator>";
+
+ QTest::newRow("objc_1")
+ << "-[SomeClass someMethod:withArguments:]"
+ << "-[SomeClass someMethod:withArguments:]";
+
+ QTest::newRow("objc_2")
+ << "+[SomeClass withClassMethod:withArguments:]"
+ << "+[SomeClass withClassMethod:withArguments:]";
+
+ QTest::newRow("objc_3")
+ << "-[SomeClass someMethodWithoutArguments]"
+ << "-[SomeClass someMethodWithoutArguments]";
+
+ QTest::newRow("objc_4")
+ << "__31-[SomeClass someMethodSchedulingBlock]_block_invoke"
+ << "__31-[SomeClass someMethodSchedulingBlock]_block_invoke";
}
#endif