Commit graph

3488 commits

Author SHA1 Message Date
Xiao YiFang e32062cf82 opt:format gd-custom file 2022-07-09 12:52:33 +08:00
Xiao YiFang 505dd9efc8 clean:minor change to the goldendict.pro file 2022-07-09 11:20:15 +08:00
Xiao YiFang 5105f12516 opt: refract the code to monitor iframe height 2022-07-09 11:17:58 +08:00
Xiao YiFang 3ef3535213 opt: disable websecurity to enable cross domain access
without this , javascript can not access certain website dictionary (using iframe )
add --disable-web-security to qapplication argv
2022-07-09 11:04:39 +08:00
Xiao YiFang 7cac8c79b8 opt:deal with empty reply. 2022-07-09 10:37:40 +08:00
Xiao YiFang 79cec220de github:remove qt6.2.4 build 2022-07-08 22:17:37 +08:00
Xiao YiFang dc058e7d68 fix: remove useless code . 2022-07-08 22:13:40 +08:00
Xiao YiFang 4d81b3b9e0 fix merge conflict 2022-07-02 19:13:53 +08:00
Igor Kushnir d8d3002329 Revert "Replace a fruitless check with an assertion"
The assertion failure can be triggered by full-text-searching for a
common word, selecting a result with many large articles and quickly
selecting text in the first article while the page is still loading.

This reverts commit c936d03fa0.
2022-07-02 12:21:34 +03:00
Igor Kushnir 1e43bdf18c highlightFTSResults: return earlier if the regexp is empty
A default-constructed QRegExp is passed to ArticleView::showDefinition()
when a user navigates from an FTS-result page by clicking a link or
double-clicking a word. QRegExp().pattern() returns an empty string,
which is stored in the "regexp" query item of an URL. When this URL is
loaded, ArticleView::loadFinished() calls highlightFTSResults(), which
then calls closeSearch(), performs multiple string and regular
expression operations and early-returns because the regular expression
pattern is empty. Returning earlier skips useless work in this case.

An alternative optimization is not calling highlightFTSResults() at all
when the regular expression is empty, but that would skip the
closeSearch() call and keep the FTS search frame visible on a page with
an empty regexp.
2022-07-01 19:48:42 +03:00
Igor Kushnir c936d03fa0 Replace a fruitless check with an assertion
This reduces CPU time waste and simplifies adding Qt WebEngine support.
2022-07-01 18:43:43 +03:00
Xiao YiFang 9f5218b305 remove useless ontop icon 2022-06-29 20:29:34 +08:00
Xiao YiFang a88758f4ef fix:inspect windows ,related to qtbug-101724 2022-06-29 20:24:55 +08:00
Xiao YiFang 8f5a552e77 work around to fix too long headword in dsl 2022-06-28 20:47:38 +08:00
xiaoyifang 417628292d
Merge branch 'goldendict:master' into staged 2022-06-28 15:06:10 +08:00
xiaoyifang 01a6ffa061
Update scanpopup.ui 2022-06-28 09:18:59 +08:00
Xiao YiFang 5a2efe20bb feat: replace ontop icon in the scan popup dialog 2022-06-28 08:03:04 +08:00
Abs62 5d51f183d6 DSL: A little more fix resource loading in some cases 2022-06-27 17:43:32 +03:00
xiaoyifang d9e25834b2
Update README.md 2022-06-26 19:07:16 +08:00
Xiao YiFang 7a642c1917 feat: tracking clipboard 2022-06-25 20:56:26 +08:00
xiaoyifang 8c8d8b8198
Update README.md 2022-06-25 06:48:55 +08:00
Xiao YiFang 3d5f3d6616 feat: clipboard tracking 2022-06-24 21:34:03 +08:00
Xiao YiFang 7eb603a9c5 feat: expose clipboard tracking function 2022-06-24 21:20:16 +08:00
Xiao YiFang b617323bfc the last headword in the block has incorrect data length 2022-06-23 20:15:55 +08:00
Xiao YiFang 4a3905c701 fix:inspect windows on qt6 can not work with right context menu 2022-06-23 20:15:49 +08:00
Xiao YiFang 4e4c9375be opt: langcoder optimization 2022-06-23 20:03:29 +08:00
Xiao YiFang af4946d7a7 fix upstream merge conflict 2022-06-22 17:48:52 +08:00
Xiao YiFang 01a8995504 the headword length is not correct
due to the parse of the headword length ,   the last headword has incorrect data length ,which has
cross over many headwords.

