fixed mac os clang warnings
This commit is contained in:
parent
db659c4d81
commit
a3b1b48450
@ -133,18 +133,18 @@ public:
|
|||||||
QtGuiResListPager(ResList *p, int ps, bool alwayssnip)
|
QtGuiResListPager(ResList *p, int ps, bool alwayssnip)
|
||||||
: ResListPager(ps, alwayssnip), m_reslist(p)
|
: ResListPager(ps, alwayssnip), m_reslist(p)
|
||||||
{}
|
{}
|
||||||
virtual bool append(const string& data);
|
virtual bool append(const string& data) override;
|
||||||
virtual bool append(const string& data, int idx, const Rcl::Doc& doc);
|
virtual bool append(const string& data, int idx, const Rcl::Doc& doc) override;
|
||||||
virtual string trans(const string& in);
|
virtual string trans(const string& in) override;
|
||||||
virtual string detailsLink();
|
virtual string detailsLink() override;
|
||||||
virtual const string &parFormat();
|
virtual const string &parFormat() override;
|
||||||
virtual const string &dateFormat();
|
virtual const string &dateFormat() override;
|
||||||
virtual string nextUrl();
|
virtual string nextUrl() override;
|
||||||
virtual string prevUrl();
|
virtual string prevUrl() override;
|
||||||
virtual string headerContent();
|
virtual string headerContent() override;
|
||||||
virtual void suggest(const vector<string>uterms,
|
virtual void suggest(const vector<string>uterms,
|
||||||
map<string, vector<string> >& sugg);
|
map<string, vector<string> >& sugg) override;
|
||||||
virtual string absSep() {return (const char *)(prefs.abssep.toUtf8());}
|
virtual string absSep() override {return (const char *)(prefs.abssep.toUtf8());}
|
||||||
|
|
||||||
#if defined(USING_WEBENGINE) || defined(USING_WEBKIT)
|
#if defined(USING_WEBENGINE) || defined(USING_WEBKIT)
|
||||||
// We used to use http://localhost/. Now use file:/// as this is
|
// We used to use http://localhost/. Now use file:/// as this is
|
||||||
|
|||||||
@ -247,7 +247,7 @@ void SSearch::onCompleterShown()
|
|||||||
}
|
}
|
||||||
// Test if the completer text begins with the current input.
|
// Test if the completer text begins with the current input.
|
||||||
QString text = data.toString();
|
QString text = data.toString();
|
||||||
if (!text.lastIndexOf(queryText->text()) == 0) {
|
if (text.lastIndexOf(queryText->text()) != 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -470,7 +470,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="label">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
|
|||||||
@ -223,7 +223,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void startElement(const std::string &nm,
|
void startElement(const std::string &nm,
|
||||||
const std::map<std::string, std::string>& attrs) {
|
const std::map<std::string, std::string>& attrs) override {
|
||||||
LOGDEB2("SSHXMLHandler::startElement: name [" << nm << "]\n");
|
LOGDEB2("SSHXMLHandler::startElement: name [" << nm << "]\n");
|
||||||
if (nm == "SD") {
|
if (nm == "SD") {
|
||||||
// Simple search saved data has a type='ssearch' attribute.
|
// Simple search saved data has a type='ssearch' attribute.
|
||||||
@ -277,7 +277,7 @@ public:
|
|||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
|
||||||
void characterData(const std::string &str) {
|
void characterData(const std::string &str) override {
|
||||||
currentText += str;
|
currentText += str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -128,7 +128,6 @@ class RclDynConf {
|
|||||||
getStringEntries(const std::string& sk);
|
getStringEntries(const std::string& sk);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
unsigned int m_mlen;
|
|
||||||
ConfSimple m_data;
|
ConfSimple m_data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -169,6 +169,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (m_terms.find(dumb) != m_terms.end()) {
|
if (m_terms.find(dumb) != m_terms.end()) {
|
||||||
|
PRETEND_USE(m_rawtext);
|
||||||
// This word is a search term. Extend or create fragment
|
// This word is a search term. Extend or create fragment
|
||||||
LOGDEB1("match: [" << dumb << "] pos " << pos << " bpos " << bts <<
|
LOGDEB1("match: [" << dumb << "] pos " << pos << " bpos " << bts <<
|
||||||
":" << bte << " remainingWords " << m_remainingWords << endl);
|
":" << bte << " remainingWords " << m_remainingWords << endl);
|
||||||
|
|||||||
@ -1721,7 +1721,7 @@ bool Db::addOrUpdate(const string &udi, const string &parent_udi, Doc &doc)
|
|||||||
// won't work).
|
// won't work).
|
||||||
time_t mtime = atoll(doc.dmtime.empty() ? doc.fmtime.c_str() :
|
time_t mtime = atoll(doc.dmtime.empty() ? doc.fmtime.c_str() :
|
||||||
doc.dmtime.c_str());
|
doc.dmtime.c_str());
|
||||||
struct tm tmb{0,0,0,0,0,0,0,0,0};
|
struct tm tmb;
|
||||||
localtime_r(&mtime, &tmb);
|
localtime_r(&mtime, &tmb);
|
||||||
char buf[50]; // It's actually 9, but use 50 to suppress warnings.
|
char buf[50]; // It's actually 9, but use 50 to suppress warnings.
|
||||||
snprintf(buf, 50, "%04d%02d%02d",
|
snprintf(buf, 50, "%04d%02d%02d",
|
||||||
|
|||||||
@ -49,10 +49,10 @@ public:
|
|||||||
* Construct from readable xapian database and family name (ie: Stm)
|
* Construct from readable xapian database and family name (ie: Stm)
|
||||||
*/
|
*/
|
||||||
XapSynFamily(Xapian::Database xdb, const std::string& familyname)
|
XapSynFamily(Xapian::Database xdb, const std::string& familyname)
|
||||||
: m_rdb(xdb)
|
: m_rdb(xdb) {
|
||||||
{
|
m_prefix1 = std::string(":") + familyname;
|
||||||
m_prefix1 = std::string(":") + familyname;
|
|
||||||
}
|
}
|
||||||
|
virtual ~XapSynFamily() {}
|
||||||
|
|
||||||
/** Retrieve all members of this family (e.g: french english german...) */
|
/** Retrieve all members of this family (e.g: french english german...) */
|
||||||
virtual bool getMembers(std::vector<std::string>&);
|
virtual bool getMembers(std::vector<std::string>&);
|
||||||
@ -62,23 +62,20 @@ public:
|
|||||||
|
|
||||||
/** Expand term to list of synonyms for given member */
|
/** Expand term to list of synonyms for given member */
|
||||||
bool synExpand(const std::string& membername,
|
bool synExpand(const std::string& membername,
|
||||||
const std::string& term, std::vector<std::string>& result);
|
const std::string& term, std::vector<std::string>& result);
|
||||||
|
|
||||||
// The prefix shared by all synonym entries inside a family member
|
// The prefix shared by all synonym entries inside a family member
|
||||||
virtual std::string entryprefix(const std::string& member)
|
virtual std::string entryprefix(const std::string& member) {
|
||||||
{
|
return m_prefix1 + ":" + member + ":";
|
||||||
return m_prefix1 + ":" + member + ":";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// The key for the "list of members" entry
|
// The key for the "list of members" entry
|
||||||
virtual std::string memberskey()
|
virtual std::string memberskey() {
|
||||||
{
|
return m_prefix1 + ";" + "members";
|
||||||
return m_prefix1 + ";" + "members";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Xapian::Database& getdb()
|
Xapian::Database& getdb() {
|
||||||
{
|
return m_rdb;
|
||||||
return m_rdb;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -95,11 +92,10 @@ protected:
|
|||||||
class XapWritableSynFamily : public XapSynFamily {
|
class XapWritableSynFamily : public XapSynFamily {
|
||||||
public:
|
public:
|
||||||
/** Construct with Xapian db open for r/w */
|
/** Construct with Xapian db open for r/w */
|
||||||
XapWritableSynFamily(Xapian::WritableDatabase db,
|
XapWritableSynFamily(Xapian::WritableDatabase db, const std::string& familyname)
|
||||||
const std::string& familyname)
|
: XapSynFamily(db, familyname), m_wdb(db) {}
|
||||||
: XapSynFamily(db, familyname), m_wdb(db)
|
|
||||||
{
|
virtual ~XapWritableSynFamily() {}
|
||||||
}
|
|
||||||
|
|
||||||
/** Delete all entries for one member (e.g. french), and remove from list
|
/** Delete all entries for one member (e.g. french), and remove from list
|
||||||
* of members */
|
* of members */
|
||||||
@ -117,6 +113,7 @@ protected:
|
|||||||
/** A functor which transforms a string */
|
/** A functor which transforms a string */
|
||||||
class SynTermTrans {
|
class SynTermTrans {
|
||||||
public:
|
public:
|
||||||
|
virtual ~SynTermTrans() {}
|
||||||
virtual std::string operator()(const std::string&) = 0;
|
virtual std::string operator()(const std::string&) = 0;
|
||||||
virtual std::string name() { return "SynTermTrans: unknown";}
|
virtual std::string name() { return "SynTermTrans: unknown";}
|
||||||
};
|
};
|
||||||
@ -129,11 +126,11 @@ public:
|
|||||||
class XapComputableSynFamMember {
|
class XapComputableSynFamMember {
|
||||||
public:
|
public:
|
||||||
XapComputableSynFamMember(Xapian::Database xdb, std::string familyname,
|
XapComputableSynFamMember(Xapian::Database xdb, std::string familyname,
|
||||||
std::string membername, SynTermTrans* trans)
|
std::string membername, SynTermTrans* trans)
|
||||||
: m_family(xdb, familyname), m_membername(membername),
|
: m_family(xdb, familyname), m_membername(membername),
|
||||||
m_trans(trans), m_prefix(m_family.entryprefix(m_membername))
|
m_trans(trans), m_prefix(m_family.entryprefix(m_membername)) {}
|
||||||
{
|
|
||||||
}
|
virtual ~XapComputableSynFamMember() {}
|
||||||
|
|
||||||
/** Expand a term to its list of synonyms. If filtertrans is set we
|
/** Expand a term to its list of synonyms. If filtertrans is set we
|
||||||
* keep only the results which transform to the same value as the input
|
* keep only the results which transform to the same value as the input
|
||||||
@ -141,12 +138,12 @@ public:
|
|||||||
* expansion when only either case or diac expansion is desired.
|
* expansion when only either case or diac expansion is desired.
|
||||||
*/
|
*/
|
||||||
bool synExpand(const std::string& term, std::vector<std::string>& result,
|
bool synExpand(const std::string& term, std::vector<std::string>& result,
|
||||||
SynTermTrans *filtertrans = 0);
|
SynTermTrans *filtertrans = 0);
|
||||||
|
|
||||||
/** Same with also wildcard/regexp expansion of entry against the keys.
|
/** Same with also wildcard/regexp expansion of entry against the keys.
|
||||||
* The input matcher will be modified to fit our key format. */
|
* The input matcher will be modified to fit our key format. */
|
||||||
bool synKeyExpand(StrMatcher* in, std::vector<std::string>& result,
|
bool synKeyExpand(StrMatcher* in, std::vector<std::string>& result,
|
||||||
SynTermTrans *filtertrans = 0);
|
SynTermTrans *filtertrans = 0);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
XapSynFamily m_family;
|
XapSynFamily m_family;
|
||||||
@ -159,41 +156,38 @@ private:
|
|||||||
class XapWritableComputableSynFamMember {
|
class XapWritableComputableSynFamMember {
|
||||||
public:
|
public:
|
||||||
XapWritableComputableSynFamMember(
|
XapWritableComputableSynFamMember(
|
||||||
Xapian::WritableDatabase xdb, std::string familyname,
|
Xapian::WritableDatabase xdb, std::string familyname,
|
||||||
std::string membername, SynTermTrans* trans)
|
std::string membername, SynTermTrans* trans)
|
||||||
: m_family(xdb, familyname), m_membername(membername),
|
: m_family(xdb, familyname), m_membername(membername),
|
||||||
m_trans(trans), m_prefix(m_family.entryprefix(m_membername))
|
m_trans(trans), m_prefix(m_family.entryprefix(m_membername)) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual bool addSynonym(const std::string& term)
|
virtual ~XapWritableComputableSynFamMember() {}
|
||||||
{
|
|
||||||
LOGDEB2("addSynonym:me " << (this) << " term [" << (term) << "] m_trans " << (m_trans) << "\n" );
|
virtual bool addSynonym(const std::string& term) {
|
||||||
std::string transformed = (*m_trans)(term);
|
LOGDEB2("addSynonym:me " << this << " term [" << term << "] m_trans " << m_trans << "\n");
|
||||||
LOGDEB2("addSynonym: transformed [" << (transformed) << "]\n" );
|
std::string transformed = (*m_trans)(term);
|
||||||
if (transformed == term)
|
LOGDEB2("addSynonym: transformed [" << transformed << "]\n");
|
||||||
|
if (transformed == term)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
std::string ermsg;
|
||||||
|
try {
|
||||||
|
m_family.getdb().add_synonym(m_prefix + transformed, term);
|
||||||
|
} XCATCHERROR(ermsg);
|
||||||
|
if (!ermsg.empty()) {
|
||||||
|
LOGERR("XapWritableComputableSynFamMember::addSynonym: xapian error " << ermsg << "\n");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
std::string ermsg;
|
|
||||||
try {
|
|
||||||
m_family.getdb().add_synonym(m_prefix + transformed, term);
|
|
||||||
} XCATCHERROR(ermsg);
|
|
||||||
if (!ermsg.empty()) {
|
|
||||||
LOGERR("XapWritableComputableSynFamMember::addSynonym: xapian error " << (ermsg) << "\n" );
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void clear()
|
void clear() {
|
||||||
{
|
m_family.deleteMember(m_membername);
|
||||||
m_family.deleteMember(m_membername);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void recreate()
|
void recreate() {
|
||||||
{
|
clear();
|
||||||
clear();
|
m_family.createMember(m_membername);
|
||||||
m_family.createMember(m_membername);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -222,4 +216,3 @@ static const std::string synFamDiCa("DCa");
|
|||||||
} // end namespace Rcl
|
} // end namespace Rcl
|
||||||
|
|
||||||
#endif /* _SYNFAMILY_H_INCLUDED_ */
|
#endif /* _SYNFAMILY_H_INCLUDED_ */
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user