OSDN Git Service

remove FileEntry Structure
authorFrank Li <lznuaa@gmail.com>
Mon, 29 Dec 2008 14:35:51 +0000 (22:35 +0800)
committerFrank Li <lznuaa@gmail.com>
Mon, 29 Dec 2008 14:35:51 +0000 (22:35 +0800)
src/Git/GitStatusListCtrl.cpp
src/Git/GitStatusListCtrl.h
src/TortoiseProc/GitStatusListCtrlHelpers.cpp

index f809128..6b72253 100644 (file)
@@ -179,19 +179,20 @@ void CGitStatusListCtrl::ClearStatusArray()
        m_arStatusArray.clear();\r
 #endif\r
 }\r
-\r
+#if 0\r
 CGitStatusListCtrl::FileEntry * CGitStatusListCtrl::GetListEntry(UINT_PTR index)\r
 {\r
-#if 0\r
+\r
        if (index >= (UINT_PTR)m_arListArray.size())\r
                return NULL;\r
        if (m_arListArray[index] >= m_arStatusArray.size())\r
                return NULL;\r
        return m_arStatusArray[m_arListArray[index]];\r
-#endif\r
+\r
        return NULL;\r
 }\r
-\r
+#endif\r
+#if 0\r
 CGitStatusListCtrl::FileEntry * CGitStatusListCtrl::GetVisibleListEntry(const CTGitPath& path)\r
 {\r
        int itemCount = GetItemCount();\r
@@ -203,20 +204,23 @@ CGitStatusListCtrl::FileEntry * CGitStatusListCtrl::GetVisibleListEntry(const CT
        }\r
        return NULL;\r
 }\r
-\r
+#endif\r
+#if 0\r
 CGitStatusListCtrl::FileEntry * CGitStatusListCtrl::GetListEntry(const CTGitPath& path)\r
 {\r
-#if 0\r
+\r
        for (size_t i=0; i < m_arStatusArray.size(); i++)\r
        {\r
                FileEntry * entry = m_arStatusArray[i];\r
                if (entry->GetPath().IsEquivalentTo(path))\r
                        return entry;\r
        }\r
-#endif\r
+\r
        return NULL;\r
 }\r
+#endif\r
 \r
+#if 0\r
 int CGitStatusListCtrl::GetIndex(const CTGitPath& path)\r
 {\r
        int itemCount = GetItemCount();\r
@@ -228,6 +232,7 @@ int CGitStatusListCtrl::GetIndex(const CTGitPath& path)
        }\r
        return -1;\r
 }\r
+#endif \r
 \r
 void CGitStatusListCtrl::Init(DWORD dwColumns, const CString& sColumnInfoContainer, DWORD dwContextMenus /* = GitSLC_POPALL */, bool bHasCheckboxes /* = true */)\r
 {\r
@@ -671,7 +676,7 @@ bool CGitStatusListCtrl::FetchStatusForSingleTarget(
 #endif\r
        return true;\r
 }\r
-\r
+#if 0\r
 const CGitStatusListCtrl::FileEntry*\r
 CGitStatusListCtrl::AddNewFileEntry(\r
                        const git_wc_status2_t* pGitStatus,  // The return from the Git GetStatus functions\r
@@ -683,7 +688,7 @@ CGitStatusListCtrl::AddNewFileEntry(
                        )\r
 {\r
        FileEntry * entry = new FileEntry();\r
-#if 0\r
+\r
        \r
        entry->path = path;\r
        entry->basepath = basePath;\r
@@ -816,9 +821,10 @@ CGitStatusListCtrl::AddNewFileEntry(
 \r
        // Pass ownership of the entry to the array\r
        m_arStatusArray.push_back(entry);\r
-#endif\r
+\r
        return entry;\r
 }\r
+#endif\r
 \r
 void CGitStatusListCtrl::AddUnversionedFolder(const CTGitPath& folderName,\r
                                                                                                const CTGitPath& basePath,\r
@@ -1989,7 +1995,7 @@ void CGitStatusListCtrl::UncheckEntry(int index, int nListItems)
                m_nSelected--;\r
        }\r
 }\r
-\r
+#if 0\r
 bool CGitStatusListCtrl::EntryPathCompareNoCase(const FileEntry* pEntry1, const FileEntry* pEntry2)\r
 {\r
        return pEntry1->path < pEntry2->path;\r
@@ -1999,7 +2005,7 @@ bool CGitStatusListCtrl::IsEntryVersioned(const FileEntry* pEntry1)
 {\r
        return pEntry1->status != git_wc_status_unversioned;\r
 }\r
-\r
+#endif\r
 bool CGitStatusListCtrl::BuildStatistics()\r
 {\r
 #if 0\r
@@ -2252,6 +2258,7 @@ void CGitStatusListCtrl::OnContextMenuGroup(CWnd * /*pWnd*/, CPoint point)
                                                lv.mask = LVIF_GROUPID;\r
                                                lv.iItem = i;\r
                                                GetItem(&lv);\r
+#if 0\r
                                                if (lv.iGroupId == group)\r
                                                {\r
                                                        FileEntry * entry = GetListEntry(i);\r
@@ -2268,6 +2275,7 @@ void CGitStatusListCtrl::OnContextMenuGroup(CWnd * /*pWnd*/, CPoint point)
                                                                }\r
                                                        }\r
                                                }\r
+#endif\r
                                        }\r
                                        GetStatisticsString();\r
                                        NotifyCheck();\r
@@ -4227,6 +4235,7 @@ void CGitStatusListCtrl::OnLvnGetInfoTip(NMHDR *pNMHDR, LRESULT *pResult)
        *pResult = 0;\r
        if (m_bBlock)\r
                return;\r
+#if 0\r
        if (GetListEntry(pGetInfoTip->iItem >= 0))\r
                if (pGetInfoTip->cchTextMax > GetListEntry(pGetInfoTip->iItem)->path.GetGitPathString().GetLength())\r
                {\r
@@ -4235,6 +4244,7 @@ void CGitStatusListCtrl::OnLvnGetInfoTip(NMHDR *pNMHDR, LRESULT *pResult)
                        else if (GetStringWidth(GetListEntry(pGetInfoTip->iItem)->path.GetGitPathString()) > GetColumnWidth(pGetInfoTip->iItem))\r
                                _tcsncpy_s(pGetInfoTip->pszText, pGetInfoTip->cchTextMax, GetListEntry(pGetInfoTip->iItem)->path.GetGitPathString(), pGetInfoTip->cchTextMax);\r
                }\r
+#endif\r
 }\r
 \r
 void CGitStatusListCtrl::OnNMCustomdraw(NMHDR *pNMHDR, LRESULT *pResult)\r
