mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-18 08:22:15 -07:00
Properly set sort indices.
This commit is contained in:
parent
42fda4b01c
commit
8703e03d25
2 changed files with 4 additions and 3 deletions
|
|
@ -22,6 +22,7 @@ VisualDeckStorageSortWidget::VisualDeckStorageSortWidget(VisualDeckStorageWidget
|
|||
sortComboBox->addItem("Sort Alphabetically (Filename)", Alphabetical);
|
||||
sortComboBox->addItem("Sort by Last Modified", ByLastModified);
|
||||
sortComboBox->addItem("Sort by Last Loaded", ByLastLoaded);
|
||||
sortComboBox->setCurrentIndex(SettingsCache::instance().getVisualDeckStorageSortingOrder());
|
||||
|
||||
// Connect sorting change signal to refresh the file list
|
||||
connect(sortComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
|
||||
|
|
@ -40,9 +41,9 @@ void VisualDeckStorageSortWidget::showEvent(QShowEvent *event)
|
|||
|
||||
void VisualDeckStorageSortWidget::updateSortOrder()
|
||||
{
|
||||
sortOrder = static_cast<SortOrder>(sortComboBox->currentData().toInt());
|
||||
sortOrder = static_cast<SortOrder>(sortComboBox->currentIndex());
|
||||
qDebug() << "Sort order updated to: " << sortOrder;
|
||||
SettingsCache::instance().setVisualDeckStorageSortingOrder(sortComboBox->currentData().toInt());
|
||||
SettingsCache::instance().setVisualDeckStorageSortingOrder(sortComboBox->currentIndex());
|
||||
emit sortOrderChanged();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,10 +27,10 @@ signals:
|
|||
private:
|
||||
enum SortOrder
|
||||
{
|
||||
ByName,
|
||||
Alphabetical,
|
||||
ByLastModified,
|
||||
ByLastLoaded,
|
||||
ByName,
|
||||
};
|
||||
QHBoxLayout *layout;
|
||||
VisualDeckStorageWidget *parent;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue