Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 21 additions & 15 deletions src/clientdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -825,25 +825,31 @@ void CClientDlg::OnVersionAndOSReceived ( COSUtil::EOpSystemType, QString strVer

void CClientDlg::OnCLVersionAndOSReceived ( CHostAddress InetAddr, COSUtil::EOpSystemType, QString strVersion )
{
// display version in connect dialog
ConnectDlg.SetServerVersionResult ( InetAddr, strVersion );

// update check
// if connect dialog showing, pass version to it, and don't do update check
if ( bConnectDlgWasShown )
{
// display version in connect dialog
ConnectDlg.SetServerVersionResult ( InetAddr, strVersion );
}
else
{
// update check
#if ( QT_VERSION >= QT_VERSION_CHECK( 5, 6, 0 ) ) && !defined( DISABLE_VERSION_CHECK )
int mySuffixIndex;
QVersionNumber myVersion = QVersionNumber::fromString ( VERSION, &mySuffixIndex );
int mySuffixIndex;
QVersionNumber myVersion = QVersionNumber::fromString ( VERSION, &mySuffixIndex );

int serverSuffixIndex;
QVersionNumber serverVersion = QVersionNumber::fromString ( strVersion, &serverSuffixIndex );
int serverSuffixIndex;
QVersionNumber serverVersion = QVersionNumber::fromString ( strVersion, &serverSuffixIndex );

// only compare if the server version has no suffix (such as dev or beta)
if ( strVersion.size() == serverSuffixIndex && QVersionNumber::compare ( serverVersion, myVersion ) > 0 )
{
// show the label and hide it after one minute again
lblUpdateCheck->show();
QTimer::singleShot ( 60000, [this]() { lblUpdateCheck->hide(); } );
}
// only compare if the server version has no suffix (such as dev or beta)
if ( strVersion.size() == serverSuffixIndex && QVersionNumber::compare ( serverVersion, myVersion ) > 0 )
{
// show the label and hide it after one minute again
lblUpdateCheck->show();
QTimer::singleShot ( 60000, [this]() { lblUpdateCheck->hide(); } );
}
#endif
}
}

void CClientDlg::OnChatTextReceived ( QString strChatText )
Expand Down