@@ -4267,6 +4277,7 @@ void CGitStatusListCtrl::OnNMCustomdraw(NMHDR *pNMHDR, LRESULT *pResult)
 \r
                        if (m_arListArray.size() > (DWORD_PTR)pLVCD->nmcd.dwItemSpec)\r
                        {\r
+#if 0\r
                                FileEntry * entry = GetListEntry((int)pLVCD->nmcd.dwItemSpec);\r
                                if (entry == NULL)\r
                                        return;\r
@@ -4323,7 +4334,7 @@ void CGitStatusListCtrl::OnNMCustomdraw(NMHDR *pNMHDR, LRESULT *pResult)
 \r
                                if (entry->isConflicted)\r
                                        crText = m_Colors.GetColor(CColors::Conflict);\r
-\r
+#endif\r
                                // Store the color back in the NMLVCUSTOMDRAW struct.\r
                                pLVCD->clrText = crText;\r
                        }\r
@@ -4370,10 +4381,10 @@ void CGitStatusListCtrl::SetEntryCheck(CTGitPath* pEntry, int listboxIndex, bool
        SetCheck(listboxIndex, bCheck);\r
 }\r
 \r
-\r
+#if 0\r
 void CGitStatusListCtrl::SetCheckOnAllDescendentsOf(const FileEntry* parentEntry, bool bCheck)\r
 {\r
-#if 0\r
+\r
        int nListItems = GetItemCount();\r
        for (int j=0; j< nListItems ; ++j)\r
        {\r
@@ -4397,11 +4408,13 @@ void CGitStatusListCtrl::SetCheckOnAllDescendentsOf(const FileEntry* parentEntry
                        }\r
                }\r
        }\r
-#endif\r
+\r
 }\r
+#endif\r
 \r
 void CGitStatusListCtrl::WriteCheckedNamesToPathList(CTGitPathList& pathList)\r
 {\r
+#if 0\r
        pathList.Clear();\r
        int nListItems = GetItemCount();\r
        for (int i=0; i< nListItems; i++)\r
@@ -4414,6 +4427,7 @@ void CGitStatusListCtrl::WriteCheckedNamesToPathList(CTGitPathList& pathList)
                }\r
        }\r
        pathList.SortByPathname();\r
+#endif\r
 }\r
 \r
 \r
