Commit graph

3488 commits

Author SHA1 Message Date
Xiao YiFang 947323854a remove extra parantheses 2022-06-16 20:28:00 +08:00
Xiao YiFang 02f7fc0048 opt: concurrent limitation and auto release semaphore 2022-06-16 20:17:07 +08:00
xiaoyifang c42326834a
Update ubuntu-6.2.yml 2022-06-16 10:06:46 +08:00
xiaoyifang f2ba7fc6c0
Update ubuntu.yml 2022-06-16 10:06:19 +08:00
xiaoyifang 8f3ff22fa5
Merge pull request #101 from xiaoyifang/feature/optimize-combine-cjk-search
optimize combine cjk search
2022-06-16 08:34:52 +08:00
Xiao YiFang 79e2f7c098 unmap file when throw exception 2022-06-16 08:18:59 +08:00
Xiao YiFang 4b9d71376d remove javascript highlight logic
webengine's findtext(highlight) has little features compared to webkits
2022-06-16 08:08:49 +08:00
Xiao YiFang 6f9c1067a3 opt: optimize cjk fulltext search
1, add concurrent parallel task limitaion
2022-06-16 08:08:43 +08:00
Xiao YiFang f52251d640 fix:mdict compact html parse style error 2022-06-16 08:00:40 +08:00
xiaoyifang 5fa479b127
Merge pull request #100 from xiaoyifang/feature/concurrent-fseek
feat:mdx lock free when loadArticle
2022-06-15 14:08:29 +08:00
Xiao YiFang 5571f877bc fix: F12 inspect windows open on the first time 2022-06-15 08:12:27 +08:00
Xiao YiFang 4cf184d646 fix upstream merge conflict 2022-06-15 07:51:45 +08:00
Xiao YiFang 949ad6de57 fix mergeconflict when merge upstream 2022-06-14 22:07:01 +08:00
Xiao YiFang 206474364a feat:mdx lock free when loadArticle 2022-06-14 21:35:21 +08:00
Xiao YiFang 53bd9f96dc concurrent minor changes
1, limit QtConcurrent thread count
2, add mutex to sets operation
2022-06-14 20:51:30 +08:00
xiaoyifang 5259be69e0
Merge pull request #99 from xiaoyifang/feature/github-action-release
github: add release changelog
2022-06-14 07:41:22 +08:00
Xiao YiFang 0088377266 clean code:remove useless code 2022-06-14 07:22:16 +08:00
Xiao YiFang ab0a8ed608 github: add release changelog 2022-06-13 22:00:01 +08:00
Xiao YiFang e8bcaa2252 style: move duplicate class together 2022-06-13 19:45:29 +08:00
Xiao YiFang ec5d2b12db style:do not allow dictionary title to be selected 2022-06-13 19:45:29 +08:00
Igor Kushnir 9b5756d5e1 Don't update pages history in ArticleView::setCurrentArticle()
The current article is saved to pages history user data before any
navigation to another page and before reloading the current page.
Therefore saving it each time the user activates an article is
redundant. This redundancy is not consistent, because when a user
activates an article by clicking on it, the current article changes in
the UI, but is not immediately saved in history as setCurrentArticle()
is not called. The inconsistent redundancy is a waste of CPU time and
can hide bugs.
2022-06-12 21:26:09 +03:00
Igor Kushnir 7df106c68c Refactor: get rid of ArticleView::articleToJump
This variable overrides history user data, which makes the current
article and position restoring code in ArticleView::loadFinished()
difficult to understand.

Encode the same logic in the history user data instead. This should make
the code more straightforward and less brittle in the face of changes.
2022-06-12 20:14:22 +03:00
Igor Kushnir 40dd01755e Always jump to current article before reloading
MainWindow calls ArticleView::reload() when the group list is updated.
This updating may add/remove/reorder dictionaries in the active group.

MainWindow also calls ArticleView::reload() when the display or addon
style changes.

In both of the above scenarios uncontrolled jumps and current article
change can occur (see also the parent commit message).

Move setting articleToJump from above the only ArticleView's reload()
call into ArticleView::reload() itself.
2022-06-12 20:14:22 +03:00
Igor Kushnir 0173251b22 Jump to the first article too after expanding optional parts
When the first article in the list is current, expanding or collapsing
optional parts results in:
1) uncontrolled jumps due to the content height changes if the scroll
   position is not (0, 0);
