mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-03-12 21:51:20 +00:00
skip add same request value on history argument enabled
This commit is contained in:
parent
a8c59d5642
commit
2c144c3182
@ -161,10 +161,20 @@ void Page::navigation_reload(
|
|||||||
// Update navigation history?
|
// Update navigation history?
|
||||||
if (ADD_HISTORY)
|
if (ADD_HISTORY)
|
||||||
{
|
{
|
||||||
pageNavigation->history_add(
|
// Skip same
|
||||||
pageNavigation->get_request_text(),
|
Glib::ustring request;
|
||||||
true
|
|
||||||
|
pageNavigation->try_history_current(
|
||||||
|
request
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (request != pageNavigation->get_request_text())
|
||||||
|
{
|
||||||
|
pageNavigation->history_add(
|
||||||
|
pageNavigation->get_request_text(),
|
||||||
|
true
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset page data
|
// Reset page data
|
||||||
|
@ -209,6 +209,21 @@ bool Navigation::try_history_back(
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Navigation::try_history_current(
|
||||||
|
Glib::ustring & request
|
||||||
|
) {
|
||||||
|
navigation::History::Memory match;
|
||||||
|
|
||||||
|
if (navigationHistory->try_current(match))
|
||||||
|
{
|
||||||
|
request = match.request;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
bool Navigation::try_history_forward(
|
bool Navigation::try_history_forward(
|
||||||
Glib::ustring & request,
|
Glib::ustring & request,
|
||||||
const bool & UPDATE_MEMORY_INDEX
|
const bool & UPDATE_MEMORY_INDEX
|
||||||
|
@ -112,6 +112,10 @@ namespace app::browser::main::tab::page
|
|||||||
const bool & UPDATE_MEMORY_INDEX
|
const bool & UPDATE_MEMORY_INDEX
|
||||||
);
|
);
|
||||||
|
|
||||||
|
bool try_history_current(
|
||||||
|
Glib::ustring & request
|
||||||
|
);
|
||||||
|
|
||||||
bool try_history_forward(
|
bool try_history_forward(
|
||||||
Glib::ustring & request,
|
Glib::ustring & request,
|
||||||
const bool & UPDATE_MEMORY_INDEX
|
const bool & UPDATE_MEMORY_INDEX
|
||||||
|
@ -189,6 +189,24 @@ bool History::try_back(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool History::try_current(
|
||||||
|
Memory & match
|
||||||
|
) {
|
||||||
|
try
|
||||||
|
{
|
||||||
|
match = memory.at(
|
||||||
|
index
|
||||||
|
);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
catch (std::out_of_range)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool History::try_forward(
|
bool History::try_forward(
|
||||||
Memory & match,
|
Memory & match,
|
||||||
const bool & UPDATE_MEMORY_INDEX
|
const bool & UPDATE_MEMORY_INDEX
|
||||||
|
@ -117,6 +117,10 @@ namespace app::browser::main::tab::page::navigation
|
|||||||
const bool & UPDATE_MEMORY_INDEX
|
const bool & UPDATE_MEMORY_INDEX
|
||||||
);
|
);
|
||||||
|
|
||||||
|
bool try_current(
|
||||||
|
Memory & match
|
||||||
|
);
|
||||||
|
|
||||||
bool try_forward(
|
bool try_forward(
|
||||||
Memory & match,
|
Memory & match,
|
||||||
const bool & UPDATE_MEMORY_INDEX
|
const bool & UPDATE_MEMORY_INDEX
|
||||||
|
Loading…
x
Reference in New Issue
Block a user