-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Effects: read effect data for decks added after initial setup #12282
Conversation
36f6b8a
to
74cb0d7
Compare
74cb0d7
to
b6e6d00
Compare
@@ -202,6 +215,25 @@ void EffectsManager::readEffectsXml() { | |||
m_pVisibleEffectsList->readEffectsXml(doc, m_pBackendManager); | |||
} | |||
|
|||
void EffectsManager::readEffectsXmlSingleDeck(const QString& deckGroup) { | |||
QDir settingsPath(m_pConfig->getSettingsPath()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normally we prefer initialization with = QDir settingsPath = m_pConfig->getSettingsPath();
To have a clear visible distinguishing from a function call.
Recently we have discussed to prefer initialization lists like:
QDir settingsPath{m_pConfig->getSettingsPath()};
This is just a hint, because that never made the way into our style guides.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ackknowldeged.
It's copy/paste from readEffectsXml()
, and actually it's mixed in the vaious effect managers already:
QString xyPath(m_pConfig->getSettingsPath() + ...);
QDir xyDir(xyPath);
vs
QFile xyFile(m_pConfig->getSettingsPath() + ...);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just code style hints.
for (int i = 0; i < quickEffectNodeList.count(); ++i) { | ||
QDomElement presetNameElement = quickEffectNodeList.at(i).toElement(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can become a range based loop, to get rid of i.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's QList::iterator, but none for QDomeNodeList.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok than let's merge. Thank you. LGTM.
Closes #12277
Fixed by creating a separate, stripped down version of
readEffectsXml
that extracts only the Quick Effect for one deck, and call that each time a deck is added after the initialsetup()
call.