Skip to content

Commit

Permalink
Merge branch 'staged' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoyifang committed Nov 6, 2023
2 parents a238161 + 2799b41 commit ffa8816
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 54 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/macos-homebrew-breakpad.yml
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ jobs:
Windows users can use either `****-installer.exe` (for installer) or `****.zip` (unzip and run).
The `goldendict.exe` can be dropped into previous installation's folder (if dependencies aren't changed).
Linux users can use AppImages or Flatpak.
https://flathub.org/zh-Hans/apps/io.github.xiaoyifang.goldendict_ng
Linux users can use Flatpak or build from source.
https://flathub.org/apps/io.github.xiaoyifang.goldendict_ng
macOS users can use `.dmg` installer.
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/macos-homebrew.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,8 @@ jobs:
Windows users can use either `****-installer.exe` (for installer) or `****.zip` (unzip and run).
The `goldendict.exe` can be dropped into previous installation's folder (if dependencies aren't changed).
Linux users can use AppImages or Flatpak.
https://flathub.org/zh-Hans/apps/io.github.xiaoyifang.goldendict_ng
Linux users can use Flatpak or build from source.
https://flathub.org/apps/io.github.xiaoyifang.goldendict_ng
macOS users can use `.dmg` installer.
Expand Down
27 changes: 11 additions & 16 deletions .github/workflows/ubuntu-6.2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,16 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
# workflow_run:
# workflows: [AutoTag]
# types: [completed]
workflow_dispatch:
push:
branches:
- dev
- master
# - staged
paths-ignore:
- 'docs/**'
# - ".github/**"
- "howto/**"
- "*.md"
- ".clang-format"
# push:
# branches:
# - dev
# - master
# paths-ignore:
# - 'docs/**'
# - "howto/**"
# - "*.md"
# - ".clang-format"

jobs:
build:
Expand Down Expand Up @@ -190,8 +185,8 @@ jobs:
Windows users can use either `****-installer.exe` (for installer) or `****.zip` (unzip and run).
The `goldendict.exe` can be dropped into previous installation's folder (if dependencies aren't changed).
Linux users can use AppImages or Flatpak.
https://flathub.org/zh-Hans/apps/io.github.xiaoyifang.goldendict_ng
Linux users can use Flatpak or build from source.
https://flathub.org/apps/io.github.xiaoyifang.goldendict_ng
macOS users can use `.dmg` installer.
Expand Down
27 changes: 11 additions & 16 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,16 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
# workflow_run:
# workflows: [AutoTag]
# types: [completed]
workflow_dispatch:
push:
branches:
- dev
- master
# - staged
paths-ignore:
- 'docs/**'
# - ".github/**"
- "howto/**"
- "*.md"
- ".clang-format"
# push:
# branches:
# - dev
# - master
# paths-ignore:
# - 'docs/**'
# - "howto/**"
# - "*.md"
# - ".clang-format"

