inconsistent-file-naming-convention.cpp

Florian Reinhard florian.reinhard at googlemail.com
Thu Mar 3 17:11:10 CET 2011


Hi!

I just wrote a script to do the renaming from dashes to nodashes and i must 
say i really don't like it.

For example:

sunshine/sunshine-advanced-settings-widget.cpp
sunshine/sunshineadvancedoptionswidget.cpp

for me it takes some seconds to sort out all different words that make up 
sunshineadvancedsettingswidget. Therefore i don't see any sane reason to 
rename anything with dashes to nodashes. I'd appreciate the other way round.

Techbase does not cover filenames:
http://techbase.kde.org/Policies/Library_Code_Policy

#kde-devel is like "do what ever you prefer"

Regards,
F



note: this does not cover .ui files

#!/bin/bash

cd $1
for oldpath in `find . -name *.h`
do
    echo $oldpath
    oldname=$(basename $oldpath)
    olddir=$(dirname $oldpath)
    newname=$(echo $oldname | sed -e's/-//g')
    newpath="$olddir/$newname"
    echo "    git mv $oldpath $newpath"
    git mv $oldpath $newpath

    # mv cpp file if exists
    if [ -f ${oldpath/%h/cpp} ]
    then
        echo "    git mv ${oldpath/%h/cpp} ${newpath/%h/cpp}"
        git mv ${oldpath/%h/cpp} ${newpath/%h/cpp}
    fi

    for f in `find . -type f | grep -v ".git"`
    do
        sed -i -e"s/$oldname"/$newname"/" $f
        git add $f
    done
done
git status


More information about the KDE-Telepathy mailing list