mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Clean up inter-library dependencies with interfaces (#6280)
* Have CardDatabase::getPreferredPrintingInfo respect card provider ID overrides (pinned printings)
Took 13 minutes
Took 37 seconds
Took 10 seconds
Took 10 seconds
# Commit time for manual adjustment:
# Took 30 seconds
Took 15 seconds
Took 8 minutes
Took 21 seconds
* Move settings cache and settings card preference provider out of libcockatrice_settings and into cockatrice
Took 52 minutes
Took 9 minutes
Took 1 minute
* Temp cache.
Took 16 minutes
* Dependency Injection for SettingsCache
* Turn SettingsCache into a QSharedPointer.
* Implement interfaces for settings that need it
Took 2 hours 38 minutes
* Adjust oracle.
Took 5 minutes
* Move abstract/noop interfaces to libcockatrice_interfaces so they can be linked against independently.
Took 52 minutes
* Clean up some links.
Took 3 minutes
* Cleanup two includes.
Took 3 minutes
* More fixes.
Took 7 minutes
* More includes that slipped past.
Took 3 minutes
* Stop mocking and start injecting for tests.
Took 15 minutes
* I don't know why remote_client was including main.
Took 4 minutes
* Include.
Took 3 minutes
* Lint.
Took 2 minutes
* Don't use Qt pointers.
Took 1 hour 7 minutes
* Make parser use CardSettingsInterface
Took 13 minutes
* Also adjust constructor lol.
Took 8 minutes
* Lint.
Took 32 minutes
* Revert "Lint."
This reverts commit ecb596c39e.
Took 3 minutes
* Test.
Took 3 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
fb30515f72
commit
a8a3fca8c9
152 changed files with 609 additions and 750 deletions
|
|
@ -23,6 +23,9 @@ set(oracle_SOURCES
|
|||
src/pagetemplates.cpp
|
||||
src/parsehelpers.cpp
|
||||
src/qt-json/json.cpp
|
||||
../cockatrice/src/client/settings/cache_settings.cpp
|
||||
../cockatrice/src/client/settings/card_counter_settings.cpp
|
||||
../cockatrice/src/client/settings/shortcuts_settings.cpp
|
||||
../cockatrice/src/client/network/update/client/release_channel.cpp
|
||||
../cockatrice/src/interface/theme_manager.cpp
|
||||
../cockatrice/src/interface/widgets/quick_settings/settings_button_widget.cpp
|
||||
|
|
@ -140,6 +143,7 @@ target_link_libraries(
|
|||
oracle
|
||||
PUBLIC libcockatrice_card
|
||||
PUBLIC libcockatrice_settings
|
||||
PUBLIC libcockatrice_network
|
||||
PUBLIC ${ORACLE_QT_MODULES}
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -3,13 +3,13 @@
|
|||
#include "interface/theme_manager.h"
|
||||
#include "oraclewizard.h"
|
||||
|
||||
#include <../../cockatrice/src/client/settings/cache_settings.h>
|
||||
#include <QApplication>
|
||||
#include <QCommandLineParser>
|
||||
#include <QIcon>
|
||||
#include <QLibraryInfo>
|
||||
#include <QTimer>
|
||||
#include <QTranslator>
|
||||
#include <libcockatrice/settings/cache_settings.h>
|
||||
|
||||
QTranslator *translator, *qtTranslator;
|
||||
ThemeManager *themeManager;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#include "oracleimporter.h"
|
||||
|
||||
#include "client/settings/cache_settings.h"
|
||||
#include "parsehelpers.h"
|
||||
#include "qt-json/json.h"
|
||||
|
||||
|
|
@ -7,6 +8,7 @@
|
|||
#include <QRegularExpression>
|
||||
#include <algorithm>
|
||||
#include <climits>
|
||||
#include <database/interface/settings_card_preference_provider.h>
|
||||
#include <libcockatrice/card/database/parser/cockatrice_xml_4.h>
|
||||
#include <libcockatrice/card/relation/card_relation.h>
|
||||
|
||||
|
|
@ -463,13 +465,14 @@ int OracleImporter::startImport()
|
|||
{
|
||||
int setCards = 0, setIndex = 0;
|
||||
// add an empty set for tokens
|
||||
CardSetPtr tokenSet = CardSet::newInstance(CardSet::TOKENS_SETNAME, tr("Dummy set containing tokens"), "Tokens");
|
||||
CardSetPtr tokenSet = CardSet::newInstance(SettingsCache::instance().cardDatabase(), CardSet::TOKENS_SETNAME,
|
||||
tr("Dummy set containing tokens"), "Tokens");
|
||||
sets.insert(CardSet::TOKENS_SETNAME, tokenSet);
|
||||
|
||||
for (const SetToDownload &curSetToParse : allSets) {
|
||||
CardSetPtr newSet =
|
||||
CardSet::newInstance(curSetToParse.getShortName(), curSetToParse.getLongName(), curSetToParse.getSetType(),
|
||||
curSetToParse.getReleaseDate(), curSetToParse.getPriority());
|
||||
CardSetPtr newSet = CardSet::newInstance(SettingsCache::instance().cardDatabase(), curSetToParse.getShortName(),
|
||||
curSetToParse.getLongName(), curSetToParse.getSetType(),
|
||||
curSetToParse.getReleaseDate(), curSetToParse.getPriority());
|
||||
if (!sets.contains(newSet->getShortName()))
|
||||
sets.insert(newSet->getShortName(), newSet);
|
||||
|
||||
|
|
@ -488,7 +491,7 @@ int OracleImporter::startImport()
|
|||
|
||||
bool OracleImporter::saveToFile(const QString &fileName, const QString &sourceUrl, const QString &sourceVersion)
|
||||
{
|
||||
CockatriceXml4Parser parser;
|
||||
CockatriceXml4Parser parser(new SettingsCardPreferenceProvider());
|
||||
return parser.saveToFile(sets, cards, fileName, sourceUrl, sourceVersion);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#include "oraclewizard.h"
|
||||
|
||||
#include "client/settings/cache_settings.h"
|
||||
#include "main.h"
|
||||
#include "oracleimporter.h"
|
||||
#include "version_string.h"
|
||||
|
|
@ -24,7 +25,6 @@
|
|||
#include <QTextEdit>
|
||||
#include <QtConcurrent>
|
||||
#include <QtGui>
|
||||
#include <libcockatrice/settings/cache_settings.h>
|
||||
|
||||
#ifdef HAS_LZMA
|
||||
#include "lzma/decompress.h"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue