Skip to content

Commit b4a0757

Browse files
committed
bug fix: do not update reduced server list if it was once received
1 parent f27cf88 commit b4a0757

2 files changed

Lines changed: 33 additions & 16 deletions

File tree

src/connectdlg.cpp

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,17 @@ CConnectDlg::CConnectDlg ( CClient* pNCliP,
3030
const bool bNewShowCompleteRegList,
3131
QWidget* parent,
3232
Qt::WindowFlags f )
33-
: QDialog ( parent, f ),
34-
pClient ( pNCliP ),
35-
strCentralServerAddress ( "" ),
36-
strSelectedAddress ( "" ),
37-
strSelectedServerName ( "" ),
38-
bShowCompleteRegList ( bNewShowCompleteRegList ),
39-
bServerListReceived ( false ),
40-
bServerListItemWasChosen ( false ),
41-
bListFilterWasActive ( false ),
42-
bShowAllMusicians ( true )
33+
: QDialog ( parent, f ),
34+
pClient ( pNCliP ),
35+
strCentralServerAddress ( "" ),
36+
strSelectedAddress ( "" ),
37+
strSelectedServerName ( "" ),
38+
bShowCompleteRegList ( bNewShowCompleteRegList ),
39+
bServerListReceived ( false ),
40+
bReducedServerListReceived ( false ),
41+
bServerListItemWasChosen ( false ),
42+
bListFilterWasActive ( false ),
43+
bShowAllMusicians ( true )
4344
{
4445
setupUi ( this );
4546

@@ -216,9 +217,10 @@ void CConnectDlg::showEvent ( QShowEvent* )
216217
void CConnectDlg::RequestServerList()
217218
{
218219
// reset flags
219-
bServerListReceived = false;
220-
bServerListItemWasChosen = false;
221-
bListFilterWasActive = false;
220+
bServerListReceived = false;
221+
bReducedServerListReceived = false;
222+
bServerListItemWasChosen = false;
223+
bListFilterWasActive = false;
222224

223225
// clear current address and name
224226
strSelectedAddress = "";
@@ -270,10 +272,24 @@ void CConnectDlg::SetServerList ( const CHostAddress& InetAddr,
270272
const CVector<CServerInfo>& vecServerInfo,
271273
const bool bIsReducedServerList )
272274
{
273-
// set flag and disable timer for resend server list request if full list
274-
// was received (i.e. not the reduced list)
275-
if ( !bIsReducedServerList )
275+
// special treatment if a reduced server list was received
276+
if ( bIsReducedServerList )
276277
{
278+
// make sure we only apply the reduced version list once
279+
if ( bReducedServerListReceived )
280+
{
281+
// do nothing
282+
return;
283+
}
284+
else
285+
{
286+
bReducedServerListReceived = true;
287+
}
288+
}
289+
else
290+
{
291+
// set flag and disable timer for resend server list request if full list
292+
// was received (i.e. not the reduced list)
277293
bServerListReceived = true;
278294
TimerReRequestServList.stop();
279295
}

src/connectdlg.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ class CConnectDlg : public QDialog, private Ui_CConnectDlgBase
102102
QString strSelectedServerName;
103103
bool bShowCompleteRegList;
104104
bool bServerListReceived;
105+
bool bReducedServerListReceived;
105106
bool bServerListItemWasChosen;
106107
bool bListFilterWasActive;
107108
bool bShowAllMusicians;

0 commit comments

Comments
 (0)