slackware-current/source/kde/patch/calligra/0070-Plan-Guard-against-trying-to-move-a-task-into-the-sa.patch
Patrick J Volkerding d0ac7419a9 Mon Mar 18 22:53:51 UTC 2019
ap/cups-filters-1.22.2-x86_64-1.txz:  Upgraded.
kde/calligra-2.9.11-x86_64-28.txz:  Rebuilt.
  Patched to fix Calligra Plan crash. Thanks to Olek.
l/adwaita-icon-theme-3.32.0-noarch-1.txz:  Upgraded.
l/giflib-5.1.8-x86_64-1.txz:  Upgraded.
l/libssh2-1.8.1-x86_64-1.txz:  Upgraded.
  Fixed several security issues.
  For more information, see:
    https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-3855
    https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-3856
    https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-3857
    https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-3858
    https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-3859
    https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-3860
    https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-3861
    https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-3862
    https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-3863
  (* Security fix *)
x/scim-1.4.18-x86_64-1.txz:  Upgraded.
xap/mozilla-firefox-60.6.0esr-x86_64-1.txz:  Upgraded.
  This is a bugfix release.
  For more information, see:
    https://www.mozilla.org/en-US/firefox/60.6.0/releasenotes/
2019-03-19 08:59:44 +01:00

50 lines
2.1 KiB
Diff

From a9134500e4e599ba316617941bcd04f640ed3999 Mon Sep 17 00:00:00 2001
From: Dag Andersen <danders@get2net.dk>
Date: Tue, 23 Aug 2016 13:30:13 +0200
Subject: [PATCH 70/80] Plan: Guard against trying to move a task into the same
porition
QAbstractItemModel cannot handle this and it causes a crash (later)
---
plan/libs/kernel/kptproject.cpp | 4 ++++
plan/libs/models/kptnodeitemmodel.cpp | 9 +++++++++
2 files changed, 13 insertions(+)
diff --git a/plan/libs/kernel/kptproject.cpp b/plan/libs/kernel/kptproject.cpp
index 451e897..fdf43bc 100644
--- a/plan/libs/kernel/kptproject.cpp
+++ b/plan/libs/kernel/kptproject.cpp
@@ -1565,6 +1565,10 @@ bool Project::moveTask( Node* node, Node *newParent, int newPos )
Node *oldParent = node->parentNode();
int oldPos = oldParent->indexOf( node );
int i = newPos < 0 ? newParent->numChildren() : newPos;
+ if ( oldParent == newParent && i == oldPos ) {
+ // no need to move to where it already is
+ return false;
+ }
int newRow = i;
if ( oldParent == newParent && newPos > oldPos ) {
++newRow; // itemmodels wants new row *before* node is removed from old position
diff --git a/plan/libs/models/kptnodeitemmodel.cpp b/plan/libs/models/kptnodeitemmodel.cpp
index e66277f..5581f8f 100644
--- a/plan/libs/models/kptnodeitemmodel.cpp
+++ b/plan/libs/models/kptnodeitemmodel.cpp
@@ -4036,6 +4036,15 @@ bool NodeItemModel::dropMimeData( const QMimeData *data, Qt::DropAction action,
if ( pos >= 0 && n->parentNode() == par && par->indexOf( n ) < pos ) {
--pos;
}
+ if ( n->parentNode() == par ) {
+ // avoid drop into the same position, QAbstractItemModel does not like it
+ int crow = par->indexOf( n );
+ if ( ( ( pos == -1 ) && ( crow == par->numChildren() - 1 ) ) || ( pos == crow ) ) {
+ delete cmd;
+ cmd = 0;
+ continue;
+ }
+ }
cmd->addCommand( new NodeMoveCmd( m_project, n, par, pos ) );
offset++;
}
--
2.7.4