mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-06 05:23:56 -07:00
Extract to method, also notify on "Reload db" and "new sets found"
Took 3 minutes Took 4 seconds
This commit is contained in:
parent
3f030fe2dc
commit
808f51a61b
4 changed files with 18 additions and 10 deletions
|
|
@ -1,6 +1,7 @@
|
|||
#include "card_database.h"
|
||||
|
||||
#include "../relation/card_relation.h"
|
||||
#include "card_database_manager.h"
|
||||
#include "parser/cockatrice_xml_4.h"
|
||||
|
||||
#include <QCryptographicHash>
|
||||
|
|
@ -60,6 +61,17 @@ void CardDatabase::loadCardDatabases()
|
|||
loadStatus = loader->loadCardDatabases();
|
||||
}
|
||||
|
||||
void CardDatabase::reloadCardDatabasesAndNotify()
|
||||
{
|
||||
loadCardDatabases();
|
||||
|
||||
QMetaObject::Connection conn;
|
||||
conn = connect(this, &CardDatabase::cardDatabaseLoadingFinished, this, [conn, this]() mutable {
|
||||
notifyEnabledSetsChanged();
|
||||
QObject::disconnect(conn);
|
||||
});
|
||||
}
|
||||
|
||||
bool CardDatabase::saveCustomTokensToFile()
|
||||
{
|
||||
return loader->saveCustomTokensToFile();
|
||||
|
|
|
|||
|
|
@ -147,6 +147,7 @@ public slots:
|
|||
|
||||
/** @brief Loads card databases from configured paths. */
|
||||
void loadCardDatabases();
|
||||
void reloadCardDatabasesAndNotify();
|
||||
|
||||
/** @brief Saves custom tokens to file.
|
||||
* @return True if successful.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue