d524bf0ee6
Use non-greedy capturing where it makes sense, also keep the user's whitespace indentation in his include statements Change-Id: Iff2b5dabf443529292e943ae69427bd15e702bf9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
24 lines
797 B
Bash
Executable File
24 lines
797 B
Bash
Executable File
#!/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,^#(\\s*)include(\\s+)<.+?/$i>,#\\1include\\2<$module/$i>," $files;
|
|
# perl -pi -e 's,^#include +".+/$i",#include "$module/$i",' $files;
|
|
done;
|
|
fi;
|
|
done;
|
|
|
|
perl -pi -e 's,<QtGui>,<QtWidgets>,' $files
|
|
perl -pi -e 's,<QtGui/QtGui>,<QtWidgets/QtWidgets>,' $files
|