diff --git a/src/qtgui/restable.cpp b/src/qtgui/restable.cpp index 21be72e2..52a128a0 100644 --- a/src/qtgui/restable.cpp +++ b/src/qtgui/restable.cpp @@ -194,7 +194,7 @@ RecollModel::RecollModel(const QStringList fields, QObject *parent) for (QStringList::const_iterator it = fields.begin(); it != fields.end(); it++) { m_fields.push_back((const char *)(it->toUtf8())); - m_getters.push_back(chooseGetter(m_fields[m_fields.size()-1])); + m_getters.push_back(chooseGetter(m_fields.back())); } g_hiliter.set_inputhtml(false); @@ -397,7 +397,7 @@ void ResTable::init() header->setSortIndicator(-1, Qt::AscendingOrder); header->setContextMenuPolicy(Qt::CustomContextMenu); connect(header, SIGNAL(sectionResized(int,int,int)), - this, SLOT(saveColWidths())); + this, SLOT(saveColState())); connect(header, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(createHeaderPopupMenu(const QPoint&))); } @@ -443,38 +443,27 @@ void ResTable::saveColState() settings.setValue("resTableSplitterSizes", splitter->saveState()); QHeaderView *header = tableView->horizontalHeader(); - if (header && header->sectionsMoved()) { - // Remember the current column order. Walk in visual order and - // create new list - QStringList newfields; - vector newwidths; - for (int vi = 0; vi < header->count(); vi++) { - int li = header->logicalIndex(vi); - newfields.push_back(prefs.restableFields.at(li)); - newwidths.push_back(header->sectionSize(li)); - } - prefs.restableFields = newfields; - prefs.restableColWidths = newwidths; - } else { - const vector& vf = m_model->getFields(); - prefs.restableFields.clear(); - for (int i = 0; i < int(vf.size()); i++) { - prefs.restableFields.push_back(QString::fromUtf8(vf[i].c_str())); - } - saveColWidths(); - } -} - -void ResTable::saveColWidths() -{ - LOGDEB(("ResTable::saveColWidths()\n")); - QHeaderView *header = tableView->horizontalHeader(); - if (!header) + const vector& vf = m_model->getFields(); + if (!header) { + LOGERR(("ResTable::saveColState: no table header ??\n")); return; - prefs.restableColWidths.clear(); - for (int i = 0; i < header->count(); i++) { - prefs.restableColWidths.push_back(header->sectionSize(i)); } + + // Remember the current column order. Walk in visual order and + // create new list + QStringList newfields; + vector newwidths; + for (int vi = 0; vi < header->count(); vi++) { + int li = header->logicalIndex(vi); + if (li < 0 || li >= int(vf.size())) { + LOGERR(("saveColState: logical index beyond list size!\n")); + continue; + } + newfields.push_back(QString::fromUtf8(vf[li].c_str())); + newwidths.push_back(header->sectionSize(li)); + } + prefs.restableFields = newfields; + prefs.restableColWidths = newwidths; } void ResTable::onTableView_currentChanged(const QModelIndex& index) diff --git a/src/qtgui/restable.h b/src/qtgui/restable.h index 47d4cab4..fdf4ec49 100644 --- a/src/qtgui/restable.h +++ b/src/qtgui/restable.h @@ -96,13 +96,12 @@ public: virtual ~ResTable() {} virtual RecollModel *getModel() {return m_model;} - virtual void saveColState(); public slots: virtual void onTableView_currentChanged(const QModelIndex&); virtual void on_tableView_entered(const QModelIndex& index); - virtual void saveColWidths(); virtual void setDocSource(RefCntr nsource); + virtual void saveColState(); virtual void resetSource(); virtual void readDocSource(bool resetPos = true); virtual void onSortDataChanged(DocSeqSortSpec); diff --git a/website/BUGS.html b/website/BUGS.html index 02c6cb0c..1bd8c0d2 100644 --- a/website/BUGS.html +++ b/website/BUGS.html @@ -81,11 +81,17 @@

recoll 1.15.2

    -
  • Clicking one of the category filter checkboxes (one of the - media/message/text/... things) with an empty result list crashes - the GUI (just like this, yeah, I know, quality insurance - etc.). Workaround: don't click these before running the first - query.
  • +
  • If a result table column is both added and moved in the same + GUI instance, the list becomes garbled (or/and the GUI + crashes). Workaround: remove the Qt GUI config + (.config/Recoll.org/recoll.conf), and perform the operation in 2 GUI + sessions: add column, exit recoll, restart, move column.
  • + +
  • Clicking one of the category filter checkboxes + (one of the media/message/text/... things) with an empty result + list crashes the GUI (just like this, yeah, I know, quality + insurance etc.). Workaround: don't click these before running the + first query.
  • Changing the indexing configuration parameters from the GUI while the indexing thread (not an external recollindex command) is