remove default values, add follow argument

This commit is contained in:
yggverse 2024-09-05 23:04:53 +03:00
parent 4cde44025f
commit ab0c28badf
4 changed files with 25 additions and 15 deletions

View File

@ -78,7 +78,8 @@ void Page::navigation_update(
if (ADD_HISTORY)
{
pageNavigation->history_add(
pageNavigation->get_request_text()
pageNavigation->get_request_text(),
true
);
}
@ -246,7 +247,7 @@ void Page::navigation_history_back()
{
Glib::ustring request;
if (pageNavigation->try_history_back(request))
if (pageNavigation->try_history_back(request, true))
{
pageNavigation->set_request_text(
request
@ -262,7 +263,7 @@ void Page::navigation_history_forward()
{
Glib::ustring request;
if (pageNavigation->try_history_forward(request))
if (pageNavigation->try_history_forward(request, true))
{
pageNavigation->set_request_text(
request

View File

@ -88,10 +88,12 @@ Navigation::Navigation(
// Actions
void Navigation::history_add(
const Glib::ustring & REQUEST
const Glib::ustring & REQUEST,
const bool & FOLLOW
) {
navigationHistory->add(
REQUEST
REQUEST,
FOLLOW
);
}
@ -153,12 +155,14 @@ Glib::ustring Navigation::get_request_port()
return navigationRequest->get_port();
}
// Actionable getters
bool Navigation::try_history_back(
Glib::ustring & request
Glib::ustring & request,
const bool & FOLLOW
) {
navigation::History::Memory match;
if (navigationHistory->try_back(match))
if (navigationHistory->try_back(match, FOLLOW))
{
request = match.request;
@ -169,11 +173,12 @@ bool Navigation::try_history_back(
}
bool Navigation::try_history_forward(
Glib::ustring & request
Glib::ustring & request,
const bool & FOLLOW
) {
navigation::History::Memory match;
if (navigationHistory->try_forward(match))
if (navigationHistory->try_forward(match, FOLLOW))
{
request = match.request;

View File

@ -38,7 +38,8 @@ namespace app::browser::main::tab::page
// Actions
void history_add(
const Glib::ustring & REQUEST
const Glib::ustring & REQUEST,
const bool & FOLLOW
);
void refresh();
@ -57,12 +58,15 @@ namespace app::browser::main::tab::page
Glib::ustring get_request_path();
Glib::ustring get_request_query();
// Actionable getters
bool try_history_back(
Glib::ustring & request
Glib::ustring & request,
const bool & FOLLOW
);
bool try_history_forward(
Glib::ustring & request
Glib::ustring & request,
const bool & FOLLOW
);
};
}

View File

@ -42,7 +42,7 @@ namespace app::browser::main::tab::page::navigation
// Actions
void add(
const Glib::ustring & REQUEST,
const bool & FOLLOW = true
const bool & FOLLOW
);
void refresh();
@ -51,12 +51,12 @@ namespace app::browser::main::tab::page::navigation
bool try_back(
Memory & match,
const bool & FOLLOW = true
const bool & FOLLOW
);
bool try_forward(
Memory & match,
const bool & FOLLOW = true
const bool & FOLLOW
);
};
}