|
|
@ -66,11 +66,11 @@ Tab::Tab( |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Tab::session_restore() |
|
|
|
int Tab::session_restore() |
|
|
|
{ |
|
|
|
{ |
|
|
|
sqlite3_stmt* statement; |
|
|
|
sqlite3_stmt* statement; |
|
|
|
|
|
|
|
|
|
|
|
const int PREPARE = ::sqlite3_prepare_v3( |
|
|
|
const int PREPARE_STATUS = ::sqlite3_prepare_v3( |
|
|
|
this->db, |
|
|
|
this->db, |
|
|
|
R"SQL( |
|
|
|
R"SQL( |
|
|
|
SELECT * FROM `app_browser_main_tab__session` ORDER BY `number` ASC |
|
|
|
SELECT * FROM `app_browser_main_tab__session` ORDER BY `number` ASC |
|
|
@ -81,7 +81,7 @@ void Tab::session_restore() |
|
|
|
nullptr |
|
|
|
nullptr |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
if (PREPARE == SQLITE_OK) |
|
|
|
if (PREPARE_STATUS == SQLITE_OK) |
|
|
|
{ |
|
|
|
{ |
|
|
|
close_all(); |
|
|
|
close_all(); |
|
|
|
|
|
|
|
|
|
|
@ -109,17 +109,19 @@ void Tab::session_restore() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
sqlite3_finalize( |
|
|
|
::sqlite3_finalize( |
|
|
|
statement |
|
|
|
statement |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return PREPARE_STATUS; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Tab::session_save() |
|
|
|
int Tab::session_save() |
|
|
|
{ |
|
|
|
{ |
|
|
|
char * error; // @TODO
|
|
|
|
char * error; // @TODO
|
|
|
|
|
|
|
|
|
|
|
|
// Delete previous tab session
|
|
|
|
// Delete previous tab session
|
|
|
|
::sqlite3_exec( |
|
|
|
const int EXEC_STATUS = ::sqlite3_exec( |
|
|
|
db, |
|
|
|
db, |
|
|
|
R"SQL( |
|
|
|
R"SQL( |
|
|
|
DELETE FROM `app_browser_main_tab__session` |
|
|
|
DELETE FROM `app_browser_main_tab__session` |
|
|
@ -129,6 +131,8 @@ void Tab::session_save() |
|
|
|
&error |
|
|
|
&error |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (EXEC_STATUS == SQLITE_OK) |
|
|
|
|
|
|
|
{ |
|
|
|
// Save current tab session
|
|
|
|
// Save current tab session
|
|
|
|
for (int page_number = 0; page_number < get_n_pages(); page_number++) |
|
|
|
for (int page_number = 0; page_number < get_n_pages(); page_number++) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -163,6 +167,9 @@ void Tab::session_save() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return EXEC_STATUS; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Tab::shutdown() |
|
|
|
void Tab::shutdown() |
|
|
|
{ |
|
|
|
{ |
|
|
|
session_save(); |
|
|
|
session_save(); |
|
|
|