Browse Source

add namespace to session methods

CPP-GTK4
yggverse 2 months ago
parent
commit
d8cf3c6d1f
  1. 20
      src/app/browser.cpp
  2. 8
      src/app/browser.hpp
  3. 8
      src/app/browser/main.cpp
  4. 4
      src/app/browser/main.hpp
  5. 12
      src/app/browser/main/tab.cpp
  6. 4
      src/app/browser/main/tab.hpp
  7. 4
      src/app/browser/main/tab/label.cpp
  8. 4
      src/app/browser/main/tab/label.hpp
  9. 8
      src/app/browser/main/tab/page.cpp
  10. 4
      src/app/browser/main/tab/page.hpp
  11. 12
      src/app/browser/main/tab/page/navigation.cpp
  12. 4
      src/app/browser/main/tab/page/navigation.hpp
  13. 4
      src/app/browser/main/tab/page/navigation/history.cpp
  14. 4
      src/app/browser/main/tab/page/navigation/history.hpp
  15. 4
      src/app/browser/main/tab/page/navigation/request.cpp
  16. 4
      src/app/browser/main/tab/page/navigation/request.hpp

20
src/app/browser.cpp

@ -30,7 +30,7 @@ Browser::Browser( @@ -30,7 +30,7 @@ Browser::Browser(
"session_clean",
[this]
{
clean();
session_clean();
}
);
@ -38,7 +38,7 @@ Browser::Browser( @@ -38,7 +38,7 @@ Browser::Browser(
"session_restore",
[this]
{
restore();
session_restore();
}
);
@ -46,7 +46,7 @@ Browser::Browser( @@ -46,7 +46,7 @@ Browser::Browser(
"session_save",
[this]
{
save();
session_save();
}
);
@ -243,14 +243,14 @@ Browser::Browser( @@ -243,14 +243,14 @@ Browser::Browser(
"<Primary>q"
);
restore(); // last session from DB
session_restore(); // last session from DB
}
);
signal_close_request().connect(
[this]
{
save();
session_save();
// @TODO sqlite3_close(db);
@ -261,7 +261,7 @@ Browser::Browser( @@ -261,7 +261,7 @@ Browser::Browser(
}
// Actions
int Browser::restore()
int Browser::session_restore()
{
sqlite3_stmt* statement; // @TODO move to the DB model namespace
@ -298,7 +298,7 @@ int Browser::restore() @@ -298,7 +298,7 @@ int Browser::restore()
) ? fullscreen() : unfullscreen();
// Restore children components
browserMain->restore(
browserMain->session_restore(
sqlite3_column_int(
statement,
DB::SESSION::ID
@ -312,7 +312,7 @@ int Browser::restore() @@ -312,7 +312,7 @@ int Browser::restore()
);
}
void Browser::clean()
void Browser::session_clean()
{
DB::SESSION::clean(
db
@ -321,7 +321,7 @@ void Browser::clean() @@ -321,7 +321,7 @@ void Browser::clean()
browserMain->tab_close_all();
}
void Browser::save()
void Browser::session_save()
{
char * error; // @TODO
@ -339,7 +339,7 @@ void Browser::save() @@ -339,7 +339,7 @@ void Browser::save()
);
// Delegate save actions to children components
browserMain->save(
browserMain->session_save(
APP_BROWSER__SESSION__ID
);
}

8
src/app/browser.hpp

@ -85,11 +85,9 @@ namespace app @@ -85,11 +85,9 @@ namespace app
);
// Actions
int restore(); // return sqlite3_finalize status code
void clean();
void save();
int session_restore(); // return sqlite3_finalize status code
void session_clean();
void session_save();
};
}

8
src/app/browser/main.cpp

@ -45,7 +45,7 @@ Main::Main( @@ -45,7 +45,7 @@ Main::Main(
// Actions
/// Session
int Main::restore(
int Main::session_restore(
const sqlite3_int64 & APP_BROWSER__SESSION__ID
) {
sqlite3_stmt* statement; // @TODO move to the DB model namespace
@ -69,7 +69,7 @@ int Main::restore( @@ -69,7 +69,7 @@ int Main::restore(
{
while (sqlite3_step(statement) == SQLITE_ROW)
{
mainTab->restore(
mainTab->session_restore(
sqlite3_column_int64(
statement,
DB::SESSION::ID
@ -83,7 +83,7 @@ int Main::restore( @@ -83,7 +83,7 @@ int Main::restore(
);
};
void Main::save(
void Main::session_save(
const sqlite3_int64 & APP_BROWSER__SESSION__ID
) {
char * error; // @TODO
@ -101,7 +101,7 @@ void Main::save( @@ -101,7 +101,7 @@ void Main::save(
);
// Delegate save actions to children components
mainTab->save(
mainTab->session_save(
APP_BROWSER_MAIN__SESSION__ID
);
};

4
src/app/browser/main.hpp

@ -95,11 +95,11 @@ namespace app::browser @@ -95,11 +95,11 @@ namespace app::browser
void tab_page_navigation_history_back();
void tab_page_navigation_history_forward();
int restore(
int session_restore(
const sqlite3_int64 & APP_BROWSER__SESSION__ID
); // return sqlite3_finalize status code
void save(
void session_save(
const sqlite3_int64 & APP_BROWSER__SESSION__ID
);

12
src/app/browser/main/tab.cpp

@ -40,7 +40,7 @@ Tab::Tab( @@ -40,7 +40,7 @@ Tab::Tab(
);
}
int Tab::restore(
int Tab::session_restore(
const sqlite3_int64 & APP_BROWSER_MAIN__SESSION__ID
) {
sqlite3_stmt* statement; // @TODO move to the DB model namespace
@ -76,7 +76,7 @@ int Tab::restore( @@ -76,7 +76,7 @@ int Tab::restore(
// Restore children components
get_tabLabel(
PAGE_NUMBER
)->restore(
)->session_restore(
sqlite3_column_int64(
statement,
DB::SESSION::ID
@ -85,7 +85,7 @@ int Tab::restore( @@ -85,7 +85,7 @@ int Tab::restore(
get_tabPage(
PAGE_NUMBER
)->restore(
)->session_restore(
sqlite3_column_int64(
statement,
DB::SESSION::ID
@ -99,7 +99,7 @@ int Tab::restore( @@ -99,7 +99,7 @@ int Tab::restore(
);
}
void Tab::save(
void Tab::session_save(
const sqlite3_int64 & APP_BROWSER_MAIN__SESSION__ID
) {
char * error; // @TODO
@ -124,13 +124,13 @@ void Tab::save( @@ -124,13 +124,13 @@ void Tab::save(
// Delegate save actions to children components
get_tabLabel(
page_number
)->save(
)->session_save(
APP_BROWSER_MAIN_TAB__SESSION__ID
);
get_tabPage(
page_number
)->save(
)->session_save(
APP_BROWSER_MAIN_TAB__SESSION__ID
);
}

4
src/app/browser/main/tab.hpp

@ -123,11 +123,11 @@ namespace app::browser::main @@ -123,11 +123,11 @@ namespace app::browser::main
const int & PAGE_NUMBER
);
int restore(
int session_restore(
const sqlite3_int64 & APP_BROWSER_MAIN__SESSION__ID
); // return sqlite3_finalize status code
void save(
void session_save(
const sqlite3_int64 & APP_BROWSER_MAIN__SESSION__ID
);

4
src/app/browser/main/tab/label.cpp

@ -44,7 +44,7 @@ Label::Label( @@ -44,7 +44,7 @@ Label::Label(
}
// Actions
int Label::restore(
int Label::session_restore(
const sqlite3_int64 & APP_BROWSER_MAIN_TAB__SESSION__ID
) {
sqlite3_stmt * statement;
@ -89,7 +89,7 @@ int Label::restore( @@ -89,7 +89,7 @@ int Label::restore(
);
}
int Label::save(
int Label::session_save(
const sqlite3_int64 & APP_BROWSER_MAIN_TAB__SESSION__ID
) {
// Delegate save action to child components (on available)

4
src/app/browser/main/tab/label.hpp

@ -72,11 +72,11 @@ namespace app::browser::main::tab @@ -72,11 +72,11 @@ namespace app::browser::main::tab
);
// Actions
int restore(
int session_restore(
const sqlite3_int64 & APP_BROWSER_MAIN_TAB__SESSION__ID
); // return sqlite3_finalize status code
int save(
int session_save(
const sqlite3_int64 & APP_BROWSER_MAIN_TAB__SESSION__ID
); // return sqlite3_finalize status code
};

8
src/app/browser/main/tab/page.cpp

@ -90,7 +90,7 @@ Page::Page( @@ -90,7 +90,7 @@ Page::Page(
}
// Actions
int Page::restore(
int Page::session_restore(
const sqlite3_int64 & APP_BROWSER_MAIN_TAB__SESSION__ID
) {
sqlite3_stmt* statement; // @TODO move to the DB model namespace
@ -145,7 +145,7 @@ int Page::restore( @@ -145,7 +145,7 @@ int Page::restore(
);
// Restore children components
pageNavigation->restore(
pageNavigation->session_restore(
sqlite3_column_int64(
statement,
DB::SESSION::ID
@ -159,11 +159,11 @@ int Page::restore( @@ -159,11 +159,11 @@ int Page::restore(
);
}
void Page::save(
void Page::session_save(
const sqlite3_int64 & APP_BROWSER_MAIN_TAB__SESSION__ID
) {
// Delegate save action to child components
pageNavigation->save(
pageNavigation->session_save(
DB::SESSION::add(
db,
APP_BROWSER_MAIN_TAB__SESSION__ID,

4
src/app/browser/main/tab/page.hpp

@ -121,11 +121,11 @@ namespace app::browser::main::tab @@ -121,11 +121,11 @@ namespace app::browser::main::tab
);
// Actions
int restore(
int session_restore(
const sqlite3_int64 & APP_BROWSER_MAIN_TAB__SESSION__ID
); // return sqlite3_finalize status code
void save(
void session_save(
const sqlite3_int64 & APP_BROWSER_MAIN_TAB__SESSION__ID
);

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

@ -109,7 +109,7 @@ void Navigation::update( @@ -109,7 +109,7 @@ void Navigation::update(
);
}
int Navigation::restore(
int Navigation::session_restore(
const sqlite3_int64 & APP_BROWSER_MAIN_TAB_PAGE__SESSION__ID
) {
sqlite3_stmt* statement; // @TODO move to the DB model namespace
@ -136,14 +136,14 @@ int Navigation::restore( @@ -136,14 +136,14 @@ int Navigation::restore(
while (sqlite3_step(statement) == SQLITE_ROW)
{
// Restore children components
navigationHistory->restore(
navigationHistory->session_restore(
sqlite3_column_int64(
statement,
DB::SESSION::ID
)
);
navigationRequest->restore(
navigationRequest->session_restore(
sqlite3_column_int64(
statement,
DB::SESSION::ID
@ -157,7 +157,7 @@ int Navigation::restore( @@ -157,7 +157,7 @@ int Navigation::restore(
);
}
void Navigation::save(
void Navigation::session_save(
const sqlite3_int64 & APP_BROWSER_MAIN_TAB_PAGE__SESSION__ID
) {
// Delete previous session
@ -173,11 +173,11 @@ void Navigation::save( @@ -173,11 +173,11 @@ void Navigation::save(
);
// Delegate save action to children components
navigationHistory->save(
navigationHistory->session_save(
APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION__ID
);
navigationRequest->save(
navigationRequest->session_save(
APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION__ID
);
}

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

@ -94,11 +94,11 @@ namespace app::browser::main::tab::page @@ -94,11 +94,11 @@ namespace app::browser::main::tab::page
const double & PROGRESS_FRACTION
);
int restore(
int session_restore(
const sqlite3_int64 & APP_BROWSER_MAIN_TAB_PAGE__SESSION__ID
); // return sqlite3_finalize status code
void save(
void session_save(
const sqlite3_int64 & APP_BROWSER_MAIN_TAB_PAGE__SESSION__ID
);

4
src/app/browser/main/tab/page/navigation/history.cpp

@ -56,7 +56,7 @@ void History::add( @@ -56,7 +56,7 @@ void History::add(
}
}
int History::restore(
int History::session_restore(
const sqlite3_int64 & APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION__ID
) {
sqlite3_stmt* statement; // @TODO move to the DB model namespace
@ -124,7 +124,7 @@ int History::restore( @@ -124,7 +124,7 @@ int History::restore(
);
}
void History::save(
void History::session_save(
const sqlite3_int64 & APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION__ID
) {
// Delete previous records for session

4
src/app/browser/main/tab/page/navigation/history.hpp

@ -102,11 +102,11 @@ namespace app::browser::main::tab::page::navigation @@ -102,11 +102,11 @@ namespace app::browser::main::tab::page::navigation
const bool & UPDATE_MEMORY_INDEX
);
int restore(
int session_restore(
const sqlite3_int64 & APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION__ID
); // return sqlite3_finalize status code
void save(
void session_save(
const sqlite3_int64 & APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION__ID
);

4
src/app/browser/main/tab/page/navigation/request.cpp

@ -89,7 +89,7 @@ void Request::update( @@ -89,7 +89,7 @@ void Request::update(
);
}
int Request::restore(
int Request::session_restore(
const sqlite3_int64 & APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION__ID
) {
sqlite3_stmt* statement; // @TODO move to the DB model namespace
@ -134,7 +134,7 @@ int Request::restore( @@ -134,7 +134,7 @@ int Request::restore(
);
}
int Request::save(
int Request::session_save(
const sqlite3_int64 & APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION__ID
) {
// Delete previous records

4
src/app/browser/main/tab/page/navigation/request.hpp

@ -89,11 +89,11 @@ namespace app::browser::main::tab::page::navigation @@ -89,11 +89,11 @@ namespace app::browser::main::tab::page::navigation
const double & PROGRESS_FRACTION
);
int restore(
int session_restore(
const sqlite3_int64 & APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION__ID
); // return sqlite3_finalize status code
int save(
int session_save(
const sqlite3_int64 & APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION__ID
);
};

Loading…
Cancel
Save