[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: Re: Relative Path Fuction
From: Andras Mantia <amantia () freemail ! hu>
Date: 2003-06-04 7:37:36
[Download RAW message or body]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Tuesday 2003 June 03 23:26, Waldo Bastian wrote:
> On Tuesday 03 June 2003 22:19, Benjamin Meyer wrote:
> > Ok here is my function using KURL. This function also doe
> >
> > -Benjamin Meyer
> >
> > P.S. KURL doesn't have the += operator nor does it have a function to
> > verify if a directory exists.
> >
> > /**
> > * Finds the relative path from path1 to path2
> > * returns true is successfull.
> > */
> > bool relativeURL(const KURL &path1, const KURL &path2,
> > KURL &relativePath ) {
>
> You can't store a relative path in KURL, it doesn't make sense.
Well, sometimes makes sense, as you will not loose the protocol information. I
use it, altough I admit that you may workaround the problem, as you just set
the protocol to the baseURL's one, if it's a relative path, but neverless
it's more easier to work with KURL's which have relative paths.
Andras
> It should
> be something like:
>
> bool relativeURL(const KURL &baseUrl, const KURL &url,
> QString &relativeUrl ) {
>
> Note that a relative path is not the same as a relative URL.
> "../my%20file.txt" is a relative URL, while "../my file.txt" is a relative
> path.
>
> Cheers,
> Waldo
- --
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+3aHETQdfac6L/08RAjNfAKDCybzVp8Cci1qQ4bZ00RMMgm+arwCgmoMF
qeMWi6Rk0EgM2dJPqUTrTH0=
=oCAK
-----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