Am 05.02.2011, 21:35 Uhr, schrieb Stefan Majewsky
<[email protected]>:
> if a Qt fairy (pun intended) would visit me and grant me one wish, it
Errr... about the fairies - i fear i have bad news for you.
See, my boy. Errrrmmmm, welll... you know - ... - gahhh, ask your mother!
:-P
> (How) Can something like this be achieved?
not tested, certainly full of typos:
class SvgRenderer : public QSvgRenderer
{
public:
SvgRenderer(QString &filename, QObject *parent)
{
QString path = filename;
if ( path.startsWith("%/") )
path = KStandardDirs::locate( path.section('/',1,1),
path.section('/',2,-1) );
QSvgRenderer(path, parent);
}
};
----
'%' in anything bash-a-like (bash, fish, zsh, etc.) is pretty much a no-go.
But you can define functions and pass them one char names (what's not
a smart idea for most chars though...) that works "similar"
put this line of brainfuck into your .bashrc
→(){type=${1%%/*};file=${1#*/};dir=`kde4-config --path $type`;if [ -e
${dir%%:*}$file -o ! -e ${dir##*:}$file ]; then echo ${dir%%:*}$file; else
echo ${dir##*:}$file; fi}
and this
kwrite `→ config/kwinrc`
or (less elegant)
kwrite $(→ config/kwinrc)
will open your local kwin config if there's one or no global either.
("→" is AltGR+i on german keyboards, everybody finds a nice and easy other
char himself ;-)
Cheers,
Thomas
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<