mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
Fix season drag and drop SEGV
This commit is contained in:
@@ -375,14 +375,12 @@ SeasonTreeView::dropEvent(QDropEvent* event)
|
||||
{
|
||||
// item and original position
|
||||
QTreeWidgetItem *item = currentItem();
|
||||
int idx1 = currentItem()->parent()->indexOfChild(item);
|
||||
int idx1 = invisibleRootItem()->indexOfChild(item);
|
||||
int idx2 = indexAt(event->pos()).row();
|
||||
|
||||
// finalise drop event
|
||||
QTreeWidget::dropEvent(event);
|
||||
|
||||
// new position
|
||||
int idx2 = currentItem()->parent()->indexOfChild(item);
|
||||
|
||||
// emit the itemMoved signal
|
||||
Q_EMIT itemMoved(item, idx1, idx2);
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ class SeasonTreeView : public QTreeWidget
|
||||
public:
|
||||
SeasonTreeView();
|
||||
|
||||
Q_SIGNALS:
|
||||
signals:
|
||||
void itemMoved(QTreeWidgetItem* item, int previous, int actual);
|
||||
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user