Arrange code
[apps/osp/Gallery.git] / src / GlFileListPresentationModel.cpp
index 24a0732..335d3dd 100644 (file)
@@ -57,7 +57,7 @@ static const int W_WIDE_THUMBNAIL = 171;
 static const int H_WIDE_THUMBNAIL = 127;
 static const int W_PLAY_FG = 64;
 static const int H_PLAY_FG = 64;
-static const int GAP_W_PLAY_FG = (W_DEFAULT_THUMBNAIL -W_PLAY_FG)/2 ;
+static const int GAP_W_PLAY_FG = (W_DEFAULT_THUMBNAIL -W_PLAY_FG)/2;
 static const int GAP_H_PLAY_FG = (H_DEFAULT_THUMBNAIL - H_PLAY_FG)/2;
 static const int GAP_H_DURATION = H_DEFAULT_THUMBNAIL - H_DURATION;
 static const int ALPHA_DURATION = 70;
@@ -695,7 +695,7 @@ FileListPresentationModel::OnContentUpdated(void)
                return;
        }
        //Clear the ImageCaches when content is updated like rotate.
-       if ( __pContentEventListener->GetCount() )
+       if (__pContentEventListener->GetCount())
        {
                ClearImageCache();
        }
@@ -1004,15 +1004,15 @@ FileListPresentationModel::MoveToContentFile(const ContentId& contentId, const S
 
        r = File::Copy(filePath, destPath, false);
 
-       if ( r == E_STORAGE_FULL)
+       if (r == E_STORAGE_FULL)
        {
                File::Remove(destPath);
        }
        ContentManager::ScanFile(destPath);
 
-       if ( r == E_SUCCESS )
+       if (r == E_SUCCESS)
        {
-               if ( isCopyOperation == false)
+               if (isCopyOperation == false)
                {
                        File::Remove(filePath);               // if Move Op remove original file
                        ContentManager::ScanFile(filePath);
@@ -1075,7 +1075,7 @@ FileListPresentationModel::SetCurrentAlbumInfo(const String& albumName, const IL
                        bool isMatched = false;
                        int outterLoopCount = __pDirectoryList->GetCount();
                        int innerLoopCount = 0;
-                       for (int i = 0; i < outterLoopCount ; ++i)
+                       for (int i = 0; i < outterLoopCount; ++i)
                        {
                                isMatched = false;
                                innerLoopCount = directoryList.GetCount();
@@ -1161,31 +1161,33 @@ FileListPresentationModel::RefreshCurrentAlbumContentInfoList(const ContentType
 void
 FileListPresentationModel::AddDirectoryIfNew(const String& dirName)
 {
+
        bool isMatched = false;
        int dirCount = __pDirectoryList->GetCount();
+       String fullDirName;
+       fullDirName = Environment::GetMediaPath();
+       fullDirName.Append(dirName);
+
        if (__albumName != ResourceManager::GetString(L"IDS_MEDIABR_BODY_ALL_ALBUMS"))//we are not in All albums
        {
                return;
        }
-       for (int i = 0; i < dirCount ; ++i)
+
+       for (int i = 0; i < dirCount; ++i)
        {
-               if (static_cast<String*>(__pDirectoryList->GetAt(i))->CompareTo(dirName) == 0)
+               if (static_cast<String*>(__pDirectoryList->GetAt(i))->CompareTo(fullDirName) == 0)
                {
                        isMatched = true;
                        break;
                }
        }
+       
        if (!isMatched)
        {
-               String fullPath = Environment::GetMediaPath();
-               fullPath.Append(dirName);
-               __pDirectoryList->Add(new (std::nothrow) String(fullPath));
-
+               __pDirectoryList->Add(new (std::nothrow) String(fullDirName));
        }
 }
 
-
-
 result
 FileListPresentationModel::RefreshContentInfoList(const ContentType contentType)
 {