do not change the server list order if the mouse is over the table to avoid selecting an incorrect server on a mouse double click (#293)

This commit is contained in:
Volker Fischer 2020-07-19 19:24:58 +02:00
parent d2654e18da
commit 4f256bef70
2 changed files with 10 additions and 5 deletions

View File

@ -3,10 +3,12 @@
3.5.10git
- do not change the server list order if the mouse is over the table to
avoid selecting an incorrect server on a mouse double click (#293)
TODO improve compact channels: smaller font size of name is too long

View File

@ -786,16 +786,19 @@ void CConnectDlg::SetPingTimeAndNumClientsResult ( const CHostAddress& InetAddr,
}
// Update sorting. Note that the sorting must be the last action for the
// current item since the topLevelItem ( iIdx ) is then no longer valid.
if ( bDoSorting && !bShowCompleteRegList ) // do not sort if "show all servers"
// current item since the topLevelItem(iIdx) is then no longer valid.
// To avoid that the list is sorted shortly before a double click (which
// could lead to connecting an incorrect server) the sorting is disabled
// as long as the mouse is over the list (#293).
if ( bDoSorting && !bShowCompleteRegList && !lvwServers->underMouse() ) // do not sort if "show all servers"
{
lvwServers->sortByColumn ( 4, Qt::AscendingOrder );
}
}
// if no server item has children, do not show decoration
bool bAnyListItemHasChilds = false;
const int iServerListLen = lvwServers->topLevelItemCount();
bool bAnyListItemHasChilds = false;
const int iServerListLen = lvwServers->topLevelItemCount();
for ( int iIdx = 0; iIdx < iServerListLen; iIdx++ )
{