Compare commits

...

34 commits

Author SHA1 Message Date
xiaoyifang 2d0a5752c1
Merge 6c63ba45b6 into 160402e1d0 2024-11-11 09:15:53 +08:00
shenleban tongying 160402e1d0 Consistently use README and no CRLF
Some checks are pending
SonarCloud / Build and analyze (push) Waiting to run
2024-11-10 17:39:43 -05:00
shenleban tongying fb48f66370 move audio files to src/audio
a
2024-11-10 17:39:43 -05:00
xiaoyifang dcc4579544
Merge pull request #1927 from xiaoyifang/opt/group-empty-name
Some checks failed
SonarCloud / Build and analyze (push) Has been cancelled
opt: Group struct default constructor only invoked with empty string
2024-11-08 20:59:40 +08:00
xiaoyifang d3ad40f988
Merge pull request #1924 from xiaoyifang/opt/tab-blank
opt: dictionary tab switch will show blank widget when source changing.
2024-11-08 20:55:42 +08:00
xiaoyifang 081cba6b23 opt: Group struct default constructor only invoked with empty string 2024-11-08 20:49:55 +08:00
xiaoyifang 59f9b3d04f opt: dictionary tab switch show blank widget when source changed 2024-11-08 20:48:31 +08:00
shenleban tongying f6434f4219 fix a mistake of https://github.com/xiaoyifang/goldendict-ng/pull/1912
Some checks are pending
SonarCloud / Build and analyze (push) Waiting to run
2024-11-08 01:36:29 -05:00
shenleban tongying f694c3210e clean: QLocale country -> territory renaming
Some checks failed
SonarCloud / Build and analyze (push) Waiting to run
deploy_website / deploy (push) Has been cancelled
2024-11-07 03:01:45 -05:00
shenleban tongying 02143921f4
opt: disable Qt≤6.7 deprecated features and disable Qt deprecation warnings 2024-11-07 07:48:39 +00:00
shenleban tongying c864a9a897
clean: remaning deprecated QCryptographicHash::addData usages 2024-11-07 02:05:54 -05:00
shenleban tongying 618310f772
clean: just use #pragma once
Some checks are pending
SonarCloud / Build and analyze (push) Waiting to run
2024-11-06 22:53:04 -05:00
shenleban tongying f8f62efa6e fix: deploy qt translations for macOS 2024-11-06 20:33:05 -05:00
shenleban tongying a61bcb1629 fix: properly load qt and webengine translations, delete GD's custom ones 2024-11-06 20:19:53 -05:00
shenleban tongying 70d21d7eca opt: revise QKeySequenceEdit usages
Some checks are pending
SonarCloud / Build and analyze (push) Waiting to run
* set Maximum length of global shortcuts to 2
* set Default to something that can be set by user
2024-11-06 15:47:03 -05:00
shenleban tongying 8ad7291147
clean: deprecated QKeySequence[]->int; answer ikm's question from 2009
Some checks are pending
SonarCloud / Build and analyze (push) Waiting to run
2024-11-06 11:11:48 +00:00
xiaoyifang 8d0859b932
Merge pull request #1906 from xiaoyifang/opt/articleview-loadfinish
opt: rearrange some code execution order
2024-11-06 17:49:28 +08:00
shenleban tongying 349fcb6628
clean: fix all globalPosition deprecations to stop related warnings (#1911) 2024-11-06 09:11:07 +00:00
shenleban tongying 7a1df4b6c6 dev: fix changelog generation again
Some checks are pending
SonarCloud / Build and analyze (push) Waiting to run
2024-11-06 01:25:55 -05:00
xiaoyifang 285a0d8882
fix: remove some tabText() in groupWidget when rename group (#1897)
* fix: remove some tabText() in groupWidget rename group

* Update src/ui/groups_widgets.cc

Co-authored-by: shenleban tongying <shenlebantongying@gmail.com>

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: shenleban tongying <shenlebantongying@gmail.com>
2024-11-06 14:10:25 +08:00
shenleban tongying 8be7b65f29
Merge pull request #1908 from shenlebantongying/clean/tidy-using-using
clean: apply clang-tidy's `modernize-use-using` (replace most `typedef`)
2024-11-06 01:01:58 -05:00
shenleban tongying fb45d2e036 dev: add last commit to .git-blame-ignore-revs 2024-11-06 00:56:26 -05:00
shenleban tongying d15081e723 clean: apply clang-tidy's modernize-use-using (replace most typedef) 2024-11-06 00:48:35 -05:00
shenleban tongying 673911b1c5
feat: auto dark reader mode that sync with system theme 2024-11-05 23:39:08 -05:00
shenleban tongying b6fa66df92
refactor: prepare config code to implement auto dark (reader) mode
Some checks are pending
SonarCloud / Build and analyze (push) Waiting to run
2024-11-06 03:27:19 +00:00
xiaoyifang 2f48993594 opt: rearrange some code execution order 2024-11-06 10:11:21 +08:00
xiaoyifang 9315dda365
Merge pull request #1905 from xiaoyifang/opt/custom-js-defer
opt: make custom javascript delay execution
2024-11-06 09:57:43 +08:00
xiaoyifang 1418f9ab9e opt: make custom javascript delay execution 2024-11-06 09:09:18 +08:00
shenleban tongying 6efdb09b1a clean: add override to satisfy clang's Winconsistent-missing-override
Some checks are pending
SonarCloud / Build and analyze (push) Waiting to run
2024-11-05 17:27:15 -05:00
xiaoyifang d4cc838652
opt: move special GroupIDs to a seperate enum (#1900)
Some checks are pending
SonarCloud / Build and analyze (push) Waiting to run
* opt: move groupid to a seperate namespace

* opt: move groupid to a seperate namespace

* Update src/config.hh

Co-authored-by: shenleban tongying <shenlebantongying@gmail.com>

---------

Co-authored-by: shenleban tongying <shenlebantongying@gmail.com>
2024-11-05 13:51:53 +08:00
xiaoyifang c8b6a6b6c5
Update topic_userstyle.md (#1899)
Some checks failed
SonarCloud / Build and analyze (push) Waiting to run
deploy_website / deploy (push) Has been cancelled
* Update topic_userstyle.md

* Update topic_userstyle.md

---------

Co-authored-by: shenleban tongying <shenlebantongying@gmail.com>
2024-11-04 21:11:01 +08:00
xiaoyifang 3f6819b049
Merge pull request #1898 from xiaoyifang/opt/compiler-version
Some checks are pending
SonarCloud / Build and analyze (push) Waiting to run
opt: [win] update Windows compiler name
2024-11-04 17:05:28 +08:00
xiaoyifang a56cfb8d3a opt: [win] update Windows compiler name 2024-11-04 16:55:32 +08:00
xiaoyifang dd22c913e2
New Crowdin updates (#1884)
* New translations Kabyle from Crowdin

* New translations Kabyle from Crowdin
2024-11-04 13:58:01 +08:00
174 changed files with 644 additions and 21456 deletions

View file

@ -12,3 +12,6 @@ b5349478cfb0dc2dd0de8c8e8aeebdd24cf7ac6b
# mass apply clang-tidy's readability-braces-around-statements
a11c9e3aeca4329e1982d8fe26bacbb21ab50ddf
# mass apply clang-tidy's modernize-use-using
d15081e723756eef053550dc9e06e31d7828dec3

View file

@ -147,7 +147,7 @@ jobs:
if [[ '${{env.prerelease}}' == 'true' ]]
then
echo "This is a pre-release"
previousTag=$(git tag --sort=-creatordate | grep "^v" | head -n 1)
previousTag=$(git tag --sort=-creatordate | grep "^v" | grep -v "Release" | head -n 1)
else
echo "This is not a pre-release"
previousTag=$(git tag --sort=-creatordate | grep "^v" | grep -v "alpha" | head -n 1)

View file

@ -192,6 +192,12 @@ endif ()
#### Compile definitions
# Disable deprecated staffs for Qt<=6.7 (Bump this if ever consider bump Qt version)
target_compile_definitions(${GOLDENDICT} PRIVATE
QT_DISABLE_DEPRECATED_UP_TO=0x060700
QT_NO_DEPRECATED_WARNINGS
)
target_compile_definitions(${GOLDENDICT} PUBLIC
CMAKE_USED_HACK # temporal hack to avoid breaking qmake build
MAKE_QTMULTIMEDIA_PLAYER
@ -266,15 +272,25 @@ if (APPLE)
set(Assembling_Dir "${CMAKE_BINARY_DIR}/redist")
set(App_Name "${GOLDENDICT}.app")
set(Redistributable_APP "${Assembling_Dir}/${App_Name}")
# if anything wrong, delete this and affect lines, and see what's Qt will generate by default.
set(QtConfPath "${Redistributable_APP}/Contents/Resources/qt.conf")
qt_generate_deploy_script(
TARGET ${GOLDENDICT}
OUTPUT_SCRIPT deploy_script
CONTENT "qt_deploy_runtime_dependencies(
CONTENT "
set(QT_DEPLOY_PREFIX \"${Redistributable_APP}\")
set(QT_DEPLOY_TRANSLATIONS_DIR \"Contents/Resources/translations\")
qt_deploy_runtime_dependencies(
EXECUTABLE \"${Redistributable_APP}\"
GENERATE_QT_CONF
NO_APP_STORE_COMPLIANCE
)"
NO_APP_STORE_COMPLIANCE)
qt_deploy_translations()
qt_deploy_qt_conf(\"${QtConfPath}\"
PLUGINS_DIR PlugIns
TRANSLATIONS_DIR Resources/translations)
"
)
install(TARGETS ${GOLDENDICT} BUNDLE DESTINATION "${Assembling_Dir}")

View file

@ -1,79 +1,79 @@
issue: https://github.com/goldendict/goldendict/issues/1441
http://tango.freedesktop.org/Tango_Desktop_Project GPLv3
list:
internet.svg
home.svg
configure.svg
fileopen.svg
addtab.svg
wizard.svg
fulltext
text2speech
reload
icons/print.svg
icons/programs.svg
error
star.svg
star_blue.svg
network.svg
hotkeys
previous
next
advanced
windows-list
filesave
playsound_color
interface
webdict
transliteration
closetab
folder
reload
menu.svg
https://packages.debian.org/bullseye/gnome-icon-theme GPLv3
lists:
clear
https://commons.wikimedia.org/wiki/File:Accessories-dictionary.svg
lists:
icon32_sdict.svg
https://freesvg.org/pushpin-vector-image public domain
lists:
pushbin
https://commons.wikimedia.org/wiki/File:Arrow_bottom_svg.svg license:public domain
lists:
1downarrow
these two icons from sertoli @ https://forum.freemdict.com/u/sertoli/summary
playsound.png
playsound_full.png
LGPL
icon32_zoombase.png https://icons.iconarchive.com/icons/oxygen-icons.org/oxygen/128/Actions-page-zoom-icon.png
icon32_zoomout.png https://icons.iconarchive.com/icons/oxygen-icons.org/oxygen/128/Actions-zoom-out-icon.png
icon32_zoomin.png https://icons.iconarchive.com/icons/oxygen-icons.org/oxygen/128/Actions-zoom-in-icon.png
reload.png https://iconarchive.com/show/oxygen-icons-by-oxygen-icons.org/Actions-edit-redo-icon.html
advanced.png https://icons.iconarchive.com/icons/oxygen-icons.org/oxygen/128/Actions-system-run-icon.png
sources.png https://icons.iconarchive.com/icons/oxygen-icons.org/oxygen/128/Apps-plasma-icon.png
book.svg https://github.com/johnfactotum/foliate
lingualibre.svg https://en.m.wikipedia.org/wiki/File:Lingualibre-logo-no-text.svg
Apache License Version 2.0
1downarrow.svg
system-search.svg
Modified from https://github.com/google/material-design-icons
add-anki-icon.svg MIT license
issue: https://github.com/goldendict/goldendict/issues/1441
http://tango.freedesktop.org/Tango_Desktop_Project GPLv3
list:
internet.svg
home.svg
configure.svg
fileopen.svg
addtab.svg
wizard.svg
fulltext
text2speech
reload
icons/print.svg
icons/programs.svg
error
star.svg
star_blue.svg
network.svg
hotkeys
previous
next
advanced
windows-list
filesave
playsound_color
interface
webdict
transliteration
closetab
folder
reload
menu.svg
https://packages.debian.org/bullseye/gnome-icon-theme GPLv3
lists:
clear
https://commons.wikimedia.org/wiki/File:Accessories-dictionary.svg
lists:
icon32_sdict.svg
https://freesvg.org/pushpin-vector-image public domain
lists:
pushbin
https://commons.wikimedia.org/wiki/File:Arrow_bottom_svg.svg license:public domain
lists:
1downarrow
these two icons from sertoli @ https://forum.freemdict.com/u/sertoli/summary
playsound.png
playsound_full.png
LGPL
icon32_zoombase.png https://icons.iconarchive.com/icons/oxygen-icons.org/oxygen/128/Actions-page-zoom-icon.png
icon32_zoomout.png https://icons.iconarchive.com/icons/oxygen-icons.org/oxygen/128/Actions-zoom-out-icon.png
icon32_zoomin.png https://icons.iconarchive.com/icons/oxygen-icons.org/oxygen/128/Actions-zoom-in-icon.png
reload.png https://iconarchive.com/show/oxygen-icons-by-oxygen-icons.org/Actions-edit-redo-icon.html
advanced.png https://icons.iconarchive.com/icons/oxygen-icons.org/oxygen/128/Actions-system-run-icon.png
sources.png https://icons.iconarchive.com/icons/oxygen-icons.org/oxygen/128/Apps-plasma-icon.png
book.svg https://github.com/johnfactotum/foliate
lingualibre.svg https://en.m.wikipedia.org/wiki/File:Lingualibre-logo-no-text.svg
Apache License Version 2.0
1downarrow.svg
system-search.svg
Modified from https://github.com/google/material-design-icons
add-anki-icon.svg MIT license
https://www.svgrepo.com/svg/435992/add-card

View file

@ -1,3 +0,0 @@
qtwebengine_zh_CN.ts is used to fixed some right context menu on webengine.
The previous qt_* rename to qt_extra_* to distinguish between the locale language.These qt_extra*.ts are also used to fix GUI translation issues as qt has not provided an update version about these language.

View file

@ -86,7 +86,7 @@
</message>
<message>
<source>(untitled)</source>
<translation type="unfinished">(untitled)</translation>
<translation>(war azwel)</translation>
</message>
<message>
<source>(picture)</source>
@ -101,7 +101,7 @@
</message>
<message>
<source>From </source>
<translation type="unfinished">From </translation>
<translation>Seg </translation>
</message>
<message>
<source>Collapse article</source>
@ -156,7 +156,7 @@
</message>
<message>
<source>Audio</source>
<translation type="unfinished">Audio</translation>
<translation>Ameslaw</translation>
</message>
<message>
<source>TTS Voice</source>
@ -941,7 +941,7 @@ between classic and school orthography in cyrillic)</translation>
</message>
<message>
<source>Cancel</source>
<translation type="unfinished">Cancel</translation>
<translation>Sefsex</translation>
</message>
<message>
<source>Help</source>
@ -1161,7 +1161,7 @@ between classic and school orthography in cyrillic)</translation>
</message>
<message>
<source>Please wait...</source>
<translation type="unfinished">Please wait...</translation>
<translation>Txil rǧu</translation>
</message>
<message>
<source>Indexing...</source>
@ -1180,11 +1180,11 @@ between classic and school orthography in cyrillic)</translation>
</message>
<message>
<source>Abkhazian</source>
<translation type="unfinished">Abkhazian</translation>
<translation>Tabxazit</translation>
</message>
<message>
<source>Avestan</source>
<translation type="unfinished">Avestan</translation>
<translation>Tavestant</translation>
</message>
<message>
<source>Afrikaans</source>
@ -1244,15 +1244,15 @@ between classic and school orthography in cyrillic)</translation>
</message>
<message>
<source>Bambara</source>
<translation type="unfinished">Bambara</translation>
<translation>Tabambarat</translation>
</message>
<message>
<source>Bengali</source>
<translation type="unfinished">Bengali</translation>
<translation>Tabengalit</translation>
</message>
<message>
<source>Tibetan</source>
<translation type="unfinished">Tibetan</translation>
<translation>Tatibitant</translation>
</message>
<message>
<source>Breton</source>
@ -1312,11 +1312,11 @@ between classic and school orthography in cyrillic)</translation>
</message>
<message>
<source>Dzongkha</source>
<translation type="unfinished">Dzongkha</translation>
<translation>Tadzungat</translation>
</message>
<message>
<source>Ewe</source>
<translation type="unfinished">Ewe</translation>
<translation>Tawit</translation>
</message>
<message>
<source>Greek</source>
@ -1344,11 +1344,11 @@ between classic and school orthography in cyrillic)</translation>
</message>
<message>
<source>Persian</source>
<translation type="unfinished">Persian</translation>
<translation>Tafarsit</translation>
</message>
<message>
<source>Fulah</source>
<translation type="unfinished">Fulah</translation>
<translation>Tafulaht</translation>
</message>
<message>
<source>Finnish</source>
@ -1372,7 +1372,7 @@ between classic and school orthography in cyrillic)</translation>
</message>
<message>
<source>Irish</source>
<translation type="unfinished">Irish</translation>
<translation>Tirlandit</translation>
</message>
<message>
<source>Scottish Gaelic</source>
@ -1404,15 +1404,15 @@ between classic and school orthography in cyrillic)</translation>
</message>
<message>
<source>Hindi</source>
<translation type="unfinished">Hindi</translation>
<translation>Tahendit</translation>
</message>
<message>
<source>Hiri Motu</source>
<translation type="unfinished">Hiri Motu</translation>
<translation>Tahirimutut</translation>
</message>
<message>
<source>Croatian</source>
<translation type="unfinished">Croatian</translation>
<translation>Takrwasit</translation>
</message>
<message>
<source>Haitian</source>
@ -1420,23 +1420,23 @@ between classic and school orthography in cyrillic)</translation>
</message>
<message>
<source>Hungarian</source>
<translation type="unfinished">Hungarian</translation>
<translation>Tahungarit</translation>
</message>
<message>
<source>Armenian</source>
<translation type="unfinished">Armenian</translation>
<translation>Taṛminit</translation>
</message>
<message>
<source>Herero</source>
<translation type="unfinished">Herero</translation>
<translation>Tahirirut</translation>
</message>
<message>
<source>Interlingua</source>
<translation type="unfinished">Interlingua</translation>
<translation>Tantirlingwat</translation>
</message>
<message>
<source>Indonesian</source>
<translation type="unfinished">Indonesian</translation>
<translation>Tandunizit</translation>
</message>
<message>
<source>Interlingue</source>
@ -1460,15 +1460,15 @@ between classic and school orthography in cyrillic)</translation>
</message>
<message>
<source>Icelandic</source>
<translation type="unfinished">Icelandic</translation>
<translation>Taslandit</translation>
</message>
<message>
<source>Italian</source>
<translation type="unfinished">Italian</translation>
<translation>Taṭelyanit</translation>
</message>
<message>
<source>Inuktitut</source>
<translation type="unfinished">Inuktitut</translation>
<translation>Tinuktitut</translation>
</message>
<message>
<source>Japanese</source>
@ -1480,23 +1480,23 @@ between classic and school orthography in cyrillic)</translation>
</message>
<message>
<source>Georgian</source>
<translation type="unfinished">Georgian</translation>
<translation>Tajyurjit</translation>
</message>
<message>
<source>Kongo</source>
<translation type="unfinished">Kongo</translation>
<translation>Takungut</translation>
</message>
<message>
<source>Kikuyu</source>
<translation type="unfinished">Kikuyu</translation>
<translation>Takikuyut</translation>
</message>
<message>
<source>Kwanyama</source>
<translation type="unfinished">Kwanyama</translation>
<translation>Takwanyamat</translation>
</message>
<message>
<source>Kazakh</source>
<translation type="unfinished">Kazakh</translation>
<translation>Takazaxt</translation>
</message>
<message>
<source>Kalaallisut</source>
@ -1512,27 +1512,27 @@ between classic and school orthography in cyrillic)</translation>
</message>
<message>
<source>Korean</source>
<translation type="unfinished">Korean</translation>
<translation>Takurit</translation>
</message>
<message>
<source>Kanuri</source>
<translation type="unfinished">Kanuri</translation>
<translation>Takanurit</translation>
</message>
<message>
<source>Kashmiri</source>
<translation type="unfinished">Kashmiri</translation>
<translation>Takacmirit</translation>
</message>
<message>
<source>Kurdish</source>
<translation type="unfinished">Kurdish</translation>
<translation>Takurdit</translation>
</message>
<message>
<source>Komi</source>
<translation type="unfinished">Komi</translation>
<translation>Takumit</translation>
</message>
<message>
<source>Cornish</source>
<translation type="unfinished">Cornish</translation>
<translation>Takurnikt</translation>
</message>
<message>
<source>Kirghiz</source>
@ -1628,11 +1628,11 @@ between classic and school orthography in cyrillic)</translation>
</message>
<message>
<source>Nepali</source>
<translation type="unfinished">Nepali</translation>
<translation>Tanipalit</translation>
</message>
<message>
<source>Ndonga</source>
<translation type="unfinished">Ndonga</translation>
<translation>Tandungat</translation>
</message>
<message>
<source>Dutch</source>
@ -1644,7 +1644,7 @@ between classic and school orthography in cyrillic)</translation>
</message>
<message>
<source>Norwegian</source>
<translation type="unfinished">Norwegian</translation>
<translation>Tanurvijit</translation>
</message>
<message>
<source>South Ndebele</source>
@ -1696,11 +1696,11 @@ between classic and school orthography in cyrillic)</translation>
</message>
<message>
<source>Portuguese</source>
<translation type="unfinished">Portuguese</translation>
<translation>Tapurtugit</translation>
</message>
<message>
<source>Quechua</source>
<translation type="unfinished">Quechua</translation>
<translation>Takicwat</translation>
</message>
<message>
<source>Raeto-Romance</source>
@ -1712,7 +1712,7 @@ between classic and school orthography in cyrillic)</translation>
</message>
<message>
<source>Romanian</source>
<translation type="unfinished">Romanian</translation>
<translation>Tarumanit</translation>
</message>
<message>
<source>Russian</source>
@ -1752,35 +1752,35 @@ between classic and school orthography in cyrillic)</translation>
</message>
<message>
<source>Slovak</source>
<translation type="unfinished">Slovak</translation>
<translation>Tasluvakt</translation>
</message>
<message>
<source>Slovenian</source>
<translation type="unfinished">Slovenian</translation>
<translation>Tasluvinit</translation>
</message>
<message>
<source>Samoan</source>
<translation type="unfinished">Samoan</translation>
<translation>Tasamwant</translation>
</message>
<message>
<source>Shona</source>
<translation type="unfinished">Shona</translation>
<translation>Tacunat</translation>
</message>
<message>
<source>Somali</source>
<translation type="unfinished">Somali</translation>
<translation>Tasumalit</translation>
</message>
<message>
<source>Albanian</source>
<translation type="unfinished">Albanian</translation>
<translation>Talbanit</translation>
</message>
<message>
<source>Serbian</source>
<translation type="unfinished">Serbian</translation>
<translation>Taṣirbit</translation>
</message>
<message>
<source>Swati</source>
<translation type="unfinished">Swati</translation>
<translation>Taswatit</translation>
</message>
<message>
<source>Southern Sotho</source>
@ -1792,27 +1792,27 @@ between classic and school orthography in cyrillic)</translation>
</message>
<message>
<source>Swedish</source>
<translation type="unfinished">Swedish</translation>
<translation>Taswidit</translation>
</message>
<message>
<source>Swahili</source>
<translation type="unfinished">Swahili</translation>
<translation>Taswahilit</translation>
</message>
<message>
<source>Tamil</source>
<translation type="unfinished">Tamil</translation>
<translation>Taṭamilit</translation>
</message>
<message>
<source>Telugu</source>
<translation type="unfinished">Telugu</translation>
<translation>Tatilugut</translation>
</message>
<message>
<source>Tajik</source>
<translation type="unfinished">Tajik</translation>
<translation>Tatajikt</translation>
</message>
<message>
<source>Thai</source>
<translation type="unfinished">Thai</translation>
<translation>Taṭaylandit</translation>
</message>
<message>
<source>Tigrinya</source>
@ -1836,7 +1836,7 @@ between classic and school orthography in cyrillic)</translation>
</message>
<message>
<source>Turkish</source>
<translation type="unfinished">Turkish</translation>
<translation>Taṭurkit</translation>
</message>
<message>
<source>Tsonga</source>
@ -1860,19 +1860,19 @@ between classic and school orthography in cyrillic)</translation>
</message>
<message>
<source>Ukrainian</source>
<translation type="unfinished">Ukrainian</translation>
<translation>Tukranit</translation>
</message>
<message>
<source>Urdu</source>
<translation type="unfinished">Urdu</translation>
<translation>Turdut</translation>
</message>
<message>
<source>Uzbek</source>
<translation type="unfinished">Uzbek</translation>
<translation>Tuzbikt</translation>
</message>
<message>
<source>Venda</source>
<translation type="unfinished">Venda</translation>
<translation>Tavendat</translation>
</message>
<message>
<source>Vietnamese</source>
@ -1912,11 +1912,11 @@ between classic and school orthography in cyrillic)</translation>
</message>
<message>
<source>Zulu</source>
<translation type="unfinished">Zulu</translation>
<translation>Tazulut</translation>
</message>
<message>
<source>Lojban</source>
<translation type="unfinished">Lojban</translation>
<translation>Talujbant</translation>
</message>
<message>
<source>Traditional Chinese</source>
@ -2027,11 +2027,11 @@ between classic and school orthography in cyrillic)</translation>
</message>
<message>
<source>Lithuanian</source>
<translation type="unfinished">Lithuanian</translation>
<translation>Taliṭwanit</translation>
</message>
<message>
<source>Macedonian</source>
<translation type="unfinished">Macedonian</translation>
<translation>Tamasidunt</translation>
</message>
<message>
<source>Dutch</source>
@ -2039,7 +2039,7 @@ between classic and school orthography in cyrillic)</translation>
</message>
<message>
<source>Polish</source>
<translation type="unfinished">Polish</translation>
<translation>Tapulandit</translation>
</message>
<message>
<source>Portuguese</source>
@ -2055,7 +2055,7 @@ between classic and school orthography in cyrillic)</translation>
</message>
<message>
<source>Albanian</source>
<translation type="unfinished">Albanian</translation>
<translation>Talbanit</translation>
</message>
<message>
<source>Serbian (Cyrillic)</source>
@ -2091,7 +2091,7 @@ between classic and school orthography in cyrillic)</translation>
</message>
<message>
<source>Persian</source>
<translation type="unfinished">Persian</translation>
<translation>Tafarsit</translation>
</message>
<message>
<source>Spanish, Argentina</source>
@ -2115,23 +2115,23 @@ between classic and school orthography in cyrillic)</translation>
</message>
<message>
<source>Tajik</source>
<translation type="unfinished">Tajik</translation>
<translation>Tatajikt</translation>
</message>
<message>
<source>Quechua</source>
<translation type="unfinished">Quechua</translation>
<translation>Takicwat</translation>
</message>
<message>
<source>Aymara</source>
<translation type="unfinished">Aymara</translation>
<translation>Taymarat</translation>
</message>
<message>
<source>Arabic, Saudi Arabia</source>
<translation type="unfinished">Arabic, Saudi Arabia</translation>
<translation>Taɛrabt, Suɛudiya Taɛrabt</translation>
</message>
<message>
<source>Turkmen</source>
<translation type="unfinished">Turkmen</translation>
<translation>Taturkmant</translation>
</message>
<message>
<source>Interlingue</source>
@ -2147,7 +2147,7 @@ between classic and school orthography in cyrillic)</translation>
</message>
<message>
<source>English</source>
<translation type="unfinished">English</translation>
<translation>Taglizit</translation>
</message>
</context>
<context>

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,467 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="zh_CN">
<context>
<name>DownloadInterruptReason</name>
<message>
<source>Unknown reason or not interrupted</source>
<translation></translation>
</message>
<message>
<source>General file operation failure</source>
<translation></translation>
</message>
<message>
<source>The file cannot be written locally, due to access restrictions</source>
<translation>访</translation>
</message>
<message>
<source>Insufficient space on the target drive</source>
<translation></translation>
</message>
<message>
<source>The directory or file name is too long</source>
<translation></translation>
</message>
<message>
<source>The file size exceeds the file system limitation</source>
<translation></translation>
</message>
<message>
<source>The file is infected with a virus</source>
<translation></translation>
</message>
<message>
<source>Temporary problem (for example file in use, or too many open files)</source>
<translation>使</translation>
</message>
<message>
<source>The file was blocked due to local policy</source>
<translation></translation>
</message>
<message>
<source>Checking the safety of the download failed due to unexpected reasons</source>
<translation></translation>
</message>
<message>
<source>File seek past the end of a file (resuming previously interrupted download)</source>
<translation></translation>
</message>
<message>
<source>The partial file did not match the expected hash</source>
<translation></translation>
</message>
<message>
<source>General network failure</source>
<translation></translation>
</message>
<message>
<source>The network operation has timed out</source>
<translation></translation>
</message>
<message>
<source>The network connection has been terminated</source>
<translation></translation>
</message>
<message>
<source>The server has gone down</source>
<translation></translation>
</message>
<message>
<source>The network request was invalid (for example, the URL or scheme is invalid)</source>
<translation>URL或scheme无效</translation>
</message>
<message>
<source>General server failure</source>
<translation></translation>
</message>
<message>
<source>The server does not have the requested data</source>
<translation></translation>
</message>
<message>
<source>The server did not authorize access to the resource</source>
<translation>访</translation>
</message>
<message>
<source>A problem with the server certificate occurred</source>
<translation></translation>
</message>
<message>
<source>Access forbidden by the server</source>
<translation>访</translation>
</message>
<message>
<source>Unexpected server response</source>
<translation></translation>
</message>
<message>
<source>Download canceled by the user</source>
<translation></translation>
</message>
</context>
<context>
<name>QQuickPdfDocument</name>
<message>
<source>no error</source>
<translation></translation>
</message>
<message>
<source>data not yet available</source>
<translation></translation>
</message>
<message>
<source>file not found</source>
<translation></translation>
</message>
<message>
<source>invalid file format</source>
<translation></translation>
</message>
<message>
<source>incorrect password</source>
<translation></translation>
</message>
<message>
<source>unsupported security scheme</source>
<translation></translation>
</message>
<message>
<source>unknown error</source>
<translation></translation>
</message>
</context>
<context>
<name>QQuickWebEngineView</name>
<message>
<source>Stop</source>
<translation></translation>
</message>
<message>
<source>Reload and Bypass Cache</source>
<translation></translation>
</message>
<message>
<source>Open link in this window</source>
<translation></translation>
</message>
<message>
<source>Toggle Play/Pause</source>
<translation>/</translation>
</message>
<message>
<source>Toggle Mute</source>
<translation></translation>
</message>
<message>
<source>Close Page</source>
<translation></translation>
</message>
<message>
<source>Unselect</source>
<translation></translation>
</message>
<message>
<source>&amp;Bold</source>
<translation>&amp;B</translation>
</message>
<message>
<source>&amp;Italic</source>
<translation>&amp;I</translation>
</message>
<message>
<source>&amp;Underline</source>
<translation>线&amp;U</translation>
</message>
<message>
<source>&amp;Strikethrough</source>
<translation>线(&amp;S)</translation>
</message>
<message>
<source>Align &amp;Left</source>
<translation>&amp;L</translation>
</message>
<message>
<source>Align &amp;Center</source>
<translation>&amp;C</translation>
</message>
<message>
<source>Align &amp;Right</source>
<translation>&amp;R</translation>
</message>
<message>
<source>Align &amp;Justified</source>
<translation>&amp;J</translation>
</message>
<message>
<source>&amp;Indent</source>
<translation>&amp;I</translation>
</message>
<message>
<source>&amp;Outdent</source>
<translation>(&amp;O)</translation>
</message>
<message>
<source>Insert &amp;Ordered List</source>
<translation>&amp;O</translation>
</message>
<message>
<source>Insert &amp;Unordered List</source>
<translation>&amp;U</translation>
</message>
</context>
<context>
<name>QWebEnginePage</name>
<message>
<source>Stop</source>
<translation></translation>
</message>
<message>
<source>Reload and Bypass Cache</source>
<translation></translation>
</message>
<message>
<source>Toggle Play/Pause</source>
<translation>/</translation>
</message>
<message>
<source>Toggle Mute</source>
<translation></translation>
</message>
<message>
<source>Close Page</source>
<translation></translation>
</message>
<message>
<source>Unselect</source>
<translation></translation>
</message>
<message>
<source>Are you sure you want to leave this page? Changes that you made may not be saved.</source>
<translation> </translation>
</message>
<message>
<source>Open link in this window</source>
<translation></translation>
</message>
<message>
<source>Open link in new background tab</source>
<translation></translation>
</message>
<message>
<source>&amp;Bold</source>
<translation>&amp;B</translation>
</message>
<message>
<source>&amp;Italic</source>
<translation>&amp;I</translation>
</message>
<message>
<source>&amp;Underline</source>
<translation>线&amp;U</translation>
</message>
<message>
<source>&amp;Strikethrough</source>
<translation>线&amp;S</translation>
</message>
<message>
<source>Align &amp;Left</source>
<translation>&amp;L</translation>
</message>
<message>
<source>Align &amp;Center</source>
<translation>&amp;C</translation>
</message>
<message>
<source>Align &amp;Right</source>
<translation>&amp;R</translation>
</message>
<message>
<source>Align &amp;Justified</source>
<translation>&amp;J</translation>
</message>
<message>
<source>&amp;Indent</source>
<translation>&amp;I</translation>
</message>
<message>
<source>&amp;Outdent</source>
<translation>(&amp;O)</translation>
</message>
<message>
<source>Insert &amp;Ordered List</source>
<translation>&amp;O</translation>
</message>
<message>
<source>Insert &amp;Unordered List</source>
<translation>&amp;U</translation>
</message>
<message>
<source>Select folder to upload</source>
<translation></translation>
</message>
</context>
<context>
<name>QtWebEnginePlugin</name>
<message>
<source>Cannot create separate instance of WebEngineNewViewRequest</source>
<translation> WebEngineNewViewRequest </translation>
</message>
<message>
<source>Cannot create separate instance of %1</source>
<translation> %1 </translation>
</message>
</context>
<context>
<name>QtWebEngineTestSupportPlugin</name>
<message>
<source>Cannot create a separate instance of WebEngineErrorPage</source>
<translation> WebEngineErrorPage </translation>
</message>
<message>
<source>Cannot create a separate instance of WebEngineTestEvent</source>
<translation> WebEngineTestEvent </translation>
</message>
</context>
<context>
<name>RenderViewContextMenuQt</name>
<message>
<source>Back</source>
<translation>退</translation>
</message>
<message>
<source>Forward</source>
<translation></translation>
</message>
<message>
<source>Reload</source>
<translation></translation>
</message>
<message>
<source>Cut</source>
<translation></translation>
</message>
<message>
<source>Copy</source>
<translation></translation>
</message>
<message>
<source>Paste</source>
<translation></translation>
</message>
<message>
<source>Undo</source>
<translation></translation>
</message>
<message>
<source>Redo</source>
<translation></translation>
</message>
<message>
<source>Select all</source>
<translation></translation>
</message>
<message>
<source>Paste and match style</source>
<translation></translation>
</message>
<message>
<source>Open link in new window</source>
<translation></translation>
</message>
<message>
<source>Open link in new tab</source>
<translation></translation>
</message>
<message>
<source>Copy link address</source>
<translation></translation>
</message>
<message>
<source>Save link</source>
<translation></translation>
</message>
<message>
<source>Copy image</source>
<translation></translation>
</message>
<message>
<source>Copy image address</source>
<translation></translation>
</message>
<message>
<source>Save image</source>
<translation></translation>
</message>
<message>
<source>Copy media address</source>
<translation></translation>
</message>
<message>
<source>Show controls</source>
<translation></translation>
</message>
<message>
<source>Loop</source>
<translation></translation>
</message>
<message>
<source>Save media</source>
<translation></translation>
</message>
<message>
<source>Inspect</source>
<translation></translation>
</message>
<message>
<source>Exit full screen</source>
<translation>退</translation>
</message>
<message>
<source>Save page</source>
<translation></translation>
</message>
<message>
<source>View page source</source>
<translation></translation>
</message>
</context>
<context>
<name>UIDelegatesManager</name>
<message>
<source>Javascript Alert - %1</source>
<translation>Javascript- - %1</translation>
</message>
<message>
<source>Javascript Confirm - %1</source>
<translation>Javascript- - %1</translation>
</message>
<message>
<source>Javascript Prompt - %1</source>
<translation>Javascript- - %1</translation>
</message>
<message>
<source>Are you sure you want to leave this page?</source>
<translation></translation>
</message>
<message>
<source>Changes that you made may not be saved.</source>
<translation></translation>
</message>
<message>
<source>Connect to proxy &quot;%1&quot; using:</source>
<translation>使%1</translation>
</message>
<message>
<source>Enter username and password for &quot;%1&quot; at %2://%3</source>
<translation> %2://%3 输入“%1”的用户名和密码</translation>
</message>
</context>
<context>
<name>WebContentsAdapter</name>
<message>
<source>HTTP-POST data can only be sent over HTTP(S) protocol</source>
<translation>HTTP-POST HTTP(S) </translation>
</message>
</context>
</TS>

