[Here's a]Patch to have KDevelop read/write KWrite document bookmarks in project session file

Mart Verburg mart.verburg at c2i.net
Mon Oct 7 17:05:39 UTC 2002


When I'm working on something using KDevelop, it often doesn't get finished in one session.  As I happen to be absent-minded from time to time as well, it hit me I'd like for KDevelop to remember where I placed bookmarks in various  documents, so that when I open a KDevelop project again, it's easier to pick up where I left off in the last session.

The most logical place to store bookmarks for project related documents in, is in the session document.  So I decided to try putting 'em in the XML-tree of the .kdevses, under <DocsAndViews>, as an attribute of each <Doc> element.  The attribute looks like
	bookmarks=linenumber1,linenumber2,...linenumberX

The attribute is only written if there is one ore more bookmarks set for a document.

When retrieving a project, the code looks for the bookmarks attribute for each document, and restores them.

When opening a .kdevses with a KKevelop version without this bookmark patch applied, the bookmarks attributes are simply skipped over, and when closing the project, the bookmark attributes will be gone from the .kdevses file.  So there shouldn't arise any problems exchanging sources between patched and non-patched versions of KDevelop.

Documentation bookmarks are stored in the config/kdeveloprc document, which seems the right place to me, as poeple will probably read documentation independant of which project they're working with.  So I left those alone.

I ftp-ed the patch to 
	ftp://fara.cs.uni-potsdam.de/incoming/
It's called
	kdevelop-2.1-save_bookmarks.patch.mart.020927.zip

The Comfiguration I'm using:
kernel:   2.4.3-ac14 (trying to update to 2.4.18 as this patch was written)
distro:   RedHat 7.0, partly updated to RH7.3 via bin-RPM's, except Glibc
glibc:    2.1.92
gcc:      2.96-110
Qt:       3.03
KDE:      3.0.0-10
KDevelop: 2.1
autoconf: 2.53
automake: 1.5


The patched version is working nicely on my system, I hope it can be useful to others as well.

The same principle of saving/retrieving bookmarks in/from the .kdevses file can off course be applied to the breakpoints.  I thought I'd wait with that to see how the development team likes the idea first.
 
-- 
With a rubber duck, one's never alone.
		-- "The Hitchhiker's Guide to the Galaxy"






More information about the KDevelop-devel mailing list