From e2fc6f4993813532d23385c802f1ffc24b09aff2 Mon Sep 17 00:00:00 2001 From: xavierqet Date: Fri, 28 Sep 2007 21:58:42 +0000 Subject: [PATCH] Correction d'un bug lors du chargement d'un conducteur modifie git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@144 bfdf4180-ca20-0410-9c96-a3a8aa849046 --- conducer.cpp | 7 ++++--- conducer.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/conducer.cpp b/conducer.cpp index b065ea7a4..1c206345b 100644 --- a/conducer.cpp +++ b/conducer.cpp @@ -841,7 +841,7 @@ bool Conducer::fromXml(QDomElement &e) { // initialise divers parametres lies a la modification des conducteurs modified_path = true; - saveProfile(); + saveProfile(false); segmentsToPath(); return(true); @@ -938,10 +938,11 @@ void Conducer::calculateTextItemPosition() { Sauvegarde le profil courant du conducteur pour l'utiliser ulterieurement dans priv_modifieConducer. */ -void Conducer::saveProfile() { +void Conducer::saveProfile(bool undo) { ConducerProfile old_profile = conducer_profile; conducer_profile.fromConducer(this); - if (Diagram *dia = diagram()) { + Diagram *dia = diagram(); + if (undo && dia) { dia -> undoStack().push(new ChangeConducerCommand(this, old_profile, conducer_profile)); } } diff --git a/conducer.h b/conducer.h index 2051ac248..8c3499451 100644 --- a/conducer.h +++ b/conducer.h @@ -73,7 +73,7 @@ class Conducer : public QGraphicsPathItem { private: void segmentsToPath(); - void saveProfile(); + void saveProfile(bool = true); void priv_calculeConducer(const QPointF &, QET::Orientation, const QPointF &, QET::Orientation); void priv_modifieConducer(const QPointF &, QET::Orientation, const QPointF &, QET::Orientation); uint nbSegments(QET::ConducerSegmentType = QET::Both) const;