plasma-framework/widgets/make_widget.sh
Alex Merry 9178353bb4 Fix inclusion guards for future widgets.
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=810532
2008-05-20 22:36:28 +00:00

26 lines
566 B
Bash
Executable File

#!/bin/sh
# usage: make_widget LineEdit
LOWERNAME=`echo $1 | tr [:upper:] [:lower:]`
NAME=$1
CAPNAME=`echo $1 | tr [:lower:] [:upper:]`
NATIVE="Q${NAME}"
HEADER="${LOWERNAME}.h"
SOURCE="${LOWERNAME}.cpp"
BOTH="$HEADER $SOURCE"
QHEADER="Q${HEADER}"
cp template.h $HEADER
cp template.cpp $SOURCE
perl -pi -e "s,<Name>,${NAME},g" $BOTH
perl -pi -e "s,<NAME>,${CAPNAME},g" $BOTH
perl -pi -e "s,<name>,${LOWERNAME},g" $BOTH
perl -pi -e "s,<Native>,$NATIVE,g" $BOTH
echo "#include \"../../plasma/${HEADER}\"" > ../includes/${NAME}
svn add ../includes/${NAME} $BOTH