Official eMule-Board: Sort Fix For Downloadclientsctrl.cpp - Official eMule-Board

Jump to content


Page 1 of 1

Sort Fix For Downloadclientsctrl.cpp

#1 User is offline   Avi-3k 

  • hebMule [retired] dev
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1,125
  • Joined: 25-June 03

Posted 26 July 2005 - 03:57 PM

there are some reversed sorts in DownloadClientsCtrl.cpp

DownloadClientsCtrl.cpp said:

...
case 3:
  iResult=CompareUnsigned(item2->GetDownloadDatarate(), item1->GetDownloadDatarate());
  break;
case 103:
  iResult=CompareUnsigned(item1->GetDownloadDatarate(), item2->GetDownloadDatarate());
  break;
case 4:
  iResult=CompareUnsigned(item2->GetPartCount(), item1->GetPartCount());
  break;
case 104:
  iResult=CompareUnsigned(item1->GetPartCount(), item2->GetPartCount());
  break;
case 5:
  iResult=CompareUnsigned(item2->GetSessionDown(), item1->GetSessionDown());
  break;
case 105:
  iResult=CompareUnsigned(item1->GetSessionDown(), item2->GetSessionDown());
  break;
case 6:
  iResult=CompareUnsigned(item2->GetSessionUp(), item1->GetSessionUp());
  break;
case 106:
  iResult=CompareUnsigned(item1->GetSessionUp(), item2->GetSessionUp());
  break;
...

should be

DownloadClientsCtrl.cpp said:

...
// Avi3k: sort fix
case 3:
  iResult=CompareUnsigned(item1->GetDownloadDatarate(), item2->GetDownloadDatarate());
  break;
case 103:
  iResult=CompareUnsigned(item2->GetDownloadDatarate(), item1->GetDownloadDatarate());
  break;
case 4:
  iResult=CompareUnsigned(item1->GetPartCount(), item2->GetPartCount());
  break;
case 104:
  iResult=CompareUnsigned(item2->GetPartCount(), item1->GetPartCount());
  break;
case 5:
  iResult=CompareUnsigned(item1->GetSessionDown(), item2->GetSessionDown());
  break;
case 105:
  iResult=CompareUnsigned(item2->GetSessionDown(), item1->GetSessionDown());
  break;
case 6:
  iResult=CompareUnsigned(item1->GetSessionUp(), item2->GetSessionUp());
  break;
case 106:
  iResult=CompareUnsigned(item2->GetSessionUp(), item1->GetSessionUp());
  break;
// end Avi3k: sort fix
...



btw, we can save code by using

Quote

...
case 1:
case 101:

  iResult=item1->GetVal() - item2->GetVal();
  break;
...
if (lParamSort>=100)
    iResult*=-1;

...

instead of

Quote

...
case 1:
  iResult=item1->GetVal() - item2->GetVal();
  break;
case 101:
  iResult=item2->GetVal() - item1->GetVal();
  break;
...

i saw that some listctrls already use this method.


Avi3k
retired developer of hebMule and eMule Skinner...
hebMule site and topic.
hebMule2 unique features: AntiLeech, AntiVirus, Fake Check, ServerFilter, WebSearches, Export Searches, Relative Priority, ModID and much much more...

eMule Skinner is an application to create/edit skins for eMule,
it's multilingual, supports mods, easy-to-use design, integrates to hebMule & Windows and lots more...

code fixes/improvements: #1, #2, #3, #4, #5, #6, #7, #8, #9, #10, #11 (to check/verify: #12, #13).
0

#2 User is offline   eMulefan83 

  • eF-Mod - Dev
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1,467
  • Joined: 22-April 03

Posted 26 July 2005 - 10:11 PM

Thx Avi-3k,

and good to see you back on work :D
0

#3 User is offline   Avi-3k 

  • hebMule [retired] dev
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1,125
  • Joined: 25-June 03

Posted 27 July 2005 - 07:44 AM

thanx, u'r welcome :)

Avi3k
retired developer of hebMule and eMule Skinner...
hebMule site and topic.
hebMule2 unique features: AntiLeech, AntiVirus, Fake Check, ServerFilter, WebSearches, Export Searches, Relative Priority, ModID and much much more...

eMule Skinner is an application to create/edit skins for eMule,
it's multilingual, supports mods, easy-to-use design, integrates to hebMule & Windows and lots more...

code fixes/improvements: #1, #2, #3, #4, #5, #6, #7, #8, #9, #10, #11 (to check/verify: #12, #13).
0

  • Member Options

Page 1 of 1

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users