Switch to side-by-side view

--- a/src/qtgui/restable.cpp
+++ b/src/qtgui/restable.cpp
@@ -274,7 +274,7 @@
 
 int RecollModel::rowCount(const QModelIndex&) const
 {
-    LOGDEB2("RecollModel::rowCount\n" );
+    LOGDEB2("RecollModel::rowCount\n");
     if (!m_source)
 	return 0;
     return m_source->getResCnt();
@@ -282,20 +282,20 @@
 
 int RecollModel::columnCount(const QModelIndex&) const
 {
-    LOGDEB2("RecollModel::columnCount\n" );
+    LOGDEB2("RecollModel::columnCount\n");
     return m_fields.size();
 }
 
 void RecollModel::readDocSource()
 {
-    LOGDEB("RecollModel::readDocSource()\n" );
+    LOGDEB("RecollModel::readDocSource()\n");
     beginResetModel();
     endResetModel();
 }
 
 void RecollModel::setDocSource(std::shared_ptr<DocSequence> nsource)
 {
-    LOGDEB("RecollModel::setDocSource\n" );
+    LOGDEB("RecollModel::setDocSource\n");
     if (!nsource) {
 	m_source = std::shared_ptr<DocSequence>();
     } else {
@@ -320,7 +320,7 @@
 
 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())) {
 	col++;
 	vector<string>::iterator it = m_fields.begin();
@@ -338,7 +338,9 @@
 QVariant RecollModel::headerData(int idx, Qt::Orientation orientation, 
 				 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) {
         return idx;
     }
@@ -356,7 +358,8 @@
 
 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() ||
 	index.column() >= int(m_fields.size())) {
 	return QVariant();
@@ -409,9 +412,10 @@
 // This gets called when the column headers are clicked
 void RecollModel::sort(int column, Qt::SortOrder order)
 {
-    if (m_ignoreSort)
-	return;
-    LOGDEB("RecollModel::sort("  << (column) << ", "  << (int(order)) << ")\n" );
+    if (m_ignoreSort) {
+	return;
+    }
+    LOGDEB("RecollModel::sort(" << column << ", " << order << ")\n");
     
     DocSeqSortSpec spec;
     if (column >= 0 && column < int(m_fields.size())) {
@@ -420,7 +424,7 @@
 	    !stringlowercmp("datetime", spec.field))
 	    spec.field = "mtime";
 	spec.desc = order == Qt::AscendingOrder ? false : true;
-    } 
+    }
     emit sortDataChanged(spec);
 }
 
@@ -524,8 +528,8 @@
 
     QKeySequence seq("Esc");
     QShortcut *sc = new QShortcut(seq, this);
-    connect(sc, SIGNAL (activated()), 
-	    tableView->selectionModel(), SLOT (clear()));
+    connect(sc, SIGNAL(activated()), 
+	    tableView->selectionModel(), SLOT(clear()));
     connect(tableView->selectionModel(), 
 	    SIGNAL(currentChanged(const QModelIndex&, const QModelIndex &)),
 	    this, SLOT(onTableView_currentChanged(const QModelIndex&)));
@@ -593,7 +597,7 @@
 
 void ResTable::makeRowVisible(int row)
 {
-    LOGDEB("ResTable::showRow("  << (row) << ")\n" );
+    LOGDEB("ResTable::showRow(" << row << ")\n");
     QModelIndex modelIndex = m_model->index(row, 0);
     tableView->scrollTo(modelIndex, QAbstractItemView::PositionAtTop);
     tableView->selectionModel()->clear();
@@ -612,7 +616,7 @@
     QHeaderView *header = tableView->horizontalHeader();
     const vector<string>& vf = m_model->getFields();
     if (!header) {
-	LOGERR("ResTable::saveColState: no table header ??\n" );
+	LOGERR("ResTable::saveColState: no table header ??\n");
 	return;
     }
 
@@ -623,7 +627,7 @@
     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" );
+	    LOGERR("saveColState: logical index beyond list size!\n");
 	    continue;
 	}
 	newfields.push_back(QString::fromUtf8(vf[li].c_str()));
@@ -635,7 +639,8 @@
 
 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())
 	return;
@@ -653,20 +658,21 @@
 
 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())
 	onTableView_currentChanged(index);
 }
 
 void ResTable::takeFocus()
 {
-//    LOGDEB("resTable: take focus\n" );
+//    LOGDEB("resTable: take focus\n");
     tableView->setFocus(Qt::ShortcutFocusReason);
 }
 
 void ResTable::setDocSource(std::shared_ptr<DocSequence> nsource)
 {
-    LOGDEB("ResTable::setDocSource\n" );
+    LOGDEB("ResTable::setDocSource\n");
     if (m_model)
 	m_model->setDocSource(nsource);
     if (m_pager)
@@ -678,13 +684,13 @@
 
 void ResTable::resetSource()
 {
-    LOGDEB("ResTable::resetSource\n" );
+    LOGDEB("ResTable::resetSource\n");
     setDocSource(std::shared_ptr<DocSequence>());
 }
 
 void ResTable::saveAsCSV()
 {
-    LOGDEB("ResTable::saveAsCSV\n" );
+    LOGDEB("ResTable::saveAsCSV\n");
     if (!m_model)
 	return;
     QString s = 
@@ -708,7 +714,8 @@
 // This is called when the sort order is changed from another widget
 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();
     if (!header || !m_model)
 	return;
@@ -732,7 +739,7 @@
 
 void ResTable::resetSort()
 {
-    LOGDEB("ResTable::resetSort()\n" );
+    LOGDEB("ResTable::resetSort()\n");
     QHeaderView *header = tableView->horizontalHeader();
     if (header)
 	header->setSortIndicator(-1, Qt::AscendingOrder); 
@@ -743,7 +750,7 @@
 
 void ResTable::readDocSource(bool resetPos)
 {
-    LOGDEB("ResTable::readDocSource("  << (int(resetPos)) << ")\n" );
+    LOGDEB("ResTable::readDocSource("  << resetPos << ")\n");
     if (resetPos)
 	tableView->verticalScrollBar()->setSliderPosition(0);
 
@@ -759,7 +766,7 @@
     }
     QString s = url.toString();
     const char *ascurl = s.toUtf8();
-    LOGDEB("ResTable::linkWasClicked: ["  << (ascurl) << "]\n" );
+    LOGDEB("ResTable::linkWasClicked: [" << ascurl << "]\n");
 
     int i = atoi(ascurl+1) -1;
     int what = ascurl[0];
@@ -819,7 +826,7 @@
     break;
 
     default: 
-	LOGERR("ResTable::linkWasClicked: bad link ["  << (ascurl) << "]\n" );
+	LOGERR("ResTable::linkWasClicked: bad link [" << ascurl << "]\n");
 	break;// ?? 
     }
 }
@@ -842,7 +849,8 @@
 
 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) {
 	int opts = m_ismainres? ResultPopup::isMain : 0;
     
@@ -973,7 +981,8 @@
 
 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();
     if (!header || !m_model)
 	return;
@@ -1019,7 +1028,8 @@
     if (!m_model)
 	return;
     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()));
 }