mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 02:50:46 -06:00
Reset sorting when changing the current table
Reset the sorting of the table view in the browse tab when changing the current table. This offers not just only a more plausible behaviour to the user but also fixes a bug that would cause an empty table to be shown when sorting e.g. column number 5 and then changing to a table with just 2 columns.
This commit is contained in:
@@ -208,7 +208,11 @@ void MainWindow::populateTable( const QString & tablename, bool keepColumnWidths
|
||||
bool mustreset = false;
|
||||
QApplication::setOverrideCursor( Qt::WaitCursor );
|
||||
if (tablename.compare(db.curBrowseTableName)!=0)
|
||||
{
|
||||
mustreset = true;
|
||||
curBrowseOrderByIndex = 1;
|
||||
curBrowseOrderByMode = ORDERMODE_ASC;
|
||||
}
|
||||
|
||||
QString orderby = QString::number(curBrowseOrderByIndex) + " " + (curBrowseOrderByMode == ORDERMODE_ASC ? "ASC" : "DESC");
|
||||
if (!db.browseTable(tablename, orderby)){
|
||||
|
||||
Reference in New Issue
Block a user