Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/staged' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
YiFang Xiao committed Oct 15, 2023
2 parents 9da4dfd + 7767d42 commit 743226e
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/macos-homebrew-breakpad.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
strategy:
matrix:
os: [macos-13]
qt_ver: [ 6.5.2 ]
qt_ver: [ 6.5.2,6.6.0 ]
qt_arch: [clang_64]
env:
targetName: GoldenDict
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos-homebrew.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
strategy:
matrix:
os: [macos-12,macos-13]
qt_ver: [ 6.5.2 ]
qt_ver: [ 6.5.2,6.6.0 ]
qt_arch: [clang_64]
env:
targetName: GoldenDict
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu-6.2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-20.04]
qt_ver: [ 6.5.2 ]
qt_ver: [ 6.5.2,6.6.0 ]
qt_arch: [gcc_64]
env:
version: 23.10.01
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu-PR-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
qt_ver: [5.15.2,6.5.2]
qt_ver: [5.15.2,6.5.2,6.6.0]
qt_arch: [gcc_64]

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows-6.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
strategy:
matrix:
os: [windows-2019]
qt_ver: [6.5.2 ]
qt_ver: [6.5.2,6.6.0 ]
qt_arch: [win64_msvc2019_64]
env:
targetName: GoldenDict.exe
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows-PR-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
strategy:
matrix:
os: [windows-2019]
qt_ver: [5.15.2,6.5.2]
qt_ver: [5.15.2,6.5.2,6.6.0]
qt_arch: [win64_msvc2019_64]
steps:
- uses: actions/setup-python@v3
Expand Down
11 changes: 5 additions & 6 deletions src/dict/dictserver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,8 @@ bool connectToServer( QTcpSocket & socket, QString const & url, QString & errorS
return false;

socket.connectToHost( serverUrl.host(), port );

if ( socket.state() != QTcpSocket::ConnectedState ) {
if ( !socket.waitForConnected( 5000 ) )
if ( !socket.waitForConnected( 100 ) )
break;
}

Expand Down Expand Up @@ -335,6 +334,7 @@ void DictServerDictionary::getServerDatabases()
if ( !errorString.isEmpty() )
gdWarning( "Retrieving databases from \"%s\" fault: %s\n", getName().c_str(), errorString.toUtf8().data() );
delete socket;
socket = nullptr;
}

class DictServerWordSearchRequest: public Dictionary::WordSearchRequest
Expand Down Expand Up @@ -482,7 +482,7 @@ void DictServerWordSearchRequest::run()
if ( count ) {
QMutexLocker _( &dataMutex );
for ( int x = 0; x < count; x++ )
matches.push_back( gd::toWString( matchesList.at( x ) ) );
matches.emplace_back( gd::toWString( matchesList.at( x ) ) );
}
}
}
Expand All @@ -496,15 +496,14 @@ void DictServerWordSearchRequest::run()
disconnectFromServer( *socket );

delete socket;
socket = nullptr;
if ( !Utils::AtomicInt::loadAcquire( isCancelled ) )
finish();
}

void DictServerWordSearchRequest::cancel()
{
isCancelled.ref();

QMutexLocker _( &dataMutex );
finish();
}

Expand Down Expand Up @@ -793,6 +792,7 @@ void DictServerArticleRequest::run()
disconnectFromServer( *socket );

delete socket;
socket = nullptr;
if ( !Utils::AtomicInt::loadAcquire( isCancelled ) )
finish();
}
Expand All @@ -801,7 +801,6 @@ void DictServerArticleRequest::cancel()
{
isCancelled.ref();

QMutexLocker _( &dataMutex );
finish();
}

Expand Down
4 changes: 2 additions & 2 deletions src/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,8 @@ int main( int argc, char ** argv )
for ( const auto & localScheme : localSchemes ) {
QWebEngineUrlScheme webUiScheme( localScheme.toLatin1() );
webUiScheme.setSyntax( QWebEngineUrlScheme::Syntax::Host );
webUiScheme.setFlags( QWebEngineUrlScheme::SecureScheme | QWebEngineUrlScheme::LocalScheme
| QWebEngineUrlScheme::LocalAccessAllowed | QWebEngineUrlScheme::CorsEnabled );
webUiScheme.setFlags( QWebEngineUrlScheme::LocalScheme | QWebEngineUrlScheme::LocalAccessAllowed
| QWebEngineUrlScheme::CorsEnabled );
QWebEngineUrlScheme::registerScheme( webUiScheme );
}

Expand Down

0 comments on commit 743226e

Please sign in to comment.