mirror of
https://github.com/djcb/mu.git
synced 2024-06-27 07:35:16 +02:00
mu-query: minor cleanups
This commit is contained in:
parent
c3283dc5ae
commit
ceed832cb9
|
@ -18,27 +18,15 @@
|
||||||
*/
|
*/
|
||||||
#include <mu-query.hh>
|
#include <mu-query.hh>
|
||||||
|
|
||||||
#include <stdexcept>
|
|
||||||
#include <string>
|
|
||||||
#include <cctype>
|
|
||||||
#include <cstring>
|
|
||||||
#include <sstream>
|
|
||||||
#include <cmath>
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <glib/gstdio.h>
|
|
||||||
|
|
||||||
#include "mu-xapian-db.hh"
|
#include "mu-xapian-db.hh"
|
||||||
#include "mu-query-results.hh"
|
|
||||||
#include "mu-query-match-deciders.hh"
|
#include "mu-query-match-deciders.hh"
|
||||||
#include "mu-query-threads.hh"
|
#include "mu-query-threads.hh"
|
||||||
|
|
||||||
#include "mu-query-parser.hh"
|
#include "mu-query-parser.hh"
|
||||||
|
|
||||||
using namespace Mu;
|
using namespace Mu;
|
||||||
|
|
||||||
struct Query::Private {
|
struct Query::Private {
|
||||||
Private(const Store& store) :
|
explicit Private(const Store& store) :
|
||||||
store_{store},
|
store_{store},
|
||||||
parser_flags_{any_of(store_.message_options() & Message::Options::SupportNgrams) ?
|
parser_flags_{any_of(store_.message_options() & Message::Options::SupportNgrams) ?
|
||||||
ParserFlags::SupportNgrams : ParserFlags::None} {}
|
ParserFlags::SupportNgrams : ParserFlags::None} {}
|
||||||
|
@ -125,7 +113,7 @@ Query::Private::make_related_enquire(const StringSet& thread_ids,
|
||||||
}
|
}
|
||||||
|
|
||||||
struct ThreadKeyMaker : public Xapian::KeyMaker {
|
struct ThreadKeyMaker : public Xapian::KeyMaker {
|
||||||
ThreadKeyMaker(const QueryMatches& matches) : match_info_(matches) {}
|
explicit ThreadKeyMaker(const QueryMatches& matches) : match_info_(matches) {}
|
||||||
std::string operator()(const Xapian::Document& doc) const override {
|
std::string operator()(const Xapian::Document& doc) const override {
|
||||||
const auto it{match_info_.find(doc.get_docid())};
|
const auto it{match_info_.find(doc.get_docid())};
|
||||||
return (it == match_info_.end()) ? "" : it->second.thread_path;
|
return (it == match_info_.end()) ? "" : it->second.thread_path;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
** Copyright (C) 2008-2023 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
** Copyright (C) 2008-2024 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
||||||
**
|
**
|
||||||
** This program is free software; you can redistribute it and/or modify
|
** This program is free software; you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
|
@ -20,9 +20,9 @@
|
||||||
#ifndef __MU_QUERY_HH__
|
#ifndef __MU_QUERY_HH__
|
||||||
#define __MU_QUERY_HH__
|
#define __MU_QUERY_HH__
|
||||||
|
|
||||||
|
#include <string>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include <glib.h>
|
|
||||||
#include <mu-store.hh>
|
#include <mu-store.hh>
|
||||||
#include <mu-query-results.hh>
|
#include <mu-query-results.hh>
|
||||||
#include <utils/mu-utils.hh>
|
#include <utils/mu-utils.hh>
|
||||||
|
@ -86,12 +86,6 @@ private:
|
||||||
*/
|
*/
|
||||||
~Query();
|
~Query();
|
||||||
|
|
||||||
/**
|
|
||||||
* Move CTOR
|
|
||||||
*
|
|
||||||
* @param other
|
|
||||||
*/
|
|
||||||
|
|
||||||
struct Private;
|
struct Private;
|
||||||
std::unique_ptr<Private> priv_;
|
std::unique_ptr<Private> priv_;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user