summaryrefslogtreecommitdiffstats
path: root/bin/fixqt4headers
blob: 0bb6add8f870d18262f63288304a6c6d9bd7a508 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash

modules=`ls $QTDIR/include`

files=`find * -name '*.h' -or -name '*.cpp' -or -name '*.C'`

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" ]; 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;

perl -pi -e 's,<QtGui>,<QtWidgets>,' $files
perl -pi -e 's,<QtGui/QtGui>,<QtWidgets/QtWidgets>,' $files