Browse Source

reorder methods

CPP-GTK4
yggverse 3 months ago
parent
commit
50df17a119
  1. 90
      src/app/browser/main/tab/page/navigation.cpp
  2. 26
      src/app/browser/main/tab/page/navigation.hpp

90
src/app/browser/main/tab/page/navigation.cpp

@ -87,16 +87,6 @@ Navigation::Navigation( @@ -87,16 +87,6 @@ Navigation::Navigation(
}
// Actions
void Navigation::history_add(
const Glib::ustring & REQUEST,
const bool & UPDATE_MEMORY_INDEX
) {
navigationHistory->add(
REQUEST,
UPDATE_MEMORY_INDEX
);
}
void Navigation::refresh()
{
// Toggle base button sensibility
@ -113,15 +103,47 @@ void Navigation::refresh() @@ -113,15 +103,47 @@ void Navigation::refresh()
navigationHistory->refresh();
}
// Setters @TODO is really wanted?
void Navigation::set_request_text(
const Glib::ustring & VALUE
void Navigation::history_add(
const Glib::ustring & REQUEST,
const bool & UPDATE_MEMORY_INDEX
) {
navigationRequest->set_text(
VALUE
navigationHistory->add(
REQUEST,
UPDATE_MEMORY_INDEX
);
}
// Actionable getters
bool Navigation::try_history_back(
Glib::ustring & request,
const bool & UPDATE_MEMORY_INDEX
) {
navigation::History::Memory match;
if (navigationHistory->try_back(match, UPDATE_MEMORY_INDEX))
{
request = match.request;
return true;
}
// refresh(); not wanted as on change listener do same @TODO
return false;
}
bool Navigation::try_history_forward(
Glib::ustring & request,
const bool & UPDATE_MEMORY_INDEX
) {
navigation::History::Memory match;
if (navigationHistory->try_forward(match, UPDATE_MEMORY_INDEX))
{
request = match.request;
return true;
}
return false;
}
// Getters @TODO &
@ -155,35 +177,11 @@ Glib::ustring Navigation::get_request_port() @@ -155,35 +177,11 @@ Glib::ustring Navigation::get_request_port()
return navigationRequest->get_port();
}
// Actionable getters
bool Navigation::try_history_back(
Glib::ustring & request,
const bool & UPDATE_MEMORY_INDEX
) {
navigation::History::Memory match;
if (navigationHistory->try_back(match, UPDATE_MEMORY_INDEX))
{
request = match.request;
return true;
}
return false;
}
bool Navigation::try_history_forward(
Glib::ustring & request,
const bool & UPDATE_MEMORY_INDEX
// Setters
void Navigation::set_request_text(
const Glib::ustring & VALUE
) {
navigation::History::Memory match;
if (navigationHistory->try_forward(match, UPDATE_MEMORY_INDEX))
{
request = match.request;
return true;
}
return false;
navigationRequest->set_text(
VALUE
);
}

26
src/app/browser/main/tab/page/navigation.hpp

@ -37,16 +37,22 @@ namespace app::browser::main::tab::page @@ -37,16 +37,22 @@ namespace app::browser::main::tab::page
);
// Actions
void refresh();
void history_add(
const Glib::ustring & REQUEST,
const bool & UPDATE_MEMORY_INDEX
);
void refresh();
// Actionable getters
bool try_history_back(
Glib::ustring & request,
const bool & UPDATE_MEMORY_INDEX
);
// Setters
void set_request_text(
const Glib::ustring & VALUE
bool try_history_forward(
Glib::ustring & request,
const bool & UPDATE_MEMORY_INDEX
);
// Getters
@ -58,15 +64,9 @@ namespace app::browser::main::tab::page @@ -58,15 +64,9 @@ 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,
const bool & UPDATE_MEMORY_INDEX
);
bool try_history_forward(
Glib::ustring & request,
const bool & UPDATE_MEMORY_INDEX
// Setters
void set_request_text(
const Glib::ustring & VALUE
);
};
}

Loading…
Cancel
Save