From e1cb0a69854329b67047277ce35d58d82fa78679 Mon Sep 17 00:00:00 2001 From: Jerzy Kozera Date: Sun, 17 Mar 2013 00:34:15 +0000 Subject: [PATCH] Increased type and search result limits from 500 and 40 to 1000 and 100 --- zeal/zealdocsetsregistry.cpp | 10 +++++----- zeal/zeallistmodel.cpp | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/zeal/zealdocsetsregistry.cpp b/zeal/zealdocsetsregistry.cpp index b3768bc..61b2a82 100644 --- a/zeal/zealdocsetsregistry.cpp +++ b/zeal/zealdocsetsregistry.cpp @@ -64,12 +64,12 @@ void ZealDocsetsRegistry::_runQuery(const QString& query_, int queryNum) QSqlQuery q; QList > found; bool withSubStrings = false; - while(found.size() < 40) { + while(found.size() < 100) { auto curQuery = query; QString notQuery; // don't return the same result twice QString parentQuery; if(withSubStrings) { - // if less than 40 found starting with query, search all substrings + // if less than 100 found starting with query, search all substrings curQuery = "%"+query; if(types[name] == ZDASH) { notQuery = QString(" and not (ztokenname like '%1%' escape '\\' or ztokenname like '%.%1%' escape '\\') ").arg(query); @@ -83,11 +83,11 @@ void ZealDocsetsRegistry::_runQuery(const QString& query_, int queryNum) int cols = 3; if(types[name] == ZEAL) { qstr = QString("select t.name, t2.name, t.path from things t left join things t2 on t2.id=t.parent where " - "(t.name like '%1%' escape '\\' %3) %2 order by lower(t.name) asc, t.path asc limit 40").arg(curQuery, notQuery, parentQuery); + "(t.name like '%1%' escape '\\' %3) %2 order by lower(t.name) asc, t.path asc limit 100").arg(curQuery, notQuery, parentQuery); } else if(types[name] == DASH) { qstr = QString("select t.name, null, t.path from searchIndex t where t.name " - "like '%1%' escape '\\' %2 order by lower(t.name) asc, t.path asc limit 40").arg(curQuery, notQuery); + "like '%1%' escape '\\' %2 order by lower(t.name) asc, t.path asc limit 100").arg(curQuery, notQuery); } else if(types[name] == ZDASH) { cols = 4; qstr = QString("select ztokenname, null, zpath, zanchor from ztoken " @@ -96,7 +96,7 @@ void ZealDocsetsRegistry::_runQuery(const QString& query_, int queryNum) // %.%1% for long Django docset values like django.utils.http // (Might be not appropriate for other docsets, but I don't have any on hand to test) "like '%1%' escape '\\' or ztokenname like '%.%1%' escape '\\' ) %2 order by lower(ztokenname) asc, zpath asc, " - "zanchor asc limit 40").arg(curQuery, notQuery); + "zanchor asc limit 100").arg(curQuery, notQuery); } q = db(name).exec(qstr); while(q.next()) { diff --git a/zeal/zeallistmodel.cpp b/zeal/zeallistmodel.cpp index 006ff4f..2f1d692 100644 --- a/zeal/zeallistmodel.cpp +++ b/zeal/zeallistmodel.cpp @@ -39,7 +39,7 @@ const QHash, int> ZealListModel::getModulesCounts() cons q = db.exec("select ztokentype, count(*) from ztoken group by ztokentype"); } while(q.next()) { - if(q.value(1).toInt() < 500) { + if(q.value(1).toInt() < 1500) { QString typeName; if(docsets->type(name) == ZEAL || docsets->type(name) == DASH) { typeName = q.value(0).toString();