getMainConfig not actually needed and possibly harmful
This commit is contained in:
parent
0821f0cc29
commit
d9b9b41a9d
@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef _DB_H_INCLUDED_
|
#ifndef _DB_H_INCLUDED_
|
||||||
#define _DB_H_INCLUDED_
|
#define _DB_H_INCLUDED_
|
||||||
/* @(#$Id: rcldb.h,v 1.64 2008-12-17 08:01:40 dockes Exp $ (C) 2004 J.F.Dockes */
|
/* @(#$Id: rcldb.h,v 1.65 2008-12-19 09:55:36 dockes Exp $ (C) 2004 J.F.Dockes */
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <list>
|
#include <list>
|
||||||
@ -187,7 +187,9 @@ class Db {
|
|||||||
/** Test if terms stem to different roots. */
|
/** Test if terms stem to different roots. */
|
||||||
bool stemDiffers(const string& lang, const string& term,
|
bool stemDiffers(const string& lang, const string& term,
|
||||||
const string& base);
|
const string& base);
|
||||||
|
|
||||||
|
RclConfig *getConf() {return m_config;}
|
||||||
|
|
||||||
/* This has to be public for access by embedded Query::Native */
|
/* This has to be public for access by embedded Query::Native */
|
||||||
Native *m_ndb;
|
Native *m_ndb;
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char rcsid[] = "@(#$Id: rclquery.cpp,v 1.10 2008-10-07 06:44:23 dockes Exp $ (C) 2008 J.F.Dockes";
|
static char rcsid[] = "@(#$Id: rclquery.cpp,v 1.11 2008-12-19 09:55:36 dockes Exp $ (C) 2008 J.F.Dockes";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -113,8 +113,7 @@ Db *Query::whatDb()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Query::setSortBy(const string& fld, bool ascending) {
|
void Query::setSortBy(const string& fld, bool ascending) {
|
||||||
RclConfig *cfg = RclConfig::getMainConfig();
|
m_sortField = m_db->getConf()->fieldCanon(fld);
|
||||||
m_sortField = cfg->fieldCanon(fld);
|
|
||||||
m_sortAscending = ascending;
|
m_sortAscending = ascending;
|
||||||
LOGDEB0(("RclQuery::setSortBy: [%s] %s\n", m_sortField.c_str(),
|
LOGDEB0(("RclQuery::setSortBy: [%s] %s\n", m_sortField.c_str(),
|
||||||
m_sortAscending ? "ascending" : "descending"));
|
m_sortAscending ? "ascending" : "descending"));
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char rcsid[] = "@(#$Id: searchdata.cpp,v 1.31 2008-12-19 09:44:39 dockes Exp $ (C) 2006 J.F.Dockes";
|
static char rcsid[] = "@(#$Id: searchdata.cpp,v 1.32 2008-12-19 09:55:36 dockes Exp $ (C) 2006 J.F.Dockes";
|
||||||
#endif
|
#endif
|
||||||
/*
|
/*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -100,7 +100,7 @@ bool SearchData::toNativeQuery(Rcl::Db &db, void *d)
|
|||||||
vector<string> exptps;
|
vector<string> exptps;
|
||||||
exptps.reserve(m_filetypes.size());
|
exptps.reserve(m_filetypes.size());
|
||||||
// Expand categories
|
// Expand categories
|
||||||
RclConfig *cfg = RclConfig::getMainConfig();
|
RclConfig *cfg = db.getConf();
|
||||||
for (vector<string>::iterator it = m_filetypes.begin();
|
for (vector<string>::iterator it = m_filetypes.begin();
|
||||||
it != m_filetypes.end(); it++) {
|
it != m_filetypes.end(); it++) {
|
||||||
if (cfg && cfg->isMimeCategory(*it)) {
|
if (cfg && cfg->isMimeCategory(*it)) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user