View file

@ -1,5 +1,4 @@
#ifndef ANKICONNECTOR_H
#define ANKICONNECTOR_H
#pragma once
#include "config.hh"
@ -29,5 +28,3 @@ signals:
private slots:
void finishedSlot( QNetworkReply * reply );
};
#endif // ANKICONNECTOR_H

View file

@ -15,6 +15,7 @@
#include <QFile>
#include <QTextDocumentFragment>
#include <QUrl>
#include <QStyleHints>
#include "fmt/core.h"
#include "fmt/compile.h"
@ -151,7 +152,22 @@ std::string ArticleMaker::makeHtmlHeader( QString const & word, QString const &
result += R"(<script src="qrc:///scripts/gd-builtin.js"></script>)";
result += R"(<script src="qrc:///scripts/mark.min.js"></script>)";
if ( GlobalBroadcaster::instance()->getPreference()->darkReaderMode ) {
/// Handling Dark reader mode.
bool darkReaderModeEnabled = false;
if ( GlobalBroadcaster::instance()->getPreference()->darkReaderMode == Config::Dark::On ) {
darkReaderModeEnabled = true;
}
#if QT_VERSION >= QT_VERSION_CHECK( 6, 5, 0 )
if ( GlobalBroadcaster::instance()->getPreference()->darkReaderMode == Config::Dark::Auto
&& QGuiApplication::styleHints()->colorScheme() == Qt::ColorScheme::Dark ) {
darkReaderModeEnabled = true;
}
#endif
if ( darkReaderModeEnabled ) {
//only enable this darkmode on modern style.
if ( cfg.displayStyle == "modern" ) {
result += R"(<link href="qrc:///article-style-darkmode.css" media="all" rel="stylesheet" type="text/css">)";
@ -209,7 +225,7 @@ body { background: #242525; }
// load the `article-style.js` in user's config folder
if ( auto userJsFile = Config::getUserJsFileName(); userJsFile.has_value() ) {
result += fmt::format( FMT_COMPILE( R"(<script src="file://{}"></script>)" ), userJsFile.value() );
result += fmt::format( FMT_COMPILE( R"(<script src="file://{}" defer></script>)" ), userJsFile.value() );
}
result += "</head><body>";
@ -315,7 +331,7 @@ sptr< Dictionary::DataRequest > ArticleMaker::makeDefinitionFor( QString const &
true );
}
if ( groupId == Instances::Group::HelpGroupId ) {
if ( groupId == GroupId::HelpGroupId ) {
if ( word == tr( "Welcome!" ) ) {
string welcome = makeWelcomeHtml();
sptr< Dictionary::DataRequestInstant > r = std::make_shared< Dictionary::DataRequestInstant >( true );

View file

@ -1,8 +1,7 @@
/* This file is (c) 2008-2012 Konstantin Isakov <ikm@goldendict.org>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef __ARTICLE_MAKER_HH_INCLUDED__
#define __ARTICLE_MAKER_HH_INCLUDED__
#pragma once
#include <QObject>
#include <QMap>
@ -101,8 +100,8 @@ class ArticleRequest: public Dictionary::DataRequest
/// A sequence of words and spacings between them, including the initial
/// spacing before the first word and the final spacing after the last word.
typedef QList< QString > Words;
typedef QList< QString > Spacings;
using Words = QList< QString >;
using Spacings = QList< QString >;
/// Splits the given string into words and spacings between them.
std::pair< Words, Spacings > splitIntoWords( QString const & );
@ -158,6 +157,3 @@ private:
int findEndOfCloseDiv( QString const &, int pos );
bool isCollapsable( Dictionary::DataRequest & req, QString const & dictId );
};
#endif

View file

@ -1,8 +1,7 @@
/* This file is (c) 2008-2012 Konstantin Isakov <ikm@goldendict.org>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef __ARTICLE_NETMGR_HH_INCLUDED__
#define __ARTICLE_NETMGR_HH_INCLUDED__
#pragma once
#include <QtNetwork>
#include <QSet>
@ -42,38 +41,38 @@ public:
delete baseReply;
}
void close()
void close() override
{
baseReply->close();
}
// QIODevice virtual functions
qint64 bytesAvailable() const;
qint64 bytesAvailable() const override;
bool atEnd() const override
{
return baseReply->atEnd();
}
qint64 bytesToWrite() const
qint64 bytesToWrite() const override
{
return baseReply->bytesToWrite();
}
bool canReadLine() const
bool canReadLine() const override
{
return baseReply->canReadLine();
}
bool isSequential() const
bool isSequential() const override
{
return baseReply->isSequential();
}
bool waitForReadyRead( int msecs )
bool waitForReadyRead( int msecs ) override
{
return baseReply->waitForReadyRead( msecs );
}
bool waitForBytesWritten( int msecs )
bool waitForBytesWritten( int msecs ) override
{
return baseReply->waitForBytesWritten( msecs );
}
bool reset()
bool reset() override
{
return baseReply->reset();
}
@ -82,37 +81,37 @@ public slots:
void applyError( QNetworkReply::NetworkError code );
// Redirect QNetworkReply slots
virtual void abort()
void abort() override
{
baseReply->abort();
}
virtual void ignoreSslErrors()
void ignoreSslErrors() override
{
baseReply->ignoreSslErrors();
}
protected:
// QNetworkReply virtual functions
void ignoreSslErrorsImplementation( const QList< QSslError > & errors )
void ignoreSslErrorsImplementation( const QList< QSslError > & errors ) override
{
baseReply->ignoreSslErrors( errors );
}
void setSslConfigurationImplementation( const QSslConfiguration & configuration )
void setSslConfigurationImplementation( const QSslConfiguration & configuration ) override
{
baseReply->setSslConfiguration( configuration );
}
void sslConfigurationImplementation( QSslConfiguration & configuration ) const
void sslConfigurationImplementation( QSslConfiguration & configuration ) const override
{
configuration = baseReply->sslConfiguration();
}
// QIODevice virtual functions
qint64 readData( char * data, qint64 maxSize );
qint64 readLineData( char * data, qint64 maxSize )
qint64 readData( char * data, qint64 maxSize ) override;
qint64 readLineData( char * data, qint64 maxSize ) override
{
return baseReply->readLine( data, maxSize );
}
qint64 writeData( const char * data, qint64 maxSize )
qint64 writeData( const char * data, qint64 maxSize ) override
{
return baseReply->write( data, maxSize );
}
@ -178,10 +177,10 @@ public:
protected:
virtual qint64 bytesAvailable() const;
virtual qint64 bytesAvailable() const override;
bool atEnd() const override;
virtual void abort() {}
virtual qint64 readData( char * data, qint64 maxSize );
virtual void abort() override {}
virtual qint64 readData( char * data, qint64 maxSize ) override;
// We use the hackery below to work around the fact that we need to emit
// ready/finish signals after we've been constructed.
@ -242,4 +241,3 @@ private:
ArticleNetworkAccessManager & mManager;
QNetworkAccessManager mgr;
};
#endif

3
src/audio/README.md Normal file
View file

@ -0,0 +1,3 @@
Code to support GD's internal/external audio players.
Only `audioplayerinterface.hh` is supposed to be used outside this folder.

View file

@ -1,5 +1,4 @@
#ifndef AUDIOOUTPUT_H
#define AUDIOOUTPUT_H
#pragma once
#include <QObject>
#include <QScopedPointer>
@ -22,6 +21,3 @@ private:
Q_DISABLE_COPY( AudioOutput )
Q_DECLARE_PRIVATE( AudioOutput )
};
#endif // AUDIOOUTPUT_H

View file

@ -1,8 +1,7 @@
/* This file is (c) 2018 Igor Kushnir <igorkuo@gmail.com>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef AUDIOPLAYERFACTORY_HH_INCLUDED
#define AUDIOPLAYERFACTORY_HH_INCLUDED
#pragma once
#include "audioplayerinterface.hh"
#include "config.hh"
@ -33,5 +32,3 @@ private:
QString audioPlaybackProgram;
AudioPlayerPtr playerPtr;
};
#endif // AUDIOPLAYERFACTORY_HH_INCLUDED

View file

@ -1,8 +1,7 @@
/* This file is (c) 2018 Igor Kushnir <igorkuo@gmail.com>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef AUDIOPLAYERINTERFACE_HH_INCLUDED
#define AUDIOPLAYERINTERFACE_HH_INCLUDED
#pragma once
#include <QScopedPointer>
#include <QString>
@ -26,6 +25,4 @@ signals:
void error( QString message );
};
typedef QScopedPointer< AudioPlayerInterface > AudioPlayerPtr;
#endif // AUDIOPLAYERINTERFACE_HH_INCLUDED
using AudioPlayerPtr = QScopedPointer< AudioPlayerInterface >;

View file

@ -1,8 +1,7 @@
/* This file is (c) 2018 Igor Kushnir <igorkuo@gmail.com>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef EXTERNALAUDIOPLAYER_HH_INCLUDED
#define EXTERNALAUDIOPLAYER_HH_INCLUDED
#pragma once
#include "audioplayerinterface.hh"
#include <memory>
@ -44,5 +43,3 @@ private:
// deleteLater() is safer because viewer actively participates in the QEventLoop.
std::unique_ptr< ExternalViewer, QObjectDeleteLater > viewer;
};
#endif // EXTERNALAUDIOPLAYER_HH_INCLUDED

View file

@ -1,5 +1,4 @@
#ifndef __FFMPEGAUDIO_HH_INCLUDED__
#define __FFMPEGAUDIO_HH_INCLUDED__
#pragma once
#ifdef MAKE_FFMPEG_PLAYER
#include "audiooutput.hh"
@ -106,5 +105,3 @@ signals:
} // namespace Ffmpeg
#endif // MAKE_FFMPEG_PLAYER
#endif // __FFMPEGAUDIO_HH_INCLUDED__

View file

@ -1,8 +1,7 @@
/* This file is (c) 2018 Igor Kushnir <igorkuo@gmail.com>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef FFMPEGAUDIOPLAYER_HH_INCLUDED
#define FFMPEGAUDIOPLAYER_HH_INCLUDED
#pragma once
#include "audioplayerinterface.hh"
#include "ffmpegaudio.hh"
@ -41,5 +40,3 @@ public:
} // namespace Ffmpeg
#endif // MAKE_FFMPEG_PLAYER
#endif // FFMPEGAUDIOPLAYER_HH_INCLUDED

View file

@ -20,17 +20,9 @@ MultimediaAudioPlayer::MultimediaAudioPlayer()
player( 0, QMediaPlayer::StreamPlayback )
#endif
{
typedef void ( QMediaPlayer::*ErrorSignal )( QMediaPlayer::Error );
#if ( QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 ) )
connect( &player,
static_cast< ErrorSignal >( &QMediaPlayer::error ),
this,
&MultimediaAudioPlayer::onMediaPlayerError );
#else
player.setAudioOutput( &audioOutput );
connect( &player, &QMediaPlayer::errorChanged, this, &MultimediaAudioPlayer::onMediaPlayerError );
#endif
#if ( QT_VERSION > QT_VERSION_CHECK( 6, 2, 0 ) )
connect( &mediaDevices, &QMediaDevices::audioOutputsChanged, this, &MultimediaAudioPlayer::audioOutputChange );

View file

@ -1,8 +1,7 @@
/* This file is (c) 2018 Igor Kushnir <igorkuo@gmail.com>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef MULTIMEDIAAUDIOPLAYER_HH_INCLUDED
#define MULTIMEDIAAUDIOPLAYER_HH_INCLUDED
#pragma once
#ifdef MAKE_QTMULTIMEDIA_PLAYER
@ -44,5 +43,3 @@ private:
};
#endif // MAKE_QTMULTIMEDIA_PLAYER
#endif // MULTIMEDIAAUDIOPLAYER_HH_INCLUDED

View file

@ -1,8 +1,7 @@
/* This file is (c) 2008-2012 Konstantin Isakov <ikm@goldendict.org>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef __AUDIOLINK_HH_INCLUDED__
#define __AUDIOLINK_HH_INCLUDED__
#pragma once
#include <QString>
@ -15,5 +14,3 @@
/// The dictionary id is used to make active dictionary feature work.
std::string addAudioLink( std::string const & url, std::string const & dictionaryId );
std::string addAudioLink( QString const & url, std::string const & dictionaryId );
#endif

View file

@ -1,7 +1,5 @@
#ifndef BASE_TYPE_H
#define BASE_TYPE_H
#pragma once
#include <QString>
typedef QMap< QString, QString > Contexts;
#endif // BASE_TYPE_H
using Contexts = QMap< QString, QString >;

View file

@ -1,8 +1,7 @@
/* This file is (c) 2008-2012 Konstantin Isakov <ikm@goldendict.org>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef __EX_HH_INCLUDED__
#define __EX_HH_INCLUDED__
#pragma once
#include <string>
@ -47,5 +46,3 @@
} \
virtual ~exName() noexcept {} \
};
#endif

View file

@ -1,8 +1,7 @@
/* This file is (c) 2008-2012 Konstantin Isakov <ikm@goldendict.org>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef __FILETYPE_HH_INCLUDED__
#define __FILETYPE_HH_INCLUDED__
#pragma once
#include <string>
@ -31,5 +30,3 @@ bool isNameOfCSS( string const & );
bool isNameOfSvg( string const & name );
} // namespace Filetype
#endif

View file

@ -1,8 +1,7 @@
/* This file is (c) 2008-2012 Konstantin Isakov <ikm@goldendict.org>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef __FOLDING_HH_INCLUDED__
#define __FOLDING_HH_INCLUDED__
#pragma once
#include "wstring.hh"
#include <QString>
@ -90,5 +89,3 @@ QString escapeWildcardSymbols( QString const & );
bool isCombiningMark( wchar ch );
} // namespace Folding
#endif

View file

@ -1,5 +1,4 @@
#ifndef __GDDEBUG_HH_INCLUDED__
#define __GDDEBUG_HH_INCLUDED__
#pragma once
#include <QFile>
@ -28,5 +27,3 @@ void gdDebug( const char *, ... )
;
extern QFile * logFilePtr;
#endif // __GDDEBUG_HH_INCLUDED__

View file

@ -1,5 +1,4 @@
#ifndef GLOBAL_GLOBALBROADCASTER_H
#define GLOBAL_GLOBALBROADCASTER_H
#pragma once
#include <QObject>
#include <vector>
@ -49,5 +48,3 @@ signals:
void websiteDictionarySignal( QString, QString );
};
#endif // GLOBAL_GLOBALBROADCASTER_H

View file

@ -1,5 +1,4 @@
#ifndef GLOBALREGEX_HH
#define GLOBALREGEX_HH
#pragma once
#include <QRegularExpression>
@ -78,5 +77,3 @@ const static QRegularExpression markSpace( R"([\p{M}\p{Z}\p{C}])", QRegularExpre
const static QRegularExpression whiteSpace( "\\s+" );
} // namespace RX
#endif // GLOBALREGEX_HH

View file

@ -1,8 +1,7 @@
/* This file is (c) 2008-2012 Konstantin Isakov <ikm@goldendict.org>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef __HTMLESCAPE_HH_INCLUDED__
#define __HTMLESCAPE_HH_INCLUDED__
#pragma once
#include <QString>
#include <string>
@ -33,5 +32,3 @@ QString fromHtmlEscaped( QString const & str );
string unescapeUtf8( string const & str, HtmlOption option = HtmlOption::Strip );
} // namespace Html
#endif

View file

@ -1,8 +1,7 @@
/* This file is (c) 2008-2012 Konstantin Isakov <ikm@goldendict.org>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef __ICONV_HH_INCLUDED__
#define __ICONV_HH_INCLUDED__
#pragma once
#include <QString>
@ -47,5 +46,3 @@ public:
// Copying/assigning isn't supported
Q_DISABLE_COPY_MOVE( Iconv );
};
#endif

View file

@ -1,11 +1,9 @@
/* This file is (c) 2008-2012 Konstantin Isakov <ikm@goldendict.org>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef __SPTR_HH_INCLUDED__
#define __SPTR_HH_INCLUDED__
#pragma once
#include <memory>
// A shorthand for std::shared_ptr
template< class T >
using sptr = std::shared_ptr< T >;
#endif

View file

@ -1,7 +1,6 @@
/* This file is (c) 2008-2012 Konstantin Isakov <ikm@goldendict.org>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef __UTF8_HH_INCLUDED__
#define __UTF8_HH_INCLUDED__
#pragma once
#include <cstdio>
#include <QByteArray>
@ -67,5 +66,3 @@ struct LineFeed
LineFeed initLineFeed( Encoding e );
} // namespace Utf8
#endif

View file

@ -1,7 +1,6 @@
/* Thin wrappers for retaining compatibility for both Qt6.x and Qt5.x */
#ifndef UTILS_HH
#define UTILS_HH
#pragma once
#include <QAtomicInt>
#include <QJsonDocument>
@ -350,5 +349,3 @@ QString escapeAmps( QString const & str );
QString unescapeAmps( QString const & str );
} // namespace Utils
#endif // UTILS_HH

View file

@ -1,8 +1,5 @@
#ifndef __WILCARD_HH_INCLUDED__
#define __WILCARD_HH_INCLUDED__
#pragma once
#include <QString>
QString wildcardsToRegexp( const QString & wc_str );
#endif

View file

@ -12,6 +12,6 @@
///
namespace gd {
typedef char32_t wchar;
typedef std::u32string wstring;
using wchar = char32_t;
using wstring = std::u32string;
} // namespace gd

View file

@ -1,8 +1,7 @@
/* This file is (c) 2008-2012 Konstantin Isakov <ikm@goldendict.org>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef __WSTRING_QT_HH_INCLUDED__
#define __WSTRING_QT_HH_INCLUDED__
#pragma once
/// This file adds conversions between gd::wstring and QString. See wstring.hh
/// for more details on gd::wstring.
@ -16,5 +15,3 @@ wstring removeTrailingZero( wstring const & v );
wstring removeTrailingZero( QString const & in );
wstring normalize( wstring const & );
} // namespace gd
#endif

View file

@ -102,32 +102,24 @@ AnkiConnectServer::AnkiConnectServer():
{
}
HotKey::HotKey():
modifiers( 0 ),
key1( 0 ),
key2( 0 )
{
}
// Does anyone know how to separate modifiers from the keycode? We'll
// use our own mask.
uint32_t const keyMask = 0x01FFFFFF;
HotKey::HotKey( QKeySequence const & seq ):
modifiers( seq[ 0 ] & ~keyMask ),
key1( seq[ 0 ] & keyMask ),
key2( seq[ 1 ] & keyMask )
modifiers( seq[ 0 ].keyboardModifiers() ),
key1( seq[ 0 ].key() ),
key2( seq[ 1 ].key() )
{
}
QKeySequence HotKey::toKeySequence() const
{
int v2 = key2 ? ( key2 | modifiers ) : 0;
return QKeySequence( key1 | modifiers, v2 );
if ( key2 != 0 && key2 != Qt::Key::Key_unknown ) {
return { QKeyCombination( modifiers, static_cast< Qt::Key >( key1 ) ),
QKeyCombination( modifiers, static_cast< Qt::Key >( key2 ) ) };
}
return { QKeyCombination( modifiers, static_cast< Qt::Key >( key1 ) ) };
;
}
bool InternalPlayerBackend::anyAvailable()
{
#if defined( MAKE_FFMPEG_PLAYER ) || defined( MAKE_QTMULTIMEDIA_PLAYER )
@ -213,8 +205,6 @@ Preferences::Preferences():
selectWordBySingleClick( false ),
autoScrollToTargetArticle( true ),
escKeyHidesMainWindow( false ),
darkMode( false ),
darkReaderMode( false ),
alwaysOnTop( false ),
searchInDock( false ),
// on macOS, register hotkeys will override system shortcuts, disabled for now to avoid troubles.
@ -225,8 +215,8 @@ Preferences::Preferences():
enableMainWindowHotkey( true ),
enableClipboardHotkey( true ),
#endif
mainWindowHotkey( QKeySequence( "Ctrl+F11,F11" ) ),
clipboardHotkey( QKeySequence( "Ctrl+C,C" ) ),
mainWindowHotkey( QKeySequence( "Ctrl+F11, Ctrl+F11" ) ),
clipboardHotkey( QKeySequence( "Ctrl+C, Ctrl+C" ) ),
startWithScanPopupOn( false ),
enableScanPopupModifiers( false ),
scanPopupModifiers( 0 ),
@ -947,11 +937,12 @@ Class load()
}
if ( !preferences.namedItem( "darkMode" ).isNull() ) {
c.preferences.darkMode = ( preferences.namedItem( "darkMode" ).toElement().text() == "1" );
c.preferences.darkMode = static_cast< Dark >( preferences.namedItem( "darkMode" ).toElement().text().toInt() );
}
if ( !preferences.namedItem( "darkReaderMode" ).isNull() ) {
c.preferences.darkReaderMode = ( preferences.namedItem( "darkReaderMode" ).toElement().text() == "1" );
c.preferences.darkReaderMode =
static_cast< Dark >( preferences.namedItem( "darkReaderMode" ).toElement().text().toInt() );
}
if ( !preferences.namedItem( "zoomFactor" ).isNull() ) {
@ -1886,11 +1877,11 @@ void save( Class const & c )
preferences.appendChild( opt );
opt = dd.createElement( "darkMode" );
opt.appendChild( dd.createTextNode( c.preferences.darkMode ? "1" : "0" ) );
opt.appendChild( dd.createTextNode( QString::number( static_cast< int >( c.preferences.darkMode ) ) ) );
preferences.appendChild( opt );
opt = dd.createElement( "darkReaderMode" );
opt.appendChild( dd.createTextNode( c.preferences.darkReaderMode ? "1" : "0" ) );
opt.appendChild( dd.createTextNode( QString::number( static_cast< int >( c.preferences.darkReaderMode ) ) ) );
preferences.appendChild( opt );
opt = dd.createElement( "zoomFactor" );

View file

@ -1,8 +1,7 @@
/* This file is (c) 2008-2012 Konstantin Isakov <ikm@goldendict.org>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef __CONFIG_HH_INCLUDED__
#define __CONFIG_HH_INCLUDED__
#pragma once
#include <QObject>
#include <QList>
@ -18,11 +17,25 @@
#include <optional>
#include <QThread>
/// Special group IDs
enum GroupId : unsigned {
AllGroupId = UINT_MAX - 1, /// The 'All' group
HelpGroupId = UINT_MAX, /// The fictitious 'Help' group
NoGroupId = 0, /// Invalid value, used to specify that no group id is specified at all.
};
/// GoldenDict's configuration
namespace Config {
// Tri states enum for Dark and Dark reader mode
enum class Dark : std::uint8_t {
Off = 0,
On = 1,
Auto = 2,
};
/// Dictionaries which are temporarily disabled via the dictionary bar.
typedef QSet< QString > MutedDictionaries;
using MutedDictionaries = QSet< QString >;
/// A path where to search for the dictionaries
struct Path
@ -47,7 +60,7 @@ struct Path
};
/// A list of paths where to search for the dictionaries
typedef QList< Path > Paths;
using Paths = QList< Path >;
/// A directory holding bunches of audiofiles, which is indexed into a separate
/// dictionary.
@ -72,7 +85,7 @@ struct SoundDir
};
/// A list of SoundDirs
typedef QList< SoundDir > SoundDirs;
using SoundDirs = QList< SoundDir >;
struct DictionaryRef
{
@ -178,14 +191,11 @@ struct HotKey
Qt::KeyboardModifiers modifiers;
int key1, key2;
HotKey();
/// Hotkey's constructor, take a QKeySequence's first two keys
/// 1st key's modifier will be the `modifiers` above
/// 1st key without modifier will becomes `key1`
/// 2nd key without modifier will becomes `key2`
/// The relation between the int and qt's KeyCode should consult qt's doc
HotKey( QKeySequence const & );
QKeySequence toKeySequence() const;
@ -414,8 +424,14 @@ struct Preferences
// Appearances
bool darkMode;
bool darkReaderMode;
Dark darkMode = Dark::Off;
Dark darkReaderMode =
#if defined( Q_OS_MACOS )
Dark::Auto;
#else
Dark::Off;
#endif
QString addonStyle;
QString displayStyle; // Article Display style (Which also affect interface style on windows)
@ -499,7 +515,7 @@ struct WebSite
};
/// All the WebSites
typedef QList< WebSite > WebSites;
using WebSites = QList< WebSite >;
/// Any DICT server
struct DictServer
@ -540,14 +556,14 @@ struct DictServer
};
/// All the DictServers
typedef QList< DictServer > DictServers;
using DictServers = QList< DictServer >;
/// Hunspell configuration
struct Hunspell
{
QString dictionariesPath;
typedef QList< QString > Dictionaries;
using Dictionaries = QList< QString >;
Dictionaries enabledDictionaries;
@ -563,7 +579,7 @@ struct Hunspell
};
/// All the MediaWikis
typedef QList< MediaWiki > MediaWikis;
using MediaWikis = QList< MediaWiki >;
/// Chinese transliteration configuration
@ -756,7 +772,7 @@ struct Program
}
};
typedef QList< Program > Programs;
using Programs = QList< Program >;
#ifndef NO_TTS_SUPPORT
struct VoiceEngine
@ -802,7 +818,7 @@ struct VoiceEngine
}
};
typedef QList< VoiceEngine > VoiceEngines;
using VoiceEngines = QList< VoiceEngine >;
#endif
struct HeadwordsDialog
@ -1012,5 +1028,3 @@ QString getStylesDir();
QString getCacheDir() noexcept;
} // namespace Config
#endif

View file

@ -1,5 +1,4 @@
#ifndef __DELEGATE_HH_INCLUDED__
#define __DELEGATE_HH_INCLUDED__
#pragma once
#include <QAbstractItemDelegate>
#include <QStyledItemDelegate>
@ -13,5 +12,3 @@ public:
private:
QStyledItemDelegate * mainDelegate;
};
#endif

View file

@ -1,8 +1,7 @@
/* This file is (c) 2008-2012 Konstantin Isakov <ikm@goldendict.org>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef __AARD_HH_INCLUDED__
#define __AARD_HH_INCLUDED__
#pragma once
#include "dictionary.hh"
@ -18,5 +17,3 @@ vector< sptr< Dictionary::Class > > makeDictionaries( vector< string > const & f
unsigned maxHeadwordsToExpand );
} // namespace Aard
#endif

View file

@ -1,8 +1,7 @@
/* This file is (c) 2013 Maksim Tamkovicz <quendimax@gmail.com>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef __BELARUSIANTRANSLIT_HH_INCLUDED__
#define __BELARUSIANTRANSLIT_HH_INCLUDED__
#pragma once
#include <vector>
#include "dictionary.hh"
@ -12,5 +11,3 @@ namespace BelarusianTranslit {
std::vector< sptr< Dictionary::Class > > makeDictionaries();
}
#endif

View file

@ -721,8 +721,8 @@ void BglArticleRequest::run()
string const & targetHeadword = displayedHeadword.size() ? displayedHeadword : headword;
QCryptographicHash hash( QCryptographicHash::Md5 );
hash.addData( targetHeadword.data(), targetHeadword.size() + 1 ); // with 0
hash.addData( articleText.data(), articleText.size() );
hash.addData( { targetHeadword.data(), static_cast< qsizetype >( targetHeadword.size() + 1 ) } ); // with 0
hash.addData( { articleText.data(), static_cast< qsizetype >( articleText.size() ) } );
if ( !articleBodiesIncluded.insert( hash.result() ).second ) {
continue; // Already had this body

View file

@ -1,8 +1,7 @@
/* This file is (c) 2008-2012 Konstantin Isakov <ikm@goldendict.org>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef __BGL_HH_INCLUDED__
#define __BGL_HH_INCLUDED__
#pragma once
#include "dictionary.hh"
@ -23,5 +22,3 @@ vector< sptr< Dictionary::Class > >
makeDictionaries( vector< string > const & fileNames, string const & indicesDir, Dictionary::Initializing & );
} // namespace Bgl
#endif

View file

@ -18,8 +18,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef BABYLON_H
#define BABYLON_H
#pragma once
#include <stdlib.h>
#include <zlib.h>
@ -115,20 +114,20 @@ const std::vector< std::string > bgl_charset = { "WINDOWS-1252", /*Default*/
const std::array< std::string, 11 > partOfSpeech = {
"n.", "adj.", "v.", "adv.", "interj.", "pron.", "prep.", "conj.", "suff.", "pref.", "art." };
typedef struct
struct bgl_block
{
unsigned type;
unsigned length;
char * data;
} bgl_block;
};
typedef struct
struct bgl_entry
{
std::string headword;
std::string definition;
std::string displayedHeadword;
std::vector< std::string > alternates;
} bgl_entry;
};
class Babylon
{
@ -229,5 +228,3 @@ private:
BGL_TARGET_CHARSET
};
};
#endif // BABYLON_H

View file

@ -1,8 +1,7 @@
/* This file is (c) 2008-2012 Konstantin Isakov <ikm@goldendict.org>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef __BTREEIDX_HH_INCLUDED__
#define __BTREEIDX_HH_INCLUDED__
#pragma once
#include "dict/dictionary.hh"
#include "dictfile.hh"
@ -270,5 +269,3 @@ struct IndexedWords: public map< string, vector< WordArticleLink > >
IndexInfo buildIndex( IndexedWords const &, File::Index & file );
} // namespace BtreeIndexing
#endif

View file

@ -1,8 +1,7 @@
/* This file is (c) 2015 Zhe Wang <0x1997@gmail.com>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef __CHINESE_HH_INCLUDED__
#define __CHINESE_HH_INCLUDED__
#pragma once
#include <map>
#include "config.hh"
@ -13,5 +12,3 @@ namespace Chinese {
std::vector< sptr< Dictionary::Class > > makeDictionaries( Config::Chinese const & );
}
#endif

View file

@ -1,8 +1,7 @@
/* This file is (c) 2008-2012 Konstantin Isakov <ikm@goldendict.org>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef __CHUNKEDSTORAGE_HH_INCLUDED__
#define __CHUNKEDSTORAGE_HH_INCLUDED__
#pragma once
#include "ex.hh"
#include "dictfile.hh"
@ -86,5 +85,3 @@ public:
};
} // namespace ChunkedStorage
#endif

View file

@ -1,5 +1,4 @@
#ifndef CUSTOMTRANSLITERATION_HH
#define CUSTOMTRANSLITERATION_HH
#pragma once
#include <vector>
@ -23,4 +22,3 @@ private:
std::vector< sptr< Dictionary::Class > > makeDictionaries( Config::CustomTrans const & );
} // namespace CustomTranslit
#endif // CUSTOMTRANSLITERATION_HH

View file

@ -1,8 +1,7 @@
/* This file is (c) 2008-2012 Konstantin Isakov <ikm@goldendict.org>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef __DICTDFILES_HH_INCLUDED__
#define __DICTDFILES_HH_INCLUDED__
#pragma once
#include "dict/dictionary.hh"
@ -16,5 +15,3 @@ vector< sptr< Dictionary::Class > >
makeDictionaries( vector< string > const & fileNames, string const & indicesDir, Dictionary::Initializing & );
} // namespace DictdFiles
#endif

View file

@ -1,8 +1,7 @@
/* This file is (c) 2008-2012 Konstantin Isakov <ikm@goldendict.org>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef __DICTIONARY_HH_INCLUDED__
#define __DICTIONARY_HH_INCLUDED__
#pragma once
#include <map>
#include <string>
@ -585,5 +584,3 @@ QString generateRandomDictionaryId();
QMap< std::string, sptr< Dictionary::Class > > dictToMap( std::vector< sptr< Dictionary::Class > > const & dicts );
} // namespace Dictionary
#endif

View file

@ -1,5 +1,4 @@
#ifndef __DICTSERVER_HH__INCLUDED__
#define __DICTSERVER_HH__INCLUDED__
#pragma once
#include "dict/dictionary.hh"
#include "config.hh"
@ -13,5 +12,3 @@ using std::string;
vector< sptr< Dictionary::Class > > makeDictionaries( Config::DictServers const & servers );
} // namespace DictServer
#endif // __DICTSERVER_HH__INCLUDED__

View file

@ -1,8 +1,7 @@
/* This file is (c) 2008-2012 Konstantin Isakov <ikm@goldendict.org>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef __DSL_HH_INCLUDED__
#define __DSL_HH_INCLUDED__
#pragma once
#include "dictionary.hh"
@ -18,5 +17,3 @@ vector< sptr< Dictionary::Class > > makeDictionaries( vector< string > const & f
unsigned int maxHeadwordSize );
} // namespace Dsl
#endif

View file

@ -1,8 +1,7 @@
/* This file is (c) 2008-2012 Konstantin Isakov <ikm@goldendict.org>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef __DSL_DETAILS_HH_INCLUDED__
#define __DSL_DETAILS_HH_INCLUDED__
#pragma once
#include <string>
#include <list>
@ -223,5 +222,3 @@ quint32 dslLanguageToId( wstring const & name );
} // namespace Details
} // namespace Dsl
#endif

View file

@ -1,5 +1,4 @@
#ifndef __EPWING_HH__INCLUDED__
#define __EPWING_HH__INCLUDED__
#pragma once
#include "dict/dictionary.hh"
#include "epwing_book.hh"
@ -20,5 +19,3 @@ void addWordToChunks( Epwing::Book::EpwingHeadword & head,
vector< sptr< Dictionary::Class > >
makeDictionaries( vector< string > const & fileNames, string const & indicesDir, Dictionary::Initializing & );
} // namespace Epwing
#endif // __EPWING_HH__INCLUDED__

View file

@ -1,5 +1,4 @@
#ifndef __EPWING_BOOK_HH_INCLUDED__
#define __EPWING_BOOK_HH_INCLUDED__
#pragma once
#include "dict/dictionary.hh"
#include "ex.hh"
@ -58,7 +57,7 @@ struct EpwingHeadword
class EpwingBook
{
typedef std::pair< int, int > EWPos;
using EWPos = std::pair< int, int >;
void setErrorString( QString const & func, EB_Error_Code code );
@ -270,6 +269,3 @@ struct EContainer
} // namespace Book
} // namespace Epwing
#endif // __EPWING_BOOK_HH_INCLUDED__

View file

@ -1,5 +1,4 @@
#ifndef __EPWING_CHARMAP_HH_INCLUDED_
#define __EPWING_CHARMAP_HH_INCLUDED_
#pragma once
#include <QByteArray>
#include <QMap>
@ -22,5 +21,3 @@ private:
};
} // namespace Epwing
#endif // __EPWING_CHARMAP_HH_INCLUDED_

View file

@ -93,7 +93,7 @@ class ForvoArticleRequest: public Dictionary::DataRequest
}
};
typedef std::list< NetReply > NetReplies;
using NetReplies = std::list< NetReply >;
NetReplies netReplies;
QString apiKey, languageCode;
string dictionaryId;
@ -107,7 +107,7 @@ public:
string const & dictionaryId_,
QNetworkAccessManager & mgr );
virtual void cancel();
void cancel() override;
private:

View file

@ -1,8 +1,7 @@
/* This file is (c) 2008-2012 Konstantin Isakov <ikm@goldendict.org>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef __FORVO_HH_INCLUDED__
#define __FORVO_HH_INCLUDED__
#pragma once
#include "dictionary.hh"
#include "config.hh"
@ -15,5 +14,3 @@ std::vector< sptr< Dictionary::Class > >
makeDictionaries( Dictionary::Initializing &, Config::Forvo const &, QNetworkAccessManager & );
} // namespace Forvo
#endif

View file

@ -1,8 +1,7 @@
/* This file is (c) 2008-2012 Konstantin Isakov <ikm@goldendict.org>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef GERMAN_HH
#define GERMAN_HH
#pragma once
#include "dictionary.hh"
@ -11,5 +10,3 @@ namespace GermanTranslit {
sptr< Dictionary::Class > makeDictionary();
}
#endif // GERMAN_HH

View file

@ -1,5 +1,4 @@
#ifndef __GLS_HH_INCLUDED__
#define __GLS_HH_INCLUDED__
#pragma once
#include "dictionary.hh"
@ -13,5 +12,3 @@ vector< sptr< Dictionary::Class > >
makeDictionaries( vector< string > const & fileNames, string const & indicesDir, Dictionary::Initializing & );
} // namespace Gls
#endif // __GLS_HH_INCLUDED__

View file

@ -1,8 +1,7 @@
/* This file is (c) 2010 Jennie Petoumenou <epetoumenou@gmail.com>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef GREEKTRANSLIT_HH
#define GREEKTRANSLIT_HH
#pragma once
#include "dictionary.hh"
@ -11,5 +10,3 @@ namespace GreekTranslit {
sptr< Dictionary::Class > makeDictionary();
}
#endif // GREEKTRANSLIT_HH

View file

@ -1,8 +1,7 @@
/* This file is (c) 2008-2012 Konstantin Isakov <ikm@goldendict.org>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef __HUNSPELL_HH_INCLUDED__
#define __HUNSPELL_HH_INCLUDED__
#pragma once
#ifdef _MSC_VER
#define HUNSPELL_STATIC
@ -41,5 +40,3 @@ vector< DataFiles > findDataFiles( QString const & path );
vector< sptr< Dictionary::Class > > makeDictionaries( Config::Hunspell const & );
} // namespace HunspellMorpho
#endif

View file

@ -33,7 +33,7 @@ class LinguaArticleRequest: public Dictionary::DataRequest
}
};
typedef std::list< NetReply > NetReplies;
using NetReplies = std::list< NetReply >;
NetReplies netReplies;
QString languageCode, langWikipediaID;
string dictionaryId;
@ -47,7 +47,7 @@ public:
string const & dictionaryId_,
QNetworkAccessManager & mgr );
virtual void cancel();
void cancel() override;
private:

View file

@ -1,5 +1,4 @@
#ifndef GOLDENDICT_LINGUALIBRE_H
#define GOLDENDICT_LINGUALIBRE_H
#pragma once
#include "dictionary.hh"
#include "config.hh"
@ -11,5 +10,3 @@ std::vector< sptr< Dictionary::Class > >
makeDictionaries( Dictionary::Initializing &, Config::Lingua const &, QNetworkAccessManager & );
} // namespace Lingua
#endif //GOLDENDICT_LINGUALIBRE_H

View file

@ -1,8 +1,7 @@
/* This file is (c) 2008-2012 Konstantin Isakov <ikm@goldendict.org>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef __LOADDICTIONARIES_HH_INCLUDED__
#define __LOADDICTIONARIES_HH_INCLUDED__
#pragma once
#include "initializing.hh"
#include "config.hh"
@ -75,4 +74,3 @@ void loadDictionaries( QWidget * parent,
/// Runs deferredInit() on all the given dictionaries. Useful when
/// loadDictionaries() was previously called with doDeferredInit = false.
void doDeferredInit( std::vector< sptr< Dictionary::Class > > & );
#endif

View file

@ -1,8 +1,7 @@
/* This file is (c) 2008-2012 Konstantin Isakov <ikm@goldendict.org>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef __L9SA_HH_INCLUDED__
#define __L9SA_HH_INCLUDED__
#pragma once
#include "dictionary.hh"
@ -16,5 +15,3 @@ vector< sptr< Dictionary::Class > >
makeDictionaries( vector< string > const & fileNames, string const & indicesDir, Dictionary::Initializing & );
} // namespace Lsa
#endif

View file

@ -18,8 +18,7 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
#ifndef __MDICTPARSER_HH_INCLUDED__
#define __MDICTPARSER_HH_INCLUDED__
#pragma once
#include <string>
#include <vector>
@ -112,9 +111,9 @@ public:
virtual void handleRecord( QString const & name, RecordInfo const & recordInfo ) = 0;
};
typedef vector< pair< qint64, qint64 > > BlockInfoVector;
typedef vector< pair< qint64, QString > > HeadWordIndex;
typedef map< qint32, pair< QString, QString > > StyleSheets;
using BlockInfoVector = vector< pair< qint64, qint64 > >;
using HeadWordIndex = vector< pair< qint64, QString > >;
using StyleSheets = map< qint32, pair< QString, QString > >;
inline QString const & title() const
{
@ -215,5 +214,3 @@ protected:
};
} // namespace Mdict
#endif // __MDICTPARSER_HH_INCLUDED__

View file

@ -621,7 +621,7 @@ void MdxArticleRequest::run()
}
QCryptographicHash hash( QCryptographicHash::Md5 );
hash.addData( articleBody.data(), articleBody.size() );
hash.addData( { articleBody.data(), static_cast< qsizetype >( articleBody.length() ) } );
if ( !articleBodiesIncluded.insert( hash.result() ).second ) {
continue; // Already had this body
}

View file

@ -1,8 +1,7 @@
/* This file is (c) 2013 Timon Wong <timon86.wang AT gmail DOT com>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef __MDX_HH_INCLUDED__
#define __MDX_HH_INCLUDED__
#pragma once
#include "dictionary.hh"
@ -15,5 +14,3 @@ vector< sptr< Dictionary::Class > >
makeDictionaries( vector< string > const & fileNames, string const & indicesDir, Dictionary::Initializing & );
} // namespace Mdx
#endif // __MDX_HH_INCLUDED__

View file

@ -389,7 +389,7 @@ void MediaWikiSectionsParser::closeListTags( int currentLevel )
class MediaWikiArticleRequest: public MediaWikiDataRequestSlots
{
typedef std::list< std::pair< QNetworkReply *, bool > > NetReplies;
using NetReplies = std::list< std::pair< QNetworkReply *, bool > >;
NetReplies netReplies;
QString url;
QString lang;

View file

@ -1,8 +1,7 @@
/* This file is (c) 2008-2012 Konstantin Isakov <ikm@goldendict.org>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef __MEDIAWIKI_HH_INCLUDED__
#define __MEDIAWIKI_HH_INCLUDED__
#pragma once
#include "dictionary.hh"
#include "config.hh"
@ -18,5 +17,3 @@ makeDictionaries( Dictionary::Initializing &, Config::MediaWikis const & wikis,
} // namespace MediaWiki
#endif

View file

@ -1,8 +1,7 @@
/* This file is (c) 2008-2012 Konstantin Isakov <ikm@goldendict.org>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef __PROGRAMS_HH_INCLUDED__
#define __PROGRAMS_HH_INCLUDED__
#pragma once
#include <QProcess>
#include "dictionary.hh"
@ -79,5 +78,3 @@ private slots:
};
} // namespace Programs
#endif

View file

@ -1,8 +1,7 @@
/* This file is (c) 2008-2012 Konstantin Isakov <ikm@goldendict.org>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef __ROMAJI_HH_INCLUDED__
#define __ROMAJI_HH_INCLUDED__
#pragma once
#include "transliteration.hh"
#include "config.hh"
@ -14,5 +13,3 @@ using std::vector;
vector< sptr< Dictionary::Class > > makeDictionaries( Config::Romaji const & );
} // namespace Romaji
#endif

View file

@ -1,8 +1,7 @@
/* This file is (c) 2008-2012 Konstantin Isakov <ikm@goldendict.org>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef __RUSSIANTRANSLIT_HH_INCLUDED__
#define __RUSSIANTRANSLIT_HH_INCLUDED__
#pragma once
#include "dictionary.hh"
@ -11,5 +10,3 @@ namespace RussianTranslit {
sptr< Dictionary::Class > makeDictionary();
}
#endif

View file

@ -1,8 +1,7 @@
/* This file is (c) 2008-2012 Konstantin Isakov <ikm@goldendict.org>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef __SDICT_HH_INCLUDED__
#define __SDICT_HH_INCLUDED__
#pragma once
#include "dictionary.hh"
@ -16,5 +15,3 @@ vector< sptr< Dictionary::Class > >
makeDictionaries( vector< string > const & fileNames, string const & indicesDir, Dictionary::Initializing & );
} // namespace Sdict
#endif

View file

@ -109,8 +109,8 @@ bool indexIsOldOrBad( string const & indexFile )
class SlobFile
{
public:
typedef std::pair< quint64, quint32 > RefEntryOffsetItem;
typedef QList< RefEntryOffsetItem > RefOffsetsVector;
using RefEntryOffsetItem = std::pair< quint64, quint32 >;
using RefOffsetsVector = QList< RefEntryOffsetItem >;
private:
enum Compressions {

View file

@ -1,5 +1,4 @@
#ifndef __SLOB_HH_INCLUDED__
#define __SLOB_HH_INCLUDED__
#pragma once
#include "dictionary.hh"
@ -15,5 +14,3 @@ vector< sptr< Dictionary::Class > > makeDictionaries( vector< string > const & f
unsigned maxHeadwordsToExpand );
} // namespace Slob
#endif // __SLOB_HH_INCLUDED__

View file

@ -1,8 +1,7 @@
/* This file is (c) 2008-2012 Konstantin Isakov <ikm@goldendict.org>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef __SOUNDDIR_HH_INCLUDED__
#define __SOUNDDIR_HH_INCLUDED__
#pragma once
#include "dictionary.hh"
#include "config.hh"
@ -17,5 +16,3 @@ vector< sptr< Dictionary::Class > >
makeDictionaries( Config::SoundDirs const &, string const & indicesDir, Dictionary::Initializing & );
} // namespace SoundDir
#endif

View file

@ -1,8 +1,7 @@
/* This file is (c) 2008-2012 Konstantin Isakov <ikm@goldendict.org>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef __SOURCES_HH_INCLUDED__
#define __SOURCES_HH_INCLUDED__
#pragma once
#include "ui_sources.h"
#include "config.hh"
@ -360,5 +359,3 @@ private slots:
void on_rescan_clicked();
};
#endif

View file

@ -1,8 +1,7 @@
/* This file is (c) 2008-2012 Konstantin Isakov <ikm@goldendict.org>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef __STARTDICT_HH_INCLUDED__
#define __STARTDICT_HH_INCLUDED__
#pragma once
#include "dictionary.hh"
@ -18,5 +17,3 @@ vector< sptr< Dictionary::Class > > makeDictionaries( vector< string > const & f
unsigned maxHeadwordsToExpand );
} // namespace Stardict
#endif

View file

@ -1,8 +1,7 @@
/* This file is (c) 2008-2012 Konstantin Isakov <ikm@goldendict.org>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef __TRANSLITERATION_HH_INCLUDED__
#define __TRANSLITERATION_HH_INCLUDED__
#pragma once
#include "dictionary.hh"
#include <map>
@ -84,5 +83,3 @@ public:
};
} // namespace Transliteration
#endif

View file

@ -1,5 +1,4 @@
#ifndef __DECOMPRESS_HH_INCLUDED__
#define __DECOMPRESS_HH_INCLUDED__
#pragma once
#include <QByteArray>
#include <string>
@ -13,5 +12,3 @@ string decompressZlib( const char * bufptr, unsigned length );
string decompressBzip2( const char * bufptr, unsigned length );
string decompressLzma2( const char * bufptr, unsigned length, bool raw_decoder = false );
#endif // DECOMPRESS_HH

View file

@ -1,8 +1,7 @@
/* This file is (c) 2008-2012 Konstantin Isakov <ikm@goldendict.org>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef GOLDENDICT_FILE_HH
#define GOLDENDICT_FILE_HH
#pragma once
#include "ex.hh"
@ -125,5 +124,3 @@ private:
};
} // namespace File
#endif

View file

@ -21,8 +21,7 @@
* 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
*/
#ifndef _DICTZIP_H_
#define _DICTZIP_H_
#pragma once
#include <stdio.h>
#include <zlib.h>
@ -112,5 +111,3 @@ extern int mmap_mode;
#ifdef __cplusplus
} /* end extern "C" */
#endif
#endif /* _DICTZIP_H_ */

View file

@ -1,8 +1,7 @@
/* This file is (c) 2008-2012 Konstantin Isakov <ikm@goldendict.org>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef __INDEXEDZIP_HH_INCLUDED__
#define __INDEXEDZIP_HH_INCLUDED__
#pragma once
#include "btreeidx.hh"
#include <QFile>
@ -48,5 +47,3 @@ public:
/// Index compressed files in zip file
bool indexFile( BtreeIndexing::IndexedWords & zipFileNames, quint32 * filesCount = 0 );
};
#endif

View file

@ -16,8 +16,7 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
#ifndef __RIPEMD_HH_INCLUDED__
#define __RIPEMD_HH_INCLUDED__
#pragma once
#include <stddef.h>
#include <QtGlobal>
@ -42,5 +41,3 @@ private:
void transform( const uchar buffer[ 64 ] );
};
#endif // __RIPEMD_HH_INCLUDED__

View file

@ -1,5 +1,4 @@
#ifndef __SPLITFILE_HH_INCLUDED__
#define __SPLITFILE_HH_INCLUDED__
#pragma once
#include <QFile>
#include <QList>
@ -51,5 +50,3 @@ public:
};
} // namespace SplitFile
#endif // __SPLITFILE_HH_INCLUDED__

View file

@ -1,5 +1,4 @@
#ifndef UFILE_HH_INCLUDED
#define UFILE_HH_INCLUDED
#pragma once
// Don't use this thing.
// Use QFile instead.
@ -29,5 +28,3 @@ gzFile gd_gzopen( const char * filename );
#define gd_fopen fopen
#define gd_gzopen( filename ) gzopen( filename, "rb" )
#endif
#endif // UFILE_HH

View file

@ -1,8 +1,7 @@
/* This file is (c) 2008-2012 Konstantin Isakov <ikm@goldendict.org>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef __ZIPFILE_HH_INCLUDED__
#define __ZIPFILE_HH_INCLUDED__
#pragma once
#include <QFile>
#include <QDateTime>
@ -72,5 +71,3 @@ bool readNextEntry( SplitZipFile &, CentralDirEntry & );
bool readLocalHeader( SplitZipFile &, LocalFileHeader & );
} // namespace ZipFile
#endif

View file

@ -1,8 +1,7 @@
/* This file is (c) 2008-2012 Konstantin Isakov <ikm@goldendict.org>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef __WEBSITE_HH_INCLUDED__
#define __WEBSITE_HH_INCLUDED__
#pragma once
#include "dictionary.hh"
#include "config.hh"
@ -17,5 +16,3 @@ vector< sptr< Dictionary::Class > > makeDictionaries( Config::WebSites const &,
} // namespace WebSite
#endif

View file

@ -1,8 +1,7 @@
/* This file is (c) 2008-2009 Konstantin Isakov <ikm@goldendict.org>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef __XDXF_HH_INCLUDED__
#define __XDXF_HH_INCLUDED__
#pragma once
#include "dictionary.hh"
@ -18,5 +17,3 @@ vector< sptr< Dictionary::Class > >
makeDictionaries( vector< string > const & fileNames, string const & indicesDir, Dictionary::Initializing & );
} // namespace Xdxf
#endif

View file

@ -1,8 +1,7 @@
/* This file is (c) 2008-2012 Konstantin Isakov <ikm@goldendict.org>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef __XDXF2HTML_HH_INCLUDED__
#define __XDXF2HTML_HH_INCLUDED__
#pragma once
#include <string>
#include <map>
@ -32,5 +31,3 @@ string convert( string const &,
QString * headword = 0 );
} // namespace Xdxf2Html
#endif

Some files were not shown because too many files have changed in this diff Show more