userguide/src/HelpMainWindow.cpp
changeset 27 0a93cba9d57a
parent 26 97d7f0705d0a
child 53 01c62bde3a2a
--- a/userguide/src/HelpMainWindow.cpp	Tue Jun 08 18:34:07 2010 +0800
+++ b/userguide/src/HelpMainWindow.cpp	Tue Jun 22 18:36:24 2010 +0800
@@ -35,6 +35,7 @@
 mContentsView(NULL)
 {
     QObject::connect(qApp, SIGNAL(aboutToQuit()), this, SLOT(saveActivity()));
+	HelpDataProvider::instance()->createHelpCategory();
     activateCategoryView();
 }
 
@@ -62,6 +63,7 @@
 			}
 			break;
 	    default:
+			HbApplication::exit();
 	        break;
 	}
 }
@@ -134,30 +136,29 @@
 
 void HelpMainWindow::saveActivity()
 {
-  HbActivityManager* activityManager = qobject_cast<HbApplication*>(qApp)->activityManager();
+	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 )
-      {
-      //qFatal("Remove failed" );
-      }
+	// clean up any previous versions of this activity from the activity manager.
+	bool ok = activityManager->removeActivity("UserGuideMainView");
+	if ( !ok )
+	{
+		//qFatal("Remove failed" );
+	}
 
-  // get a screenshot for saving to the activity manager
-  QVariantHash metadata;
-  metadata.insert("screenshot", QPixmap::grabWidget(this, rect()));
+	// get a screenshot for saving to the activity manager
+	QVariantHash metadata;
+	metadata.insert("screenshot", QPixmap::grabWidget(this, rect()));
 
-  // save any data necessary to save the state
-  QByteArray serializedActivity;
-  QDataStream stream(&serializedActivity, QIODevice::WriteOnly | QIODevice::Append);
-  stream << "whatever data you need to save the state adequately";
+	// save any data necessary to save the state
+	QByteArray serializedActivity;
+	QDataStream stream(&serializedActivity, QIODevice::WriteOnly | QIODevice::Append);
 
-  // add the activity to the activity manager
-  ok = activityManager->addActivity("UserGuideMainView", serializedActivity, metadata);
-  if ( !ok )
-      {
-      qFatal("Add failed" );
-      }
+	// add the activity to the activity manager
+	ok = activityManager->addActivity("UserGuideMainView", serializedActivity, metadata);
+	if ( !ok )
+	{
+		qFatal("Add failed" );
+	}
 }
 
 // end of file