Fix updateSessionName in SQLStorage 08/49908/3
authorKamil Nowac <k.nowac@samsung.com>
Wed, 21 Oct 2015 11:01:27 +0000 (13:01 +0200)
committerKamil Nowa? <k.nowac@samsung.com>
Wed, 21 Oct 2015 11:23:33 +0000 (04:23 -0700)
[Issue] https://bugs.tizen.org/jira/browse/TT-218
[Problem] Function does not update name
[Solution] Changed usage of parameter
[Verification] Currently not used so
it must be tested directly from the code.

Change-Id: I16576b3abca48eabc5fab8c8077afacd0c531f47

services/SessionStorage/SqlStorage.cpp
services/SessionStorage/SqlStorage.h

index 95e477f..8d21f0e 100644 (file)
@@ -304,11 +304,8 @@ void SqlStorage::clearSession(const Session& session,
     }
 }
 
-void SqlStorage::updateSessionName(Session& session, std::string newName)
+void SqlStorage::updateSessionName(Session& session, const std::string& newName)
 {
-    //FIXME - newName not used! The sql query creation below should be fixed.
-    // submitted bug: https://bugs.tizen.org/jira/browse/TT-218
-    (void)newName;
     if(session.isValid()){
         boost::format updateSessionNameString("UPDATE %1%  SET %2% = ?  WHERE %3% = ?" );
         updateSessionNameString % TABLE_SESSION % COL_SESSION_NAME % COL_SESSION_ID;
@@ -318,7 +315,7 @@ void SqlStorage::updateSessionName(Session& session, std::string newName)
 
         try{
             storage::SQLQuery updateSessionNameQuery(connection->prepare(updateSessionNameString.str()));
-            updateSessionNameQuery.bindText(1, session.sessionName());
+            updateSessionNameQuery.bindText(1, newName);
             updateSessionNameQuery.bindInt(2, session.sessionId());
             updateSessionNameQuery.exec();
         }catch( storage::StorageException &e){
index cdef84c..77ea296 100644 (file)
@@ -78,7 +78,7 @@ public:
     /**
      * Change session name.
      */
-    void updateSessionName(tizen_browser::Session::Session& session, std::string newName);
+    void updateSessionName(tizen_browser::Session::Session& session, const std::string& newName);
 
     /**
      * Deletes item form session, and stores changes.