d = priv;
}
-QWebHistoryItem QWebPageHistory::itemAtIndex(int i) const
-{
- WebCore::HistoryItem *item = d->lst->itemAtIndex(i);
-
- QWebHistoryItemPrivate *priv = new QWebHistoryItemPrivate(item);
- return QWebHistoryItem(priv);
-}
-
QWebPageHistory::QWebPageHistory(const QWebPageHistory &other)
{
d = other.d;
{
}
+void QWebPageHistory::clear()
+{
+ RefPtr<WebCore::HistoryItem> current = d->lst->currentItem();
+ int capacity = d->lst->capacity();
+ d->lst->setCapacity(0);
+ d->lst->setCapacity(capacity);
+ d->lst->addItem(current.get());
+ d->lst->goToItem(current.get());
+}
+
QList<QWebHistoryItem> QWebPageHistory::items() const
{
const WebCore::HistoryItemVector &items = d->lst->entries();
return QWebHistoryItem(priv);
}
+QWebHistoryItem QWebPageHistory::itemAtIndex(int i) const
+{
+ WebCore::HistoryItem *item = d->lst->itemAtIndex(i);
+
+ QWebHistoryItemPrivate *priv = new QWebHistoryItemPrivate(item);
+ return QWebHistoryItem(priv);
+}
+
QWebPageHistory(const QWebPageHistory &other);
QWebPageHistory &operator=(const QWebPageHistory &other);
~QWebPageHistory();
+
+ void clear();
QList<QWebHistoryItem> items() const;
QList<QWebHistoryItem> backItems(int maxItems) const;
+2007-10-09 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Simon.
+
+ add a clear() method to QWebPageHistory.
+
+ * Api/qwebpagehistory.cpp:
+ (QWebPageHistory::clear):
+ (QWebPageHistory::itemAtIndex):
+ * Api/qwebpagehistory.h:
+
2007-10-05 Lars Knoll <lars@trolltech.com>
add proper error messages to the FrameLoaderClient.