mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-30 00:31:14 +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
Notes:
sideshowbarker
2024-07-17 04:02:40 +09:00
Author: https://github.com/Baitinq Commit: https://github.com/SerenityOS/serenity/commit/b447e486b5 Pull-request: https://github.com/SerenityOS/serenity/pull/16004 Reviewed-by: https://github.com/davidot ✅
|
@ -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)
|
||||
|
|
|
@ -20,6 +20,7 @@ public:
|
|||
void dump() const;
|
||||
|
||||
void push(const URL& url, String const& title);
|
||||
void replace_current(const URL& url, String const& title);
|
||||
void update_title(String const& title);
|
||||
URLTitlePair current() const;
|
||||
|
||||
|
|
Loading…
Reference in a new issue