[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: Re: KStandardDirs
From: Andras Mantia <amantia () freemail ! hu>
Date: 2003-06-05 18:52:12
[Download RAW message or body]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Thursday 05 June 2003 20:42, Amilcar do Carmo Lucas wrote:
> Andras Mantia wrote:
[...]
> >>what happens with paths like ~foo/kde?
> >
> >/home/userfoo/kde ? (~ = /home/user)
> >
> >Andras
>
> yes Andras, you're right that's what you get out of this code.
> But what you should get is /home/foo/kde
> This is a bug, a fix whould be:
>
> static void fixHomeDir(QString &dir)
> {
> if (dir[0] == '~' && dir[1] == '/')
> {
> dir = QDir::homeDirPath() + dir.mid(1);
> }
> else
> {
> dir = "/home/" + dir.mid(1);
> }
> }
Yes, this is a proof-fool implementation (with one note [1]). But anyway
~foo/kde is an invalid
path, so should it really be handled? The name contains "fix", so this fits
in...
[1]: in the else you should use dir = QDir::homeDirPath() + '/' + dir.mid(1),
I think.
Andras
- --
Quanta Plus developer - http://quanta.sourceforge.net
K Desktop Environment - http://www.kde.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
iD8DBQE+35FcTQdfac6L/08RAtarAKDfmd+OKESS2JF1nTOi6jgbpMZtbACgwH0N
5NzcAMr80TuVqKWCj+XI3qg=
=9GyJ
-----END PGP SIGNATURE-----
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic