188 relPath.Append('\\'); |
188 relPath.Append('\\'); |
189 |
189 |
190 TFileName fileName; |
190 TFileName fileName; |
191 PodcastUtils::FileNameFromUrl(info->Url(), fileName); |
191 PodcastUtils::FileNameFromUrl(info->Url(), fileName); |
192 |
192 |
193 TFileName extension; |
|
194 extension.Copy(fileName.Mid(fileName.LocateReverse('.'))); |
|
195 DP1("extension=%S", &extension); |
|
196 |
|
197 TFileName newFilename; |
193 TFileName newFilename; |
198 newFilename.Format(_L("%u%S"), info->Uid(), &extension); |
194 |
199 DP1("newFilename=%S", &newFilename); |
195 TInt periodPos = fileName.LocateReverse('.'); |
|
196 |
|
197 if (periodPos != -1) |
|
198 { |
|
199 // file extension (most likely) found |
|
200 TFileName extension; |
|
201 extension.Copy(fileName.Mid(periodPos)); |
|
202 DP1("extension=%S", &extension); |
|
203 |
|
204 newFilename.Format(_L("%u%S"), info->Uid(), &extension); |
|
205 DP1("newFilename=%S", &newFilename); |
|
206 } |
|
207 else |
|
208 { |
|
209 // no extension found, we'll have to rely on magic numbers |
|
210 newFilename.Copy(fileName); |
|
211 } |
200 |
212 |
201 relPath.Append(newFilename); |
213 relPath.Append(newFilename); |
202 PodcastUtils::EnsureProperPathName(relPath); |
214 PodcastUtils::EnsureProperPathName(relPath); |
203 |
215 |
204 // complete file path is base dir + rel path |
216 // complete file path is base dir + rel path |