[Winmerge-svn] SF.net SVN: winmerge:[7424] branches/R2_14/Src
Windows visual diff and merge for files and directories
Brought to you by:
christianlist,
grimmdp
From: <ge...@us...> - 2010-11-15 13:25:55
|
Revision: 7424 http://winmerge.svn.sourceforge.net/winmerge/?rev=7424&view=rev Author: gerundt Date: 2010-11-15 13:25:49 +0000 (Mon, 15 Nov 2010) Log Message: ----------- Unify DIFFITEM method naming and remove unused method. Modified Paths: -------------- branches/R2_14/Src/7zCommon.cpp branches/R2_14/Src/DiffContext.cpp branches/R2_14/Src/DiffItem.cpp branches/R2_14/Src/DiffItem.h branches/R2_14/Src/DirView.cpp branches/R2_14/Src/DirViewColItems.cpp branches/R2_14/Src/MainFrm.cpp Modified: branches/R2_14/Src/7zCommon.cpp =================================================================== --- branches/R2_14/Src/7zCommon.cpp 2010-11-13 17:33:09 UTC (rev 7423) +++ branches/R2_14/Src/7zCommon.cpp 2010-11-15 13:25:49 UTC (rev 7424) @@ -905,8 +905,8 @@ envelope->FullPath = sFilename; envelope->FullPath.insert(0, _T("\\")); envelope->FullPath.insert(0, m_bRight ? - di.getRightFilepath(pDoc->GetRightBasePath()) : - di.getLeftFilepath(pDoc->GetLeftBasePath())); + di.GetRightFilepath(pDoc->GetRightBasePath()) : + di.GetLeftFilepath(pDoc->GetLeftBasePath())); UINT32 Recurse = item.Mask.Recurse; @@ -924,7 +924,7 @@ // Folder is not implied by some other file, and has // not been enumerated so far, so enumerate it now! envelope->Name = di.left.path; - envelope->FullPath = di.getLeftFilepath(pDoc->GetLeftBasePath()); + envelope->FullPath = di.GetLeftFilepath(pDoc->GetLeftBasePath()); implied = PVOID(2); // Don't enumerate same folder twice! isSideLeft = false; Recurse = 0; @@ -943,7 +943,7 @@ // Folder is not implied by some other file, and has // not been enumerated so far, so enumerate it now! envelope->Name = di.right.path; - envelope->FullPath = di.getRightFilepath(pDoc->GetRightBasePath()); + envelope->FullPath = di.GetRightFilepath(pDoc->GetRightBasePath()); implied = PVOID(2); // Don't enumerate same folder twice! isSideRight = false; Recurse = 0; @@ -1099,7 +1099,7 @@ { cchBuffer += ( - m_bRight ? di.getRightFilepath(sLeftRootPath) : di.getLeftFilepath(sRightRootPath) + m_bRight ? di.GetRightFilepath(sLeftRootPath) : di.GetLeftFilepath(sRightRootPath) ).length() + (m_bRight ? di.right.filename : di.left.filename).length() + 2; } } @@ -1113,7 +1113,7 @@ ( pchBuffer, _T("%s\\%s"), - m_bRight ? di.getRightFilepath(sLeftRootPath).c_str() : di.getLeftFilepath(sRightRootPath).c_str(), + m_bRight ? di.GetRightFilepath(sLeftRootPath).c_str() : di.GetLeftFilepath(sRightRootPath).c_str(), m_bRight ? di.right.filename.c_str() : di.left.filename.c_str() ) + 1; } Modified: branches/R2_14/Src/DiffContext.cpp =================================================================== --- branches/R2_14/Src/DiffContext.cpp 2010-11-13 17:33:09 UTC (rev 7423) +++ branches/R2_14/Src/DiffContext.cpp 2010-11-15 13:25:49 UTC (rev 7424) @@ -125,9 +125,9 @@ String filepath; if (bLeft == TRUE) - filepath = paths_ConcatPath(di.getLeftFilepath(GetNormalizedLeft()), di.left.filename); + filepath = paths_ConcatPath(di.GetLeftFilepath(GetNormalizedLeft()), di.left.filename); else - filepath = paths_ConcatPath(di.getRightFilepath(GetNormalizedRight()), di.right.filename); + filepath = paths_ConcatPath(di.GetRightFilepath(GetNormalizedRight()), di.right.filename); DiffFileInfo & dfi = bLeft ? di.left : di.right; if (!dfi.Update(filepath.c_str())) @@ -185,7 +185,7 @@ LPCTSTR ext = PathFindExtension(di.left.filename.c_str()); if (!CheckFileForVersion(ext)) return; - spath = di.getLeftFilepath(GetNormalizedLeft()); + spath = di.GetLeftFilepath(GetNormalizedLeft()); spath = paths_ConcatPath(spath, di.left.filename); } else @@ -195,7 +195,7 @@ LPCTSTR ext = PathFindExtension(di.right.filename.c_str()); if (!CheckFileForVersion(ext)) return; - spath = di.getRightFilepath(GetNormalizedRight()); + spath = di.GetRightFilepath(GetNormalizedRight()); spath = paths_ConcatPath(spath, di.right.filename); } Modified: branches/R2_14/Src/DiffItem.cpp =================================================================== --- branches/R2_14/Src/DiffItem.cpp 2010-11-13 17:33:09 UTC (rev 7423) +++ branches/R2_14/Src/DiffItem.cpp 2010-11-15 13:25:49 UTC (rev 7424) @@ -30,7 +30,7 @@ } /** @brief Return path to left file, including all but file name */ -String DIFFITEM::getLeftFilepath(const String &sLeftRoot) const +String DIFFITEM::GetLeftFilepath(const String &sLeftRoot) const { String sPath; if (!diffcode.isSideRightOnly()) @@ -41,7 +41,7 @@ } /** @brief Return path to right file, including all but file name */ -String DIFFITEM::getRightFilepath(const String &sRightRoot) const +String DIFFITEM::GetRightFilepath(const String &sRightRoot) const { String sPath; if (!diffcode.isSideLeftOnly()) Modified: branches/R2_14/Src/DiffItem.h =================================================================== --- branches/R2_14/Src/DiffItem.h 2010-11-13 17:33:09 UTC (rev 7423) +++ branches/R2_14/Src/DiffItem.h 2010-11-15 13:25:49 UTC (rev 7424) @@ -144,9 +144,8 @@ DIFFITEM() : parent(NULL), nidiffs(-1), nsdiffs(-1), customFlags1(0) { } ~DIFFITEM(); - bool isEmpty() const { return this == &emptyitem; } - String getLeftFilepath(const String &sLeftRoot) const; - String getRightFilepath(const String &sRightRoot) const; + String GetLeftFilepath(const String &sLeftRoot) const; + String GetRightFilepath(const String &sRightRoot) const; int GetDepth() const; bool IsAncestor(const DIFFITEM *pdi) const; bool HasChildren() const; Modified: branches/R2_14/Src/DirView.cpp =================================================================== --- branches/R2_14/Src/DirView.cpp 2010-11-13 17:33:09 UTC (rev 7423) +++ branches/R2_14/Src/DirView.cpp 2010-11-15 13:25:49 UTC (rev 7424) @@ -731,9 +731,9 @@ !di.diffcode.isSideLeftOnly() && !di.diffcode.isSideRightOnly() && !di.diffcode.isResultFiltered()) { - String leftPath = di.getLeftFilepath(pDoc->GetLeftBasePath()) + + String leftPath = di.GetLeftFilepath(pDoc->GetLeftBasePath()) + _T("\\") + di.left.filename; - String rightPath = di.getRightFilepath(pDoc->GetRightBasePath()) + + String rightPath = di.GetRightFilepath(pDoc->GetRightBasePath()) + _T("\\") + di.right.filename; CString filteredFilenames; filteredFilenames.Format(_T("%s|%s"), leftPath.c_str(), rightPath.c_str()); @@ -820,8 +820,8 @@ continue; String currentDir = (side == SIDE_LEFT) ? - di.getLeftFilepath(pDoc->GetLeftBasePath()) : - di.getRightFilepath(pDoc->GetRightBasePath()); + di.GetLeftFilepath(pDoc->GetLeftBasePath()) : + di.GetRightFilepath(pDoc->GetRightBasePath()); String filename = ((side == SIDE_LEFT) ? di.left.filename : di.right.filename); @@ -3090,7 +3090,7 @@ const DIFFITEM& di = GetDiffItem(sel); if (!di.diffcode.isSideRightOnly()) { - strPaths += di.getLeftFilepath(GetDocument()->GetLeftBasePath()); + strPaths += di.GetLeftFilepath(GetDocument()->GetLeftBasePath()); strPaths += _T("\\"); // If item is a folder then subfolder (relative to base folder) // is in filename member. @@ -3115,7 +3115,7 @@ const DIFFITEM& di = GetDiffItem(sel); if (!di.diffcode.isSideLeftOnly()) { - strPaths += di. getRightFilepath(pDoc->GetRightBasePath()); + strPaths += di.GetRightFilepath(pDoc->GetRightBasePath()); strPaths += _T("\\"); // If item is a folder then subfolder (relative to base folder) // is in filename member. @@ -3140,7 +3140,7 @@ const DIFFITEM& di = GetDiffItem(sel); if (!di.diffcode.isSideRightOnly()) { - strPaths += di.getLeftFilepath(pDoc->GetLeftBasePath()); + strPaths += di.GetLeftFilepath(pDoc->GetLeftBasePath()); strPaths += _T("\\"); // If item is a folder then subfolder (relative to base folder) // is in filename member. @@ -3150,7 +3150,7 @@ if (!di.diffcode.isSideLeftOnly()) { - strPaths += di. getRightFilepath(pDoc->GetRightBasePath()); + strPaths += di.GetRightFilepath(pDoc->GetRightBasePath()); strPaths += _T("\\"); // If item is a folder then subfolder (relative to base folder) // is in filename member. Modified: branches/R2_14/Src/DirViewColItems.cpp =================================================================== --- branches/R2_14/Src/DirViewColItems.cpp 2010-11-13 17:33:09 UTC (rev 7423) +++ branches/R2_14/Src/DirViewColItems.cpp 2010-11-15 13:25:49 UTC (rev 7424) @@ -277,12 +277,12 @@ else if (di.diffcode.isSideLeftOnly()) { s = theApp.LoadString(IDS_LEFT_ONLY_IN_FMT); - string_replace(s, _T("%1"), di.getLeftFilepath(pCtxt->GetNormalizedLeft()).c_str()); + string_replace(s, _T("%1"), di.GetLeftFilepath(pCtxt->GetNormalizedLeft()).c_str()); } else if (di.diffcode.isSideRightOnly()) { s = theApp.LoadString(IDS_RIGHT_ONLY_IN_FMT); - string_replace(s, _T("%1"), di.getRightFilepath(pCtxt->GetNormalizedRight()).c_str()); + string_replace(s, _T("%1"), di.GetRightFilepath(pCtxt->GetNormalizedRight()).c_str()); } else if (di.diffcode.isResultSame()) { Modified: branches/R2_14/Src/MainFrm.cpp =================================================================== --- branches/R2_14/Src/MainFrm.cpp 2010-11-13 17:33:09 UTC (rev 7423) +++ branches/R2_14/Src/MainFrm.cpp 2010-11-15 13:25:49 UTC (rev 7424) @@ -2078,10 +2078,10 @@ if (bValidFiles) { // Format full paths to files (leftFile/rightFile) - String leftFile = item.getLeftFilepath(pDoc->GetLeftBasePath()); + String leftFile = item.GetLeftFilepath(pDoc->GetLeftBasePath()); if (!leftFile.empty()) leftFile += _T("\\") + item.left.filename; - String rightFile = item.getRightFilepath(pDoc->GetRightBasePath()); + String rightFile = item.GetRightFilepath(pDoc->GetRightBasePath()); if (!rightFile.empty()) rightFile += _T("\\") + item.right.filename; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |