mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-19 10:20:17 -06:00
Rectify the sort indicator after multiple column selection
When more than one column is selected we abort the sorting, but Qt has already assigned the sort indicator to the last selected column, so we have to restore the saved settings to fix the sort indicator column. See issue #1717
This commit is contained in:
@@ -2009,12 +2009,15 @@ void MainWindow::enableEditing(bool enable_edit)
|
||||
|
||||
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
|
||||
BrowseDataTableSettings& settings = browseTableSettings[currentlyBrowsedTableName()];
|
||||
|
||||
// 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. But restore before the sort indicator automatically changed by Qt so it still indicates the last
|
||||
// use sort action.
|
||||
if(ui->dataTable->selectionModel()->selectedColumns().count() > 1) {
|
||||
applyBrowseTableSettings(settings);
|
||||
return;
|
||||
}
|
||||
int dummy;
|
||||
Qt::SortOrder order;
|
||||
fromSortOrderVector(settings.query.orderBy(), dummy, order);
|
||||
|
||||
Reference in New Issue
Block a user