new KDevPlatform API for consideration
Matt Rogers
mattr at kde.org
Fri May 26 04:35:26 UTC 2006
On Thursday 25 May 2006 10:53, Andras Mantia wrote:
> On Wednesday 24 May 2006 15:12, Matt Rogers wrote:
> > On Wednesday 24 May 2006 05:44, Andras Mantia wrote:
> > > On Wednesday 24 May 2006 05:16, Matt Rogers wrote:
> > > > hmmm, no, absoluteUrl and relativeUrl should be removed perhaps.
> > > > They seem completely useless ATM.
> > >
> > > Jumping in.. There is a need to calculate/convert urls to
> > > absolute/relative urls based on the "project base".
> > >
> > > Andras
> >
> > use cases?
>
> Well, for example we store the relative URL to the project base for each
> project file. I know for KDevelop it's KDevelop2 days, but we don't
> have files belonging to a build system describing what is in the
> project and what is not, so we list all files in the project file and
> assign some attributes to them. Similar thing will be required once
> David starts the teamwork mode support, as notes and such have to be
> associated to project files.
> So whenever you add a file to a project, the relative url based on the
> project base is stored in the project file. When you access it (eg.
> upload), the URL is converted to an absolute one so it can be passed to
> KIO.
So... what if you branched out a bit, and try to realize how using the project
manager importers and the file manager can help you from not having to keep
that list. For example, there is a generic importer already in
trunk/KDE/kdevelop/buildtools/importers/generic that, at the moment, only
takes C & C++ files, but i'm sure it could be extended and enhanced to use
the mimetypes that are supported by the language support parts of the
project. We could also extend it such that it would use KDirLister to look
for new files and automatically add them to the project (if so desired)
Please try to start thinking out of the box a bit about how your current code
can be adapted to these new ideas rather than just keeping in line with what
you already have. The ultimate goal of the file managers is so that you don't
have to store file lists in the project file or in some separate file.
> relative/absolute URL handling is needed in other cases as well, like
> when inserting a link/image into a file.
Sure, I won't dispute that, but is that really something that should be part
of KDevProject?
> If you ask me if these conversion methods should be part of KDevelop or
> not, I can say that having good methods in kdelibs is better (and IIRC
> there is something like that in KUrl from KDE4). In that case a
> relative/absolute url conversion method in the project interface would
> be a convenience method, so you can omit a call (and an extra argument)
> to get the project base each time you calculate the relative url based
> on the project base.
>
> Andras
have you looked at the new QUrl and KUrl to see if they do this already? Seems
like basic functionality that shouldn't/wouldn't be left out. After all,
there's some QFile related class that will convert between relative and
absolute paths.
--
Matt
More information about the KDevelop-devel
mailing list