Fix selection of entire columns in browse tab

Fix the selection of entire columns in the browse tab table view. Even
when selecting multiple columns the data would be re-sorted instead of
selected; this is changed now.
This commit is contained in:
Martin Kleusberg
2013-03-16 19:35:27 +01:00
parent e548224bd9
commit 80e4708fc2

View File

@@ -1129,6 +1129,10 @@ void MainWindow::activateFields(bool enable)
void MainWindow::browseTableHeaderClicked(int logicalindex)
{
// Abort if there is more than one column selected because this tells us that the user pretty sure wants to do a range selection instead of sorting data
if(ui->dataTable->selectionModel()->selectedColumns().count() > 1)
return;
// instead of the column name we just use the column index, +2 because 'rowid, *' is the projection
curBrowseOrderByIndex = logicalindex + 2;
curBrowseOrderByMode = curBrowseOrderByMode == ORDERMODE_ASC ? ORDERMODE_DESC : ORDERMODE_ASC;