Browse Source

remove extra ns

CPP-GTK4
yggverse 2 months ago
parent
commit
2e441060df
  1. 22
      src/app/browser/main/tab.cpp
  2. 14
      src/app/browser/main/tab/page.cpp

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

@ -53,7 +53,7 @@ int Tab::restore()
{ {
sqlite3_stmt* statement; // @TODO move to the DB model namespace sqlite3_stmt* statement; // @TODO move to the DB model namespace
const int PREPARE_STATUS = ::sqlite3_prepare_v3( const int PREPARE_STATUS = sqlite3_prepare_v3(
db, db,
R"SQL( R"SQL(
SELECT * FROM `app_browser_main_tab__session` ORDER BY `page_number` ASC SELECT * FROM `app_browser_main_tab__session` ORDER BY `page_number` ASC
@ -72,12 +72,12 @@ int Tab::restore()
{ {
const int PAGE_NUMBER = append( const int PAGE_NUMBER = append(
reinterpret_cast<const char*>( reinterpret_cast<const char*>(
::sqlite3_column_text( sqlite3_column_text(
statement, statement,
DB::APP_BROWSER_MAIN_TAB__SESSION::LABEL_TEXT DB::APP_BROWSER_MAIN_TAB__SESSION::LABEL_TEXT
) )
), ),
::sqlite3_column_int( sqlite3_column_int(
statement, statement,
DB::APP_BROWSER_MAIN_TAB__SESSION::IS_CURRENT DB::APP_BROWSER_MAIN_TAB__SESSION::IS_CURRENT
) == 1 ) == 1
@ -85,7 +85,7 @@ int Tab::restore()
} }
} }
::sqlite3_finalize( sqlite3_finalize(
statement statement
); );
@ -338,7 +338,7 @@ int Tab::DB::init(
) { ) {
char * error; char * error;
return ::sqlite3_exec( return sqlite3_exec(
db, db,
R"SQL( R"SQL(
CREATE TABLE IF NOT EXISTS `app_browser_main_tab__session` CREATE TABLE IF NOT EXISTS `app_browser_main_tab__session`
@ -362,7 +362,7 @@ int Tab::DB::clear(
char * error; // @TODO char * error; // @TODO
sqlite3_stmt * statement; sqlite3_stmt * statement;
const int PREPARE_STATUS = ::sqlite3_prepare_v3( const int PREPARE_STATUS = sqlite3_prepare_v3(
db, db,
R"SQL( R"SQL(
SELECT * FROM `app_browser_main_tab__session` SELECT * FROM `app_browser_main_tab__session`
@ -377,13 +377,13 @@ int Tab::DB::clear(
{ {
while (::sqlite3_step(statement) == SQLITE_ROW) while (::sqlite3_step(statement) == SQLITE_ROW)
{ {
const int APP_BROWSER_MAIN_TAB__SESSION_ID = ::sqlite3_column_int( const int APP_BROWSER_MAIN_TAB__SESSION_ID = sqlite3_column_int(
statement, statement,
DB::APP_BROWSER_MAIN_TAB__SESSION::ID DB::APP_BROWSER_MAIN_TAB__SESSION::ID
); );
// Delete record // Delete record
::sqlite3_exec( sqlite3_exec(
db, db,
Glib::ustring::sprintf( Glib::ustring::sprintf(
R"SQL( R"SQL(
@ -404,7 +404,7 @@ int Tab::DB::clear(
} }
} }
return ::sqlite3_finalize( return sqlite3_finalize(
statement statement
); );
} }
@ -417,7 +417,7 @@ sqlite3_int64 Tab::DB::add(
) { ) {
char * error; // @TODO char * error; // @TODO
::sqlite3_exec( sqlite3_exec(
db, db,
Glib::ustring::sprintf( Glib::ustring::sprintf(
R"SQL( R"SQL(
@ -442,7 +442,7 @@ sqlite3_int64 Tab::DB::add(
&error &error
); );
return ::sqlite3_last_insert_rowid( return sqlite3_last_insert_rowid(
db db
); );
} }

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

@ -369,7 +369,7 @@ int Page::DB::init(
) { ) {
char * error; char * error;
return ::sqlite3_exec( return sqlite3_exec(
db, db,
R"SQL( R"SQL(
CREATE TABLE IF NOT EXISTS `app_browser_main_tab_page__session` CREATE TABLE IF NOT EXISTS `app_browser_main_tab_page__session`
@ -394,7 +394,7 @@ int Page::DB::clear(
char * error; // @TODO char * error; // @TODO
sqlite3_stmt * statement; sqlite3_stmt * statement;
const int PREPARE_STATUS = ::sqlite3_prepare_v3( const int PREPARE_STATUS = sqlite3_prepare_v3(
db, db,
Glib::ustring::sprintf( Glib::ustring::sprintf(
R"SQL( R"SQL(
@ -412,7 +412,7 @@ int Page::DB::clear(
{ {
while (::sqlite3_step(statement) == SQLITE_ROW) while (::sqlite3_step(statement) == SQLITE_ROW)
{ {
const int APP_BROWSER_MAIN_TAB_PAGE__SESSION_ID = ::sqlite3_column_int( const int APP_BROWSER_MAIN_TAB_PAGE__SESSION_ID = sqlite3_column_int(
statement, statement,
DB::APP_BROWSER_MAIN_TAB_PAGE__SESSION::ID DB::APP_BROWSER_MAIN_TAB_PAGE__SESSION::ID
); );
@ -420,7 +420,7 @@ int Page::DB::clear(
// @TODO Delegate cleanup to the child components // @TODO Delegate cleanup to the child components
// Delete record // Delete record
::sqlite3_exec( sqlite3_exec(
db, db,
Glib::ustring::sprintf( Glib::ustring::sprintf(
R"SQL( R"SQL(
@ -435,7 +435,7 @@ int Page::DB::clear(
} }
} }
return ::sqlite3_finalize( return sqlite3_finalize(
statement statement
); );
} }
@ -449,7 +449,7 @@ sqlite3_int64 Page::DB::add(
) { ) {
char * error; // @TODO char * error; // @TODO
::sqlite3_exec( sqlite3_exec(
db, db,
Glib::ustring::sprintf( Glib::ustring::sprintf(
R"SQL( R"SQL(
@ -477,7 +477,7 @@ sqlite3_int64 Page::DB::add(
&error &error
); );
return ::sqlite3_last_insert_rowid( return sqlite3_last_insert_rowid(
db db
); );
} }
Loading…
Cancel
Save