, m_lastModificationTime(std::move(source.m_lastModificationTime))
, m_sessinName(std::move(source.m_sessinName))
, m_isValid(std::move(source.m_isValid))
+ , m_items(std::move(source.m_items))
{
}
Session & Session::operator=(Session&& other)
{
if (this != &other) {
- m_sessionId = std::move(other.m_sessionId);
+ m_sessionId = std::move(other.m_sessionId);
+ m_items = std::move(other.m_items);
m_lastModificationTime = std::move(other.m_lastModificationTime);
m_sessinName = std::move(other.m_sessinName);
m_isValid = std::move(other.m_isValid);
SqlStorage* const storage = SqlStorage::getInstance();
if(storage){
storage->removeItem(*this, tabId);
+ storage->updateSession(*this);
}
}
}
bool SqlStorage::init()
{
+ BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
if(m_isInitialized){
return true;
}
std::string sessionDb(boost::any_cast < std::string > (config.get("DB_SESSION")));
m_dbString = resourceDbDir + sessionDb;
-
bool status = initSessionDatabase();
-
if( status ) {
m_isInitialized = true;
return true;
bool SqlStorage::initSessionDatabase()
{
+ BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
storage::SQLTransactionScope scope(storage::DriverManager::getDatabase(m_dbString));
try{
tizen_browser::services::StorageService::checkAndCreateTable(&scope
Session SqlStorage::getLastSession()
{
- boost::format getLastSessionString("SELECT %1%, %2%, %3% FROM %4% ORDER BY %3% DESC LIMIT 1;");
+ BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
+ boost::format getLastSessionString("SELECT %1%, %2%, %3% FROM %4% ORDER BY %3% DESC LIMIT 1,1;");
getLastSessionString % COL_SESSION_ID % COL_SESSION_NAME % COL_SESSION_DATE % TABLE_SESSION;
unsigned int sessionId;
std::string sessionName;
try{
storage::SQLTransactionScope scope(storage::DriverManager::getDatabase(m_dbString));
std::shared_ptr<storage::SQLDatabase> connection = scope.database();
-
storage::SQLQuery getLastSessionQuery(connection->prepare(getLastSessionString.str()));
getLastSessionQuery.exec();
void SqlStorage::readSession(Session& session, std::shared_ptr< storage::SQLDatabase > connection)
{
+ BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
if(session.isValid()){
boost::format getSessionDataString("SELECT %1%, %2% FROM %3% WHERE %4% = ? ");
getSessionDataString % COL_URL_TABID % COL_URL_URL % TABLE_URL % COL_URL_SESION_ID;