From 56c91468e4a8530e3e0e95e523ed2e37691e5186 Mon Sep 17 00:00:00 2001 From: "chitta.rs" Date: Mon, 1 Apr 2013 19:47:16 +0530 Subject: [PATCH] 1.Nabi issue fix 2.Internal issue fix Change-Id: Iae8f5da774819b01a1b14eae1373b09d47238dd8 --- inc/MfTypes.h | 3 +- src/MfContentListItem.cpp | 4 +- src/MfFileManageForm.cpp | 9 +++ src/MfFileManageWorkerThread.cpp | 6 ++ src/MfFolderEntryDetailPresentationModel.cpp | 92 ++++++++++++++++++++++++---- src/MfFolderEntryPresentationModel.cpp | 2 +- src/MfSubBaseFileManageForm.cpp | 4 +- src/MfSubFolderSelection.cpp | 17 +++-- src/MfThumbnailItemProviderAndListener.cpp | 2 +- src/MfTopLevelDirectoryMoveCopy.cpp | 6 +- 10 files changed, 118 insertions(+), 27 deletions(-) diff --git a/inc/MfTypes.h b/inc/MfTypes.h index 5d6bc20..2b6870e 100644 --- a/inc/MfTypes.h +++ b/inc/MfTypes.h @@ -394,7 +394,8 @@ enum ThumbnailProviderSourceID THUMBNAIL_PROVIDER_SOURCEID_TOP_FOLDER_FILE_LIST_FORM = 0, /*!< Enum value SOURCE_TOP_LEVEL_FORM. */ THUMBNAIL_PROVIDER_SOURCEID_SUB_FOLDER_FILE_LIST_FORM = 1, /*!< Enum value SOURCE_SUB_LEVEL_FORM. */ THUMBNAIL_PROVIDER_SOURCEID_SUB_MOVE_COPY_FORM, - THUMBNAIL_PROVIDER_SOURCEID_TOP_MOVE_COPY_FORM, /*!< Enum value SOURCE_TOP_MOVE_COPY_FORM. */ + THUMBNAIL_PROVIDER_SOURCEID_TOP_MOVE_COPY_FORM,/*!< Enum value SOURCE_TOP_MOVE_COPY_FORM. */ + THUMBNAIL_PROVIDER_SOURCEID_SHARE_FORM, THUMBNAIL_PROVIDER_SOURCEID_FILE_MANAGE_FORM, /*!< Enum value SOUCE_FILE_MANAGE_FORM. */ THUMBNAIL_PROVIDER_SOURCEID_SPLIT_PANEL_FORM, /*!< Enum value SOURCE_SPLIT_PANEL_FORM. */ THUMBNAIL_PROVIDER_SOURCEID_SPLIT_PANEL_FILE_MANAGE_FORM, diff --git a/src/MfContentListItem.cpp b/src/MfContentListItem.cpp index 23b04a3..1f55fa9 100644 --- a/src/MfContentListItem.cpp +++ b/src/MfContentListItem.cpp @@ -866,7 +866,7 @@ ContentListItem::MakeSearchFormListItem(void) int width = __itemWidth; int w_Rename = W_RENAME_ICON; int h_Rename = W_RENAME_ICON; - int w_Title = width - (W_LISTVIEW_ITEM_BITMAP + (4 * X_LISTVIEW) + w_Rename + W_RENAME_ICON); + int w_Title = width - (W_LISTVIEW_ITEM_BITMAP + (4 * X_LISTVIEW) + W_RENAME_ICON); int x_Rename = width - (W_RENAME_ICON + X_LISTVIEW); GetItemSize(__itemHeight, titleHeight); @@ -877,7 +877,7 @@ ContentListItem::MakeSearchFormListItem(void) SetElementTextVerticalAlignment(CONTENT_LIST_ITEM_TYPE_RENAME, ALIGNMENT_MIDDLE); __thumbnailRect.SetBounds(thumbnailX, thumbnailY, thumbnailWidth, thumbnailHeight); //right side width:20 - __titleRect.SetBounds(thumbnailX + thumbnailWidth + normalGap, Y_LISTVIEW, w_Title, H_LISTVIEW_ITEM_TITLE); + __titleRect.SetBounds((2 * thumbnailX) + thumbnailWidth, Y_LISTVIEW, w_Title, H_LISTVIEW_ITEM_TITLE); __editRenameRect.SetBounds(x_Rename, (__itemHeight - W_RENAME_ICON) / 2, w_Rename, h_Rename); __editDateRect.SetBounds(thumbnailX + thumbnailWidth + normalGap, H_LISTVIEW_ITEM_TITLE + Y_LISTVIEW, w_Title, H_LISTVIEW_ITEM_DESCRIPTION); diff --git a/src/MfFileManageForm.cpp b/src/MfFileManageForm.cpp index f610d25..a697b91 100644 --- a/src/MfFileManageForm.cpp +++ b/src/MfFileManageForm.cpp @@ -196,6 +196,8 @@ FileManageForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousScen int folderCount = 0; int fileCount = 0; + int thumbnailItemSource = THUMBNAIL_PROVIDER_SOURCEID_FILE_MANAGE_FORM; + result r = E_SUCCESS; _previousSceneId = previousSceneId; @@ -238,21 +240,28 @@ FileManageForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousScen if (_editOrShare == FILE_MANAGE_EDIT) { + thumbnailItemSource = THUMBNAIL_PROVIDER_SOURCEID_FILE_MANAGE_FORM; + if (pAppResource != null) { pAppResource->GetString(L"IDS_MF_SK3_EDIT", headerText); } _pBaseItemProvider->SetSourceForm(CREATE_ITEM_SOURCE_FILE_MANAGE_FORM); _pFolderEntryPM->SetSourceForm(CREATE_ITEM_SOURCE_FILE_MANAGE_FORM); + _pThumbnailItemProvider->SetCreateItemSource(thumbnailItemSource); } else { + thumbnailItemSource = THUMBNAIL_PROVIDER_SOURCEID_SHARE_FORM; + if (pAppResource != null) { pAppResource->GetString(L"IDS_COM_BUTTON_SHARE", headerText); } _pBaseItemProvider->SetSourceForm(CREATE_ITEM_SOURCE_SHARE_FORM); _pFolderEntryPM->SetSourceForm(CREATE_ITEM_SOURCE_SHARE_FORM); + _pThumbnailItemProvider->SetCreateItemSource(thumbnailItemSource); + } _pEditListView->SetItemProvider(*_pBaseItemProvider); diff --git a/src/MfFileManageWorkerThread.cpp b/src/MfFileManageWorkerThread.cpp index fef1f84..0b8fbfe 100644 --- a/src/MfFileManageWorkerThread.cpp +++ b/src/MfFileManageWorkerThread.cpp @@ -1879,14 +1879,19 @@ CATCH: RequestId reqId; r = ContentManager::ScanDirectory(filePath,true,this,reqId); AppLogDebug("Scan dir result %s",GetErrorMessage(r)); + TryCatch(r == E_SUCCESS,,"Scan Dir Failed"); } else { r = ContentManager::ScanFile(filePath); AppLogDebug("scan file result %s",GetErrorMessage(r)); + TryCatch(r == E_SUCCESS,,"Scan File Failed"); } return r; +CATCH: + AppLogDebug("Update content Failed"); + return r; } result @@ -2043,6 +2048,7 @@ FileManageWorkerThread::RenameFolderEntry(void) { r = ContentManager::ScanFile(__renameFilePath); AppLogDebug("scan file result %s",GetErrorMessage(r)); + TryCatch(r == E_SUCCESS,,"scan file failed"); r = ContentManager::ScanFile(__filePath); AppLogDebug("scan file result %s",GetErrorMessage(r)); diff --git a/src/MfFolderEntryDetailPresentationModel.cpp b/src/MfFolderEntryDetailPresentationModel.cpp index a239dad..3d9bddf 100644 --- a/src/MfFolderEntryDetailPresentationModel.cpp +++ b/src/MfFolderEntryDetailPresentationModel.cpp @@ -157,9 +157,40 @@ FolderEntryDetailPresentationModel::GetFileName(const Tizen::Base::String& fileP StringTokenizer strTok(filePath, delim); result r = E_SUCCESS; - while (strTok.HasMoreTokens()) + String displayPhone; + String displaySdCard; + String defMediaPath = BasePresentationModel::GetMediaPath(); + String defSdCardPath = BasePresentationModel::GetSdCardPath(); + + AppResource* pAppResource = null; + + pAppResource = UiApp::GetInstance()->GetAppResource(); + + if (pAppResource != null) { - strTok.GetNextToken(token); + pAppResource->GetString(L"IDS_MF_TAB_PHONE", displayPhone); + pAppResource->GetString(L"IDS_MF_TAB_MEMORY_CARD", displaySdCard); + + displayPhone.Append("/"); + displaySdCard.Append("/"); + } + + if(filePath == defMediaPath) + { + token = displayPhone; + token.Remove(token.GetLength()-1,1); + } + else if(filePath == defSdCardPath) + { + token = displaySdCard; + token.Remove(token.GetLength()-1,1); + } + else + { + while (strTok.HasMoreTokens()) + { + strTok.GetNextToken(token); + } } pFileName = new (std::nothrow) String; @@ -171,8 +202,13 @@ FolderEntryDetailPresentationModel::GetFileName(const Tizen::Base::String& fileP String* FolderEntryDetailPresentationModel::GetFileDisplayPath(const Tizen::Base::String& filePath) { + AppLogDebug("Entry"); + String previousParentPath(L""); String fileDisplayPath; - String* pUpdatedFilePath = null; + String delim(L"/"); + String token(L""); + String *pParentPath; + String displayPhone; String displaySdCard; String defMediaPath = BasePresentationModel::GetMediaPath(); @@ -191,22 +227,52 @@ FolderEntryDetailPresentationModel::GetFileDisplayPath(const Tizen::Base::String displaySdCard.Append("/"); } - fileDisplayPath = filePath; - - if (fileDisplayPath.IsEmpty() == false) + if (filePath.Equals(BasePresentationModel::GetMediaPath(), false) || + filePath.Equals(BasePresentationModel::GetSdCardPath(), false) || + filePath.Equals(BasePresentationModel::GetUsbPath(), false)) + { + AppLogDebug("path sent is root path hence return"); + pParentPath = new (std::nothrow) String(L"/"); + return pParentPath; + } + else { - if (fileDisplayPath.StartsWith(defMediaPath, 0)) + StringTokenizer strTok(filePath, delim); + while (strTok.HasMoreTokens()) { - fileDisplayPath.Replace(defMediaPath, displayPhone); + strTok.GetNextToken(token); + previousParentPath.Append(L"/"); + previousParentPath.Append(token); + + if (strTok.GetTokenCount() == 1 /*|| + token.Equals(BasePresentationModel::GetMediaPath(), false) || + token.Equals(BasePresentationModel::GetSdCardPath(), false) || + token.Equals(BasePresentationModel::GetUsbPath(), false)*/) + { + break; + } } - else if (fileDisplayPath.StartsWith(defSdCardPath, 0)) + previousParentPath.Append(L"/"); + fileDisplayPath = previousParentPath; + + if (fileDisplayPath.IsEmpty() == false) { - fileDisplayPath.Replace(defSdCardPath, displaySdCard); + if (fileDisplayPath.StartsWith(defMediaPath, 0)) + { + fileDisplayPath.Replace(defMediaPath, displayPhone); + } + else if (fileDisplayPath.StartsWith(defSdCardPath, 0)) + { + fileDisplayPath.Replace(defSdCardPath, displaySdCard); + } } + //previousParentPath.Append(L"/"); + AppLogDebug("Display path is %ls",fileDisplayPath.GetPointer()); + fileDisplayPath.Remove(fileDisplayPath.GetLength()-1,1); + pParentPath = new (std::nothrow) String(fileDisplayPath); + AppLogDebug("Exit %s", GetErrorMessage(GetLastResult())); + return pParentPath; } - - pUpdatedFilePath = new (std::nothrow) String(fileDisplayPath); - return pUpdatedFilePath; } long long int diff --git a/src/MfFolderEntryPresentationModel.cpp b/src/MfFolderEntryPresentationModel.cpp index 0149fbd..ff5a25e 100644 --- a/src/MfFolderEntryPresentationModel.cpp +++ b/src/MfFolderEntryPresentationModel.cpp @@ -929,7 +929,7 @@ FolderEntryPresentationModel::InitThumbnailManager(void) __ThumbnailRequestInProgress = false; TryReturn(__pThumbnailManager != null, E_FAILURE, "Thumbnails could not be generated"); - TryCatch((__pFolderEntries != null) && (__pFolderEntries->GetCount() != 0) && (__requestId >= 0),r=E_FAILURE, "Invalid Arguments!"); + TryReturn((__pFolderEntries != null) && (__pFolderEntries->GetCount() != 0) && (__requestId >= 0),E_FAILURE, "Invalid Arguments!"); pDirEntry = static_cast< DirectoryEntry* >(__pFolderEntries->GetAt(__requestId)); TryCatch(pDirEntry != null,r=E_FAILURE , "FileEntry list is empty!"); diff --git a/src/MfSubBaseFileManageForm.cpp b/src/MfSubBaseFileManageForm.cpp index a100d49..5c85a7d 100644 --- a/src/MfSubBaseFileManageForm.cpp +++ b/src/MfSubBaseFileManageForm.cpp @@ -1161,9 +1161,9 @@ SubBaseFileManageForm::HideFileProgressingPopup(void) if (_pFileProgressingPopup != null && _pFileProgressingPopup->IsVisible()) { _pFileProgressingPopup->SetShowState(false); - _pFileProgressingPopup->Invalidate(true); + //_pFileProgressingPopup->Invalidate(true); - _pFileProgressingPopup->RemoveAllControls(); + //_pFileProgressingPopup->RemoveAllControls(); delete _pFileProgressingPopup; _pFileProgressingPopup = null; } diff --git a/src/MfSubFolderSelection.cpp b/src/MfSubFolderSelection.cpp index f980009..2bdaa87 100644 --- a/src/MfSubFolderSelection.cpp +++ b/src/MfSubFolderSelection.cpp @@ -385,6 +385,7 @@ SubFolderSelection::OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& li ArrayList* pArgs = null; bool itemStatus = false; Integer currentIndex = index; + RelativeLayout* pLayout = null; pArgs = new (std::nothrow) ArrayList(); pArgs->Construct(); @@ -528,8 +529,11 @@ SubFolderSelection::OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& li if (_selectionMode == SELECTION_MODE_MULTIPLE) // start of MULTIPLE_MODE_SELECTION if { - RelativeLayout* pLayout = dynamic_cast (Form::GetLayoutN()); - pLayout->SetRelation(*_pListView, _pLabelNumberOfItems,RECT_EDGE_RELATION_BOTTOM_TO_TOP); + pLayout = dynamic_cast (Form::GetLayoutN()); + if (pLayout != null) + { + pLayout->SetRelation(*_pListView, _pLabelNumberOfItems,RECT_EDGE_RELATION_BOTTOM_TO_TOP); + } if (selectedItemsCount > 0) { @@ -577,12 +581,17 @@ SubFolderSelection::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previous const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs) { + RelativeLayout* pLayout = null; + SceneManager::GetInstance()->AddSceneManagerEventListener(*this); if (_selectionMode == SELECTION_MODE_SINGE) // start of MULTIPLE_MODE_SELECTION if { - RelativeLayout* pLayout = dynamic_cast (Form::GetLayoutN()); - pLayout->SetRelation(*_pListView, this ,RECT_EDGE_RELATION_BOTTOM_TO_BOTTOM); + pLayout = dynamic_cast (Form::GetLayoutN()); + if (pLayout != null) + { + pLayout->SetRelation(*_pListView, this ,RECT_EDGE_RELATION_BOTTOM_TO_BOTTOM); + } delete pLayout; diff --git a/src/MfThumbnailItemProviderAndListener.cpp b/src/MfThumbnailItemProviderAndListener.cpp index 227542d..8d458e9 100644 --- a/src/MfThumbnailItemProviderAndListener.cpp +++ b/src/MfThumbnailItemProviderAndListener.cpp @@ -229,7 +229,7 @@ ThumbnailItemProviderAndListener::CreateItem(int index) DirectoryEntry* pDirStr = null; IconListViewItem* pItem = null; - CreateItemSource source; + ContentType contentType = CONTENT_TYPE_UNKNOWN; AppRegistry* pAppRegistry = null; pAppRegistry = UiApp::App::GetInstance()->GetAppRegistry(); diff --git a/src/MfTopLevelDirectoryMoveCopy.cpp b/src/MfTopLevelDirectoryMoveCopy.cpp index a034308..2a4db30 100644 --- a/src/MfTopLevelDirectoryMoveCopy.cpp +++ b/src/MfTopLevelDirectoryMoveCopy.cpp @@ -283,19 +283,19 @@ MfTopLevelDirectoryMoveCopy::CreateItem(int index, int itemWidth) { case 0: { - pItem->AddElement(Rectangle(26, 19, 74, 74), IDA_FORMAT_BITMAP, *__pPhone, __pPhonePress, null); + pItem->AddElement(Rectangle(X_LISTVIEW, Y_LISTVIEW, W_LISTVIEW_ITEM_BITMAP, H_LISTVIEW_ITEM_BITMAP), IDA_FORMAT_BITMAP, *__pPhone, __pPhonePress, null); } break; case 1: { - pItem->AddElement(Rectangle(26, 19, 74, 74), IDA_FORMAT_BITMAP, *__pMemoryCard, __pMemoryCardPress, null); + pItem->AddElement(Rectangle(X_LISTVIEW, Y_LISTVIEW, W_LISTVIEW_ITEM_BITMAP, H_LISTVIEW_ITEM_BITMAP), IDA_FORMAT_BITMAP, *__pMemoryCard, __pMemoryCardPress, null); } break; case 2: { - pItem->AddElement(Rectangle(26, 19, 74, 74), IDA_FORMAT_BITMAP, *__pExternalStorage, __pExternalStoragePress, null); + pItem->AddElement(Rectangle(X_LISTVIEW, Y_LISTVIEW, W_LISTVIEW_ITEM_BITMAP, H_LISTVIEW_ITEM_BITMAP), IDA_FORMAT_BITMAP, *__pExternalStorage, __pExternalStoragePress, null); } break; default: -- 2.7.4