no more segfault when deleting animated part
authorinsilmaril
Wed Jul 16 11:56:44 2008 +0000 (2008-07-16)
changeset 722462d39502273
parent 721 12958f987bcf
child 723 11f9124c1cca
no more segfault when deleting animated part
branchobj.cpp
tex/vym.changelog
vymmodel.cpp
vymmodel.h
     1.1 --- a/branchobj.cpp	Wed Jul 16 10:46:14 2008 +0000
     1.2 +++ b/branchobj.cpp	Wed Jul 16 11:56:44 2008 +0000
     1.3 @@ -53,6 +53,13 @@
     1.4  
     1.5  BranchObj::~BranchObj ()
     1.6  {
     1.7 +	// If I'm animated, I need to un-animate myself first
     1.8 +	if (anim.isAnimated() )
     1.9 +	{
    1.10 +		anim.setAnimated (false);
    1.11 +		model->stopAnimation (this);
    1.12 +	}
    1.13 +
    1.14  	//cout << "Destr BranchObj of "<<this<<endl;
    1.15  	// Check, if this branch was the last child to be deleted
    1.16  	// If so, unset the scrolled flags
     2.1 --- a/tex/vym.changelog	Wed Jul 16 10:46:14 2008 +0000
     2.2 +++ b/tex/vym.changelog	Wed Jul 16 11:56:44 2008 +0000
     2.3 @@ -1,3 +1,9 @@
     2.4 +-------------------------------------------------------------------
     2.5 +Wed Jul 16 13:47:01 CEST 2008 - uwedr@suse.de
     2.6 +
     2.7 +- Version: 1.13.0 
     2.8 +- Bugfix: Deleting an animated part no longer segfaults 
     2.9 +
    2.10  -------------------------------------------------------------------
    2.11  Fri Jul 11 14:01:31 CEST 2008 - uwedr@suse.de
    2.12  
     3.1 --- a/vymmodel.cpp	Wed Jul 16 10:46:14 2008 +0000
     3.2 +++ b/vymmodel.cpp	Wed Jul 16 11:56:44 2008 +0000
     3.3 @@ -1421,10 +1421,6 @@
     3.4  	return NULL;
     3.5  }
     3.6  
     3.7 -void VymModel::removeSelection()
     3.8 -{
     3.9 -}
    3.10 -
    3.11  QString VymModel::saveToDir (const QString &tmpdir,const QString &prefix, int verbose, const QPointF &offset)
    3.12  {
    3.13      QString s;
    3.14 @@ -2134,6 +2130,11 @@
    3.15  	}
    3.16  	if (bo && selection.type()==Selection::Branch)
    3.17  	{
    3.18 +		//FIXME need to check if any animObj is part of Branch, remove from animated obj list then
    3.19 +
    3.20 +		// missing!!!!
    3.21 +
    3.22 +
    3.23  		BranchObj* par=(BranchObj*)bo->getParObj();
    3.24  		selection.unselect();
    3.25  		saveStateRemovingPart (bo, QString ("Delete %1").arg(getObjectName(bo)));
    3.26 @@ -4063,6 +4064,13 @@
    3.27  	}
    3.28  }
    3.29  
    3.30 +void VymModel::stopAnimation (MapObj *mo)
    3.31 +{
    3.32 +	int i=animObjList.indexOf(mo);
    3.33 +    if (i>=0)
    3.34 +		animObjList.removeAt (i);
    3.35 +}
    3.36 +
    3.37  void VymModel::sendSelection()
    3.38  {
    3.39  	if (netstate!=Server) return;
     4.1 --- a/vymmodel.h	Wed Jul 16 10:46:14 2008 +0000
     4.2 +++ b/vymmodel.h	Wed Jul 16 11:56:44 2008 +0000
     4.3 @@ -223,8 +223,6 @@
     4.4      LinkableMapObj* findObjBySelect (const QString &s);		// find MapObj by select string
     4.5      LinkableMapObj* findID (const QString &s);				// find MapObj by previously set ID
     4.6  
     4.7 -	void removeSelection ();								// remove selected object
     4.8 -
     4.9  	QString saveToDir (const QString&,const QString&,int, const QPointF&);// Save data recursivly to tempdir
    4.10  
    4.11  
    4.12 @@ -464,6 +462,8 @@
    4.13  	void animate();						//!< Called by timer to animate stuff
    4.14  public:
    4.15  	void startAnimation(const QPointF &start, const QPointF &dest);
    4.16 +	void stopAnimation(MapObj *mo);
    4.17 +
    4.18  ////////////////////////////////////////////
    4.19  // Network related 
    4.20  ////////////////////////////////////////////