unused: IProject::urlRelativeToProject
Andreas Pakulat
apaku at gmx.de
Fri Apr 24 18:59:02 UTC 2009
On 24.04.09 19:22:14, Milian Wolff wrote:
> On Friday 24 April 2009, Milian Wolff wrote:
> > The method urlRelativeToProject (from IProject) is never being called in
> > kdevelop / kdevplatform.
> >
> > Should it be removed or does someone think it's required?
> >
> > I'd have to make it supports remote URLs which I'm not sure it's currently
> > doing properly. But still the following should be OK to commit, right?
> >
> > - if ( KUrl::isRelativeUrl( relativeUrl.toLocalFile() ) )
> > + if ( relativeUrl.isRelative() ) {
>
> Oh and what I forgot what apol suggested to me:
>
> - if ( KUrl::isRelativeUrl( relativeUrl.toLocalFile() ) )
> - return KUrl( folder(), relativeUrl.toLocalFile() );
> + if ( relativeUrl.isRelative() ) {
> + kDebug() << "build relative url from " << folder() <<
> relativeUrl.path() << KUrl(folder(), relativeUrl.path());
> + return KUrl( folder(), relativeUrl.path() );
> + }
No, that would be wrong. Whenever you want to convert to local system
paths, you _have_ to use toLocalFile, not path().
However looking at the API docs this code is completely bogus anyway. So
if you're sure that the method isn't called anywhere right now, then
remove it. I'm pretty sure we did use it at some point, but apparently
don't do that anymore right now. We can always re-add it later on.
Andreas
--
You've been leading a dog's life. Stay off the furniture.
More information about the KDevelop-devel
mailing list