mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:17:45 +00:00
Browser: Add History::replace_current() function
This function replaces the current history entry with a new history entry.
This commit is contained in:
parent
45214fdb1a
commit
b447e486b5
2 changed files with 10 additions and 0 deletions
|
@ -30,6 +30,15 @@ void History::push(const URL& url, String const& title)
|
|||
m_current++;
|
||||
}
|
||||
|
||||
void History::replace_current(const URL& url, String const& title)
|
||||
{
|
||||
if (m_current == -1)
|
||||
return;
|
||||
|
||||
m_current--;
|
||||
push(url, title);
|
||||
}
|
||||
|
||||
History::URLTitlePair History::current() const
|
||||
{
|
||||
if (m_current == -1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue