From 0680edd1e98ce015909df92acfe9bb261b18d9b2 Mon Sep 17 00:00:00 2001 From: shenleban tongying Date: Thu, 21 Nov 2024 08:06:17 -0500 Subject: [PATCH] clean: delete unused QSemaphore and do a header cleanup --- src/audio/audiooutput.cc | 3 +-- src/dict/aard.cc | 7 +------ src/dict/bgl.cc | 7 ++----- src/dict/btreeidx.cc | 5 +---- src/dict/btreeidx.hh | 5 ----- src/dict/dictdfiles.cc | 2 +- src/dict/dictserver.cc | 7 ++++--- src/dict/dsl.cc | 22 ++-------------------- src/dict/epwing.cc | 11 ++--------- src/dict/gls.cc | 10 +--------- src/dict/hunspell.cc | 16 ++++------------ src/dict/mdx.cc | 6 ++---- src/dict/sdict.cc | 2 +- src/dict/slob.cc | 7 ++----- src/dict/stardict.cc | 24 +++++++++--------------- src/dict/xdxf.cc | 8 -------- src/dict/zim.cc | 5 +---- src/ftshelpers.hh | 3 +-- src/fulltextsearch.cc | 10 +++++----- src/fulltextsearch.hh | 9 --------- 20 files changed, 40 insertions(+), 129 deletions(-) diff --git a/src/audio/audiooutput.cc b/src/audio/audiooutput.cc index b4d4be13..ab434878 100644 --- a/src/audio/audiooutput.cc +++ b/src/audio/audiooutput.cc @@ -1,7 +1,6 @@ #include "audiooutput.hh" -#include -#include +#include #include #include #include diff --git a/src/dict/aard.cc b/src/dict/aard.cc index 1e76e27d..99a093c8 100644 --- a/src/dict/aard.cc +++ b/src/dict/aard.cc @@ -16,16 +16,11 @@ #include #include - +#include #include -#include -#include #include -#include #include #include -#include "ufile.hh" -#include "wstring_qt.hh" #include "utils.hh" namespace Aard { diff --git a/src/dict/bgl.cc b/src/dict/bgl.cc index 4fda7d37..6cc20708 100644 --- a/src/dict/bgl.cc +++ b/src/dict/bgl.cc @@ -14,20 +14,17 @@ #include "language.hh" #include "utf8.hh" #include "utils.hh" - #include #include #include #include #include #include - - #include +#include +#include #include #include -#include -#include namespace Bgl { diff --git a/src/dict/btreeidx.cc b/src/dict/btreeidx.cc index 696144e3..2697e641 100644 --- a/src/dict/btreeidx.cc +++ b/src/dict/btreeidx.cc @@ -4,9 +4,6 @@ #include "btreeidx.hh" #include "folding.hh" #include "utf8.hh" -#include -#include -#include #include #include #include @@ -18,7 +15,7 @@ #include "wildcard.hh" #include "globalbroadcaster.hh" -#include +#include #include namespace BtreeIndexing { diff --git a/src/dict/btreeidx.hh b/src/dict/btreeidx.hh index 2a077ec8..ed0eb8fb 100644 --- a/src/dict/btreeidx.hh +++ b/src/dict/btreeidx.hh @@ -5,17 +5,12 @@ #include "dict/dictionary.hh" #include "dictfile.hh" - -#include #include #include #include #include - #include #include -#include -#include /// A base for the dictionary which creates a btree index to look up diff --git a/src/dict/dictdfiles.cc b/src/dict/dictdfiles.cc index ef1a58a5..9e12ece0 100644 --- a/src/dict/dictdfiles.cc +++ b/src/dict/dictdfiles.cc @@ -7,7 +7,6 @@ #include "utf8.hh" #include "dictzip.hh" #include "htmlescape.hh" - #include "langcoder.hh" #include #include @@ -18,6 +17,7 @@ #include #include "gddebug.hh" #include "ftshelpers.hh" +#include #include diff --git a/src/dict/dictserver.cc b/src/dict/dictserver.cc index 4a4b8d23..3fc5b71f 100644 --- a/src/dict/dictserver.cc +++ b/src/dict/dictserver.cc @@ -7,11 +7,12 @@ #include #include #include -#include #include "htmlescape.hh" - +#include +#include +#include #include -#include +#include namespace DictServer { diff --git a/src/dict/dsl.cc b/src/dict/dsl.cc index 8fe62868..a2845607 100644 --- a/src/dict/dsl.cc +++ b/src/dict/dsl.cc @@ -11,7 +11,6 @@ #include "htmlescape.hh" #include "iconv.hh" #include "filetype.hh" - #include "audiolink.hh" #include "langcoder.hh" #include "wstring_qt.hh" @@ -19,36 +18,22 @@ #include "gddebug.hh" #include "tiff.hh" #include "ftshelpers.hh" - #include #include #include #include #include #include - -#include #include #include #include - #include #include #include -#include - #include - -// For TIFF conversion -#include #include -#include - -// For SVG handling -#include - -#include - +#include +#include #include "utils.hh" namespace Dsl { @@ -154,7 +139,6 @@ class DslDictionary: public BtreeIndexing::BtreeDictionary QAtomicInt deferredInitDone; QMutex deferredInitMutex; bool deferredInitRunnableStarted; - QSemaphore deferredInitRunnableExited; string initError; @@ -1405,7 +1389,6 @@ class DslArticleRequest: public Dictionary::DataRequest bool ignoreDiacritics; QAtomicInt isCancelled; - QSemaphore hasExited; QFuture< void > f; public: @@ -1582,7 +1565,6 @@ class DslResourceRequest: public Dictionary::DataRequest string resourceName; QAtomicInt isCancelled; - QSemaphore hasExited; QFuture< void > f; public: diff --git a/src/dict/epwing.cc b/src/dict/epwing.cc index cc2b6fff..372bf01d 100644 --- a/src/dict/epwing.cc +++ b/src/dict/epwing.cc @@ -1,26 +1,19 @@ /* This file is (c) 2014 Abs62 * Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */ +#include #ifndef NO_EPWING_SUPPORT #include "epwing_book.hh" #include "epwing.hh" - #include - #include - #include - #include - #include - #include + #include #include #include - #include "btreeidx.hh" #include "folding.hh" #include "gddebug.hh" - #include "chunkedstorage.hh" - #include "wstring_qt.hh" #include "filetype.hh" #include "ftshelpers.hh" #include "globalregex.hh" diff --git a/src/dict/gls.cc b/src/dict/gls.cc index 15b238bc..a98cb86e 100644 --- a/src/dict/gls.cc +++ b/src/dict/gls.cc @@ -16,24 +16,16 @@ #include "dictzip.hh" #include "indexedzip.hh" #include "ftshelpers.hh" - #include "htmlescape.hh" #include "filetype.hh" #include "tiff.hh" #include "audiolink.hh" - #include -#include -#include #include -// For TIFF conversion -#include #include -#include - +#include #include #include - #include #include #include diff --git a/src/dict/hunspell.cc b/src/dict/hunspell.cc index d0a7ff3b..85de3a90 100644 --- a/src/dict/hunspell.cc +++ b/src/dict/hunspell.cc @@ -6,30 +6,22 @@ #include "htmlescape.hh" #include "iconv.hh" #include "folding.hh" -#include "wstring_qt.hh" #include "language.hh" #include "langcoder.hh" - -#include -#include -#include - #include - #include #include #include - #include +#include "gddebug.hh" +#include "utils.hh" +#include + #ifndef INCLUDE_LIBRARY_PATH #include #else #include #endif -#include "gddebug.hh" - -#include "utils.hh" -#include namespace HunspellMorpho { diff --git a/src/dict/mdx.cc b/src/dict/mdx.cc index 3e7fc522..bd3cb6e8 100644 --- a/src/dict/mdx.cc +++ b/src/dict/mdx.cc @@ -11,19 +11,16 @@ #include "chunkedstorage.hh" #include "gddebug.hh" #include "langcoder.hh" - #include "audiolink.hh" #include "ex.hh" #include "mdictparser.hh" #include "filetype.hh" #include "ftshelpers.hh" #include "htmlescape.hh" - #include #include #include #include - #include "globalregex.hh" #include "tiff.hh" #include "utils.hh" @@ -32,8 +29,9 @@ #include #include #include +#include #include -#include +#include namespace Mdx { diff --git a/src/dict/sdict.cc b/src/dict/sdict.cc index 2a6de02e..9cd37859 100644 --- a/src/dict/sdict.cc +++ b/src/dict/sdict.cc @@ -13,8 +13,8 @@ #include "utf8.hh" #include #include +#include #include -#include #include #include #include diff --git a/src/dict/slob.cc b/src/dict/slob.cc index 685b496e..e722bd3f 100644 --- a/src/dict/slob.cc +++ b/src/dict/slob.cc @@ -10,25 +10,22 @@ #include "utf8.hh" #include "decompress.hh" #include "langcoder.hh" -#include "wstring_qt.hh" #include "ftshelpers.hh" #include "htmlescape.hh" #include "filetype.hh" #include "tiff.hh" #include "utils.hh" - #include "iconv.hh" - #include +#include #include #include #include #include #include #include - +#include #include - #include #include #include diff --git a/src/dict/stardict.cc b/src/dict/stardict.cc index f8ed4dd9..5760c7b8 100644 --- a/src/dict/stardict.cc +++ b/src/dict/stardict.cc @@ -11,36 +11,30 @@ #include "htmlescape.hh" #include "langcoder.hh" #include "gddebug.hh" - #include "filetype.hh" #include "indexedzip.hh" #include "tiff.hh" #include "ftshelpers.hh" #include "audiolink.hh" - #include #include #include #include +#include +#include +#include +#include "ufile.hh" +#include "utils.hh" +#include +#include "globalregex.hh" +#include +#include #ifndef Q_OS_WIN #include #else #include #endif -#include - - -#include -#include -#include -#include -#include -#include "ufile.hh" -#include "utils.hh" - -#include -#include "globalregex.hh" namespace Stardict { diff --git a/src/dict/xdxf.cc b/src/dict/xdxf.cc index 8a3e1d9a..9387cd6d 100644 --- a/src/dict/xdxf.cc +++ b/src/dict/xdxf.cc @@ -8,7 +8,6 @@ #include "chunkedstorage.hh" #include "dictzip.hh" #include "htmlescape.hh" - #include #include #include @@ -17,26 +16,19 @@ #include #include #include "gddebug.hh" -#include "wstring_qt.hh" #include "xdxf2html.hh" #include "ufile.hh" -#include "dictzip.hh" #include "langcoder.hh" #include "indexedzip.hh" #include "filetype.hh" #include "tiff.hh" #include "ftshelpers.hh" - - #include #include -#include #include #include #include #include -#include -#include #include #include "utils.hh" diff --git a/src/dict/zim.cc b/src/dict/zim.cc index 805c71da..e90a22c0 100644 --- a/src/dict/zim.cc +++ b/src/dict/zim.cc @@ -5,7 +5,6 @@ #include "zim.hh" #include "btreeidx.hh" - #include "folding.hh" #include "gddebug.hh" #include "utf8.hh" @@ -23,14 +22,12 @@ #include #include #include - #include - #include #include #include #include - #include + #include #include #include "globalregex.hh" #include diff --git a/src/ftshelpers.hh b/src/ftshelpers.hh index 9172f485..fa786af0 100644 --- a/src/ftshelpers.hh +++ b/src/ftshelpers.hh @@ -2,8 +2,7 @@ #include #include -#include - +#include #include "dict/dictionary.hh" #include "btreeidx.hh" #include "fulltextsearch.hh" diff --git a/src/fulltextsearch.cc b/src/fulltextsearch.cc index edfb815f..fe810ea0 100644 --- a/src/fulltextsearch.cc +++ b/src/fulltextsearch.cc @@ -1,14 +1,14 @@ /* This file is (c) 2014 Abs62 * Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */ -#include "fulltextsearch.hh" #include "ftshelpers.hh" +#include "fulltextsearch.hh" #include "gddebug.hh" -#include "help.hh" - -#include -#include #include "globalregex.hh" +#include "help.hh" +#include +#include +#include namespace FTS { diff --git a/src/fulltextsearch.hh b/src/fulltextsearch.hh index d4a63db8..4a3dcbe8 100644 --- a/src/fulltextsearch.hh +++ b/src/fulltextsearch.hh @@ -1,19 +1,10 @@ #pragma once -#include -#include -#include #include -#include #include #include -#include - -#include - #include "dict/dictionary.hh" #include "ui_fulltextsearch.h" - #include "config.hh" #include "instances.hh" #include "delegate.hh"