qt5base-lts/bin/fixqt4headers

24 lines
781 B
Plaintext
Raw Normal View History

#!/bin/bash
modules=`ls $QTDIR/include`
files=`find * -name '*.h' -or -name '*.cpp' -or -name '*.C' -or -name '*.cc' -or -name '*.CC'`
echo $files
for module in $modules; do
# once we change other things, change the line from == "QtWidgets" to != "Qt" to get everything fixed
if [ $module == "QtWidgets" ] || [ $module == "QtPrintSupport" ]; then
echo $module ":"
includes=`ls $QTDIR/include/$module`
for i in $includes; do
# echo " fixing " $i
perl -pi -e "s,^#include +<.+/$i>,#include <$module/$i>," $files;
# perl -pi -e 's,^#include +".+/$i",#include "$module/$i",' $files;
done;
fi;
done;
2011-05-08 07:47:19 +00:00
perl -pi -e 's,<QtGui>,<QtWidgets>,' $files
perl -pi -e 's,<QtGui/QtGui>,<QtWidgets/QtWidgets>,' $files