log statement cleanup while looking for sthing else...

This commit is contained in:
Jean-Francois Dockes 2017-01-16 13:40:44 +01:00
parent 2594b71ae8
commit 139e1c567c
3 changed files with 72 additions and 56 deletions

View File

@ -554,7 +554,7 @@ void RclMain::initDbOpen()
void RclMain::setStemLang(QAction *id) void RclMain::setStemLang(QAction *id)
{ {
LOGDEB("RclMain::setStemLang(" << (id) << ")\n" ); LOGDEB("RclMain::setStemLang(" << id << ")\n");
// Check that the menu entry is for a stemming language change // Check that the menu entry is for a stemming language change
// (might also be "show prefs" etc. // (might also be "show prefs" etc.
bool isLangId = false; bool isLangId = false;
@ -584,7 +584,8 @@ void RclMain::setStemLang(QAction *id)
lang = id->text(); lang = id->text();
} }
prefs.queryStemLang = lang; prefs.queryStemLang = lang;
LOGDEB("RclMain::setStemLang(" << (id) << "): lang [" << ((const char *)prefs.queryStemLang.toUtf8()) << "]\n" ); LOGDEB("RclMain::setStemLang(" << id << "): lang [" <<
qs2utf8s(prefs.queryStemLang) << "]\n");
rwSettings(true); rwSettings(true);
emit stemLangChanged(lang); emit stemLangChanged(lang);
} }
@ -592,7 +593,7 @@ void RclMain::setStemLang(QAction *id)
// Set the checked stemming language item before showing the prefs menu // Set the checked stemming language item before showing the prefs menu
void RclMain::setStemLang(const QString& lang) void RclMain::setStemLang(const QString& lang)
{ {
LOGDEB("RclMain::setStemLang(" << ((const char *)lang.toUtf8()) << ")\n" ); LOGDEB("RclMain::setStemLang(" << qs2utf8s(lang) << ")\n");
QAction *id; QAction *id;
if (lang == "") { if (lang == "") {
id = m_idNoStem; id = m_idNoStem;
@ -665,7 +666,8 @@ void RclMain::fileExit()
// Start a db query and set the reslist docsource // Start a db query and set the reslist docsource
void RclMain::startSearch(std::shared_ptr<Rcl::SearchData> sdata, bool issimple) void RclMain::startSearch(std::shared_ptr<Rcl::SearchData> sdata, bool issimple)
{ {
LOGDEB("RclMain::startSearch. Indexing " << (m_idxproc?"on":"off") << " Active " << (m_queryActive) << "\n" ); LOGDEB("RclMain::startSearch. Indexing " << (m_idxproc?"on":"off") <<
" Active " << m_queryActive << "\n");
if (m_queryActive) { if (m_queryActive) {
LOGDEB("startSearch: already active\n"); LOGDEB("startSearch: already active\n");
return; return;
@ -843,7 +845,7 @@ void RclMain::onSortDataChanged(DocSeqSortSpec spec)
void RclMain::on_actionShowResultsAsTable_toggled(bool on) void RclMain::on_actionShowResultsAsTable_toggled(bool on)
{ {
LOGDEB("RclMain::on_actionShowResultsAsTable_toggled(" << (int(on)) << ")\n" ); LOGDEB("RclMain::on_actionShowResultsAsTable_toggled(" << on << ")\n");
prefs.showResultsAsTable = on; prefs.showResultsAsTable = on;
displayingTable = on; displayingTable = on;
restable->setVisible(on); restable->setVisible(on);
@ -852,8 +854,9 @@ void RclMain::on_actionShowResultsAsTable_toggled(bool on)
static QShortcut tablefocseq(QKeySequence("Ctrl+r"), this); static QShortcut tablefocseq(QKeySequence("Ctrl+r"), this);
if (!on) { if (!on) {
int docnum = restable->getDetailDocNumOrTopRow(); int docnum = restable->getDetailDocNumOrTopRow();
if (docnum >= 0) if (docnum >= 0) {
reslist->resultPageFor(docnum); reslist->resultPageFor(docnum);
}
disconnect(&tablefocseq, SIGNAL(activated()), disconnect(&tablefocseq, SIGNAL(activated()),
restable, SLOT(takeFocus())); restable, SLOT(takeFocus()));
sSearch->takeFocus(); sSearch->takeFocus();
@ -872,7 +875,7 @@ void RclMain::on_actionShowResultsAsTable_toggled(bool on)
void RclMain::on_actionSortByDateAsc_toggled(bool on) void RclMain::on_actionSortByDateAsc_toggled(bool on)
{ {
LOGDEB("RclMain::on_actionSortByDateAsc_toggled(" << (int(on)) << ")\n" ); LOGDEB("RclMain::on_actionSortByDateAsc_toggled(" << on << ")\n");
if (on) { if (on) {
if (actionSortByDateDesc->isChecked()) { if (actionSortByDateDesc->isChecked()) {
actionSortByDateDesc->setChecked(false); actionSortByDateDesc->setChecked(false);
@ -885,7 +888,7 @@ void RclMain::on_actionSortByDateAsc_toggled(bool on)
void RclMain::on_actionSortByDateDesc_toggled(bool on) void RclMain::on_actionSortByDateDesc_toggled(bool on)
{ {
LOGDEB("RclMain::on_actionSortByDateDesc_toggled(" << (int(on)) << ")\n" ); LOGDEB("RclMain::on_actionSortByDateDesc_toggled(" << on << ")\n");
if (on) { if (on) {
if (actionSortByDateAsc->isChecked()) { if (actionSortByDateAsc->isChecked()) {
actionSortByDateAsc->setChecked(false); actionSortByDateAsc->setChecked(false);
@ -1064,7 +1067,7 @@ void RclMain::catgFilter(QAction *act)
// User pressed a filter button: set filter params in reslist // User pressed a filter button: set filter params in reslist
void RclMain::catgFilter(int id) void RclMain::catgFilter(int id)
{ {
LOGDEB("RclMain::catgFilter: id " << (id) << "\n" ); LOGDEB("RclMain::catgFilter: id " << id << "\n");
if (id < 0 || id >= int(m_catgbutvec.size())) if (id < 0 || id >= int(m_catgbutvec.size()))
return; return;

View File

@ -259,12 +259,12 @@ string QtGuiResListPager::iconUrl(RclConfig *config, Rcl::Doc& doc)
ConfIndexer::docsToPaths(docs, paths); ConfIndexer::docsToPaths(docs, paths);
if (!paths.empty()) { if (!paths.empty()) {
string path; string path;
LOGDEB0("ResList::iconUrl: source path [" << (paths[0]) << "]\n" ); LOGDEB2("ResList::iconUrl: source path [" << paths[0] << "]\n");
if (thumbPathForUrl(cstr_fileu + paths[0], 128, path)) { if (thumbPathForUrl(cstr_fileu + paths[0], 128, path)) {
LOGDEB0("ResList::iconUrl: icon path [" << (path) << "]\n" ); LOGDEB2("ResList::iconUrl: icon path [" << path << "]\n");
return cstr_fileu + path; return cstr_fileu + path;
} else { } else {
LOGDEB0("ResList::iconUrl: no icon: path [" << (path) << "]\n" ); LOGDEB2("ResList::iconUrl: no icon: path [" << path << "]\n");
} }
} else { } else {
LOGDEB("ResList::iconUrl: docsToPaths failed\n"); LOGDEB("ResList::iconUrl: docsToPaths failed\n");
@ -283,7 +283,8 @@ public:
string s1, s2; string s1, s2;
stringsToString<vector<string> >(m_hdata->groups[idx], s1); stringsToString<vector<string> >(m_hdata->groups[idx], s1);
stringsToString<vector<string> >(m_hdata->ugroups[m_hdata->grpsugidx[idx]], s2); stringsToString<vector<string> >(m_hdata->ugroups[m_hdata->grpsugidx[idx]], s2);
LOGDEB("Reslist startmatch: group " << (s1) << " user group " << (s2) << "\n" ); LOGDEB2("Reslist startmatch: group " << s1 << " user group " <<
s2 << "\n");
} }
return string("<span class='rclmatch' style='") return string("<span class='rclmatch' style='")
@ -732,7 +733,7 @@ void ResList::resultPageFor(int docnum)
void ResList::append(const QString &text) void ResList::append(const QString &text)
{ {
LOGDEB2("QtGuiReslistPager::appendQString : " << ((const char*)text.toUtf8()) << "\n" ); LOGDEB2("QtGuiReslistPager::appendQString : " << qs2utf8s(text) << "\n");
#ifdef RESLIST_TEXTBROWSER #ifdef RESLIST_TEXTBROWSER
QTextBrowser::append(text); QTextBrowser::append(text);
#else #else
@ -750,7 +751,9 @@ void ResList::displayPage()
setHtml(m_text); setHtml(m_text);
#endif #endif
LOGDEB0("ResList::displayPg: hasNext " << (m_pager->hasPrev()) << " atBot " << (scrollIsAtBottom()) << " hasPrev " << (m_pager->hasNext()) << " at Top " << (scrollIsAtTop()) << " \n" ); LOGDEB0("ResList::displayPg: hasNext " << m_pager->hasNext() <<
" atBot " << scrollIsAtBottom() << " hasPrev " <<
m_pager->hasPrev() << " at Top " << scrollIsAtTop() << " \n");
setupArrows(); setupArrows();
// Possibly color paragraph of current preview if any // Possibly color paragraph of current preview if any

View File

@ -320,7 +320,7 @@ void RecollModel::deleteColumn(int col)
void RecollModel::addColumn(int col, const string& field) void RecollModel::addColumn(int col, const string& field)
{ {
LOGDEB("AddColumn: col " << (col) << " fld [" << (field) << "]\n" ); LOGDEB("AddColumn: col " << col << " fld [" << field << "]\n");
if (col >= 0 && col < int(m_fields.size())) { if (col >= 0 && col < int(m_fields.size())) {
col++; col++;
vector<string>::iterator it = m_fields.begin(); vector<string>::iterator it = m_fields.begin();
@ -338,7 +338,9 @@ void RecollModel::addColumn(int col, const string& field)
QVariant RecollModel::headerData(int idx, Qt::Orientation orientation, QVariant RecollModel::headerData(int idx, Qt::Orientation orientation,
int role) const int role) const
{ {
LOGDEB2("RecollModel::headerData: idx " << (idx) << " orientation " << (orientation == Qt::Vertical ? "vertical":"horizontal") << " role " << (role) << "\n" ); LOGDEB2("RecollModel::headerData: idx " << idx << " orientation " <<
(orientation == Qt::Vertical ? "vertical":"horizontal") <<
" role " << role << "\n");
if (orientation == Qt::Vertical && role == Qt::DisplayRole) { if (orientation == Qt::Vertical && role == Qt::DisplayRole) {
return idx; return idx;
} }
@ -356,7 +358,8 @@ QVariant RecollModel::headerData(int idx, Qt::Orientation orientation,
QVariant RecollModel::data(const QModelIndex& index, int role) const QVariant RecollModel::data(const QModelIndex& index, int role) const
{ {
LOGDEB2("RecollModel::data: row " << (index.row()) << " col " << (index.column()) << " role " << (role) << "\n" ); LOGDEB2("RecollModel::data: row " << index.row() << " col " <<
index.column() << " role " << role << "\n");
if (!m_source || role != Qt::DisplayRole || !index.isValid() || if (!m_source || role != Qt::DisplayRole || !index.isValid() ||
index.column() >= int(m_fields.size())) { index.column() >= int(m_fields.size())) {
return QVariant(); return QVariant();
@ -409,9 +412,10 @@ void RecollModel::saveAsCSV(FILE *fp)
// This gets called when the column headers are clicked // This gets called when the column headers are clicked
void RecollModel::sort(int column, Qt::SortOrder order) void RecollModel::sort(int column, Qt::SortOrder order)
{ {
if (m_ignoreSort) if (m_ignoreSort) {
return; return;
LOGDEB("RecollModel::sort(" << (column) << ", " << (int(order)) << ")\n" ); }
LOGDEB("RecollModel::sort(" << column << ", " << order << ")\n");
DocSeqSortSpec spec; DocSeqSortSpec spec;
if (column >= 0 && column < int(m_fields.size())) { if (column >= 0 && column < int(m_fields.size())) {
@ -593,7 +597,7 @@ int ResTable::getDetailDocNumOrTopRow()
void ResTable::makeRowVisible(int row) void ResTable::makeRowVisible(int row)
{ {
LOGDEB("ResTable::showRow(" << (row) << ")\n" ); LOGDEB("ResTable::showRow(" << row << ")\n");
QModelIndex modelIndex = m_model->index(row, 0); QModelIndex modelIndex = m_model->index(row, 0);
tableView->scrollTo(modelIndex, QAbstractItemView::PositionAtTop); tableView->scrollTo(modelIndex, QAbstractItemView::PositionAtTop);
tableView->selectionModel()->clear(); tableView->selectionModel()->clear();
@ -635,7 +639,8 @@ void ResTable::saveColState()
void ResTable::onTableView_currentChanged(const QModelIndex& index) void ResTable::onTableView_currentChanged(const QModelIndex& index)
{ {
LOGDEB2("ResTable::onTableView_currentChanged(" << (index.row()) << ", " << (index.column()) << ")\n" ); LOGDEB2("ResTable::onTableView_currentChanged(" << index.row() << ", " <<
index.column() << ")\n");
if (!m_model || !m_model->getDocSource()) if (!m_model || !m_model->getDocSource())
return; return;
@ -653,7 +658,8 @@ void ResTable::onTableView_currentChanged(const QModelIndex& index)
void ResTable::on_tableView_entered(const QModelIndex& index) void ResTable::on_tableView_entered(const QModelIndex& index)
{ {
LOGDEB2("ResTable::on_tableView_entered(" << (index.row()) << ", " << (index.column()) << ")\n" ); LOGDEB2("ResTable::on_tableView_entered(" << index.row() << ", " <<
index.column() << ")\n");
if (!tableView->selectionModel()->hasSelection()) if (!tableView->selectionModel()->hasSelection())
onTableView_currentChanged(index); onTableView_currentChanged(index);
} }
@ -708,7 +714,8 @@ void ResTable::saveAsCSV()
// This is called when the sort order is changed from another widget // This is called when the sort order is changed from another widget
void ResTable::onSortDataChanged(DocSeqSortSpec spec) void ResTable::onSortDataChanged(DocSeqSortSpec spec)
{ {
LOGDEB("ResTable::onSortDataChanged: [" << (spec.field) << "] desc " << (int(spec.desc)) << "\n" ); LOGDEB("ResTable::onSortDataChanged: [" << spec.field << "] desc " <<
spec.desc << "\n");
QHeaderView *header = tableView->horizontalHeader(); QHeaderView *header = tableView->horizontalHeader();
if (!header || !m_model) if (!header || !m_model)
return; return;
@ -743,7 +750,7 @@ void ResTable::resetSort()
void ResTable::readDocSource(bool resetPos) void ResTable::readDocSource(bool resetPos)
{ {
LOGDEB("ResTable::readDocSource(" << (int(resetPos)) << ")\n" ); LOGDEB("ResTable::readDocSource(" << resetPos << ")\n");
if (resetPos) if (resetPos)
tableView->verticalScrollBar()->setSliderPosition(0); tableView->verticalScrollBar()->setSliderPosition(0);
@ -759,7 +766,7 @@ void ResTable::linkWasClicked(const QUrl &url)
} }
QString s = url.toString(); QString s = url.toString();
const char *ascurl = s.toUtf8(); const char *ascurl = s.toUtf8();
LOGDEB("ResTable::linkWasClicked: [" << (ascurl) << "]\n" ); LOGDEB("ResTable::linkWasClicked: [" << ascurl << "]\n");
int i = atoi(ascurl+1) -1; int i = atoi(ascurl+1) -1;
int what = ascurl[0]; int what = ascurl[0];
@ -819,7 +826,7 @@ void ResTable::linkWasClicked(const QUrl &url)
break; break;
default: default:
LOGERR("ResTable::linkWasClicked: bad link [" << (ascurl) << "]\n" ); LOGERR("ResTable::linkWasClicked: bad link [" << ascurl << "]\n");
break;// ?? break;// ??
} }
} }
@ -842,7 +849,8 @@ void ResTable::onDoubleClick(const QModelIndex& index)
void ResTable::createPopupMenu(const QPoint& pos) void ResTable::createPopupMenu(const QPoint& pos)
{ {
LOGDEB("ResTable::createPopupMenu: m_detaildocnum " << (m_detaildocnum) << "\n" ); LOGDEB("ResTable::createPopupMenu: m_detaildocnum " << m_detaildocnum <<
"\n");
if (m_detaildocnum >= 0 && m_model) { if (m_detaildocnum >= 0 && m_model) {
int opts = m_ismainres? ResultPopup::isMain : 0; int opts = m_ismainres? ResultPopup::isMain : 0;
@ -973,7 +981,8 @@ void ResTable::menuShowSubDocs()
void ResTable::createHeaderPopupMenu(const QPoint& pos) void ResTable::createHeaderPopupMenu(const QPoint& pos)
{ {
LOGDEB("ResTable::createHeaderPopupMenu(" << (pos.x()) << ", " << (pos.y()) << ")\n" ); LOGDEB("ResTable::createHeaderPopupMenu(" << pos.x() << ", " <<
pos.y() << ")\n");
QHeaderView *header = tableView->horizontalHeader(); QHeaderView *header = tableView->horizontalHeader();
if (!header || !m_model) if (!header || !m_model)
return; return;
@ -1019,7 +1028,8 @@ void ResTable::addColumn()
if (!m_model) if (!m_model)
return; return;
QAction *action = (QAction *)sender(); QAction *action = (QAction *)sender();
LOGDEB("addColumn: text " << (qs2utf8s(action->text())) << ", data " << (qs2utf8s(action->data().toString())) << "\n" ); LOGDEB("addColumn: text " << qs2utf8s(action->text()) << ", data " <<
qs2utf8s(action->data().toString()) << "\n");
m_model->addColumn(m_popcolumn, qs2utf8s(action->data().toString())); m_model->addColumn(m_popcolumn, qs2utf8s(action->data().toString()));
} }