Replace history on redirect
This commit is contained in:
parent
db0202cc36
commit
3a5b991042
|
@ -883,6 +883,7 @@ void BrowserTab::on_redirected(QUrl uri, bool is_permanent)
|
|||
redirection_count += 1;
|
||||
this->current_location = uri;
|
||||
this->setUrlBarText(uri.toString(QUrl::FullyEncoded));
|
||||
this->history.replaceUrl(this->current_history_index.row(), uri);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -30,6 +30,11 @@ QModelIndex TabBrowsingHistory::pushUrl(QModelIndex const & position, const QUrl
|
|||
return this->createIndex(this->history.size() - 1, 0);
|
||||
}
|
||||
|
||||
void TabBrowsingHistory::replaceUrl(size_t const position, QUrl const & url)
|
||||
{
|
||||
this->history.replace(position, url);
|
||||
}
|
||||
|
||||
QUrl TabBrowsingHistory::get(const QModelIndex &index) const
|
||||
{
|
||||
if(not index.isValid())
|
||||
|
|
|
@ -17,6 +17,7 @@ public:
|
|||
bool canGoForward() const;
|
||||
|
||||
QModelIndex pushUrl(QModelIndex const & position, QUrl const & url);
|
||||
void replaceUrl(size_t const position, QUrl const & url);
|
||||
|
||||
QUrl get(QModelIndex const & index) const;
|
||||
|
||||
|
|
Loading…
Reference in New Issue