notes/notesui/notesviews/src/notescollectionview.cpp
changeset 50 579cc610882e
parent 26 a949c2543c15
child 58 ef813d54df51
equal deleted inserted replaced
49:5de72ea7a065 50:579cc610882e
   250 	// Refresh the content of the view.
   250 	// Refresh the content of the view.
   251 	resetCollectionView();
   251 	resetCollectionView();
   252 
   252 
   253 	// Cleanup.
   253 	// Cleanup.
   254 	mNotesEditor->deleteLater();
   254 	mNotesEditor->deleteLater();
       
   255 	
       
   256 	mAppControllerIf->switchToView(NotesNamespace::NotesMainViewId);
   255 }
   257 }
   256 
   258 
   257 /*!
   259 /*!
   258 	Updates the view data in case of changes in the database.
   260 	Updates the view data in case of changes in the database.
   259 	Handles the case when entry is added or deleted by notes application.
   261 	Handles the case when entry is added or deleted by notes application.
   332 		const QModelIndex &index, int start, int end)
   334 		const QModelIndex &index, int start, int end)
   333 {
   335 {
   334 	Q_UNUSED(index)
   336 	Q_UNUSED(index)
   335 	Q_UNUSED(start)
   337 	Q_UNUSED(start)
   336 	Q_UNUSED(end)
   338 	Q_UNUSED(end)
   337 
   339 	
   338 	// Update the count of notes in the view.
   340 	// Check model is set for mListView  before update 	
   339 	QString countString(hbTrId("txt_notes_list_note_count"));
   341 	if( mListView->model())
   340 	QModelIndex mdlIndex = mListView->model()->index(1, 0);
   342 	{
   341 	QStringList favStringList;
   343 		// Update the count of notes in the view.
   342 	favStringList.append(hbTrId("txt_notes_list_favorites"));
   344 		QString countString(hbTrId("txt_notes_list_note_count"));
   343 	favStringList.append(countString.arg(mFavouriteModel->rowCount()));
   345 		QModelIndex mdlIndex = mListView->model()->index(1, 0);
   344 	mListView->model()->setData(mdlIndex, favStringList, Qt::DisplayRole);
   346 		QStringList favStringList;
       
   347 		favStringList.append(hbTrId("txt_notes_list_favorites"));
       
   348 		favStringList.append(countString.arg(mFavouriteModel->rowCount()));
       
   349 		mListView->model()->setData(mdlIndex, favStringList, Qt::DisplayRole);
       
   350 	}
   345 }
   351 }
   346 
   352 
   347 /*!
   353 /*!
   348 	Slot to handle the case when the state of an action has changed.
   354 	Slot to handle the case when the state of an action has changed.
   349  */
   355  */