On VCS changes notifications
aleixpol at kde.org
Sun Mar 7 17:30:13 UTC 2010
On Sun, Mar 7, 2010 at 4:23 PM, Andreas Pakulat <apaku at gmx.de> wrote:
> On 06.03.10 19:39:28, Aleix Pol wrote:
> > I was wondering about how could we know that the repository has changed
> > any way.
> > Here's some ideas, maybe we can find the proper solution for that:
> > - Provide the vcs directory from the IBasicVCS class, something like
> > IBasicVCS::repositoryForUrl(const KUrl&);", that would mean expose too
> > information then we could have the KDirWatch who did that.
> Can you elaborate a bit what "vcs directory" is and what you want to do
I mean the .git/.svn directory. we could set a dir watcher on that.
> > - Create a IBasicVCS signal called "void
> > KUrl&)" that would tell us what changed when commiting/updating. we
> > connect to it when a project with this is added then just wait for
> > notifications. Here we would have to hope the VCS plugin does that right
> > we could use it (and if implemented properly would work when it's
> > commited/updated from the console).
> Well, thats the best thing, we can even have separate signals
> "comitFinished(const KUrl::List&)" and "directoryUpdated(const
> KUrl::List&)". Additionally we'd probably should connect to a signal in
> the documentcontroller thats triggered when a file is saved. The good
> thing about having separate signals is that it might be easier to update
> and fetch the status as the commitFinished() can have a list of only
> those files that have really been comitted.
> The repository-interface might also need some signal to notify
> interested parties when the repository got a change, so that one can
> display this in the project tree too (this one would probably rely on a
> timer regularly fetching the information).
> > - Add a "QList<KUrl> VcsJob::urls() const" method that would tell us what
> > changed. Then we could listen to the IRunController and whenever some job
> > unregistered, we check if it's one of those we're interested on and we
> > retrieve the info. It's a little unnatural but since the Vcs nature is so
> > centered on paths, it could make sense. We wouldn't trigger the updates
> > the user commits/updates on the console, though.
> I don't like this, as the vcs-plugins has no idea when the "changed
> urls" list can be cleared. So the only option would be clearing it each
> time after calling, which is a problem with multiple plugins want to do
> something when a vcs-plugin did something.
> You'll wish that you had done some of the hard things when they were easier
> to do.
> KDevelop-devel mailing list
> KDevelop-devel at kdevelop.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the KDevelop-devel