mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-22 06:43:54 -07:00
Run formatter on all our files (#6942)
This commit is contained in:
parent
b3c89167c5
commit
1d5d3f2d38
19 changed files with 153 additions and 81 deletions
|
|
@ -61,24 +61,30 @@ inline QString expandPattern(const QString &pattern,
|
|||
QString result = pattern;
|
||||
|
||||
auto replaceIfPresent = [&](const QString &token, const QString &value) -> bool {
|
||||
if (!result.contains(token))
|
||||
if (!result.contains(token)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (value.isEmpty())
|
||||
if (value.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
result.replace(token, value);
|
||||
return true;
|
||||
};
|
||||
|
||||
if (!replaceIfPresent("{name}", name))
|
||||
if (!replaceIfPresent("{name}", name)) {
|
||||
return {};
|
||||
if (!replaceIfPresent("{set}", set))
|
||||
}
|
||||
if (!replaceIfPresent("{set}", set)) {
|
||||
return {};
|
||||
if (!replaceIfPresent("{collector}", collector))
|
||||
}
|
||||
if (!replaceIfPresent("{collector}", collector)) {
|
||||
return {};
|
||||
if (!replaceIfPresent("{providerId}", providerId))
|
||||
}
|
||||
if (!replaceIfPresent("{providerId}", providerId)) {
|
||||
return {};
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
@ -96,8 +102,9 @@ generateImportVariants(const QString &name, const QString &set, const QString &c
|
|||
pattern.replace("_", sep);
|
||||
|
||||
QString v = expandPattern(pattern, name, set, collector, providerId);
|
||||
if (!v.isEmpty())
|
||||
if (!v.isEmpty()) {
|
||||
variants << v;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,8 +28,9 @@ CardPictureLoaderWorker::CardPictureLoaderWorker()
|
|||
static_cast<qint64>(SettingsCache::instance().getNetworkCacheSizeInMB()));
|
||||
|
||||
connect(&SettingsCache::instance(), &SettingsCache::networkCacheSizeChanged, cache, [this](int newSizeInMB) {
|
||||
if (cache)
|
||||
if (cache) {
|
||||
cache->setMaximumCacheSize(1024L * 1024L * static_cast<qint64>(newSizeInMB));
|
||||
}
|
||||
});
|
||||
|
||||
networkManager->setCache(cache);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue