mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-05 09:33:25 -08:00
[DeckSync] Prefer ctor params for set-once client/provider per review
This commit is contained in:
parent
aa5cadd4eb
commit
5b51fc8810
3 changed files with 8 additions and 4 deletions
|
|
@ -42,6 +42,11 @@ DeckSyncManager::DeckSyncManager(QObject *parent) : QObject(parent)
|
|||
{
|
||||
}
|
||||
|
||||
DeckSyncManager::DeckSyncManager(AbstractClient *_client, ColorIdentityProvider provider, QObject *parent)
|
||||
: QObject(parent), client(_client), colorIdentityProvider(std::move(provider))
|
||||
{
|
||||
}
|
||||
|
||||
void DeckSyncManager::setClient(AbstractClient *_client)
|
||||
{
|
||||
client = _client;
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ public:
|
|||
};
|
||||
|
||||
explicit DeckSyncManager(QObject *parent = nullptr);
|
||||
DeckSyncManager(AbstractClient *client, ColorIdentityProvider provider, QObject *parent = nullptr);
|
||||
|
||||
void setClient(AbstractClient *_client);
|
||||
void setProfile(const DeckSyncProfile &_profile);
|
||||
|
|
|
|||
|
|
@ -254,10 +254,8 @@ TabDeckStorage::TabDeckStorage(TabSupervisor *_tabSupervisor,
|
|||
rightToolBar->addAction(aNewFolder);
|
||||
rightToolBar->addAction(aDeleteRemoteDeck);
|
||||
|
||||
syncManager = new DeckSyncManager(this);
|
||||
syncManager->setClient(client);
|
||||
syncManager->setColorIdentityProvider(
|
||||
[](const DeckList &deck) { return getDeckColorIdentity(deck, CardDatabaseManager::query()); });
|
||||
syncManager = new DeckSyncManager(
|
||||
client, [](const DeckList &deck) { return getDeckColorIdentity(deck, CardDatabaseManager::query()); }, this);
|
||||
connect(syncManager, &DeckSyncManager::statusMessage, this, &TabDeckStorage::onSyncStatusMessage);
|
||||
connect(syncManager, &DeckSyncManager::syncFinished, this, &TabDeckStorage::onSyncFinished);
|
||||
if (currentUserInfo != nullptr) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue