slackware-current/source/kde/patch/calligra/0068-Backport-Plan-Fix-task-module-load-and-save.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

68 lines
2.7 KiB
Diff

From fd5b8dca68d0a418aac926fe60814ebe537ee032 Mon Sep 17 00:00:00 2001
From: Dag Andersen <danders@get2net.dk>
Date: Mon, 22 Aug 2016 10:00:52 +0200
Subject: [PATCH 68/80] Backport: Plan: Fix task module load and save
Workaround: saveTaskModules destroys project
---
plan/kptview.cpp | 19 ++++++++++++-------
plan/libs/models/kptnodeitemmodel.cpp | 6 +++++-
2 files changed, 17 insertions(+), 8 deletions(-)
diff --git a/plan/kptview.cpp b/plan/kptview.cpp
index b38d8b6..af606f6 100644
--- a/plan/kptview.cpp
+++ b/plan/kptview.cpp
@@ -114,6 +114,7 @@
#include "kptviewlistdocker.h"
#include "kptviewlist.h"
#include "kptschedulesdocker.h"
+#include "kptpart.h"
#include "kptdebug.h"
#include "plansettings.h"
@@ -3033,13 +3034,17 @@ void View::saveTaskModule( const KUrl &url, Project *project )
QString dir = Factory::global().dirs()->saveLocation( "plan_taskmodules" );
kDebug(planDbg())<<"dir="<<dir;
if ( ! dir.isEmpty() ) {
- MainDocument part(getKoPart());
- part.insertProject( *project, 0, 0 );
- part.getProject().setName( project->name() );
- part.getProject().setLeader( project->leader() );
- part.getProject().setDescription( project->description() );
- part.saveNativeFormat( dir + url.fileName() );
- kDebug(planDbg())<<dir + url.fileName();
+ Part *part = new Part( this );
+ MainDocument *doc = new MainDocument( part );
+ part->setDocument( doc );
+ doc->disconnect(); // doc shall not handle feedback from openUrl()
+ doc->setAutoSave( 0 ); //disable
+ doc->insertProject( *project, 0, 0 );
+ doc->getProject().setName( project->name() );
+ doc->getProject().setLeader( project->leader() );
+ doc->getProject().setDescription( project->description() );
+ doc->saveNativeFormat( dir + url.fileName() );
+ part->deleteLater(); // also deletes document
} else {
kDebug(planDbg())<<"Could not find a location";
}
diff --git a/plan/libs/models/kptnodeitemmodel.cpp b/plan/libs/models/kptnodeitemmodel.cpp
index 834e45a..45b1650 100644
--- a/plan/libs/models/kptnodeitemmodel.cpp
+++ b/plan/libs/models/kptnodeitemmodel.cpp
@@ -4990,7 +4990,11 @@ bool TaskModuleModel::importProject( const KUrl &url, bool emitsignal )
stripProject( project );
addTaskModule( project );
if ( emitsignal ) {
- emit saveTaskModule( url, project );
+ // FIXME: save modifies the project, so give it a copy (see kptview.cpp)
+ Project p;
+ status.setProject( &p );
+ p.load( element, status );
+ emit saveTaskModule( url, &p );
}
} else {
kDebug(planDbg())<<"Failed to load project from:"<<url;
--
2.7.4