kio code adjustment related to previous GUI crash fix: forgot kde4
This commit is contained in:
parent
5d22ad3bcb
commit
3163f18fdd
@ -51,8 +51,7 @@ using namespace KIO;
|
|||||||
RclConfig *RecollProtocol::o_rclconfig;
|
RclConfig *RecollProtocol::o_rclconfig;
|
||||||
|
|
||||||
RecollProtocol::RecollProtocol(const QByteArray &pool, const QByteArray &app)
|
RecollProtocol::RecollProtocol(const QByteArray &pool, const QByteArray &app)
|
||||||
: SlaveBase("recoll", pool, app), m_initok(false), m_rcldb(0),
|
: SlaveBase("recoll", pool, app), m_initok(false), m_alwaysdir(false)
|
||||||
m_alwaysdir(false)
|
|
||||||
{
|
{
|
||||||
kDebug() << endl;
|
kDebug() << endl;
|
||||||
if (o_rclconfig == 0) {
|
if (o_rclconfig == 0) {
|
||||||
@ -71,7 +70,7 @@ RecollProtocol::RecollProtocol(const QByteArray &pool, const QByteArray &app)
|
|||||||
}
|
}
|
||||||
rwSettings(false);
|
rwSettings(false);
|
||||||
|
|
||||||
m_rcldb = new Rcl::Db(o_rclconfig);
|
m_rcldb = std::shared_ptr<Rcl::Db>(new Rcl::Db(o_rclconfig));
|
||||||
if (!m_rcldb) {
|
if (!m_rcldb) {
|
||||||
m_reason = "Could not build database object. (out of memory ?)";
|
m_reason = "Could not build database object. (out of memory ?)";
|
||||||
return;
|
return;
|
||||||
@ -103,7 +102,6 @@ RecollProtocol::RecollProtocol(const QByteArray &pool, const QByteArray &app)
|
|||||||
RecollProtocol::~RecollProtocol()
|
RecollProtocol::~RecollProtocol()
|
||||||
{
|
{
|
||||||
kDebug();
|
kDebug();
|
||||||
delete m_rcldb;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RecollProtocol::maybeOpenDb(string &reason)
|
bool RecollProtocol::maybeOpenDb(string &reason)
|
||||||
@ -333,7 +331,7 @@ bool RecollProtocol::doSearch(const QueryDesc& qd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<Rcl::SearchData> sdata(sd);
|
std::shared_ptr<Rcl::SearchData> sdata(sd);
|
||||||
std::shared_ptr<Rcl::Query>query(new Rcl::Query(m_rcldb));
|
std::shared_ptr<Rcl::Query>query(new Rcl::Query(m_rcldb.get()));
|
||||||
query->setCollapseDuplicates(prefs.collapseDuplicates);
|
query->setCollapseDuplicates(prefs.collapseDuplicates);
|
||||||
if (!query->setQuery(sdata)) {
|
if (!query->setQuery(sdata)) {
|
||||||
m_reason = "Query execute failed. Invalid query or syntax error?";
|
m_reason = "Query execute failed. Invalid query or syntax error?";
|
||||||
@ -342,7 +340,8 @@ bool RecollProtocol::doSearch(const QueryDesc& qd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
DocSequenceDb *src =
|
DocSequenceDb *src =
|
||||||
new DocSequenceDb(std::shared_ptr<Rcl::Query>(query), "Query results", sdata);
|
new DocSequenceDb(m_rcldb, std::shared_ptr<Rcl::Query>(query),
|
||||||
|
"Query results", sdata);
|
||||||
if (src == 0) {
|
if (src == 0) {
|
||||||
error(KIO::ERR_SLAVE_DEFINED, "Can't build result sequence");
|
error(KIO::ERR_SLAVE_DEFINED, "Can't build result sequence");
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@ -168,7 +168,7 @@ class RecollProtocol : public KIO::SlaveBase {
|
|||||||
bool isRecollResult(const KUrl &url, int *num, QString* q);
|
bool isRecollResult(const KUrl &url, int *num, QString* q);
|
||||||
|
|
||||||
bool m_initok;
|
bool m_initok;
|
||||||
Rcl::Db *m_rcldb;
|
std::shared_ptr<Rcl::Db> m_rcldb;
|
||||||
string m_reason;
|
string m_reason;
|
||||||
bool m_alwaysdir;
|
bool m_alwaysdir;
|
||||||
string m_stemlang; // english by default else env[RECOLL_KIO_STEMLANG]
|
string m_stemlang; // english by default else env[RECOLL_KIO_STEMLANG]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user