Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/windirstat.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorassarbad <none@none>2004-11-28 18:38:42 +0300
committerassarbad <none@none>2004-11-28 18:38:42 +0300
commit2c23c9e9bbf06b377a8158ea906d299a4e675189 (patch)
treed9e0f65ac9a2caa6c1dc485bacb3ab8e7dfc7ba2 /windirstat/item.cpp
parentd8c533e024ac075b787d910011035743ebd1ee24 (diff)
- Possible sorting implementation (using bit-order in m_attributes)
Diffstat (limited to 'windirstat/item.cpp')
-rw-r--r--windirstat/item.cpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/windirstat/item.cpp b/windirstat/item.cpp
index 0cab7da..b1cee86 100644
--- a/windirstat/item.cpp
+++ b/windirstat/item.cpp
@@ -275,7 +275,12 @@ int CItem::CompareSibling(const CTreeListItem *tlib, int subitem) const
break;
case COL_ATTRIBUTES:
{
-// return CompareNoCase(other->m_name);
+ if (GetSortAttributes() < other->GetSortAttributes())
+ return -1;
+ else if (GetSortAttributes() == other->GetSortAttributes())
+ return 0;
+ else
+ return 1;
}
break;
@@ -644,6 +649,21 @@ DWORD CItem::GetAttributes() const
return ret;
}
+// Returns a value which resembles sorting of RHSACE considering gaps
+DWORD CItem::GetSortAttributes() const
+{
+ DWORD ret = 0;
+
+ ret += (m_attributes & 0x01); // R
+ ret += (m_attributes & 0x02); // H
+ ret += (m_attributes & 0x04); // S
+ ret += (m_attributes & 0x08); // A
+ ret += (m_attributes & 0x20); // C
+ ret += (m_attributes & 0x40); // E
+
+ return (m_attributes & INVALID_m_attributes) ? 0 : ret;
+}
+
double CItem::GetFraction() const
{
if (GetParent() == NULL)
@@ -1605,6 +1625,9 @@ void CItem::DrivePacman()
// $Log$
+// Revision 1.22 2004/11/28 15:38:42 assarbad
+// - Possible sorting implementation (using bit-order in m_attributes)
+//
// Revision 1.21 2004/11/28 14:40:06 assarbad
// - Extended CFileFindWDS to replace a global function
// - Now packing/unpacking the file attributes. This even spares a call to find encrypted/compressed files.