75 |
75 |
76 /** |
76 /** |
77 Standard c++ constructor |
77 Standard c++ constructor |
78 */ |
78 */ |
79 CMTPImageDpGetObject::CMTPImageDpGetObject(MMTPDataProviderFramework& aFramework, MMTPConnection& aConnection, CMTPImageDataProvider& aDataProvider) : |
79 CMTPImageDpGetObject::CMTPImageDpGetObject(MMTPDataProviderFramework& aFramework, MMTPConnection& aConnection, CMTPImageDataProvider& aDataProvider) : |
80 CMTPRequestProcessor(aFramework, aConnection, sizeof(KMTPGetObjectPolicy)/sizeof(TMTPRequestElementInfo), KMTPGetObjectPolicy), |
80 CMTPRequestProcessor(aFramework, aConnection, sizeof(KMTPGetObjectPolicy)/sizeof(TMTPRequestElementInfo), KMTPGetObjectPolicy), |
|
81 iFramework(aFramework), |
81 iDataProvider(aDataProvider) |
82 iDataProvider(aDataProvider) |
82 { |
83 { |
83 |
84 |
84 } |
85 } |
85 |
86 |
104 //does not take ownership |
105 //does not take ownership |
105 CMTPObjectMetaData* objectInfo = iRequestChecker->GetObjectInfo(objectHandle); |
106 CMTPObjectMetaData* objectInfo = iRequestChecker->GetObjectInfo(objectHandle); |
106 __ASSERT_DEBUG(objectInfo, Panic(EMTPImageDpObjectNull)); |
107 __ASSERT_DEBUG(objectInfo, Panic(EMTPImageDpObjectNull)); |
107 |
108 |
108 BuildFileObjectL(objectInfo->DesC(CMTPObjectMetaData::ESuid)); |
109 BuildFileObjectL(objectInfo->DesC(CMTPObjectMetaData::ESuid)); |
109 SendDataL(*iFileObject); |
110 SendDataL(*iFileObject); |
110 __FLOG(_L8("<< CMTPImageDpGetObject::ServiceL")); |
111 __FLOG(_L8("<< CMTPImageDpGetObject::ServiceL")); |
111 } |
112 } |
112 |
113 |
113 |
114 |
114 /** |
115 /** |
124 __FLOG(_L8("<< CMTPImageDpGetObject::BuildFileObjectL")); |
125 __FLOG(_L8("<< CMTPImageDpGetObject::BuildFileObjectL")); |
125 } |
126 } |
126 |
127 |
127 TBool CMTPImageDpGetObject::DoHandleCompletingPhaseL() |
128 TBool CMTPImageDpGetObject::DoHandleCompletingPhaseL() |
128 { |
129 { |
129 __FLOG(_L8(" CMTPImageDpGetObject::DoHandleResponsePhaseL - Entry")); |
130 __FLOG(_L8(" CMTPImageDpGetObject::DoHandleResponsePhaseL - Entry")); |
130 TInt currentNewPics = 0; |
131 |
131 iDataProvider.Repository().Get(ENewImagesCount, currentNewPics); |
132 /** |
132 if (currentNewPics != 0) |
133 * end-user does not cancel the operation, we think the getobject operation is successful. |
|
134 */ |
|
135 if (!iCancelled) |
133 { |
136 { |
134 /** |
137 TUint32 objectHandle = Request().Uint32(TMTPTypeRequest::ERequestParameter1); |
135 Zero the new pictures of RProperty. |
138 CMTPObjectMetaData* objectInfo = iRequestChecker->GetObjectInfo(objectHandle); |
136 Because we think the end-use has import all pictures as long as MTP receive one getobject operation |
139 if (MTPImageDpUtilits::IsNewPicture(*objectInfo)) |
137 |
140 { |
138 There are two different phases to collect new pictures: |
141 //update new picture status |
139 1. In enumeration phase, calculate new pictures value from MSS in one go. |
142 MTPImageDpUtilits::UpdateObjectStatusToOldL(iFramework, *objectInfo); |
140 2. After enumeration phase, dynamically calculate new pictures value from MdS by Notifications |
143 iDataProvider.DecreaseNewPictures(1); |
141 */ |
144 } |
142 iDataProvider.Repository().Set(ENewImagesCount, 0); |
145 } |
143 RProperty::Set(TUid::Uid(KMTPServerUID), KMTPNewPicKey, 0); |
|
144 } |
|
145 |
146 |
146 __FLOG(_L8("CMTPImageDpGetObject::DoHandleResponsePhaseL - Exit")); |
147 __FLOG(_L8("CMTPImageDpGetObject::DoHandleResponsePhaseL - Exit")); |
147 return CMTPRequestProcessor::DoHandleCompletingPhaseL(); |
148 return CMTPRequestProcessor::DoHandleCompletingPhaseL(); |
148 } |
149 } |