mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-17 20:41:33 -07:00
Reload card db and notify enabled sets change on "Manage Sets" dialog save (#6837)
* Reload card db and notify enabled sets change on "Manage Sets" dialog save Took 1 hour 18 minutes Took 6 seconds * Extract to method, also notify on "Reload db" and "new sets found" Took 3 minutes Took 4 seconds * Add an "always enable new sets" fuse to "new sets found" dialog Took 11 minutes * Always debounce modelDirty() with dirty() timer. Took 29 minutes Took 3 minutes * Performance improvements for settings by not constructing a new settings object on every single set() call (this forced a sync to/from fs but it seems fine to just rely on Qts own periodic sync?) Took 23 minutes Took 3 seconds --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
ac2e995f15
commit
d30690236a
12 changed files with 84 additions and 37 deletions
|
|
@ -29,6 +29,11 @@ VisualDatabaseDisplayWidget::VisualDatabaseDisplayWidget(QWidget *parent,
|
|||
: QWidget(parent), deckEditor(_deckEditor), databaseModel(database_model),
|
||||
databaseDisplayModel(database_display_model)
|
||||
{
|
||||
debounceTimer = new QTimer(this);
|
||||
debounceTimer->setSingleShot(true); // Ensure it only fires once after the timeout
|
||||
|
||||
connect(debounceTimer, &QTimer::timeout, this, &VisualDatabaseDisplayWidget::onSearchModelChanged);
|
||||
|
||||
cards = new QList<ExactCard>;
|
||||
connect(databaseDisplayModel, &CardDatabaseDisplayModel::modelDirty, this,
|
||||
&VisualDatabaseDisplayWidget::modelDirty);
|
||||
|
|
@ -157,11 +162,6 @@ void VisualDatabaseDisplayWidget::initialize()
|
|||
|
||||
mainLayout->addWidget(cardSizeWidget);
|
||||
|
||||
debounceTimer = new QTimer(this);
|
||||
debounceTimer->setSingleShot(true); // Ensure it only fires once after the timeout
|
||||
|
||||
connect(debounceTimer, &QTimer::timeout, this, &VisualDatabaseDisplayWidget::onSearchModelChanged);
|
||||
|
||||
databaseDisplayModel->setFilterTree(filterModel->filterTree());
|
||||
|
||||
connect(filterModel, &FilterTreeModel::layoutChanged, this, &VisualDatabaseDisplayWidget::onSearchModelChanged);
|
||||
|
|
@ -286,7 +286,9 @@ void VisualDatabaseDisplayWidget::loadNextPage()
|
|||
}
|
||||
|
||||
// Load the next page of cards and add them to the flow widget
|
||||
flowWidget->setUpdatesEnabled(false);
|
||||
loadPage(start, end);
|
||||
flowWidget->setUpdatesEnabled(true);
|
||||
}
|
||||
|
||||
void VisualDatabaseDisplayWidget::loadPage(int start, int end)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue