diff options
| author | Karol Kosek <krkk@krkk.ct8.pl> | 2021-01-11 19:08:48 +0100 |
|---|---|---|
| committer | Felix Queißner <felix@ib-queissner.de> | 2021-01-11 20:29:21 +0100 |
| commit | 3a5b99104288d292dc3ab2935617268f335cd455 (patch) | |
| tree | 46d85f3073cdfdc730add8b28262f40b8984e920 /src | |
| parent | db0202cc36512f30c7a20068834d37bf8e6490a3 (diff) | |
| download | kristall-3a5b99104288d292dc3ab2935617268f335cd455.tar.gz | |
Replace history on redirect
Diffstat (limited to 'src')
| -rw-r--r-- | src/browsertab.cpp | 1 | ||||
| -rw-r--r-- | src/tabbrowsinghistory.cpp | 5 | ||||
| -rw-r--r-- | src/tabbrowsinghistory.hpp | 1 |
3 files changed, 7 insertions, 0 deletions
diff --git a/src/browsertab.cpp b/src/browsertab.cpp index ef3bb48..1682069 100644 --- a/src/browsertab.cpp +++ b/src/browsertab.cpp @@ -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 { diff --git a/src/tabbrowsinghistory.cpp b/src/tabbrowsinghistory.cpp index 5f2cba4..5cb03ae 100644 --- a/src/tabbrowsinghistory.cpp +++ b/src/tabbrowsinghistory.cpp @@ -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()) diff --git a/src/tabbrowsinghistory.hpp b/src/tabbrowsinghistory.hpp index 8adee30..c1e20e7 100644 --- a/src/tabbrowsinghistory.hpp +++ b/src/tabbrowsinghistory.hpp @@ -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; |
