Diffstat (limited to 'noncore/apps/qashmoney/budgetdisplay.cpp') (more/less context) (show whitespace changes)
-rwxr-xr-x | noncore/apps/qashmoney/budgetdisplay.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/noncore/apps/qashmoney/budgetdisplay.cpp b/noncore/apps/qashmoney/budgetdisplay.cpp index 09f62b2..afc6a2d 100755 --- a/noncore/apps/qashmoney/budgetdisplay.cpp +++ b/noncore/apps/qashmoney/budgetdisplay.cpp @@ -84,2 +84,9 @@ BudgetDisplay::BudgetDisplay ( QWidget *parent ) : QWidget ( parent ) connect ( listview->header(), SIGNAL ( sizeChange ( int, int, int ) ), this, SLOT ( saveColumnSize ( int, int, int ) ) ); + connect ( listview->header(), SIGNAL ( clicked ( int ) ), this, SLOT ( saveSortingPreference ( int ) ) ); + + // pull the column sorting preference from the preferences table, and configure the listview accordingly + int column = 0; + int direction = 0; + preferences->getSortingPreference ( 3, &column, &direction ); + listview->setSorting ( column, direction ); @@ -120,2 +127,7 @@ void BudgetDisplay::saveColumnSize ( int column, int oldsize, int newsize ) +void BudgetDisplay::saveSortingPreference ( int column ) + { + preferences->changeSortingPreference ( 3, column ); + } + int BudgetDisplay::getIDColumn () |