userguide/src/HelpDataProvider.cpp
changeset 27 0a93cba9d57a
parent 26 97d7f0705d0a
child 37 4eefeeb3cd2d
equal deleted inserted replaced
26:97d7f0705d0a 27:0a93cba9d57a
    70 
    70 
    71 ///////////////////////////////////////////////////////////////////////////////////////
    71 ///////////////////////////////////////////////////////////////////////////////////////
    72 
    72 
    73 QAbstractItemModel* HelpDataProvider::getCategoryData()
    73 QAbstractItemModel* HelpDataProvider::getCategoryData()
    74 {
    74 {
    75     if(!mHelpModel->rowCount())
       
    76     {
       
    77         createHelpCategory();
       
    78     }
       
    79 
       
    80     return mHelpModel;
    75     return mHelpModel;
    81 }
    76 }
    82 
    77 
    83 QAbstractItemModel* HelpDataProvider::getSearchData(const QString& key)
    78 QAbstractItemModel* HelpDataProvider::getSearchData(const QString& key)
    84 {
    79 {
    87 		return mSearhResultModel;
    82 		return mSearhResultModel;
    88 	}
    83 	}
    89 
    84 
    90 	mLastSrhKey = key;
    85 	mLastSrhKey = key;
    91     mSearhResultModel->setFilterRegExp(key);
    86     mSearhResultModel->setFilterRegExp(key);
       
    87 
    92 	
    88 	
    93     return mSearhResultModel;
    89     return mSearhResultModel;
    94 }
    90 }
    95 
    91 
    96 void HelpDataProvider::setHelpContentUrl(const QString& uid, const QString& href)
    92 void HelpDataProvider::setHelpContentUrl(const QString& uid, const QString& href)
   185 	mHelpModel->sort(0, HelpUtils::sortOrder());
   181 	mHelpModel->sort(0, HelpUtils::sortOrder());
   186 }
   182 }
   187 
   183 
   188 void HelpDataProvider::constructBuiltInCategory(const QString& path, const QStringList& uidList, const QStringList& titleList)
   184 void HelpDataProvider::constructBuiltInCategory(const QString& path, const QStringList& uidList, const QStringList& titleList)
   189 {
   185 {
   190 //	constructCategory2(title, uid);
       
   191 	if(uidList.count() != titleList.count())
   186 	if(uidList.count() != titleList.count())
   192 	{
   187 	{
   193 		//ToDo
   188 		//ToDo
   194 		return;
   189 		return;
   195 	}
   190 	}
   361 	if(featureIdLst.count() != uidList.count())
   356 	if(featureIdLst.count() != uidList.count())
   362 	{
   357 	{
   363 		return;
   358 		return;
   364 	}
   359 	}
   365 
   360 
   366 	for(int i = featureIdLst.count()  - 1; i <= 0; i--)
   361 	for(int i = featureIdLst.count()  - 1; i >= 0; i--)
   367 	{
   362 	{
   368 		int featureID = featureIdLst.at(i).toInt();
   363 		int featureID = featureIdLst.at(i).toInt();
   369 		if(!HelpUtils::suppportFeatureID(featureID))
   364 		if(!HelpUtils::suppportFeatureID(featureID))
   370 		{
   365 		{
   371 			uidList.removeAt(i);
   366 			uidList.removeAt(i);
   424 	if(featureIdLst.count() != hrefList.count())
   419 	if(featureIdLst.count() != hrefList.count())
   425 	{
   420 	{
   426 		return;
   421 		return;
   427 	}
   422 	}
   428 
   423 
   429 	for(int i = featureIdLst.count()  - 1; i <= 0; i--)
   424 	for(int i = featureIdLst.count()  - 1; i >= 0; i--)
   430 	{
   425 	{
   431 		int featureID = featureIdLst.at(i).toInt();
   426 		int featureID = featureIdLst.at(i).toInt();
   432 		if(!HelpUtils::suppportFeatureID(featureID))
   427 		if(!HelpUtils::suppportFeatureID(featureID))
   433 		{
   428 		{
   434 			hrefList.removeAt(i);
   429 			hrefList.removeAt(i);