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
This commit is contained in:
xavierqet
2007-09-28 21:58:42 +00:00
parent 0405ac447d
commit e2fc6f4993
2 changed files with 5 additions and 4 deletions

View File

@@ -841,7 +841,7 @@ bool Conducer::fromXml(QDomElement &e) {
// initialise divers parametres lies a la modification des conducteurs // initialise divers parametres lies a la modification des conducteurs
modified_path = true; modified_path = true;
saveProfile(); saveProfile(false);
segmentsToPath(); segmentsToPath();
return(true); return(true);
@@ -938,10 +938,11 @@ void Conducer::calculateTextItemPosition() {
Sauvegarde le profil courant du conducteur pour l'utiliser ulterieurement Sauvegarde le profil courant du conducteur pour l'utiliser ulterieurement
dans priv_modifieConducer. dans priv_modifieConducer.
*/ */
void Conducer::saveProfile() { void Conducer::saveProfile(bool undo) {
ConducerProfile old_profile = conducer_profile; ConducerProfile old_profile = conducer_profile;
conducer_profile.fromConducer(this); conducer_profile.fromConducer(this);
if (Diagram *dia = diagram()) { Diagram *dia = diagram();
if (undo && dia) {
dia -> undoStack().push(new ChangeConducerCommand(this, old_profile, conducer_profile)); dia -> undoStack().push(new ChangeConducerCommand(this, old_profile, conducer_profile));
} }
} }

View File

@@ -73,7 +73,7 @@ class Conducer : public QGraphicsPathItem {
private: private:
void segmentsToPath(); void segmentsToPath();
void saveProfile(); void saveProfile(bool = true);
void priv_calculeConducer(const QPointF &, QET::Orientation, const QPointF &, QET::Orientation); void priv_calculeConducer(const QPointF &, QET::Orientation, const QPointF &, QET::Orientation);
void priv_modifieConducer(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; uint nbSegments(QET::ConducerSegmentType = QET::Both) const;