mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 15:24:05 +00:00
Merge branch 'staged' into opt/double-click-in-welcome-page
This commit is contained in:
commit
dd48ba7d60
|
@ -263,8 +263,13 @@ public:
|
|||
|
||||
void setFTSParameters( Config::FullTextSearch const & fts ) override
|
||||
{
|
||||
can_FTS = enable_FTS && fts.enabled && !fts.disabledTypes.contains( "AARD", Qt::CaseInsensitive )
|
||||
&& ( fts.maxDictionarySize == 0 || getArticleCount() <= fts.maxDictionarySize );
|
||||
if ( metadata_enable_fts.has_value() ) {
|
||||
can_FTS = fts.enabled && metadata_enable_fts.value();
|
||||
}
|
||||
else {
|
||||
can_FTS = fts.enabled && !fts.disabledTypes.contains( "AARD", Qt::CaseInsensitive )
|
||||
&& ( fts.maxDictionarySize == 0 || getArticleCount() <= fts.maxDictionarySize );
|
||||
}
|
||||
}
|
||||
|
||||
protected:
|
||||
|
|
|
@ -219,8 +219,12 @@ public:
|
|||
|
||||
void setFTSParameters( Config::FullTextSearch const & fts ) override
|
||||
{
|
||||
can_FTS = enable_FTS && fts.enabled && !fts.disabledTypes.contains( "BGL", Qt::CaseInsensitive )
|
||||
&& ( fts.maxDictionarySize == 0 || getArticleCount() <= fts.maxDictionarySize );
|
||||
if ( metadata_enable_fts.has_value() ) {
|
||||
can_FTS = fts.enabled && metadata_enable_fts.value();
|
||||
}
|
||||
else
|
||||
can_FTS = fts.enabled && !fts.disabledTypes.contains( "BGL", Qt::CaseInsensitive )
|
||||
&& ( fts.maxDictionarySize == 0 || getArticleCount() <= fts.maxDictionarySize );
|
||||
}
|
||||
|
||||
protected:
|
||||
|
|
|
@ -140,8 +140,12 @@ public:
|
|||
|
||||
void setFTSParameters( Config::FullTextSearch const & fts ) override
|
||||
{
|
||||
can_FTS = enable_FTS && fts.enabled && !fts.disabledTypes.contains( "DICTD", Qt::CaseInsensitive )
|
||||
&& ( fts.maxDictionarySize == 0 || getArticleCount() <= fts.maxDictionarySize );
|
||||
if ( metadata_enable_fts.has_value() ) {
|
||||
can_FTS = fts.enabled && metadata_enable_fts.value();
|
||||
}
|
||||
else
|
||||
can_FTS = fts.enabled && !fts.disabledTypes.contains( "DICTD", Qt::CaseInsensitive )
|
||||
&& ( fts.maxDictionarySize == 0 || getArticleCount() <= fts.maxDictionarySize );
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -315,8 +315,7 @@ protected:
|
|||
QAtomicInt FTS_index_completed;
|
||||
bool synonymSearchEnabled;
|
||||
string dictionaryName;
|
||||
//default to true;
|
||||
bool enable_FTS = true;
|
||||
std::optional< bool > metadata_enable_fts = std::nullopt;
|
||||
|
||||
// Load user icon if it exist
|
||||
// By default set icon to empty
|
||||
|
@ -376,7 +375,7 @@ public:
|
|||
|
||||
void setFtsEnable( bool _enable_FTS )
|
||||
{
|
||||
enable_FTS = _enable_FTS;
|
||||
metadata_enable_fts = _enable_FTS;
|
||||
}
|
||||
|
||||
/// Returns all the available properties, like the author's name, copyright,
|
||||
|
|
|
@ -235,9 +235,12 @@ public:
|
|||
{
|
||||
if ( ensureInitDone().size() )
|
||||
return;
|
||||
|
||||
can_FTS = enable_FTS && fts.enabled && !fts.disabledTypes.contains( "DSL", Qt::CaseInsensitive )
|
||||
&& ( fts.maxDictionarySize == 0 || getArticleCount() <= fts.maxDictionarySize );
|
||||
if ( metadata_enable_fts.has_value() ) {
|
||||
can_FTS = fts.enabled && metadata_enable_fts.value();
|
||||
}
|
||||
else
|
||||
can_FTS = fts.enabled && !fts.disabledTypes.contains( "DSL", Qt::CaseInsensitive )
|
||||
&& ( fts.maxDictionarySize == 0 || getArticleCount() <= fts.maxDictionarySize );
|
||||
}
|
||||
|
||||
uint32_t getFtsIndexVersion() override
|
||||
|
|
|
@ -154,9 +154,12 @@ public:
|
|||
{
|
||||
if ( ensureInitDone().size() )
|
||||
return;
|
||||
|
||||
can_FTS = enable_FTS && fts.enabled && !fts.disabledTypes.contains( "EPWING", Qt::CaseInsensitive )
|
||||
&& ( fts.maxDictionarySize == 0 || getArticleCount() <= fts.maxDictionarySize );
|
||||
if ( metadata_enable_fts.has_value() ) {
|
||||
can_FTS = fts.enabled && metadata_enable_fts.value();
|
||||
}
|
||||
else
|
||||
can_FTS = fts.enabled && !fts.disabledTypes.contains( "EPWING", Qt::CaseInsensitive )
|
||||
&& ( fts.maxDictionarySize == 0 || getArticleCount() <= fts.maxDictionarySize );
|
||||
}
|
||||
|
||||
static int japaneseWriting( gd::wchar ch );
|
||||
|
|
|
@ -408,8 +408,12 @@ public:
|
|||
|
||||
void setFTSParameters( Config::FullTextSearch const & fts ) override
|
||||
{
|
||||
can_FTS = enable_FTS && fts.enabled && !fts.disabledTypes.contains( "GLS", Qt::CaseInsensitive )
|
||||
&& ( fts.maxDictionarySize == 0 || getArticleCount() <= fts.maxDictionarySize );
|
||||
if ( metadata_enable_fts.has_value() ) {
|
||||
can_FTS = fts.enabled && metadata_enable_fts.value();
|
||||
}
|
||||
else
|
||||
can_FTS = fts.enabled && !fts.disabledTypes.contains( "GLS", Qt::CaseInsensitive )
|
||||
&& ( fts.maxDictionarySize == 0 || getArticleCount() <= fts.maxDictionarySize );
|
||||
}
|
||||
|
||||
protected:
|
||||
|
|
|
@ -260,9 +260,12 @@ public:
|
|||
{
|
||||
if ( !ensureInitDone().empty() )
|
||||
return;
|
||||
|
||||
can_FTS = enable_FTS && fts.enabled && !fts.disabledTypes.contains( "MDICT", Qt::CaseInsensitive )
|
||||
&& ( fts.maxDictionarySize == 0 || getArticleCount() <= fts.maxDictionarySize );
|
||||
if ( metadata_enable_fts.has_value() ) {
|
||||
can_FTS = fts.enabled && metadata_enable_fts.value();
|
||||
}
|
||||
else
|
||||
can_FTS = fts.enabled && !fts.disabledTypes.contains( "MDICT", Qt::CaseInsensitive )
|
||||
&& ( fts.maxDictionarySize == 0 || getArticleCount() <= fts.maxDictionarySize );
|
||||
}
|
||||
|
||||
QString getCachedFileName( QString name );
|
||||
|
|
|
@ -177,8 +177,12 @@ public:
|
|||
|
||||
void setFTSParameters( Config::FullTextSearch const & fts ) override
|
||||
{
|
||||
can_FTS = enable_FTS && fts.enabled && !fts.disabledTypes.contains( "SDICT", Qt::CaseInsensitive )
|
||||
&& ( fts.maxDictionarySize == 0 || getArticleCount() <= fts.maxDictionarySize );
|
||||
if ( metadata_enable_fts.has_value() ) {
|
||||
can_FTS = fts.enabled && metadata_enable_fts.value();
|
||||
}
|
||||
else
|
||||
can_FTS = fts.enabled && !fts.disabledTypes.contains( "SDICT", Qt::CaseInsensitive )
|
||||
&& ( fts.maxDictionarySize == 0 || getArticleCount() <= fts.maxDictionarySize );
|
||||
}
|
||||
|
||||
protected:
|
||||
|
|
|
@ -640,8 +640,12 @@ public:
|
|||
|
||||
void setFTSParameters( Config::FullTextSearch const & fts ) override
|
||||
{
|
||||
can_FTS = enable_FTS && fts.enabled && !fts.disabledTypes.contains( "SLOB", Qt::CaseInsensitive )
|
||||
&& ( fts.maxDictionarySize == 0 || getArticleCount() <= fts.maxDictionarySize );
|
||||
if ( metadata_enable_fts.has_value() ) {
|
||||
can_FTS = fts.enabled && metadata_enable_fts.value();
|
||||
}
|
||||
else
|
||||
can_FTS = fts.enabled && !fts.disabledTypes.contains( "SLOB", Qt::CaseInsensitive )
|
||||
&& ( fts.maxDictionarySize == 0 || getArticleCount() <= fts.maxDictionarySize );
|
||||
}
|
||||
|
||||
uint32_t getFtsIndexVersion() override
|
||||
|
|
|
@ -200,8 +200,12 @@ public:
|
|||
|
||||
void setFTSParameters( Config::FullTextSearch const & fts ) override
|
||||
{
|
||||
can_FTS = enable_FTS && fts.enabled && !fts.disabledTypes.contains( "STARDICT", Qt::CaseInsensitive )
|
||||
&& ( fts.maxDictionarySize == 0 || getArticleCount() <= fts.maxDictionarySize );
|
||||
if ( metadata_enable_fts.has_value() ) {
|
||||
can_FTS = fts.enabled && metadata_enable_fts.value();
|
||||
}
|
||||
else
|
||||
can_FTS = fts.enabled && !fts.disabledTypes.contains( "STARDICT", Qt::CaseInsensitive )
|
||||
&& ( fts.maxDictionarySize == 0 || getArticleCount() <= fts.maxDictionarySize );
|
||||
}
|
||||
|
||||
protected:
|
||||
|
|
|
@ -200,8 +200,12 @@ public:
|
|||
|
||||
void setFTSParameters( Config::FullTextSearch const & fts ) override
|
||||
{
|
||||
can_FTS = enable_FTS && fts.enabled && !fts.disabledTypes.contains( "XDXF", Qt::CaseInsensitive )
|
||||
&& ( fts.maxDictionarySize == 0 || getArticleCount() <= fts.maxDictionarySize );
|
||||
if ( metadata_enable_fts.has_value() ) {
|
||||
can_FTS = fts.enabled && metadata_enable_fts.value();
|
||||
}
|
||||
else
|
||||
can_FTS = fts.enabled && !fts.disabledTypes.contains( "XDXF", Qt::CaseInsensitive )
|
||||
&& ( fts.maxDictionarySize == 0 || getArticleCount() <= fts.maxDictionarySize );
|
||||
}
|
||||
|
||||
uint32_t getFtsIndexVersion() override
|
||||
|
|
|
@ -221,8 +221,12 @@ public:
|
|||
|
||||
void setFTSParameters( Config::FullTextSearch const & fts ) override
|
||||
{
|
||||
can_FTS = enable_FTS && fts.enabled && !fts.disabledTypes.contains( "ZIM", Qt::CaseInsensitive )
|
||||
&& ( fts.maxDictionarySize == 0 || getArticleCount() <= fts.maxDictionarySize );
|
||||
if ( metadata_enable_fts.has_value() ) {
|
||||
can_FTS = fts.enabled && metadata_enable_fts.value();
|
||||
}
|
||||
else
|
||||
can_FTS = fts.enabled && !fts.disabledTypes.contains( "ZIM", Qt::CaseInsensitive )
|
||||
&& ( fts.maxDictionarySize == 0 || getArticleCount() <= fts.maxDictionarySize );
|
||||
}
|
||||
|
||||
protected:
|
||||
|
|
Loading…
Reference in a new issue