Fixed undo of detach()
authorinsilmaril
Tue Dec 01 11:06:15 2009 +0000 (2009-12-01)
changeset 81382ebfc46233b
parent 812 62d4137bfb90
child 814 31de6677aa96
Fixed undo of detach()
mainwindow.cpp
mysortfilterproxymodel.cpp
tex/vym.changelog
version.h
vymmodel.cpp
vymmodel.h
     1.1 --- a/mainwindow.cpp	Fri Nov 27 15:00:51 2009 +0000
     1.2 +++ b/mainwindow.cpp	Tue Dec 01 11:06:15 2009 +0000
     1.3 @@ -1125,7 +1125,7 @@
     1.4  	viewMenu->addAction (a);
     1.5  	connect( a, SIGNAL( triggered() ), this, SLOT(windowPreviousEditor() ) );
     1.6  
     1.7 -	switchboard.print();
     1.8 +	if (debug) switchboard.print();
     1.9  }
    1.10  
    1.11  // Mode Actions
    1.12 @@ -2884,7 +2884,7 @@
    1.13  	}	
    1.14  }
    1.15  
    1.16 -void Main::editNewBranchAbove()	// FIXME-1 can crash
    1.17 +void Main::editNewBranchAbove()	
    1.18  {
    1.19  	VymModel *m=currentModel();
    1.20  	if ( m)
     2.1 --- a/mysortfilterproxymodel.cpp	Fri Nov 27 15:00:51 2009 +0000
     2.2 +++ b/mysortfilterproxymodel.cpp	Tue Dec 01 11:06:15 2009 +0000
     2.3 @@ -25,7 +25,7 @@
     2.4  }
     2.5  */
     2.6  
     2.7 -bool MySortFilterProxyModel::filterAcceptsRow(int sourceRow,	// FIXME-1 find a way to show _all_ rows which match, independent of parent
     2.8 +bool MySortFilterProxyModel::filterAcceptsRow(int sourceRow,	// FIXME-2 find a way to show _all_ rows which match, independent of parent
     2.9          const QModelIndex &sourceParent) const
    2.10  {
    2.11      QModelIndex index0 = sourceModel()->index(sourceRow, 0, sourceParent);
     3.1 --- a/tex/vym.changelog	Fri Nov 27 15:00:51 2009 +0000
     3.2 +++ b/tex/vym.changelog	Tue Dec 01 11:06:15 2009 +0000
     3.3 @@ -1,3 +1,8 @@
     3.4 +-------------------------------------------------------------------
     3.5 +Tue Dec  1 12:03:42 CET 2009 - vym@insilmaril.de
     3.6 +
     3.7 +- Bugfix: Undo of detach
     3.8 +
     3.9  -------------------------------------------------------------------
    3.10  Thu Nov 26 22:32:34 CET 2009 - vym@insilmaril.de
    3.11  
     4.1 --- a/version.h	Fri Nov 27 15:00:51 2009 +0000
     4.2 +++ b/version.h	Tue Dec 01 11:06:15 2009 +0000
     4.3 @@ -7,7 +7,7 @@
     4.4  #define __VYM_VERSION "1.13.0"
     4.5  //#define __VYM_CODENAME "Codename: RC-1"
     4.6  #define __VYM_CODENAME "Codename: development version, not for production!"
     4.7 -#define __VYM_BUILD_DATE "2009-11-26"
     4.8 +#define __VYM_BUILD_DATE "2009-12-01"
     4.9  
    4.10  
    4.11  bool checkVersion(const QString &);
     5.1 --- a/vymmodel.cpp	Fri Nov 27 15:00:51 2009 +0000
     5.2 +++ b/vymmodel.cpp	Tue Dec 01 11:06:15 2009 +0000
     5.3 @@ -237,7 +237,7 @@
     5.4  	// Build xml recursivly
     5.5  	if (!saveSel)
     5.6  		// Save all mapcenters as complete map, if saveSel not set
     5.7 -		s+=saveTreeToDir(tmpdir,prefix,writeflags,offset);
     5.8 +		s+=saveTreeToDir(tmpdir,prefix,offset);
     5.9  	else
    5.10  	{
    5.11  		switch (saveSel->getType())
    5.12 @@ -276,7 +276,7 @@
    5.13  	return s;
    5.14  }
    5.15  
    5.16 -QString VymModel::saveTreeToDir (const QString &tmpdir,const QString &prefix, int verbose, const QPointF &offset)	// FIXME-4 verbose not needed (used to write icons)
    5.17 +QString VymModel::saveTreeToDir (const QString &tmpdir,const QString &prefix, const QPointF &offset)
    5.18  {
    5.19      QString s;
    5.20  
    5.21 @@ -2028,11 +2028,18 @@
    5.22  			for (int i=0; i<selbi->branchCount();++i)
    5.23  				selbi->getBranchNum(i)->getBranchObj()->setRelPos();
    5.24  		
    5.25 -		//QString oldsel=getSelectString();
    5.26 +		QString oldsel=getSelectString();
    5.27 +		int n=selbi->num();
    5.28 +		QPointF p;
    5.29 +		BranchObj *bo=selbi->getBranchObj();
    5.30 +		if (bo) p=bo->getAbsPos();
    5.31 +		QString parsel=getSelectString(selbi->parent());
    5.32  		if ( relinkBranch (selbi,rootItem,-1) )
    5.33  			saveState (
    5.34 -				selbi,QString("relink()"), //FIXME-1 add paramters when detaching
    5.35 -				selbi,"detach ()",
    5.36 +				getSelectString (selbi),
    5.37 +				QString("relinkTo (\"%1\",%2,%3,%4)").arg(parsel).arg(n).arg(p.x()).arg(p.y()),
    5.38 +				oldsel,
    5.39 +				"detach ()",
    5.40  				QString("Detach %1").arg(getObjectName(selbi))
    5.41  			);
    5.42  	}
     6.1 --- a/vymmodel.h	Fri Nov 27 15:00:51 2009 +0000
     6.2 +++ b/vymmodel.h	Tue Dec 01 11:06:15 2009 +0000
     6.3 @@ -77,7 +77,7 @@
     6.4      QString saveToDir (const QString &tmpdir, const QString &prefix, bool writeflags, const QPointF &offset, TreeItem *saveSel);
     6.5  
     6.6  	/*! Save all data in tree*/
     6.7 -	QString saveTreeToDir (const QString&,const QString&,int, const QPointF&);// Save data recursivly to tempdir
     6.8 +	QString saveTreeToDir (const QString&,const QString&,const QPointF&);// Save data recursivly to tempdir
     6.9  
    6.10  
    6.11  	/*! \brief Sets filepath, filename and mapname