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(
} }
// Actions // Actions
void Navigation::history_add(
const Glib::ustring & REQUEST,
const bool & UPDATE_MEMORY_INDEX
) {
navigationHistory->add(
REQUEST,
UPDATE_MEMORY_INDEX
);
}
void Navigation::refresh() void Navigation::refresh()
{ {
// Toggle base button sensibility // Toggle base button sensibility
@ -113,15 +103,47 @@ void Navigation::refresh()
navigationHistory->refresh(); navigationHistory->refresh();
} }
// Setters @TODO is really wanted? void Navigation::history_add(
void Navigation::set_request_text( const Glib::ustring & REQUEST,
const Glib::ustring & VALUE const bool & UPDATE_MEMORY_INDEX
) { ) {
navigationRequest->set_text( navigationHistory->add(
VALUE 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 & // Getters @TODO &
@ -155,35 +177,11 @@ Glib::ustring Navigation::get_request_port()
return navigationRequest->get_port(); return navigationRequest->get_port();
} }
// Actionable getters // Setters
bool Navigation::try_history_back( void Navigation::set_request_text(
Glib::ustring & request, const Glib::ustring & VALUE
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
) { ) {
navigation::History::Memory match; navigationRequest->set_text(
VALUE
if (navigationHistory->try_forward(match, UPDATE_MEMORY_INDEX)) );
{
request = match.request;
return true;
}
return false;
} }

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

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

Loading…
Cancel
Save