the string(constData) will ignore the other headwords coming behind the \0 character.
2022-06-22 07:52:19 +08:00
Igor Kushnir 7fa7ad6e52 FFmpeg 5.0 player: stop reading raw data at EOF
Since the update to FFmpeg 5.0, when FFmpeg+libao internal player is
selected, most sounds fail to be pronounced. Furthermore, each failed
pronunciation attempt increases GoldenDict's CPU usage. Finally,
GoldenDict continues to hang and utilize the CPU cores when the user
attempts to exit it.

The reason for the issue is: GoldenDict's readAudioData() returns 0 at
EOF but FFmpeg expects the callback to return AVERROR_EOF. As a result,
internal player's threads are busy calling readAudioData() indefinitely.

a606f27f4c
documented the expected return value of the read_packet callback.
252500a78f
removed the code that handled the deprecated 0 return value gracefully.

The relevant deprecation warning
"Invalid return value 0 for stream protocol" had been flooding
GoldenDict's output for years

Fixes #1489.
2022-06-21 17:53:23 +03:00
xiaoyifang 7bcdfac334
Merge branch 'goldendict:master' into staged 2022-06-21 07:52:25 +08:00
Igor Kushnir 39abe4f1a6 Restart search when case sensitivity changes
One issue with the current implementation is that a wrong-cased match
remains selected when the user checks the Case Sensitive checkbox.
Another issue is that the noResults property of searchText is not
updated right away, which means that searchText's background color
remains wrong until next search.

Handle toggling case sensitivity in the same way as editing the searched
text: restart search from the beginning of the page. This improves the
Search-in-page UI consistency.
2022-06-20 19:18:57 +03:00
xiaoyifang 8ee6446df1
Merge pull request #104 from xiaoyifang/fix/concurrent-run
concurrent run will crash application
2022-06-19 21:22:30 +08:00
Xiao YiFang bd02d65ecc concurrent run will crash application 2022-06-19 20:26:39 +08:00
Xiao YiFang 6ff042d56f fulltext search can not cancel 2022-06-19 14:56:18 +08:00
Xiao YiFang 4edd3b3987 add mutex to scopedmemmap 2022-06-19 13:26:41 +08:00
Xiao YiFang 3c02fb7499 bump alpha version to 22.6.22 2022-06-19 10:16:31 +08:00
Xiao YiFang f65d47602a concurrent excepton 2022-06-18 20:46:17 +08:00
Xiao YiFang ff5e3b5778 feat:optimize fulltext search ,skip unfinished ftx 2022-06-18 18:50:05 +08:00
Xiao YiFang a5726aead7 replace regularexpress with global static variables 2022-06-18 18:20:58 +08:00
Xiao YiFang afd477e3a6 fix:a very race case boundary protection
need further inverstigation
2022-06-18 13:53:26 +08:00
Xiao YiFang 9472e1a06c code simplified 2022-06-18 12:50:12 +08:00
Xiao YiFang 3d3088738e revert mutex parent class from qrecursivemutex to qmutex 2022-06-18 09:17:43 +08:00
Xiao YiFang 7a43cc366e use qmutex instead of mutex(qmutexrecursive) 2022-06-18 09:09:49 +08:00
Xiao YiFang 6d5ff66008 feat: cancel fulltext search 2022-06-17 21:41:45 +08:00
Xiao YiFang 2f3af9d7d3 map nullptr check 2022-06-17 20:37:59 +08:00
Xiao YiFang fa72de7b17 github:ubuntu 6.x appimage 2022-06-17 20:29:02 +08:00
Xiao YiFang ceb31baf97 add mutex to getBlock 2022-06-17 20:23:16 +08:00
Xiao YiFang 5c4a968781 github:upgrade qt6.3.0 to qt6.3.1 2022-06-16 21:08:01 +08:00
Xiao YiFang 1830415da5 fix: highlight a rare case when toPlainText omit space between two words 2022-06-16 21:03:58 +08:00
Xiao YiFang 2da252539a auto file unmap 2022-06-16 20:37:26 +08:00