File: assert-partlist.diff

package info (click to toggle)
musescore3 3.2.3%2Bdfsg2-21
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 219,852 kB
  • sloc: cpp: 291,412; xml: 200,226; sh: 3,779; ansic: 1,447; python: 393; makefile: 246; perl: 82; pascal: 79
file content (35 lines) | stat: -rw-r--r-- 1,464 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Description: Convert an assert to action; tricky:
 The assert triggers if the user click-holds on a checkbox in
 an instrument then moves the mouse, which triggers Qt’s stupid
 idea to interpret dragging in nōn-drag/droppable QTreeWidget
 as beginning to select, causing the select to trigger before
 the current item is updated (this isn’t a multiselect); via
 https://lists.qt-project.org/pipermail/interest/2012-October/004241.html
 this is not disablable, so just nope out as good as we can
 instead, hope that subsequent interaction fixes this. (This
 MIGHT leave the buttons inoperable on a selected item, but…)
Author: mirabilos <tg@debian.org>
Forwarded: not-yet
Justification: upstream only cares about 4.x these days
 (perhaps to 3.7?)

--- a/mscore/instrwidget.cpp
+++ b/mscore/instrwidget.cpp
@@ -503,6 +503,7 @@ void InstrumentsWidget::on_partiturList_
       {
       QList<QTreeWidgetItem*> wi = partiturList->selectedItems();
       if (wi.isEmpty()) {
+ nope:
             removeButton->setEnabled(false);
             upButton->setEnabled(false);
             downButton->setEnabled(false);
@@ -511,7 +512,8 @@ void InstrumentsWidget::on_partiturList_
             return;
             }
       QTreeWidgetItem* item = wi.front();
-      Q_ASSERT(partiturList->currentItem() == item);
+      if (partiturList->currentItem() != item)
+            goto nope;
       bool flag = item != nullptr;
 
       int count = 0; // item can be hidden