diff -r 96df3ab41000 -r 8db05346071b locationpickerservice/src/locationpickercollectioncontent.cpp --- a/locationpickerservice/src/locationpickercollectioncontent.cpp Wed Jun 23 18:07:15 2010 +0300 +++ b/locationpickerservice/src/locationpickercollectioncontent.cpp Tue Jul 06 14:10:28 2010 +0300 @@ -27,40 +27,36 @@ // ---------------------------------------------------------------- // LocationPickerCollectionContent::LocationPickerCollectionContent() // ----------------------------------------------------------------- -LocationPickerCollectionContent::LocationPickerCollectionContent( Qt::Orientations aOrientation , quint32 aCollectionId ) - :mOrientation(aOrientation), - mProxyModel(NULL), +LocationPickerCollectionContent::LocationPickerCollectionContent( quint32 aCollectionId ) + :mProxyModel(NULL), mModel(NULL), mDataManager(NULL), mLocationFound(false) { // Create a standard model for the view list mModel = new QStandardItemModel( this ); - if(mModel) + // create data manager to manage data in the model + mDataManager = LocationPickerDataManager::getInstance(); + if( mDataManager->populateModel( *mModel, ELocationPickerCollectionContent, aCollectionId ) ) { - // create data manager to manage data in the model - mDataManager = LocationPickerDataManager::getInstance(); - if( mDataManager->populateModel( *mModel, ELocationPickerCollectionContent, mOrientation , aCollectionId ) ) - { - // Create the proxy model. - mProxyModel = new LocationPickerProxyModel(mOrientation); - mProxyModel->setSourceModel(mModel); - mProxyModel->setDynamicSortFilter(TRUE); - mProxyModel->setSortRole(Qt::DisplayRole); - mProxyModel->setSortCaseSensitivity(Qt::CaseInsensitive); - // sort - mProxyModel->sort(0, Qt::AscendingOrder); - mLocationFound = true; - } - else - { - // no locations to display. - QStandardItem *modelItem = new QStandardItem(); - modelItem->setData(QVariant(hbTrId("txt_lint_list_no_location_entries_present")), Qt::DisplayRole); - mModel->appendRow( modelItem ); - mLocationFound = false; - } + // Create the proxy model. + mProxyModel = new LocationPickerProxyModel(); + mProxyModel->setSourceModel(mModel); + mProxyModel->setDynamicSortFilter(TRUE); + mProxyModel->setSortRole(Qt::DisplayRole); + mProxyModel->setSortCaseSensitivity(Qt::CaseInsensitive); + // sort + mProxyModel->sort(0, Qt::AscendingOrder); + mLocationFound = true; } + else + { + // no locations to display. + QStandardItem *modelItem = new QStandardItem(); + modelItem->setData(QVariant(hbTrId("txt_lint_list_no_location_entries_present")), Qt::DisplayRole); + mModel->appendRow( modelItem ); + mLocationFound = false; + } } // ---------------------------------------------------------------- @@ -80,14 +76,6 @@ return mProxyModel; } -// ---------------------------------------------------------------- -// LocationPickerCollectionContent::getStandardModel -// ----------------------------------------------------------------- -QStandardItemModel* LocationPickerCollectionContent::getStandardModel() -{ - return mModel; -} - // ---------------------------------------------------------------------------- // LocationPickerCollectionContent::getData() // ----------------------------------------------------------------------------