indents etc.

This commit is contained in:
Jean-Francois Dockes 2022-04-07 14:49:21 +02:00
parent ad2db6cd1c
commit 561592b618
2 changed files with 18 additions and 18 deletions

View File

@ -264,8 +264,7 @@ void RclMain::startNativeViewer(Rcl::Doc doc, int pagenum, QString qterm)
// Get rid of the command name. lcmd is now argv[1...n] // Get rid of the command name. lcmd is now argv[1...n]
lcmd.erase(lcmd.begin()); lcmd.erase(lcmd.begin());
// Process the command arguments to determine if we need to create // Process the command arguments to determine if we need to create a temporary file.
// a temporary file.
// If the command has a %i parameter it will manage the // If the command has a %i parameter it will manage the
// un-embedding. Else if ipath is not empty, we need a temp file. // un-embedding. Else if ipath is not empty, we need a temp file.
@ -390,8 +389,8 @@ void RclMain::startNativeViewer(Rcl::Doc doc, int pagenum, QString qterm)
settings.value("/Recoll/prefs/showTempFileWarning").toInt(); settings.value("/Recoll/prefs/showTempFileWarning").toInt();
} }
// If we are not called with a page number (which would happen for a call // If we are not called with a page number (which would happen for a call from the snippets
// from the snippets window), see if we can compute a page number anyway. // window), see if we can compute a page number anyway.
if (m_source && pagenum == -1 && (pagenumNeeded(cmd) || termNeeded(cmd)|| linenumNeeded(cmd))) { if (m_source && pagenum == -1 && (pagenumNeeded(cmd) || termNeeded(cmd)|| linenumNeeded(cmd))) {
pagenum = m_source->getFirstMatchPage(doc, term); pagenum = m_source->getFirstMatchPage(doc, term);
if (pagenum == -1) if (pagenum == -1)
@ -436,23 +435,22 @@ void RclMain::startNativeViewer(Rcl::Doc doc, int pagenum, QString qterm)
execViewer(subs, enterHistory, execpath, lcmd, cmd, doc, execwflags); execViewer(subs, enterHistory, execpath, lcmd, cmd, doc, execwflags);
} }
void RclMain::execViewer(const map<string, string>& subs, bool enterHistory, void RclMain::execViewer(
const string& execpath, const map<string, string>& subs, bool enterHistory, const string& execpath,
const vector<string>& _lcmd, const string& cmd, const vector<string>& _lcmd, const string& cmd, Rcl::Doc doc, int flags)
Rcl::Doc doc, int flags)
{ {
string ncmd;
vector<string> lcmd; vector<string> lcmd;
for (vector<string>::const_iterator it = _lcmd.begin(); for (const auto oparm : _lcmd) {
it != _lcmd.end(); it++) { string nparm;
pcSubst(*it, ncmd, subs); pcSubst(oparm, nparm, subs);
LOGDEB("" << *it << "->" << (ncmd) << "\n" ); LOGDEB0("" << oparm << "->" << nparm << "\n");
lcmd.push_back(ncmd); lcmd.push_back(nparm);
} }
// Also substitute inside the unsplit command line and display // Also substitute inside the unsplit command line for display in status bar
// in status bar string ncmd;
pcSubst(cmd, ncmd, subs); pcSubst(cmd, ncmd, subs);
#ifndef _WIN32 #ifndef _WIN32
ncmd += " &"; ncmd += " &";
#endif #endif
@ -465,8 +463,7 @@ void RclMain::execViewer(const map<string, string>& subs, bool enterHistory,
string fcharset = theconfig->getDefCharset(true); string fcharset = theconfig->getDefCharset(true);
transcode(ncmd, prcmd, fcharset, "UTF-8"); transcode(ncmd, prcmd, fcharset, "UTF-8");
#endif #endif
QString msg = tr("Executing: [") + QString msg = tr("Executing: [") + QString::fromUtf8(prcmd.c_str()) + "]";
QString::fromUtf8(prcmd.c_str()) + "]";
stb->showMessage(msg, 10000); stb->showMessage(msg, 10000);
} }

View File

@ -179,12 +179,15 @@ bool matchGroup(const HighlightData& hldata,
const auto& tg(hldata.index_term_groups[grpidx]); const auto& tg(hldata.index_term_groups[grpidx]);
bool isphrase = tg.kind == HighlightData::TermGroup::TGK_PHRASE; bool isphrase = tg.kind == HighlightData::TermGroup::TGK_PHRASE;
#ifdef DEBUGGROUPS
string allplterms; string allplterms;
for (const auto& entry:inplists) { for (const auto& entry:inplists) {
allplterms += entry.first + " "; allplterms += entry.first + " ";
} }
LOGRP("matchGroup: isphrase " << isphrase << ". Have plists for [" << allplterms << "]\n"); LOGRP("matchGroup: isphrase " << isphrase << ". Have plists for [" << allplterms << "]\n");
//LOGRP("matchGroup: hldata: " << hldata.toString() << std::endl); //LOGRP("matchGroup: hldata: " << hldata.toString() << std::endl);
#endif
int window = int(tg.orgroups.size() + tg.slack); int window = int(tg.orgroups.size() + tg.slack);
// The position lists we are going to work with. We extract them from the // The position lists we are going to work with. We extract them from the