Commit 588a84a9 authored by David Faure's avatar David Faure

Add support for .ui files in c++-*-class-and-file

parent 1de3c228
......@@ -25,6 +25,9 @@ if [ ! -f $newfile.h ]; then
if [ -f ${newfile}_p.h ]; then
git add ${newfile}_p.h
fi
if [ -f ${newfile}.ui ]; then
git add ${newfile}.ui
fi
fi
# Update build system
......@@ -36,6 +39,7 @@ fi
if test -n "$buildsystemfile"; then
perl -pi -e '$_ .= "$1'$newfile.cpp'\n" if (m/^(\s*)'$oldfile'\.cpp/)' $buildsystemfile
perl -pi -e '$_ .= "$1'$newfile.h'\n" if (m/^(\s*)'$oldfile'\.h/)' $buildsystemfile
perl -pi -e '$_ .= "$1'$newfile.ui'\n" if (m/^(\s*)'$oldfile'\.ui/)' $buildsystemfile
fi
# Rename class
......@@ -43,6 +47,9 @@ perl -pi -e "s/$oldname/$newname/g" $newfile.h $newfile.cpp
if [ -f ${newfile}_p.h ]; then
perl -pi -e "s/$oldname/$newname/g" ${newfile}_p.h
fi
if [ -f ${newfile}.ui ]; then
perl -pi -e "s/$oldname/$newname/g" ${newfile}.ui
fi
oldinclguard=`echo $oldname | tr a-z A-Z`
newinclguard=`echo $newname | tr a-z A-Z`
......
......@@ -53,6 +53,9 @@ if [ ! -f $newfile.h ]; then
if [ -f ${oldfile}_p.h ]; then
my_mv ${oldfile}_p.h ${newfile}_p.h
fi
if [ -f ${oldfile}.ui ]; then
my_mv ${oldfile}.ui ${newfile}.ui
fi
fi
# Update buildsystem
......@@ -62,7 +65,7 @@ else
buildsystemfile=`ls -1 *.pro 2>/dev/null | head -n 1`
fi
if test -n "$buildsystemfile"; then
perl -pi -e "s/\b$oldfile\.cpp/$newfile.cpp/;s/\b$oldfile\.h/$newfile\.h/" $buildsystemfile
perl -pi -e "s/\b$oldfile\.cpp/$newfile.cpp/;s/\b$oldfile\.h/$newfile\.h/;s/\b$oldfile\.ui/$newfile\.ui/" $buildsystemfile
fi
# Rename class
......@@ -73,6 +76,9 @@ perl -pi -e "s/$oldname/$newname/g" $newfile.cpp
if [ -f ${newfile}_p.h ]; then
perl -pi -e "s/$oldname/$newname/g" ${newfile}_p.h
fi
if [ -f ${newfile}.ui ]; then
perl -pi -e "s/$oldname/$newname/g" ${newfile}.ui
fi
oldinclguard=`echo $oldname | tr a-z A-Z`
newinclguard=`echo $newname | tr a-z A-Z`
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment