mirror of
https://github.com/2dust/v2rayN.git
synced 2025-07-02 21:12:09 +00:00
fixes sort the traffics may not work...
This commit is contained in:
parent
f4b885dce5
commit
dee4b19775
1 changed files with 5 additions and 22 deletions
|
@ -17,42 +17,25 @@ namespace v2rayN.Base
|
||||||
ListViewItem l2 = (ListViewItem)y;
|
ListViewItem l2 = (ListViewItem)y;
|
||||||
|
|
||||||
int doIntSort = Sorting;
|
int doIntSort = Sorting;
|
||||||
if (doIntSort > 0) // Tag will be number
|
if (doIntSort > 0 // Tag will be number
|
||||||
|
&& (ulong.TryParse(l1.SubItems[Column].Tag?.ToString(), out ulong fl1)
|
||||||
|
&& ulong.TryParse(l2.SubItems[Column].Tag?.ToString(), out ulong fl2)) // fallback to text
|
||||||
|
)
|
||||||
{
|
{
|
||||||
var data1 = l1.SubItems[Column].Tag;
|
|
||||||
var data2 = l2.SubItems[Column].Tag;
|
|
||||||
if(data1 == null & data2 == null)
|
|
||||||
{
|
|
||||||
data1 = l1.SubItems[Column].Text;
|
|
||||||
data2 = l2.SubItems[Column].Text;
|
|
||||||
System.Diagnostics.Debug.WriteLine("Tag missing?");
|
|
||||||
}
|
|
||||||
|
|
||||||
ulong.TryParse(data1.ToString(), out ulong fl1);
|
|
||||||
ulong.TryParse(data2.ToString(), out ulong fl2);
|
|
||||||
|
|
||||||
if (doIntSort == 1)
|
if (doIntSort == 1)
|
||||||
{
|
|
||||||
return fl1.CompareTo(fl2);
|
return fl1.CompareTo(fl2);
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
return fl2.CompareTo(fl1);
|
return fl2.CompareTo(fl1);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string str1 = l1.SubItems[Column].Text;
|
string str1 = l1.SubItems[Column].Text;
|
||||||
string str2 = l2.SubItems[Column].Text;
|
string str2 = l2.SubItems[Column].Text;
|
||||||
|
|
||||||
if (doIntSort == -1)
|
if (doIntSort == -1 || doIntSort == 1)
|
||||||
{
|
|
||||||
return str1.CompareTo(str2);
|
return str1.CompareTo(str2);
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
return str2.CompareTo(str1);
|
return str2.CompareTo(str1);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue