Fix #33088: Time signature properties crash#33217
Fix #33088: Time signature properties crash#33217RomanPudashkin wants to merge 2 commits intomusescore:masterfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR reorganizes QML/Qt lifecycle handling across several palette widgets: initialization work is shifted into appropriate lifecycle hooks ( 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/palette/widgets/customizekitdialog.cpp (1)
271-282:⚠️ Potential issue | 🟠 Major | ⚡ Quick winInitialize drumset state before populating/selecting pitch rows.
loadPitchesList()depends onm_editedDrumset, but Line 281 initializes drumset data only after list population/selection. This can seed the initial UI with default/stale values.Suggested fix
void CustomizeKitDialog::componentComplete() { m_notation = globalContext()->currentNotation(); if (!m_notation) { return; } - QTreeWidgetItem* itemToSelect = loadPitchesList(); - pitchList->setCurrentItem(itemToSelect ? itemToSelect : pitchList->topLevelItem(0)); - initDrumsetAndKey(); + QTreeWidgetItem* itemToSelect = loadPitchesList(); + pitchList->setCurrentItem(itemToSelect ? itemToSelect : pitchList->topLevelItem(0)); }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/palette/widgets/customizekitdialog.cpp` around lines 271 - 282, In componentComplete(), initDrumsetAndKey() must be called before loadPitchesList() and before selecting the pitchList item because loadPitchesList() depends on m_editedDrumset; move the initDrumsetAndKey() call to precede the call to loadPitchesList()/pitchList->setCurrentItem so the drumset state (m_editedDrumset) is initialized first and loadPitchesList() will populate rows with correct data.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@src/palette/widgets/customizekitdialog.cpp`:
- Around line 271-282: In componentComplete(), initDrumsetAndKey() must be
called before loadPitchesList() and before selecting the pitchList item because
loadPitchesList() depends on m_editedDrumset; move the initDrumsetAndKey() call
to precede the call to loadPitchesList()/pitchList->setCurrentItem so the
drumset state (m_editedDrumset) is initialized first and loadPitchesList() will
populate rows with correct data.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: e12cb621-19b1-45b7-ab4b-c66d447f8292
📒 Files selected for processing (7)
src/palette/widgets/customizekitdialog.cppsrc/palette/widgets/noteGroups.cppsrc/palette/widgets/noteGroups.hsrc/palette/widgets/palettewidget.cppsrc/palette/widgets/palettewidget.hsrc/palette/widgets/timesignaturepropertiesdialog.cppsrc/palette/widgets/timesignaturepropertiesdialog.h
87cfffe to
21a878d
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/palette/widgets/customizekitdialog.cpp`:
- Around line 280-281: Remove the constructor assertion that assumes pitchList
has items (the assertion near the constructor) and instead perform the check
when population runs in componentComplete(); specifically, keep calling
loadPitchesList() but guard the subsequent setCurrentItem() by verifying
pitchList and that either itemToSelect or pitchList->topLevelItem(0) is non-null
before calling setCurrentItem(), or move the assertion to componentComplete()
after population; reference symbols: pitchList, loadPitchesList(),
componentComplete(), and the constructor assertion to locate the change.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 92b9748f-750e-4aa2-8fe2-4d2c01e5e7dc
📒 Files selected for processing (1)
src/palette/widgets/customizekitdialog.cpp
21a878d to
2234a40
Compare
Resolves: #33088