diff --git a/src/app/browser.cpp b/src/app/browser.cpp index a054a5f9..fa215a3a 100644 --- a/src/app/browser.cpp +++ b/src/app/browser.cpp @@ -30,7 +30,7 @@ Browser::Browser( "session_clean", [this] { - clean(); + session_clean(); } ); @@ -38,7 +38,7 @@ Browser::Browser( "session_restore", [this] { - restore(); + session_restore(); } ); @@ -46,7 +46,7 @@ Browser::Browser( "session_save", [this] { - save(); + session_save(); } ); @@ -243,14 +243,14 @@ Browser::Browser( "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( } // 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() ) ? fullscreen() : unfullscreen(); // Restore children components - browserMain->restore( + browserMain->session_restore( sqlite3_column_int( statement, DB::SESSION::ID @@ -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() browserMain->tab_close_all(); } -void Browser::save() +void Browser::session_save() { char * error; // @TODO @@ -339,7 +339,7 @@ void Browser::save() ); // Delegate save actions to children components - browserMain->save( + browserMain->session_save( APP_BROWSER__SESSION__ID ); } diff --git a/src/app/browser.hpp b/src/app/browser.hpp index b0ee76be..f2debd9d 100644 --- a/src/app/browser.hpp +++ b/src/app/browser.hpp @@ -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(); }; } diff --git a/src/app/browser/main.cpp b/src/app/browser/main.cpp index ac202673..f56447aa 100644 --- a/src/app/browser/main.cpp +++ b/src/app/browser/main.cpp @@ -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( { 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( ); }; -void Main::save( +void Main::session_save( const sqlite3_int64 & APP_BROWSER__SESSION__ID ) { char * error; // @TODO @@ -101,7 +101,7 @@ void Main::save( ); // Delegate save actions to children components - mainTab->save( + mainTab->session_save( APP_BROWSER_MAIN__SESSION__ID ); }; diff --git a/src/app/browser/main.hpp b/src/app/browser/main.hpp index 2ae8f884..c3703cad 100644 --- a/src/app/browser/main.hpp +++ b/src/app/browser/main.hpp @@ -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 ); diff --git a/src/app/browser/main/tab.cpp b/src/app/browser/main/tab.cpp index 649dc898..21d19196 100644 --- a/src/app/browser/main/tab.cpp +++ b/src/app/browser/main/tab.cpp @@ -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( // Restore children components get_tabLabel( PAGE_NUMBER - )->restore( + )->session_restore( sqlite3_column_int64( statement, DB::SESSION::ID @@ -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( ); } -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( // 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 ); } diff --git a/src/app/browser/main/tab.hpp b/src/app/browser/main/tab.hpp index 81a17f1b..bd0c01e8 100644 --- a/src/app/browser/main/tab.hpp +++ b/src/app/browser/main/tab.hpp @@ -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 ); diff --git a/src/app/browser/main/tab/label.cpp b/src/app/browser/main/tab/label.cpp index b86d0342..25e87d16 100644 --- a/src/app/browser/main/tab/label.cpp +++ b/src/app/browser/main/tab/label.cpp @@ -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( ); } -int Label::save( +int Label::session_save( const sqlite3_int64 & APP_BROWSER_MAIN_TAB__SESSION__ID ) { // Delegate save action to child components (on available) diff --git a/src/app/browser/main/tab/label.hpp b/src/app/browser/main/tab/label.hpp index 032662d5..f2948454 100644 --- a/src/app/browser/main/tab/label.hpp +++ b/src/app/browser/main/tab/label.hpp @@ -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 }; diff --git a/src/app/browser/main/tab/page.cpp b/src/app/browser/main/tab/page.cpp index 948aad62..8936033f 100644 --- a/src/app/browser/main/tab/page.cpp +++ b/src/app/browser/main/tab/page.cpp @@ -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( ); // Restore children components - pageNavigation->restore( + pageNavigation->session_restore( sqlite3_column_int64( statement, DB::SESSION::ID @@ -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, diff --git a/src/app/browser/main/tab/page.hpp b/src/app/browser/main/tab/page.hpp index 7cf7eb8e..9ae19f22 100644 --- a/src/app/browser/main/tab/page.hpp +++ b/src/app/browser/main/tab/page.hpp @@ -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 ); diff --git a/src/app/browser/main/tab/page/navigation.cpp b/src/app/browser/main/tab/page/navigation.cpp index 07a9c22f..1ba754c9 100644 --- a/src/app/browser/main/tab/page/navigation.cpp +++ b/src/app/browser/main/tab/page/navigation.cpp @@ -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( 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( ); } -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( ); // 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 ); } diff --git a/src/app/browser/main/tab/page/navigation.hpp b/src/app/browser/main/tab/page/navigation.hpp index c9673431..8a871b1d 100644 --- a/src/app/browser/main/tab/page/navigation.hpp +++ b/src/app/browser/main/tab/page/navigation.hpp @@ -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 ); diff --git a/src/app/browser/main/tab/page/navigation/history.cpp b/src/app/browser/main/tab/page/navigation/history.cpp index d9065d55..95dba158 100644 --- a/src/app/browser/main/tab/page/navigation/history.cpp +++ b/src/app/browser/main/tab/page/navigation/history.cpp @@ -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( ); } -void History::save( +void History::session_save( const sqlite3_int64 & APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION__ID ) { // Delete previous records for session diff --git a/src/app/browser/main/tab/page/navigation/history.hpp b/src/app/browser/main/tab/page/navigation/history.hpp index 1216bcc0..13b1f8a8 100644 --- a/src/app/browser/main/tab/page/navigation/history.hpp +++ b/src/app/browser/main/tab/page/navigation/history.hpp @@ -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 ); diff --git a/src/app/browser/main/tab/page/navigation/request.cpp b/src/app/browser/main/tab/page/navigation/request.cpp index d42e268a..3329d2b9 100644 --- a/src/app/browser/main/tab/page/navigation/request.cpp +++ b/src/app/browser/main/tab/page/navigation/request.cpp @@ -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( ); } -int Request::save( +int Request::session_save( const sqlite3_int64 & APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION__ID ) { // Delete previous records diff --git a/src/app/browser/main/tab/page/navigation/request.hpp b/src/app/browser/main/tab/page/navigation/request.hpp index a6f1869b..8ab78c6e 100644 --- a/src/app/browser/main/tab/page/navigation/request.hpp +++ b/src/app/browser/main/tab/page/navigation/request.hpp @@ -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 ); };