Applied latest source code
[apps/native/preloaded/Settings.git] / src / StWallpaperAlbumListDetailForm.cpp
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Flora License, Version 1.1 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //     http://floralicense.org/license/
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an AS IS BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16
17 /**
18  * @file                StWallpaperAlbumListDetailForm.cpp
19  * @brief               This is the implementation file for WallpaperAlbumListDetailForm class.
20  */
21
22 #include <FIo.h>
23 #include <FSystem.h>
24 #include "StSettingScenesList.h"
25 #include "StTypes.h"
26 #include "StWallpaperAlbumListDetailForm.h"
27
28 using namespace Tizen::App;
29 using namespace Tizen::Base;
30 using namespace Tizen::Base::Collection;
31 using namespace Tizen::Content;
32 using namespace Tizen::Graphics;
33 using namespace Tizen::Io;
34 using namespace Tizen::System;
35 using namespace Tizen::Ui;
36 using namespace Tizen::Ui::Controls;
37 using namespace Tizen::Ui::Scenes;
38
39 static const int MAX_UNDER_FILE_SIZE = 334;
40 static const int MAX_OVER_FILE_SIZE = 158;
41 static const int FOLDER_BITMAP_MAX = 6;
42 static const int W_LARGE_SIZE_TEXT_GAP = 110;
43 static const int W_HUGE_SIZE_PORTRAIT_TEXT_GAP = 90;
44 static const int W_HUGE_SIZE_LANDSCAPE_TEXT_GAP = 220;
45 static const int LINE_COUNT_DEFAULT = 1;
46
47 static const int BASE_FORM_DEFAULT_MARGIN = 32;
48
49 static const String IMAGE_VIEWER_APP_ID = L"tizen.imageviewer";
50 static const String IMAGE_VIEWER_CROP_OPERATION_ID = L"http://tizen.org/appcontrol/operation/image/crop";
51
52 WallpaperAlbumListDetailForm::WallpaperAlbumListDetailForm(void)
53         : __isRunningAppControl(false)
54         , __itemCount(0)
55         , __pContentId(null)
56         , __pPresentationModel(null)
57         , __pIconListView(null)
58         , __pAlbumPathList(null)
59 {
60 }
61
62 WallpaperAlbumListDetailForm::~WallpaperAlbumListDetailForm(void)
63 {
64 }
65
66 result
67 WallpaperAlbumListDetailForm::Initialize(void)
68 {
69         AppLogDebug("ENTER");
70         Form::Construct(FORM_STYLE_NORMAL | FORM_STYLE_INDICATOR | FORM_STYLE_HEADER | FORM_STYLE_FOOTER);
71         SetOrientationAutoMode();
72         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
73         return GetLastResult();
74 }
75
76 void
77 WallpaperAlbumListDetailForm::SetOrientationAutoMode(void)
78 {
79         this->SetOrientation(ORIENTATION_AUTOMATIC_FOUR_DIRECTION);
80         this->AddOrientationEventListener(*this);
81 }
82
83 void
84 WallpaperAlbumListDetailForm::UpdateIconListView(void)
85 {
86         bool createIconListView = true;
87         if (__itemCount == 0)
88         {
89                 createIconListView = false;
90         }
91         if (__pIconListView != null)
92         {
93                 if (createIconListView)
94                 {
95                         __pIconListView->UpdateList();
96                         return;
97                 }
98         }
99
100         RemoveControl(__pIconListView);
101         __pIconListView = null;
102
103         if (createIconListView)
104         {
105                 CreateIconListView();
106         }
107         else
108         {
109                 Label* pLabel = static_cast<Label*>(this->GetControl(NO_CONTENTS, false));
110                 if (pLabel == null)
111                 {
112                         Rectangle clientRect = GetClientAreaBounds();
113                         Bitmap* pBitmp = ResourceManager::GetBitmapN(IDB_NO_CONTENTS);
114
115                         int bitmapWidth = pBitmp->GetWidth();
116                         int bitmapHeight = pBitmp->GetHeight();
117                         String labelText = ResourceManager::GetString(L"IDS_ST_BODY_NO_CONTENT");
118                         Color textColor = COLOR_HELP_TEXT_TYPE_03_NORMAL;
119                         int noContentTextHeight = GetHeightForStringArea(labelText, bitmapWidth, 32);
120
121                         int xPos = (clientRect.width / LINE_COUNT_2) - (bitmapWidth / DIVIDE_BY_TWO);
122                         int yPos = (clientRect.height / LINE_COUNT_2) - ((bitmapHeight + noContentTextHeight) / DIVIDE_BY_TWO);
123
124                         Label* pLabel = new (std::nothrow) Label();
125                         pLabel->Construct(Rectangle(xPos, yPos, bitmapWidth, bitmapHeight), L"");
126                         pLabel->SetName(NO_CONTENTS);
127                         pLabel->SetBackgroundBitmap(*pBitmp);
128
129                         yPos = yPos + bitmapHeight;
130
131                         Label* pLabelNoContents = new (std::nothrow) Label();
132                         pLabelNoContents->Construct(Rectangle(0, yPos, clientRect.width, noContentTextHeight), L"");
133                         pLabelNoContents->SetName(NO_CONTENTS_TEXT);
134                         pLabelNoContents->SetTextColor(textColor);
135                         pLabelNoContents->SetText(labelText);
136
137                         AddControl(pLabel);
138                         AddControl(pLabelNoContents);
139                 }
140         }
141 }
142
143 int
144 WallpaperAlbumListDetailForm::GetHeightForStringArea(const Tizen::Base::String source, int width, int fontSize) const
145 {
146         Font font;
147         Dimension dim;
148         String temp;
149
150         int lineCount = LINE_COUNT_DEFAULT;
151         int margin = BASE_FORM_DEFAULT_MARGIN + RELATIVE_LAYOUT_RIGHT_MARGIN;
152         if (fontSize > FONT_MAIN_TEXT_SIZE_LARGE)
153         {
154                 OrientationStatus orientationStatus = GetOrientationStatus();
155                 if (((orientationStatus == ORIENTATION_STATUS_PORTRAIT)
156                         || (orientationStatus == ORIENTATION_STATUS_PORTRAIT_REVERSE))
157                         && (fontSize == FONT_MAIN_TEXT_SIZE_HUGE))
158                 {
159                         width -= W_HUGE_SIZE_PORTRAIT_TEXT_GAP;
160                 }
161                 else if (((orientationStatus == ORIENTATION_STATUS_LANDSCAPE)
162                                 || (orientationStatus == ORIENTATION_STATUS_LANDSCAPE_REVERSE))
163                                 && (fontSize == FONT_MAIN_TEXT_SIZE_HUGE))
164                 {
165                         width -= W_HUGE_SIZE_LANDSCAPE_TEXT_GAP;
166                 }
167                 width -= W_LARGE_SIZE_TEXT_GAP;
168         }
169         int boudwidth = width - margin;
170         font.Construct(FONT_STYLE_PLAIN, fontSize);
171
172         for (int i = 0; i < source.GetLength(); i++)
173         {
174                 temp.Append(source[i]);
175                 font.GetTextExtent(temp, temp.GetLength(), dim);
176                 if (dim.width > boudwidth)
177                 {
178                         temp.Clear();
179                         temp.Append(source[i]);
180                         lineCount++;
181                 }
182         }
183
184         return dim.height * lineCount;
185 }
186
187 void
188 WallpaperAlbumListDetailForm::CreateHeader(const Tizen::Base::String& textTitle)
189 {
190         Header* pHeader = GetHeader();
191
192         pHeader->SetStyle(HEADER_STYLE_TITLE);
193         pHeader->SetTitleText(textTitle);
194 }
195
196 void
197 WallpaperAlbumListDetailForm::CreateFooter(void)
198 {
199         Footer* pFooter = GetFooter();
200         if (pFooter)
201         {
202                 pFooter->SetStyle(FOOTER_STYLE_BUTTON_TEXT);
203         }
204
205         SetFormBackEventListener(this);
206 }
207
208 result
209 WallpaperAlbumListDetailForm::OnInitializing(void)
210 {
211         __pPresentationModel = WallpaperAlbumListPresentationModel::GetInstance();
212
213         return E_SUCCESS;
214 }
215
216 result
217 WallpaperAlbumListDetailForm::OnTerminating(void)
218 {
219         AppLogDebug("ENTER");
220
221         if (__pPresentationModel != null)
222         {
223                 __pPresentationModel = null;
224         }
225
226         if (__pIconListView != null)
227         {
228                 __pIconListView = null;
229         }
230
231         if (__pAlbumPathList != null)
232         {
233                 delete __pAlbumPathList;
234                 __pAlbumPathList = null;
235         }
236
237         return E_SUCCESS;
238 }
239
240 int
241 WallpaperAlbumListDetailForm::GetItemCount(void)
242 {
243         return __itemCount;
244 }
245
246 IconListViewItem*
247 WallpaperAlbumListDetailForm::CreateItem(int index)
248 {
249         AppLogDebug("ENTER : index(%d)", index);
250
251         Bitmap* pBitmap = __pPresentationModel->CreateDetailMergeBitmapN(index);
252
253         if (pBitmap != null)
254         {
255                 IconListViewItem* pIconListview = new (std::nothrow) IconListViewItem();
256                 pIconListview->Construct(*pBitmap);
257                 delete pBitmap;
258                 pBitmap = null;
259
260                 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
261                 return pIconListview;
262         }
263
264         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
265         return null;
266 }
267
268 bool
269 WallpaperAlbumListDetailForm::DeleteItem(int index, IconListViewItem* pItem)
270 {
271         delete pItem;
272         return true;
273 }
274
275 void
276 WallpaperAlbumListDetailForm::OnIconListViewItemStateChanged(IconListView& view, int index, IconListViewItemStatus status)
277 {
278         AppLogDebug("ENTER");
279
280         if (__isRunningAppControl)
281         {
282                 AppLogDebug("busy status");
283                 return;
284         }
285
286         if (status == ICON_LIST_VIEW_ITEM_SELECTED)
287         {
288                 IList* pContentIdList = __pPresentationModel->GetContentIdList();
289                 __pContentId = static_cast<ContentId*>(pContentIdList->GetAt(index));
290                 HashMap extraData;
291                 extraData.Construct();
292                 String typeKey = L"http://tizen.org/appcontrol/data/image/crop_mode";
293                 String typeVal = L"fit_to_screen";
294                 extraData.Add(&typeKey, &typeVal);
295
296                 ContentManager pContentManager;
297                 pContentManager.Construct();
298                 ImageContentInfo* pImageContentInfo = static_cast<ImageContentInfo*>(pContentManager.GetContentInfoN(*__pContentId));
299
300                 Rectangle rect = GetClientAreaBounds();
301                 if (pImageContentInfo == null)
302                 {
303                         AppLogDebug("pImageContentInfo is null");
304                         return;
305                 }
306                 String uri = String(L"file://") + pImageContentInfo->GetContentPath();
307         
308                 AppControl* pAc = AppManager::FindAppControlN(IMAGE_VIEWER_APP_ID, IMAGE_VIEWER_CROP_OPERATION_ID);
309                 if (pAc)
310                 {
311                         if (pAc->Start(&uri, null, &extraData, this) == E_SUCCESS)
312                         {
313                                 __isRunningAppControl = true;
314                         }
315                         delete pAc;
316                 }
317
318         }
319         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
320 }
321
322 void
323 WallpaperAlbumListDetailForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source)
324 {
325         if (__isRunningAppControl)
326         {
327                 AppLogDebug("busy status");
328                 return;
329         }
330         SceneManager* pSceneManager = SceneManager::GetInstance();
331         AppAssert(pSceneManager);
332
333         pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), null);
334 }
335
336 void
337 WallpaperAlbumListDetailForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs)
338 {
339         if (pArgs != null)
340         {
341                 __pAlbumPathList = static_cast<ArrayList*>(pArgs);
342         }
343
344         if (__pPresentationModel == null)
345         {
346                 __pPresentationModel = WallpaperAlbumListPresentationModel::GetInstance();
347         }
348         SetAllAlbumPathList();
349         __pPresentationModel->InitializeFileList(__pAlbumPathList);
350         __itemCount = __pPresentationModel->GetFileCount();
351
352         UpdateIconListView();
353         CreateHeader(ResourceManager::GetString(L"IDS_MP_BODY_ADD_IMAGE"));
354         CreateFooter();
355 }
356
357 void
358 WallpaperAlbumListDetailForm::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId)
359 {
360 }
361
362 void
363 WallpaperAlbumListDetailForm::CreateIconListView(void)
364 {
365         int itemRectLineSize = 0;
366
367         if (__itemCount < FOLDER_BITMAP_MAX)
368         {
369                 itemRectLineSize = MAX_UNDER_FILE_SIZE;
370         }
371         else
372         {
373                 itemRectLineSize = MAX_OVER_FILE_SIZE;
374         }
375         Dimension itemSize(itemRectLineSize, itemRectLineSize);
376
377         __pIconListView = new (std::nothrow) IconListView();
378         __pIconListView->Construct(Rectangle(0, 0, GetClientAreaBounds().width, GetClientAreaBounds().height), itemSize);
379         __pIconListView->SetItemProvider(*this);
380         __pIconListView->SetItemBorderStyle(ICON_LIST_VIEW_ITEM_BORDER_STYLE_NONE);
381         __pIconListView->SetTouchAnimationEnabled(false);
382         __pIconListView->AddIconListViewItemEventListener(*this);
383
384         AddControl(__pIconListView);
385
386         Invalidate(true);
387 }
388
389 void
390 WallpaperAlbumListDetailForm::OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus)
391 {
392         if (__pIconListView == null)
393         {
394                 Label* pLabel = static_cast<Label*>(this->GetControl(NO_CONTENTS, false));
395                 if (pLabel != null)
396                 {
397                         Rectangle clientRect = GetClientAreaBounds();
398                         Rectangle labelBound = pLabel->GetBounds();
399
400                         int xPos = (clientRect.width / LINE_COUNT_2) - (labelBound.width / LINE_COUNT_2);
401                         int yPos = (clientRect.height / LINE_COUNT_2) -(labelBound.height / LINE_COUNT_2);
402
403                         pLabel->SetBounds(Rectangle(xPos, yPos, labelBound.width, labelBound.height));
404                         yPos = yPos + pLabel->GetBounds().height;
405                         Label* pTextLabel = static_cast<Label*>(this->GetControl(NO_CONTENTS_TEXT, false));
406                         if (pTextLabel != null)
407                         {
408                                 pTextLabel->SetBounds(Rectangle(0, yPos, clientRect.width, pTextLabel->GetBounds().height));
409                         }
410                 }
411         }
412         else
413         {
414                 __pIconListView->SetBounds(Rectangle(0, 0, GetClientAreaBounds().width, GetClientAreaBounds().height));
415         }
416         Invalidate(true);
417 }
418
419 void
420 WallpaperAlbumListDetailForm::OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs)
421 {
422         if (requestId == REFRESH_REQUEST_EVENT)
423         {
424                 AppLog("Refresh");
425                 __isRunningAppControl = false;
426
427                 __pPresentationModel->InitializeAlbumInfoList();
428                 SetAllAlbumPathList();
429                 __pPresentationModel->InitializeFileList(__pAlbumPathList);
430                 __itemCount = __pPresentationModel->GetFileCount();
431                 UpdateIconListView();
432                 if (pArgs)
433                 {
434                         pArgs->RemoveAll(true);
435                         delete pArgs;
436                 }
437         }
438 }
439
440 void
441 WallpaperAlbumListDetailForm::OnAppControlCompleteResponseReceived(const AppId& appId, const Tizen::Base::String& operationId, AppCtrlResult appControlResult, const Tizen::Base::Collection::IMap* pExtraData)
442 {
443         if (appId.Equals(IMAGE_VIEWER_APP_ID)
444                 && operationId.Equals(IMAGE_VIEWER_CROP_OPERATION_ID))
445         {
446                 if (appControlResult == APP_CTRL_RESULT_SUCCEEDED)
447                 {
448                         int argIndex = 0;
449                         AppLogDebug("Image crop succeeded.");
450                         String* pStr = WallpaperAlbumListPresentationModel::GetInstance()->GetHomeLockArgument();
451                         if (pStr->Equals(L"0", true))
452                         {
453                                 argIndex = 0;
454                         }
455                         else if (pStr->Equals(L"1", true))
456                         {
457                                 argIndex = 1;
458                         }
459                         else if (pStr->Equals(L"2", true))
460                         {
461                                 argIndex = 2;
462                         }
463                         if (pExtraData)
464                         {
465                                 IMapEnumerator* pEnum = pExtraData->GetMapEnumeratorN();
466                                 while (pEnum->MoveNext() == E_SUCCESS)
467                                 {
468                                         String* pKey = dynamic_cast<String*>(pEnum->GetKey());
469                                         if (pKey != null && *pKey == L"http://tizen.org/appcontrol/data/selected")
470                                         {
471                                                 IList* pValueList = dynamic_cast<IList*>(pEnum->GetValue());
472                                                 if (pValueList)
473                                                 {
474                                                         String dstPath = Application::GetInstance()->GetAppSharedPath() + PATH_DATA_DIRECTORY;
475                                                         String srcPath = L"";
476                                                         String srcFileExtention = L"";
477                                                         String* pSrcPath = dynamic_cast<String*>(pValueList->GetAt(0));
478                                                         if (pSrcPath != null)
479                                                         {
480                                                                 srcPath = *pSrcPath;
481                                                         }
482                                                         if (srcPath.IsEmpty() == false)
483                                                         {
484                                                                 srcFileExtention = File::GetFileExtension(srcPath);
485                                                         }
486
487                                                         switch (argIndex)
488                                                         {
489                                                         case 0:
490                                                         {
491                                                                 dstPath.Append(L"home.");
492                                                                 dstPath.Append(srcFileExtention);
493                                                                 File::Copy(srcPath, dstPath, false);
494                                                                 AppLog("FilePath = %S", dstPath.GetPointer());
495                                                                 if (SettingInfo::SetValue(RUNTIME_INFO_KEY_WALLPAPER_SCREEN, dstPath) != E_SUCCESS)
496                                                                 {
497                                                                         AppLogDebug("Wallpaper Screen SetValue is Fail [%s]", GetErrorMessage(GetLastResult()));
498                                                                 }
499                                                         }
500                                                         break;
501
502                                                         case 1:
503                                                         {
504                                                                 dstPath.Append(L"/lock.");
505                                                                 dstPath.Append(srcFileExtention);
506                                                                 File::Copy(srcPath, dstPath, false);
507
508                                                                 if (SettingInfo::SetValue(RUNTIME_INFO_KEY_WALLPAPER_SCREEN_LOCK, dstPath) != E_SUCCESS)
509                                                                 {
510                                                                         AppLogDebug("Wallpaper Lock Screen SetValue is Fail [%s]", GetErrorMessage(GetLastResult()));
511                                                                 }
512                                                         }
513                                                         break;
514
515                                                         case 2:
516                                                         {
517                                                                 dstPath.Append(L"homelock.");
518                                                                 dstPath.Append(srcFileExtention);
519                                                                 File::Copy(srcPath, dstPath, false);
520
521                                                                 if (SettingInfo::SetValue(RUNTIME_INFO_KEY_WALLPAPER_SCREEN, dstPath) != E_SUCCESS)
522                                                                 {
523                                                                         AppLogDebug("Wallpaper Screen SetValue is Fail [%s]", GetErrorMessage(GetLastResult()));
524                                                                 }
525
526                                                                 if (SettingInfo::SetValue(RUNTIME_INFO_KEY_WALLPAPER_SCREEN_LOCK, dstPath) != E_SUCCESS)
527                                                                 {
528                                                                         AppLogDebug("Wallpaper Lock Screen SetValue is Fail [%s]", GetErrorMessage(GetLastResult()));
529                                                                 }
530                                                         }
531                                                         break;
532
533                                                         default:
534                                                                 break;
535                                                         }
536                                                         SceneManager* pSceneManager = SceneManager::GetInstance();
537                                                         AppAssert(pSceneManager);
538                                                         IListT<SceneId>* sceneList = pSceneManager->GetSceneHistoryN();
539                                                         pSceneManager->ClearSceneHistory();
540                                                         int sceneIndex = 0;
541                                                         while (sceneIndex < sceneList->GetCount())
542                                                         {
543                                                                 String* pSceneId = new (std::nothrow) String();
544                                                                 sceneList->GetAt(sceneIndex++, *pSceneId);
545                                                                 if (pSceneId->Equals(IDSCN_WALLPAPER_ALBUM_LIST, true) == true)
546                                                                 {
547                                                                         if (pSceneManager->IsSceneAlive(*pSceneId) == true)
548                                                                         {
549                                                                                 pSceneManager->DestroyScene(*pSceneId);
550                                                                         }
551                                                                         delete pSceneId;
552                                                                         continue;
553                                                                 }
554
555                                                                 pSceneManager->AddToSceneHistory(*pSceneId);
556                                                                 delete pSceneId;
557                                                         }
558                                                         pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), null);
559                                                 }
560                                         }
561                                 }
562                                 delete pEnum;
563                         }
564                         return;
565                 }
566                 else if (appControlResult == APP_CTRL_RESULT_FAILED)
567                 {
568                         AppLog("Image crop failed.");
569                 }
570                 else if (appControlResult == APP_CTRL_RESULT_CANCELED)
571                 {
572                         AppLog("Image crop was canceled.");
573                 }
574                 else if (appControlResult == APP_CTRL_RESULT_TERMINATED)
575                 {
576                         AppLog("Image crop was terminated.");
577                 }
578                 else if (appControlResult == APP_CTRL_RESULT_ABORTED)
579                 {
580                         AppLog("Image crop was aborted.");
581                 }
582
583                 __isRunningAppControl = false;
584         }
585         return;
586 }
587
588 void
589 WallpaperAlbumListDetailForm::SetAllAlbumPathList(void)
590 {
591         String isAllAlbum = *static_cast<String*>(__pAlbumPathList->GetAt(0));
592
593         String allAlbumsString = ResourceManager::GetString(L"IDS_MEDIABR_BODY_ALL_ALBUMS");
594         if (isAllAlbum.Equals(allAlbumsString, true) == false)
595         {
596                 AppLogDebug("__pAlbumPathList is not AllAlbum");
597                 return;
598         }
599
600         delete __pAlbumPathList;
601         __pAlbumPathList = null;
602         IList* pAlbumInfoList = __pPresentationModel->GetAlbumInfoList();
603         if (pAlbumInfoList == null)
604         {
605                 AppLogDebug("pAlbumInfoList is null");
606                 return;
607         }
608
609         AlbumInfo* pAlbumInfo = static_cast<AlbumInfo*>(pAlbumInfoList->GetAt(0));
610         if (pAlbumInfo == null)
611         {
612                 AppLogDebug("pAlbumInfo is null");
613                 return;
614         }
615
616         ArrayList* pAlbumPathList = new (std::nothrow) ArrayList(SingleObjectDeleter);
617         pAlbumPathList->Construct();
618         pAlbumPathList->Add(new (std::nothrow) String(allAlbumsString));
619         for (int i = 0; i < pAlbumInfo->GetDirectoryCount(); i++)
620         {
621                 pAlbumPathList->Add(*(new (std::nothrow) String(pAlbumInfo->GetDirectory(i))));
622         }
623         __pAlbumPathList = pAlbumPathList;
624 }