Skip to content

Commit e9865ff

Browse files
committed
Do not do update checks while connect dialog open
1 parent 7187813 commit e9865ff

1 file changed

Lines changed: 21 additions & 15 deletions

File tree

src/clientdlg.cpp

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -825,25 +825,31 @@ void CClientDlg::OnVersionAndOSReceived ( COSUtil::EOpSystemType, QString strVer
825825

826826
void CClientDlg::OnCLVersionAndOSReceived ( CHostAddress InetAddr, COSUtil::EOpSystemType, QString strVersion )
827827
{
828-
// display version in connect dialog
829-
ConnectDlg.SetServerVersionResult ( InetAddr, strVersion );
830-
831-
// update check
828+
// if connect dialog showing, pass version to it, and don't do update check
829+
if ( bConnectDlgWasShown )
830+
{
831+
// display version in connect dialog
832+
ConnectDlg.SetServerVersionResult ( InetAddr, strVersion );
833+
}
834+
else
835+
{
836+
// update check
832837
#if ( QT_VERSION >= QT_VERSION_CHECK( 5, 6, 0 ) ) && !defined( DISABLE_VERSION_CHECK )
833-
int mySuffixIndex;
834-
QVersionNumber myVersion = QVersionNumber::fromString ( VERSION, &mySuffixIndex );
838+
int mySuffixIndex;
839+
QVersionNumber myVersion = QVersionNumber::fromString ( VERSION, &mySuffixIndex );
835840

836-
int serverSuffixIndex;
837-
QVersionNumber serverVersion = QVersionNumber::fromString ( strVersion, &serverSuffixIndex );
841+
int serverSuffixIndex;
842+
QVersionNumber serverVersion = QVersionNumber::fromString ( strVersion, &serverSuffixIndex );
838843

839-
// only compare if the server version has no suffix (such as dev or beta)
840-
if ( strVersion.size() == serverSuffixIndex && QVersionNumber::compare ( serverVersion, myVersion ) > 0 )
841-
{
842-
// show the label and hide it after one minute again
843-
lblUpdateCheck->show();
844-
QTimer::singleShot ( 60000, [this]() { lblUpdateCheck->hide(); } );
845-
}
844+
// only compare if the server version has no suffix (such as dev or beta)
845+
if ( strVersion.size() == serverSuffixIndex && QVersionNumber::compare ( serverVersion, myVersion ) > 0 )
846+
{
847+
// show the label and hide it after one minute again
848+
lblUpdateCheck->show();
849+
QTimer::singleShot ( 60000, [this]() { lblUpdateCheck->hide(); } );
850+
}
846851
#endif
852+
}
847853
}
848854

849855
void CClientDlg::OnChatTextReceived ( QString strChatText )

0 commit comments

Comments
 (0)