2) current article change if a non-first article is saved in history
   user data (e.g. if a mouse click had made the first article active).

Treat the first current article in the same way as non-first ones.

This change also affects the case when the current article is not
present in the article list. If the current article is simply empty,
then there is no behavior change. If the current article is not empty,
it *must* be in the list, unless something else went wrong.
2022-06-12 20:14:22 +03:00
Igor Kushnir de69036e9e ArticleView: deduplicate expand-optional-parts code 2022-06-12 20:14:22 +03:00
Igor Kushnir e8a1358bce Refactor: extract ArticleView::load()
This way it is clearer that the pages history is updated just before
each navigation to a different page.

The call to ArticleView::saveHistoryUserData() now occurs slightly later
in ArticleView::showDefinition(). I don't think the intervening code can
affect the current article or window position. So the reordering most
likely does not affect application behavior.
2022-06-12 20:13:54 +03:00
Igor Kushnir ca0209faff Save current article and window position before loading DSL picture
Without the added saveHistoryUserData() call, returning back from the
enlarged picture page ("gdpicture") restores the current article and the
window position that were last saved. At this commit the "gdpicture"
behavior is consistent with regular links: returning back from the
enlarged picture page sets the article with the picture as current and
restores the window position at the time of the click on the picture.
2022-06-12 20:13:54 +03:00
Xiao YiFang 058ba392fd opt: fullindex need not to care about stylesheet 2022-06-11 21:06:59 +08:00
Xiao YiFang 837dcfbf63 qt5.15.2 does not work with qtconcurrent::blockingmapped 2022-06-11 21:06:59 +08:00
Xiao YiFang 76969aa49d fulltext search add concurrent support 2022-06-11 20:55:16 +08:00
Xiao YiFang 886aa7f25d github: PR check add concurrency restriction 2022-06-11 20:55:16 +08:00
Xiao YiFang 33b3a95e34 add qt5.15.2 compatibility with qtconcurrent 2022-06-11 20:55:15 +08:00
Xiao YiFang 6c82bf71b6 improve: move temporary to global static 2022-06-11 20:55:15 +08:00
Xiao YiFang dcaebf4948 imp. add QtConcurrent to checkArticle 2022-06-11 20:55:15 +08:00
Xiao YiFang 880f2df1b0 clean code: remove useless code 2022-06-11 20:55:15 +08:00
Xiao YiFang 9ea83f1299 fix : control character cause qdomdocument can not parse attribute 2022-06-11 16:25:56 +08:00
Xiao YiFang 3ed7ce5ccb syntaticly space is more reasonable than remove directly. 2022-06-10 20:44:59 +08:00
Xiao YiFang faa1ee480c fix conflict,ignore upstream change
the codebase has already changed. the upstream fix does not apply to current situation
2022-06-09 20:18:44 +08:00
Xiao YiFang 0c21dacc8a fix : inspect element hang forever if opened by right context menu on the first time. 2022-06-09 20:15:02 +08:00
xiaoyifang 73e02719d3
Update CHANGES.md 2022-06-09 12:47:59 +08:00
Igor Kushnir 10d0d8193b setCurrentArticle(): return false if the article doesn't exist
201f11e656 missed this possibility and may
have inadvertently changed the application behavior in a corner case.
2022-06-08 19:05:02 +03:00
Xiao YiFang 1c27c2e71d Revert "github: changelog modify"
This reverts commit 01da9c93ab.
2022-06-08 21:47:59 +08:00
Xiao YiFang 01da9c93ab github: changelog modify 2022-06-08 21:16:04 +08:00
Xiao YiFang 4ce03e9415 html unescape 2022-06-08 21:13:07 +08:00
Xiao YiFang 3e6c85b404 add dict's margin back to lingos style 2022-06-08 20:55:08 +08:00
Xiao YiFang 547f2a4cd2 remember last link's groupId and muted dictionary 2022-06-08 20:52:44 +08:00
Xiao YiFang 88b265765f add entry:// link support 2022-06-07 21:22:37 +08:00
Xiao YiFang 9daff6ae37 support mdex builtin link entry: 2022-06-07 08:14:53 +08:00
Xiao YiFang 5f856bf2ae refactor getqueryword 2022-06-07 08:14:53 +08:00
xiaoyifang ccd8ace0ec
Merge pull request #93 from xiaoyifang/feature/0606string-convert-replace
opt: replace string() with QString::toStdstring
2022-06-06 21:59:56 +08:00