kio code adjustment related to previous GUI crash fix
This commit is contained in:
parent
17f103daa9
commit
9a3effae28
@ -48,8 +48,7 @@ using namespace std;
|
|||||||
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)
|
|
||||||
{
|
{
|
||||||
qDebug() << "RecollProtocol::RecollProtocol()";
|
qDebug() << "RecollProtocol::RecollProtocol()";
|
||||||
if (o_rclconfig == 0) {
|
if (o_rclconfig == 0) {
|
||||||
@ -68,7 +67,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;
|
||||||
@ -100,7 +99,6 @@ RecollProtocol::RecollProtocol(const QByteArray& pool, const QByteArray& app)
|
|||||||
RecollProtocol::~RecollProtocol()
|
RecollProtocol::~RecollProtocol()
|
||||||
{
|
{
|
||||||
qDebug() << "RecollProtocol::~RecollProtocol()";
|
qDebug() << "RecollProtocol::~RecollProtocol()";
|
||||||
delete m_rcldb;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RecollProtocol::maybeOpenDb(string& reason)
|
bool RecollProtocol::maybeOpenDb(string& reason)
|
||||||
@ -337,7 +335,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?";
|
||||||
@ -346,7 +344,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, u8s2qs("Can't build result sequence"));
|
error(KIO::ERR_SLAVE_DEFINED, u8s2qs("Can't build result sequence"));
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@ -177,7 +177,7 @@ private:
|
|||||||
bool isRecollResult(const QUrl& url, int *num, QString* q);
|
bool isRecollResult(const QUrl& url, int *num, QString* q);
|
||||||
|
|
||||||
bool m_initok;
|
bool m_initok;
|
||||||
Rcl::Db *m_rcldb;
|
std::shared_ptr<Rcl::Db> m_rcldb;
|
||||||
std::string m_reason;
|
std::string m_reason;
|
||||||
bool m_alwaysdir;
|
bool m_alwaysdir;
|
||||||
// english by default else env[RECOLL_KIO_STEMLANG]
|
// english by default else env[RECOLL_KIO_STEMLANG]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user