@@ -4789,6 +4803,7 @@ bool CGitStatusListCtrl::HasPath(const CTGitPath& path)
 \r
 bool CGitStatusListCtrl::IsPathShown(const CTGitPath& path)\r
 {\r
+#if 0\r
        int itemCount = GetItemCount();\r
        for (int i=0; i < itemCount; i++)\r
        {\r
@@ -4796,6 +4811,7 @@ bool CGitStatusListCtrl::IsPathShown(const CTGitPath& path)
                if (entry->GetPath().IsEquivalentTo(path))\r
                        return true;\r
        }\r
+#endif\r
        return false;\r
 }\r
 \r
@@ -5085,6 +5101,7 @@ bool CGitStatusListCtrl::CopySelectedEntriesToClipboard(DWORD dwCols)
 \r
 size_t CGitStatusListCtrl::GetNumberOfChangelistsInSelection()\r
 {\r
+#if 0\r
        std::set<CString> changelists;\r
        POSITION pos = GetFirstSelectedItemPosition();\r
        int index;\r
@@ -5095,6 +5112,8 @@ size_t CGitStatusListCtrl::GetNumberOfChangelistsInSelection()
                        changelists.insert(entry->changelist);\r
        }\r
        return changelists.size();\r
+#endif \r
+       return 0;\r
 }\r
 \r
 bool CGitStatusListCtrl::PrepareGroups(bool bForce /* = false */)\r
index c009c2f..ffc6ff4 100644 (file)
@@ -145,6 +145,7 @@ SVNSLC_SHOWINCOMPLETE|SVNSLC_SHOWEXTERNAL|SVNSLC_SHOWINEXTERNALS)
 typedef int (__cdecl *GENERICCOMPAREFN)(const void * elem1, const void * elem2);\r
 typedef CComCritSecLock<CComCriticalSection> Locker;\r
 \r
+class CGitStatusListCtrlDropTarget;\r
 /**\r
  * \ingroup SVN\r
  * A List control, based on the MFC CListCtrl which shows a list of\r
@@ -193,7 +194,7 @@ public:
         * Helper class for CGitStatusListCtrl which represents\r
         * the data for each file shown.\r
         */\r
-\r
+#if 0\r
        class FileEntry\r
        {\r
        public:\r
@@ -319,6 +320,7 @@ public:
                friend class CGitStatusListCtrlDropTarget;\r
         friend class CSorter;\r
        };\r
+#endif\r
        /**\r
         * \ingroup TortoiseProc\r
         * Helper class for CGitStatusListCtrl that represents\r
@@ -376,9 +378,9 @@ public:
         /// call these to update the user-prop list\r
         /// (will also auto-insert /-remove new list columns)\r
 \r
-        void UpdateUserPropList (const std::vector<FileEntry*>& files);\r
-        void UpdateRelevance ( const std::vector<FileEntry*>& files\r
-                             , const std::vector<size_t>& visibleFiles);\r
+        //void UpdateUserPropList (const std::vector<FileEntry*>& files);\r
+        //void UpdateRelevance ( const std::vector<FileEntry*>& files\r
+         //                    , const std::vector<size_t>& visibleFiles);\r
 \r
         /// don't clutter the context menu with irrelevant prop info\r
 \r
@@ -562,13 +564,13 @@ public:
        /**\r
         * Returns the file entry data for the list control index.\r
         */\r
-       CGitStatusListCtrl::FileEntry * GetListEntry(UINT_PTR index);\r
+       //CGitStatusListCtrl::FileEntry * GetListEntry(UINT_PTR index);\r
 \r
        /**\r
         * Returns the file entry data for the specified path.\r
         * \note The entry might not be shown in the list control.\r
         */\r
-       CGitStatusListCtrl::FileEntry * GetListEntry(const CTGitPath& path);\r
+       //CGitStatusListCtrl::FileEntry * GetListEntry(const CTGitPath& path);\r
 \r
        /**\r
         * Returns the index of the list control entry with the specified path,\r
@@ -579,7 +581,7 @@ public:
        /**\r
         * Returns the file entry data for the specified path in the list control.\r
         */\r
