Fixed bug that 2nd app control is not working 80/46780/2
authorJung Ick Guack <ji.guack@samsung.com>
Wed, 26 Aug 2015 06:01:02 +0000 (15:01 +0900)
committerJung Ick Guack <ji.guack@samsung.com>
Wed, 26 Aug 2015 06:10:16 +0000 (15:10 +0900)
[Issue#]    HQ Synergy TF team reported the issue
[Problem]   Only 1st app control is working.
            After 2nd app control is not working.
[Cause]     There is wrong scope for first initializing code when start SimpleUI::exec
[Sollution] Move opening new tab to out of first initializing scope.
[Verify]    App control should open the tab even after 2nd command.
            HQ Synergy TF team verified thie fix.

Change-Id: Ic59d7e977c07a90de6aea455224d4bb44db7c922
Signed-off-by: Jung Ick Guack <ji.guack@samsung.com>
services/SimpleUI/SimpleUI.cpp

index c5e2385939dc05771be9b8b40005f57dca912e3f..965cc3e1bc6799bf0a74ff5e3c14fcd33b88de8d 100644 (file)
@@ -310,29 +310,29 @@ int SimpleUI::exec(const std::string& _url)
         m_mainUI->bookmarkClicked.connect(boost::bind(&SimpleUI::onBookmarkButtonClicked, this,_1));
         m_mainUI->bookmarkManagerClicked.connect(boost::bind(&SimpleUI::onBookmarkManagerButtonClicked, this,_1));
 
-        // only when first run
-        if (url.empty()) {
-            BROWSER_LOGD("[%s]: changing to homeUrl", __func__);
-            switchViewToHomePage();
+       }
+
+       if (url.empty()) {
+               BROWSER_LOGD("[%s]: changing to homeUrl", __func__);
+               switchViewToHomePage();
 #if MERGE_ME // Not sure if this should be enabled
-            filterURL(HomePageURL);
+               filterURL(HomePageURL);
 #endif
-            if(lastSession.items().size() >= 1){
-                for(auto iter=lastSession.items().begin(),
-                          end=lastSession.items().end();
-                    iter != end;
-                    iter++
-                ){
-                    openNewTab(iter->second);
-                }
-                m_sessionService->getStorage()->deleteSession(lastSession);
-            }
-        }
-        else
-            openNewTab(url);
-    }
-
-    BROWSER_LOGD("[%s]:%d url=%s", __func__, __LINE__, url.c_str());
+               if(lastSession.items().size() >= 1){
+                       for(auto iter=lastSession.items().begin(),
+                               end=lastSession.items().end();
+                               iter != end;
+                               iter++
+                               ){
+                                       openNewTab(iter->second);
+                               }
+                               m_sessionService->getStorage()->deleteSession(lastSession);
+                       }
+               }
+               else
+                       openNewTab(url);
+
+       BROWSER_LOGD("[%s]:%d url=%s", __func__, __LINE__, url.c_str());
 
     m_simpleURI->setFocus();