Getting the current active project

Andras Mantia amantia at kde.org
Tue Apr 3 10:24:00 UTC 2007


On Tuesday 03 April 2007, Andreas Pakulat wrote:
> Hmm, right. But this means that IProject has to parse the
> locally-cached project file everytime its asked for a
> KSharedConfig::Ptr (i.e. at least a reparseConfiguration() is
> needed).

I don't know the current implementation, but I'd imagine the following:
- if the file is local, open that file directly with KConfig
- if the file is remote, download, open the downloaded file with KConfig

Everything is done the same way from this point on, except that there 
are writes/actions  that trigger an upload, in which case 
an "uploadProject" method is called which uploads if it was a remote 
file (or let's say sync-s in case of local ones).

> > Of course a crash recovery mechanism is needed, so you don't loose
> > your project changes if KDevelop crashed and the temporary project
> > file was not uploaded yet.
>
> That is rather hard. If KDevelop crashes we can't do anything anymore
> (without hooking into various unix signals, I think), especially not
> upload a locally cached file.

I don't see the need of unix signals. Quanta has a crash-recovery 
mechanism since quite some time for documents, and a similar could be 
used for projects as well. The idea (in a simple form) is something 
like the following:
- keep the downloaded file in a separate temp directory
- keep a list of what project was opened in kdeveloprc (or some other 
config file)
- when the project is closed, remove the entry from kdeveloprc

If KDevelop crashes, the entry from the kdeveloprc will not be removed, 
so on the next startup it knows that there is a downloaded project 
file, which can be used to recover and go on from the last state 
instead of downloading an older version from the remote place.

Andras
-- 
Quanta Plus developer - http://quanta.kdewebdev.org
K Desktop Environment - http://www.kde.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20070403/f29eaff6/attachment.sig>


More information about the KDevelop-devel mailing list