-       CGitStatusListCtrl::FileEntry * GetVisibleListEntry(const CTGitPath& path);\r
+       //CGitStatusListCtrl::FileEntry * GetVisibleListEntry(const CTGitPath& path);\r
 \r
        /**\r
         * Returns a String containing some statistics like number of modified, normal, deleted,...\r
@@ -729,7 +731,7 @@ public:
 private:\r
        void SaveColumnWidths(bool bSaveToRegistry = false);\r
        void Sort();    ///< Sorts the control by columns\r
-       void AddEntry(FileEntry * entry, WORD langID, int listIndex);   ///< add an entry to the control\r
+       //void AddEntry(FileEntry * entry, WORD langID, int listIndex); ///< add an entry to the control\r
        void RemoveListEntry(int index);        ///< removes an entry from the listcontrol and both arrays\r
        bool BuildStatistics(); ///< build the statistics and correct the case of files/folders\r
        void StartDiff(int fileindex);  ///< start the external diff program\r
@@ -752,26 +754,26 @@ private:
        void ClearStatusArray();\r
 \r
        /// Sort predicate function - Compare the paths of two entries without regard to case\r
-       static bool EntryPathCompareNoCase(const FileEntry* pEntry1, const FileEntry* pEntry2);\r
+       //static bool EntryPathCompareNoCase(const FileEntry* pEntry1, const FileEntry* pEntry2);\r
 \r
        /// Predicate used to build a list of only the versioned entries of the FileEntry array\r
-       static bool IsEntryVersioned(const FileEntry* pEntry1);\r
+       //static bool IsEntryVersioned(const FileEntry* pEntry1);\r
 \r
        /// Look up the relevant show flags for a particular Git status value\r
        DWORD GetShowFlagsFromGitStatus(git_wc_status_kind status);\r
 \r
        /// Build a FileEntry item and add it to the FileEntry array\r
-       const FileEntry* AddNewFileEntry(\r
-               const git_wc_status2_t* pGitStatus,  // The return from the Git GetStatus functions\r
-               const CTGitPath& path,                          // The path of the item we're adding\r
-               const CTGitPath& basePath,                      // The base directory for this status build\r
-               bool bDirectItem,                                       // Was this item the first found by GetFirstFileStatus or by a subsequent GetNextFileStatus call\r
-               bool bInExternal,                                       // Are we in an 'external' folder\r
-               bool bEntryfromDifferentRepo            // if the entry is from a different repository\r
-               );\r
+       //const FileEntry* AddNewFileEntry(\r
+       //      const git_wc_status2_t* pGitStatus,  // The return from the Git GetStatus functions\r
+       //      const CTGitPath& path,                          // The path of the item we're adding\r
+       //      const CTGitPath& basePath,                      // The base directory for this status build\r
+       //      bool bDirectItem,                                       // Was this item the first found by GetFirstFileStatus or by a subsequent GetNextFileStatus call\r
+       //      bool bInExternal,                                       // Are we in an 'external' folder\r
+       //      bool bEntryfromDifferentRepo            // if the entry is from a different repository\r
+       //      );\r
 \r
        /// Adjust the checkbox-state on all descendants of a specific item\r
-       void SetCheckOnAllDescendentsOf(const FileEntry* parentEntry, bool bCheck);\r
+       //void SetCheckOnAllDescendentsOf(const FileEntry* parentEntry, bool bCheck);\r
 \r
        /// Build a path list of all the selected items in the list (NOTE - SELECTED, not CHECKED)\r
        void FillListOfSelectedItemPaths(CTGitPathList& pathList, bool bNoIgnored = false);\r
index 16c6a5e..0411791 100644 (file)
@@ -403,12 +403,12 @@ void CGitStatusListCtrl::ColumnManager::ColumnResized (int column)
 \r
 // call these to update the user-prop list\r
 // (will also auto-insert /-remove new list columns)\r
-\r
+#if 0\r
 void CGitStatusListCtrl::ColumnManager::UpdateUserPropList \r
     (const std::vector<FileEntry*>& files)\r
 {\r
     // collect all user-defined props\r
-#if 0\r
+\r
     std::set<CString> aggregatedProps;\r
     for (size_t i = 0, count = files.size(); i < count; ++i)\r
         files[i]->present_props.GetPropertyNames (aggregatedProps);\r
@@ -506,15 +506,16 @@ void CGitStatusListCtrl::ColumnManager::UpdateUserPropList
 \r
     ApplyColumnOrder();\r
 \r
-#endif\r
-}\r
 \r
+}\r
+#endif\r
+#if 0\r
 void CGitStatusListCtrl::ColumnManager::UpdateRelevance \r
     ( const std::vector<FileEntry*>& files\r
     , const std::vector<size_t>& visibleFiles)\r
 {\r
     // collect all user-defined props that belong to shown files\r
-#if 0\r
+\r
     std::set<CString> aggregatedProps;\r
     for (size_t i = 0, count = visibleFiles.size(); i < count; ++i)\r
         files[visibleFiles[i]]->present_props.GetPropertyNames (aggregatedProps);\r
@@ -530,9 +531,9 @@ void CGitStatusListCtrl::ColumnManager::UpdateRelevance
             columns[i].relevant \r
                 = aggregatedProps.find (GetName(i)) != aggregatedProps.end();\r
         }\r
-#endif\r
-}\r
 \r
+}\r
+#endif\r
 // don't clutter the context menu with irrelevant prop info\r
 \r
 bool CGitStatusListCtrl::ColumnManager::AnyUnusedProperties() const\r