201041 default
authorhgs
Tue, 19 Oct 2010 16:27:19 +0800
changeset 53 01c62bde3a2a
parent 50 024e23fdab18
201041
userguide/Userguide.pro
userguide/inc/HelpMainWindow.h
userguide/src/HelpMainWindow.cpp
--- a/userguide/Userguide.pro	Fri Oct 01 17:11:20 2010 +0800
+++ b/userguide/Userguide.pro	Tue Oct 19 16:27:19 2010 +0800
@@ -65,7 +65,9 @@
     INCLUDEPATH += /sf/mw/webruntime/wrt/runtimecore
 		INCLUDEPATH += /sf/mw/webruntime/wrt
 		DEFINES += CWRT_BUILDING_TENONE
-  	LIBS += -lRuntimeCore -lezip -lxqservice -lxqserviceutil -lcone -leikcore -lmediaclientaudio -leikcoctl -leiksrv -lapparc -lavkon -lefsrv -lcharconv -lws32 -lhal -lgdi -lapgrfx
+  	LIBS += -lRuntimeCore -lezip -lxqservice -lxqserviceutil -lcone -leikcore -lmediaclientaudio \
+            -leikcoctl -leiksrv -lapparc -lavkon -lefsrv -lcharconv -lws32 -lhal -lgdi -lapgrfx \
+            -lafservice
   	include(rom/userguide.pri)
   	SKINICON = qtg_large_help
 }
--- a/userguide/inc/HelpMainWindow.h	Fri Oct 01 17:11:20 2010 +0800
+++ b/userguide/inc/HelpMainWindow.h	Tue Oct 19 16:27:19 2010 +0800
@@ -27,6 +27,7 @@
 class HelpCategoryView;
 class HelpKeywordView;
 class HelpContentsView;
+class AfActivityStorage;
 
 class HelpMainWindow : public HbMainWindow
 {
@@ -57,6 +58,7 @@
 	HelpKeywordView* mKeywordView;
 	HelpContentsView* mContentsView;
 	HelpViewName mPreviousViewName;
+	AfActivityStorage* mActivityStorage;
 };
 
 #endif //HELPMAINWINDOW_H
--- a/userguide/src/HelpMainWindow.cpp	Fri Oct 01 17:11:20 2010 +0800
+++ b/userguide/src/HelpMainWindow.cpp	Tue Oct 19 16:27:19 2010 +0800
@@ -19,7 +19,7 @@
 #include <hbnotificationdialog.h>
 #include <hbaction.h>
 #include <hbapplication.h>
-#include <hbactivitymanager.h>
+#include <afactivitystorage.h>
 
 #include "HelpBaseView.h"
 #include "HelpCategoryView.h"
@@ -35,7 +35,10 @@
 mContentsView(NULL)
 {
     QObject::connect(qApp, SIGNAL(aboutToQuit()), this, SLOT(saveActivity()));
+
+    mActivityStorage = new AfActivityStorage(this);
 	HelpDataProvider::instance()->createHelpCategory();
+
     activateCategoryView();
 }
 
@@ -51,17 +54,19 @@
 	    case HelpViewCategory:
             activateCategoryView();
 			break;
+			
 	    case HelpViewKeyword:
             activateKeywordView();
 			break;
+			
 	    case HelpViewContents:
             activateContentsView();
 			break;
+			
 		case PreviousView:
-			{
-				onActivateView(mPreviousViewName);
-			}
+			onActivateView(mPreviousViewName);
 			break;
+			
 	    default:
 			HbApplication::exit();
 	        break;
@@ -136,11 +141,9 @@
 
 void HelpMainWindow::saveActivity()
 {
-	HbActivityManager* activityManager = qobject_cast<HbApplication*>(qApp)->activityManager();
-
 	// clean up any previous versions of this activity from the activity manager.
-	bool ok = activityManager->removeActivity("UserGuideMainView");
-	if ( !ok )
+	bool ok = mActivityStorage->removeActivity("UserGuideMainView");
+	if(!ok)
 	{
 		//qFatal("Remove failed" );
 	}
@@ -154,10 +157,10 @@
 	QDataStream stream(&serializedActivity, QIODevice::WriteOnly | QIODevice::Append);
 
 	// add the activity to the activity manager
-	ok = activityManager->addActivity("UserGuideMainView", serializedActivity, metadata);
-	if ( !ok )
+	ok = mActivityStorage->saveActivity("UserGuideMainView", serializedActivity, metadata);
+	if(!ok)
 	{
-		qFatal("Add failed" );
+		//qFatal("Add failed");
 	}
 }