konq_history format

David Faure faure at kde.org
Wed Nov 12 23:20:38 GMT 2003


On Thursday 13 November 2003 00:08, Peter Baker wrote:
> hi,
> 
> what is the format of the konqueror history file? is it possible to convert it to a plain text file listing of all URLs visited?

~/.kde/share/apps/konqueror/konq_history is a binary file for efficiency reasons.
It is created with QDataStream and contains:
* a version number, as 32-bit unsigned int
and for each history entry:
* the URL as a KURL
* the URL typed in the location bar, as a QString
* the title, as a QString
* number of times visited, as 32-bit unsigned int
* first visited, as a QDateTime
* last visited, as a QDateTime

The KURL itself contains
protocol, user, pass, host, path, path_encoded, query, ref_encoded, 8bit-value being 1, and port as a short int.

The QDataStream format is documented on http://doc.trolltech.com
There you go, you should have all the info - but this isn't straightforward at all.
Good luck :)

But it might simpler to 
1) create a standalone program that uses KDE code to load the history 
(see libkonq/konq_history*), then write a main() that exports the history as text.
or
2) make saveHistory() also save a text version (so that konq saves it by itself).

-- 
David FAURE, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).




More information about the kfm-devel mailing list