From dbd532b7d070e6fb6bb2dffc2392558c83a7e608 Mon Sep 17 00:00:00 2001 From: Sup Yut Sum Date: Wed, 20 Mar 2013 12:31:55 +0800 Subject: [PATCH] Git Status List Control sort by path as second priority, not by the n-1 column any more Signed-off-by: Sup Yut Sum --- src/TortoiseProc/GitStatusListCtrlHelpers.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/TortoiseProc/GitStatusListCtrlHelpers.cpp b/src/TortoiseProc/GitStatusListCtrlHelpers.cpp index d1d25a043..1e44d7cbd 100644 --- a/src/TortoiseProc/GitStatusListCtrlHelpers.cpp +++ b/src/TortoiseProc/GitStatusListCtrlHelpers.cpp @@ -608,6 +608,7 @@ bool CSorter::operator() (const CTGitPath* entry1 , const CTGitPath* entry2) con result = int(fileSize1 - fileSize2); } + break; } case 6: //Last Modification Date { @@ -621,6 +622,7 @@ bool CSorter::operator() (const CTGitPath* entry1 , const CTGitPath* entry2) con result = CompareFileTime(filetime1, filetime2); } + break; } case 5: //Del Number { @@ -629,6 +631,7 @@ bool CSorter::operator() (const CTGitPath* entry1 , const CTGitPath* entry2) con // result = entry1->lock_comment.CompareNoCase(entry2->lock_comment); result = A2L(entry1->m_StatDel)-A2L(entry2->m_StatDel); } + break; } case 4: //Add Number { @@ -637,6 +640,7 @@ bool CSorter::operator() (const CTGitPath* entry1 , const CTGitPath* entry2) con //result = entry1->lock_owner.CompareNoCase(entry2->lock_owner); result = A2L(entry1->m_StatAdd)-A2L(entry2->m_StatAdd); } + break; } case 3: // Status @@ -645,6 +649,7 @@ bool CSorter::operator() (const CTGitPath* entry1 , const CTGitPath* entry2) con { result = entry1->GetActionName(entry1->m_Action).CompareNoCase(entry2->GetActionName(entry2->m_Action)); } + break; } case 2: //Ext file { @@ -652,6 +657,7 @@ bool CSorter::operator() (const CTGitPath* entry1 , const CTGitPath* entry2) con { result = entry1->GetFileExtension().CompareNoCase(entry2->GetFileExtension()); } + break; } case 1: // File name { @@ -659,6 +665,7 @@ bool CSorter::operator() (const CTGitPath* entry1 , const CTGitPath* entry2) con { result = entry1->GetFileOrDirectoryName().CompareNoCase(entry2->GetFileOrDirectoryName()); } + break; } case 0: // Full path column { @@ -666,8 +673,12 @@ bool CSorter::operator() (const CTGitPath* entry1 , const CTGitPath* entry2) con { result = CTGitPath::Compare(entry1->GetGitPathString(), entry2->GetGitPathString()); } + break; } } // switch (m_nSortedColumn) + // sort by path name as second priority + if (sortedColumn > 0 && result == 0) + result = CTGitPath::Compare(entry1->GetGitPathString(), entry2->GetGitPathString()); if (!ascending) result = -result; -- 2.11.4.GIT