Small example how to dumb-port from qDebug to qCDebug

This commit is contained in:
Sebastian Kügler 2013-11-20 04:37:47 +01:00
parent ccca440859
commit 082e6c65e5

14
tools/port-qcdebug.sh Executable file
View File

@ -0,0 +1,14 @@
#!/bin/sh
# Port all qDebug() statements to qCDebug()
# change all QDebug includes to QLoggingCategory
# Note: don't forget to put the right debug area here,
# i.e. replace SYSTEMTRAY with whatever you put into
# the Q_LOGGING_CATEGORY(SYSTEMTRAY, "systemtray") macro
for FS in `find $PWD -name '*.h' -o -name '*.cpp'`; do
perl -p -i -e 's/qDebug\(\)/qCDebug(SYSTEMTRAY)/g' $FS
perl -p -i -e 's/\#include \<QDebug\>/\#include \<QLoggingCategory\>/g' $FS
done