jobs:
build:
Expand Down Expand Up @@ -177,8 +172,8 @@ jobs:
Windows users can use either `****-installer.exe` (for installer) or `****.zip` (unzip and run).
The `goldendict.exe` can be dropped into previous installation's folder (if dependencies aren't changed).
Linux users can use AppImages or Flatpak.
https://flathub.org/zh-Hans/apps/io.github.xiaoyifang.goldendict_ng
Linux users can use Flatpak or build from source.
https://flathub.org/apps/io.github.xiaoyifang.goldendict_ng
macOS users can use `.dmg` installer.
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/windows-6.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,8 @@ jobs:
Windows users can use either `****-installer.exe` (for installer) or `****.zip` (unzip and run).
The `goldendict.exe` can be dropped into previous installation's folder (if dependencies aren't changed).
Linux users can use AppImages or Flatpak.
https://flathub.org/zh-Hans/apps/io.github.xiaoyifang.goldendict_ng
Linux users can use Flatpak or build from source.
https://flathub.org/apps/io.github.xiaoyifang.goldendict_ng
macOS users can use `.dmg` installer.
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ jobs:
Windows users can use either `****-installer.exe` (for installer) or `****.zip` (unzip and run).
The `goldendict.exe` can be dropped into previous installation's folder (if dependencies aren't changed).
Linux users can use AppImages or Flatpak.
https://flathub.org/zh-Hans/apps/io.github.xiaoyifang.goldendict_ng
Linux users can use Flatpak or build from source.
https://flathub.org/apps/io.github.xiaoyifang.goldendict_ng
macOS users can use `.dmg` installer.
Expand Down
17 changes: 7 additions & 10 deletions src/dict/dictserver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ bool connectToServer( QTcpSocket & socket, QString const & url, QString & errorS

socket.connectToHost( serverUrl.host(), port );
if ( socket.state() != QTcpSocket::ConnectedState ) {
if ( !socket.waitForConnected( 100 ) )
if ( !socket.waitForConnected( 2000 ) )
break;
}

Expand Down Expand Up @@ -344,14 +344,12 @@ class DictServerWordSearchRequest: public Dictionary::WordSearchRequest
QString errorString;
QFuture< void > f;
DictServerDictionary & dict;
QTcpSocket * socket;

public:

DictServerWordSearchRequest( wstring const & word_, DictServerDictionary & dict_ ):
word( word_ ),
dict( dict_ ),
socket( 0 )
dict( dict_ )
{
f = QtConcurrent::run( [ this ]() {
this->run();
Expand All @@ -362,7 +360,8 @@ class DictServerWordSearchRequest: public Dictionary::WordSearchRequest

~DictServerWordSearchRequest() override
{
f.waitForFinished();
//with this line ,the gui will be frozened?
// f.waitForFinished();
}

void cancel() override;
Expand All @@ -375,7 +374,7 @@ void DictServerWordSearchRequest::run()
return;
}

socket = new QTcpSocket;
auto socket = new QTcpSocket;

if ( !socket ) {
finish();
Expand Down Expand Up @@ -514,14 +513,12 @@ class DictServerArticleRequest: public Dictionary::DataRequest
QString errorString;
QFuture< void > f;
DictServerDictionary & dict;
QTcpSocket * socket;

public:

DictServerArticleRequest( wstring const & word_, DictServerDictionary & dict_ ):
word( word_ ),
dict( dict_ ),
socket( 0 )
dict( dict_ )
{
f = QtConcurrent::run( [ this ]() {
this->run();
Expand All @@ -545,7 +542,7 @@ void DictServerArticleRequest::run()
return;
}

socket = new QTcpSocket;
auto socket = new QTcpSocket;

if ( !socket ) {
finish();
Expand Down
4 changes: 3 additions & 1 deletion src/wordfinder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,8 @@ void WordFinder::updateResults()

void WordFinder::cancelSearches()
{
for ( auto & queuedRequest : queuedRequests )
for ( auto & queuedRequest : queuedRequests ) {
disconnect( queuedRequest.get(), 0, 0, 0 );
queuedRequest->cancel();
}
}
7 changes: 4 additions & 3 deletions website/docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ If Qt's version is not changed, you can also download a single `goldendict.exe`

## Linux

* `.Appimage` can be used in any recent linux distros.
* See the right side for available packages in various linux distros.
<a href='https://flathub.org/apps/io.github.xiaoyifang.goldendict_ng'><img width='240' alt='Download on Flathub' src='https://dl.flathub.org/assets/badges/flathub-badge-en.svg'/></a>

* See the right side for available packages in various Linux distros.
* In Debian 12 and Ubuntu 23.04, `goldendict-webengine` is available (For later versions it is `goldendict-ng`).
* Pre-built binary is also available from [archlinuxcn's repo](https://github.com/archlinuxcn/repo/tree/master/archlinuxcn/goldendict-ng-git).
* [Gentoo package from PG_Overlay](https://gitlab.com/Perfect_Gentleman/PG_Overlay/-/blob/master/app-text/goldendict/goldendict-9999-r6.ebuild)

## macOS

One of the `.dmg` installers.
One of the `.dmg` installers.

0 comments on commit ffa8816

Please sign in to comment.