notes/notesui/notesviews/src/notescollectionview.cpp
changeset 26 a949c2543c15
parent 23 fd30d51f876b
child 50 579cc610882e
--- a/notes/notesui/notesviews/src/notescollectionview.cpp	Mon May 03 12:30:32 2010 +0300
+++ b/notes/notesui/notesviews/src/notescollectionview.cpp	Fri May 14 15:51:09 2010 +0300
@@ -117,9 +117,6 @@
 			mListView, SIGNAL(activated(const QModelIndex &)),
 			this, SLOT(handleActivated(const QModelIndex &)));
 
-	// Populate the content of the view.
-	populateListView();
-
 	// Get the toolbar/menu actions.
 	mAllNotesAction = static_cast<HbAction *> (
 			mDocLoader->findObject("allNotesAction"));
@@ -158,6 +155,46 @@
 }
 
 /*!
+	Populate the content of the view.
+ */
+void NotesCollectionView::populateListView()
+{
+	QStandardItemModel *model = new QStandardItemModel(this);
+	model->setColumnCount(1);
+
+	QString countString(hbTrId("txt_notes_list_note_count"));
+
+	// Add To-do's item.
+	QStandardItem *item = new QStandardItem();
+	QStringList todoStringList;
+	todoStringList.append(hbTrId("txt_notes_list_todos"));
+	todoStringList.append(countString.arg(QString::number(todosCount())));
+	item->setData(todoStringList, Qt::DisplayRole);
+	model->appendRow(item);
+
+	// Add Favorites item.
+	item = new QStandardItem();
+	QStringList favStringList;
+	favStringList.append(hbTrId("txt_notes_list_favorites"));
+	favStringList.append(countString.arg(mFavouriteModel->rowCount()));
+	item->setData(favStringList, Qt::DisplayRole);
+	model->appendRow(item);
+
+	// Add Recent notes item.
+	item = new QStandardItem();
+	QStringList notesStringList;
+	notesStringList.append(hbTrId("txt_notes_list_plain_notes"));
+	notesStringList.append(
+			countString.arg(QString::number(recentNotesCount())));
+	item->setData(notesStringList, Qt::DisplayRole);
+	model->appendRow(item);
+
+	HbStyleLoader::registerFilePath(":/style");
+	mListView->setLayoutName("custom");
+	mListView->setModel(model);
+}
+
+/*!
 	Displays all notes view.
  */
 void NotesCollectionView::displayAllNotesView()
@@ -315,46 +352,6 @@
 	mViewCollectionAction->setChecked(true);
 }
 
-/*!
-	Populate the content of the view.
- */
-void NotesCollectionView::populateListView()
-{
-	QStandardItemModel *model = new QStandardItemModel(this);
-	model->setColumnCount(1);
-
-	QString countString(hbTrId("txt_notes_list_note_count"));
-
-	// Add To-do's item.
-	QStandardItem *item = new QStandardItem();
-	QStringList todoStringList;
-	todoStringList.append(hbTrId("txt_notes_list_todos"));
-	todoStringList.append(countString.arg(QString::number(todosCount())));
-	item->setData(todoStringList, Qt::DisplayRole);
-	model->appendRow(item);
-
-	// Add Favorites item.
-	item = new QStandardItem();
-	QStringList favStringList;
-	favStringList.append(hbTrId("txt_notes_list_favorites"));
-	favStringList.append(countString.arg(mFavouriteModel->rowCount()));
-	item->setData(favStringList, Qt::DisplayRole);
-	model->appendRow(item);
-
-	// Add Recent notes item.
-	item = new QStandardItem();
-	QStringList notesStringList;
-	notesStringList.append(hbTrId("txt_notes_list_plain_notes"));
-	notesStringList.append(
-			countString.arg(QString::number(recentNotesCount())));
-	item->setData(notesStringList, Qt::DisplayRole);
-	model->appendRow(item);
-
-	HbStyleLoader::registerFilePath(":/style");
-	mListView->setLayoutName("custom");
-	mListView->setModel(model);
-}
-
 
 /*!
 	Returns the todos count