History-Problems (0)

Baumann, Thomas baumann at valudo.de
Wed Jul 21 10:16:56 BST 2004


Hi there,

I have problems implementing a history to my KHTML-based browser. I'm sorry
for posting so much code here, but I am not quite sure wheather this problem
is related to my wrong implementation of save-/restoreState, or any other
reason. It would be nice if one of you could have a look at it. One of you
should know how to implement a "KHistory" and could point me to the problem
quite quickly­.

I have got my own history-obejcts looking like this:

class HistoryItem {
   public:
      HistoryItem(KParts::BrowserExtension* sender = 0, const KURL url =
KURL(), const KParts::URLArgs urlArgs = KParts::URLArgs());
      KParts::BrowserExtension* sender();
      KURL url();
      KParts::URLArgs urlArgs();
      QByteArray state;
      ...
};

Everytime my BrowserExtension emits openURLNotify, the browser saves the
current state and url of the part like this:

// store state of browserExtension
HistoryItem* item = new HistoryItem(_myKHTML->browserExtension(),
_myKHTML->url(), _myKHTML->browserExtension()->urlArgs());
QDataStream stream(item->state, IO_WriteOnly);
item->sender()->saveState(stream);

... [to be continued] ...




More information about the kfm-devel mailing list