597 HsMenuService::getAllCollectionsModel()); |
597 HsMenuService::getAllCollectionsModel()); |
598 caModel->setSecondLineVisibility(true); |
598 caModel->setSecondLineVisibility(true); |
599 QStandardItemModel *model = new QStandardItemModel(this); |
599 QStandardItemModel *model = new QStandardItemModel(this); |
600 QList<QStandardItem *> items; |
600 QList<QStandardItem *> items; |
601 for (int row = 0; row < caModel->rowCount(); row++) { |
601 for (int row = 0; row < caModel->rowCount(); row++) { |
|
602 int itemId = caModel->data(caModel->index(row, 0), |
|
603 CaItemModel::IdRole).toInt(); |
|
604 // do not add actual collection to model |
|
605 if(itemId == mCollectionId) |
|
606 { |
|
607 continue; |
|
608 } |
602 uint flags = caModel->data(caModel->index(row, 0), |
609 uint flags = caModel->data(caModel->index(row, 0), |
603 CaItemModel::FlagsRole).value<EntryFlags> (); |
610 CaItemModel::FlagsRole).value<EntryFlags> (); |
604 int itemId = caModel->data(caModel->index(row, 0), |
|
605 CaItemModel::IdRole).toInt(); |
|
606 if ((flags & RemovableEntryFlag) && (itemId != collectionId)) { |
611 if ((flags & RemovableEntryFlag) && (itemId != collectionId)) { |
607 QStandardItem *standardItem = new QStandardItem(); |
612 QStandardItem *standardItem = new QStandardItem(); |
608 standardItem->setData(caModel->data(caModel->index(row, 0), |
613 standardItem->setData(caModel->data(caModel->index(row, 0), |
609 CaItemModel::IdRole), CaItemModel::IdRole); |
614 CaItemModel::IdRole), CaItemModel::IdRole); |
610 standardItem->setData(caModel->data(caModel->index(row, 0), |
615 standardItem->setData(caModel->data(caModel->index(row, 0), |