new way to handle tmpdir, minor changes
authorinsilmaril
Thu Sep 22 12:14:23 2005 +0000 (2005-09-22)
changeset 164d442a66e9121
parent 163 30b22f7bd009
child 165 4244bcd9e6ea
new way to handle tmpdir, minor changes
branchobj.cpp
lang/vym_de.ts
lang/vym_en.ts
lang/vym_es.ts
linkablemapobj.cpp
linkablemapobj.h
main.cpp
mainwindow.cpp
mapcenterobj.cpp
mapeditor.cpp
mapeditor.h
misc.cpp
misc.h
settings.cpp
version.h
     1.1 --- a/branchobj.cpp	Mon Sep 12 19:52:51 2005 +0000
     1.2 +++ b/branchobj.cpp	Thu Sep 22 12:14:23 2005 +0000
     1.3 @@ -201,19 +201,9 @@
     1.4  	// ignore mapcenter and mainbranch
     1.5  	if (lmo->getDepth()<2) off=0;
     1.6  	if (off==0)
     1.7 -	{
     1.8  		link2ParPos=false;
     1.9 -	//	parObj=o;
    1.10 -	}	
    1.11  	else
    1.12 -	{	
    1.13  		link2ParPos=true;
    1.14 -	//	if (off>0)
    1.15 -	//		parObj=o->getParObj();
    1.16 -	//	else	
    1.17 -	//		parObj=o->getParObj();
    1.18 -	//	parObj=o;
    1.19 -	}		
    1.20  	parObj=o;
    1.21  
    1.22  	depth=parObj->getDepth()+1;
    1.23 @@ -400,10 +390,11 @@
    1.24  	// Overloaded from LinkableMapObj
    1.25  	// BranchObj can use color of heading
    1.26  
    1.27 -	if (mapEditor->getLinkColorHint()==HeadingColor)
    1.28 -		LinkableMapObj::setLinkColor (heading->getColor() );
    1.29 -	else	
    1.30 -		LinkableMapObj::setLinkColor ();
    1.31 +	if (mapEditor)
    1.32 +		if (mapEditor->getLinkColorHint()==HeadingColor)
    1.33 +			LinkableMapObj::setLinkColor (heading->getColor() );
    1.34 +		else	
    1.35 +			LinkableMapObj::setLinkColor ();
    1.36  }
    1.37  
    1.38  void BranchObj::setColor (QColor col, bool colorChilds)
    1.39 @@ -578,7 +569,7 @@
    1.40  
    1.41  void BranchObj::positionBBox()
    1.42  {
    1.43 -	// FIXME testing (optimization)
    1.44 +	// TODO testing (optimization)
    1.45  	/*
    1.46  	QString h=getHeading();
    1.47  	if (!h.isEmpty())
    1.48 @@ -663,12 +654,6 @@
    1.49  
    1.50  void BranchObj::setHeading(QString s)
    1.51  {
    1.52 -	/*FIXME
    1.53 -    // Adjusting font size
    1.54 -    QFont font=heading->getFont();
    1.55 -	font.setPointSize(getDefHeadingSize() );
    1.56 -    heading->setFont(font);
    1.57 -	*/
    1.58      heading->setText(s);	// set new heading
    1.59  	calcBBoxSize();			// recalculate bbox
    1.60      positionBBox();			// rearrange contents
    1.61 @@ -1140,7 +1125,7 @@
    1.62  
    1.63  void BranchObj::alignRelativeTo (QPoint ref)
    1.64  {
    1.65 -/* FIXME testing
    1.66 +/* TODO testing
    1.67  	if (!getHeading().isEmpty())
    1.68  		cout << "BO::alignRelTo "<<getHeading()<<endl;
    1.69  	else	
    1.70 @@ -1210,7 +1195,7 @@
    1.71  
    1.72  void BranchObj::reposition()
    1.73  {	
    1.74 -/* FIXME testing
    1.75 +/* TODO testing only
    1.76  	if (!getHeading().isEmpty())
    1.77  		cout << "BO::reposition  "<<getHeading()<<endl;
    1.78  	else	
     2.1 --- a/lang/vym_de.ts	Mon Sep 12 19:52:51 2005 +0000
     2.2 +++ b/lang/vym_de.ts	Thu Sep 22 12:14:23 2005 +0000
     2.3 @@ -798,7 +798,7 @@
     2.4      </message>
     2.5      <message>
     2.6          <source>Couldn&apos;t save</source>
     2.7 -        <translation type="obsolete">Diese Datei konnte nicht gespeichert werden:</translation>
     2.8 +        <translation>Diese Datei konnte nicht gespeichert werden:</translation>
     2.9      </message>
    2.10      <message>
    2.11          <source>Saved </source>
    2.12 @@ -1269,18 +1269,6 @@
    2.13          <source>Set application to open external links...</source>
    2.14          <translation>Anwendung zum Öffnen externer Verweise...</translation>
    2.15      </message>
    2.16 -    <message>
    2.17 -        <source>Hide link</source>
    2.18 -        <translation>Link nicht anzeigen</translation>
    2.19 -    </message>
    2.20 -    <message>
    2.21 -        <source>Hide link if object is not selected</source>
    2.22 -        <translation>Link nicht anzeigen, falls Objekt nicht selektiert ist</translation>
    2.23 -    </message>
    2.24 -    <message>
    2.25 -        <source>Couldn&apos;t save %1</source>
    2.26 -        <translation>Konnte %1 nicht speichern</translation>
    2.27 -    </message>
    2.28  </context>
    2.29  <context>
    2.30      <name>MapEditor</name>
    2.31 @@ -1671,7 +1659,7 @@
    2.32      </message>
    2.33      <message>
    2.34          <source>The file %1 exists already. Do you want to overwrite it?</source>
    2.35 -        <translation type="obsolete">Die Datei %1 gibt es bereits.
    2.36 +        <translation>Die Datei %1 gibt es bereits.
    2.37  Wollen Sie sie überschreiben?</translation>
    2.38      </message>
    2.39      <message>
     3.1 --- a/lang/vym_en.ts	Mon Sep 12 19:52:51 2005 +0000
     3.2 +++ b/lang/vym_en.ts	Thu Sep 22 12:14:23 2005 +0000
     3.3 @@ -860,6 +860,10 @@
     3.4          <translation type="unfinished"></translation>
     3.5      </message>
     3.6      <message>
     3.7 +        <source>Couldn&apos;t save</source>
     3.8 +        <translation type="unfinished"></translation>
     3.9 +    </message>
    3.10 +    <message>
    3.11          <source>Export XML to directory</source>
    3.12          <translation type="unfinished"></translation>
    3.13      </message>
    3.14 @@ -1044,18 +1048,6 @@
    3.15          <source>Set application to open external links...</source>
    3.16          <translation type="unfinished"></translation>
    3.17      </message>
    3.18 -    <message>
    3.19 -        <source>Hide link</source>
    3.20 -        <translation type="unfinished"></translation>
    3.21 -    </message>
    3.22 -    <message>
    3.23 -        <source>Hide link if object is not selected</source>
    3.24 -        <translation type="unfinished"></translation>
    3.25 -    </message>
    3.26 -    <message>
    3.27 -        <source>Couldn&apos;t save %1</source>
    3.28 -        <translation type="unfinished"></translation>
    3.29 -    </message>
    3.30  </context>
    3.31  <context>
    3.32      <name>MapEditor</name>
    3.33 @@ -1267,6 +1259,10 @@
    3.34          <translation type="unfinished"></translation>
    3.35      </message>
    3.36      <message>
    3.37 +        <source>The file %1 exists already. Do you want to overwrite it?</source>
    3.38 +        <translation type="unfinished"></translation>
    3.39 +    </message>
    3.40 +    <message>
    3.41          <source>Cannot find the directory %1</source>
    3.42          <translation type="unfinished"></translation>
    3.43      </message>
     4.1 --- a/lang/vym_es.ts	Mon Sep 12 19:52:51 2005 +0000
     4.2 +++ b/lang/vym_es.ts	Thu Sep 22 12:14:23 2005 +0000
     4.3 @@ -939,7 +939,7 @@
     4.4      </message>
     4.5      <message>
     4.6          <source>Couldn&apos;t save</source>
     4.7 -        <translation type="obsolete">No pudo guardar</translation>
     4.8 +        <translation>No pudo guardar</translation>
     4.9      </message>
    4.10      <message>
    4.11          <source>The file </source>
    4.12 @@ -1159,18 +1159,6 @@
    4.13          <source>Set application to open external links...</source>
    4.14          <translation type="unfinished"></translation>
    4.15      </message>
    4.16 -    <message>
    4.17 -        <source>Hide link</source>
    4.18 -        <translation type="unfinished"></translation>
    4.19 -    </message>
    4.20 -    <message>
    4.21 -        <source>Hide link if object is not selected</source>
    4.22 -        <translation type="unfinished"></translation>
    4.23 -    </message>
    4.24 -    <message>
    4.25 -        <source>Couldn&apos;t save %1</source>
    4.26 -        <translation type="unfinished"></translation>
    4.27 -    </message>
    4.28  </context>
    4.29  <context>
    4.30      <name>MapEditor</name>
    4.31 @@ -1422,6 +1410,10 @@
    4.32          <translation type="unfinished"></translation>
    4.33      </message>
    4.34      <message>
    4.35 +        <source>The file %1 exists already. Do you want to overwrite it?</source>
    4.36 +        <translation type="unfinished"></translation>
    4.37 +    </message>
    4.38 +    <message>
    4.39          <source>Cannot find the directory %1</source>
    4.40          <translation type="unfinished"></translation>
    4.41      </message>
     5.1 --- a/linkablemapobj.cpp	Mon Sep 12 19:52:51 2005 +0000
     5.2 +++ b/linkablemapobj.cpp	Thu Sep 22 12:14:23 2005 +0000
     5.3 @@ -62,6 +62,7 @@
     5.4  void LinkableMapObj::init ()
     5.5  {
     5.6      depth=-1;	
     5.7 +	mapEditor=NULL;
     5.8      childObj=NULL;
     5.9      parObj=NULL;
    5.10      parObjTmpBuf=NULL;
    5.11 @@ -126,8 +127,16 @@
    5.12  {
    5.13  }
    5.14  
    5.15 +bool LinkableMapObj::hasParObjTmp()
    5.16 +{
    5.17 +	if (parObjTmpBuf) return true;
    5.18 +	return false;
    5.19 +}
    5.20 +
    5.21  LinkStyle LinkableMapObj::getDefLinkStyle ()
    5.22  {
    5.23 +	if (!mapEditor) return StyleUndef;
    5.24 +
    5.25  	LinkStyle ls=mapEditor->getLinkStyle();
    5.26  	switch (ls)
    5.27  	{
    5.28 @@ -204,8 +213,7 @@
    5.29  				else
    5.30  					p->hide();
    5.31  				pa0.resize (3);
    5.32 -				// TODO
    5.33 -				// a bit awkward: draw the lines additionally to polygon, to avoid
    5.34 +				// TODO a bit awkward: draw the lines additionally to polygon, to avoid
    5.35  				// missing pixels, when polygon is extremly flat
    5.36  				l = new QCanvasLine(canvas);
    5.37  				l->setPen( QPen(linkcolor, 1) );
    5.38 @@ -227,8 +235,7 @@
    5.39  				pa1.resize (arcsegs+1);
    5.40  				pa2.resize (arcsegs+1);
    5.41  
    5.42 -				// TODO
    5.43 -				// a bit awkward: draw the lines additionally 
    5.44 +				// TODO a bit awkward: draw the lines additionally 
    5.45  				// to polygon, to avoid missing pixels, 
    5.46  				// if polygon is extremly flat
    5.47  				for (i=0;i<arcsegs;i++)
    5.48 @@ -247,12 +254,7 @@
    5.49  			default: 
    5.50  				break;	
    5.51  		}	
    5.52 -		// FIXME updateLink is usually called (multiple times) later:
    5.53 -		//updateLink();
    5.54 -	} else
    5.55 -	{
    5.56 -		qWarning ("Error: ChildObj or parObj == NULL in LinkableMapObj::setLinkStyle\n");
    5.57 -	}
    5.58 +	} 
    5.59  }
    5.60  
    5.61  LinkStyle LinkableMapObj::getLinkStyle()
    5.62 @@ -287,7 +289,8 @@
    5.63  {
    5.64  	// Overloaded in BranchObj and childs
    5.65  	// here only set default color
    5.66 -	setLinkColor (mapEditor->getDefLinkColor());
    5.67 +	if (mapEditor)
    5.68 +		setLinkColor (mapEditor->getDefLinkColor());
    5.69  }
    5.70  
    5.71  void LinkableMapObj::setLinkColor(QColor col)
    5.72 @@ -650,8 +653,8 @@
    5.73  
    5.74  void LinkableMapObj::alignRelativeTo (QPoint ref)
    5.75  {
    5.76 +	// TODO testing, seems not to be used right now...
    5.77  	cout << "LMO::alignRelTo   ref="<<ref<<endl;
    5.78 -	//FIXME 
    5.79  }
    5.80  
    5.81  void LinkableMapObj::reposition()
     6.1 --- a/linkablemapobj.h	Mon Sep 12 19:52:51 2005 +0000
     6.2 +++ b/linkablemapobj.h	Thu Sep 22 12:14:23 2005 +0000
     6.3 @@ -33,6 +33,7 @@
     6.4      virtual void setParObj (LinkableMapObj*);
     6.5      virtual void setParObjTmp (LinkableMapObj*,QPoint,int);	// Only for moving Obj around
     6.6  	virtual void unsetParObjTmp();						// reuse original ParObj
     6.7 +	virtual bool hasParObjTmp();
     6.8  	LinkStyle getDefLinkStyle();
     6.9      void setLinkStyle(LinkStyle);            
    6.10  	LinkStyle getLinkStyle();
     7.1 --- a/main.cpp	Mon Sep 12 19:52:51 2005 +0000
     7.2 +++ b/main.cpp	Thu Sep 22 12:14:23 2005 +0000
     7.3 @@ -21,6 +21,7 @@
     7.4  								// initialized in mainwindow
     7.5  
     7.6  Main *mainWindow;				// used in BranchObj::select()								
     7.7 +QString tmpVymDir;				// All temp files go there, created in mainwindow
     7.8  MapEditor *clipboardME;			
     7.9  FlagRowObj *systemFlagsDefault;	// used to copy from in LinkableMapObj
    7.10  FlagRowObj *standardFlagsDefault;
     8.1 --- a/mainwindow.cpp	Mon Sep 12 19:52:51 2005 +0000
     8.2 +++ b/mainwindow.cpp	Thu Sep 22 12:14:23 2005 +0000
     8.3 @@ -60,6 +60,7 @@
     8.4  
     8.5  extern TextEditor *textEditor;
     8.6  extern Main *mainWindow;
     8.7 +extern QString tmpVymDir;
     8.8  extern int statusbarTime;
     8.9  extern MapEditor *clipboardME;
    8.10  extern FlagRowObj* standardFlagsDefault;
    8.11 @@ -168,6 +169,11 @@
    8.12  	        settings.readNumEntry( "/vym/mainwindow/geometry/posY", 100));
    8.13  
    8.14  
    8.15 +	// Create unique temporary directory
    8.16 +	tmpVymDir=makeUniqueDir ("/tmp/vym-XXXXXX");
    8.17 +
    8.18 +	// TODO Create direcctory for clipboard
    8.19 +
    8.20  	// Set random seed (random used for object IDs)
    8.21      QTime t = QTime::currentTime();		// set random seed
    8.22      srand( t.hour()*12+t.minute()*60+t.second()*60 );
    8.23 @@ -236,7 +242,6 @@
    8.24  	connect (findWindow, SIGNAL( somethingChanged() ), 
    8.25  		this, SLOT(editFindChanged() ) );	
    8.26  
    8.27 -	// FIXME testing
    8.28  	// Connect TextEditor, so that we can update flags if text changes
    8.29  	connect (textEditor, SIGNAL (textHasChanged() ), this, SLOT (updateNoteFlag()));
    8.30  
    8.31 @@ -277,6 +282,9 @@
    8.32  
    8.33  	// To make the texteditor save its settings, call the destructor
    8.34  	delete (textEditor);
    8.35 +
    8.36 +	// Remove temporary directory
    8.37 +	removeDir (QDir(tmpVymDir));
    8.38  }
    8.39  
    8.40  void Main::loadCmdLine()
    8.41 @@ -1329,7 +1337,7 @@
    8.42  						{
    8.43  							for ( QStringList::Iterator it = flist.begin(); it != flist.end(); ++it ) 
    8.44  								*it=tmpMapDir + "/" + *it;
    8.45 -							// FIXME Multiple entries, load all (but only the first one into this ME)
    8.46 +							// TODO Multiple entries, load all (but only the first one into this ME)
    8.47  							//mainWindow->fileLoadFromTmp (flist);
    8.48  							//returnCode=1;	// Silently forget this attempt to load
    8.49  							qWarning ("MainWindow::load (fn)  multimap found...");
     9.1 --- a/mapcenterobj.cpp	Mon Sep 12 19:52:51 2005 +0000
     9.2 +++ b/mapcenterobj.cpp	Thu Sep 22 12:14:23 2005 +0000
     9.3 @@ -27,7 +27,6 @@
     9.4  void MapCenterObj::clear() 
     9.5  {
     9.6  	BranchObj::clear();
     9.7 -    init();
     9.8  }
     9.9  
    9.10  void MapCenterObj::init () 
    9.11 @@ -37,10 +36,11 @@
    9.12      absPos=QPoint (canvas->width()/2, canvas->height()/2);
    9.13  
    9.14  	// FIXME this should be done in TextObj later...
    9.15 -	QFont font ("Sans Serif,16,-1,5,50,0,0,0,0,0");		
    9.16 -	heading->setFont(font);
    9.17 +	//QFont font ("Sans Serif,16,-1,5,50,0,0,0,0,0");		
    9.18 +	//heading->setFont(font);
    9.19 +	depth=0;
    9.20 +	setDefAttr(MovedBranch);
    9.21  
    9.22 -	depth=0;
    9.23  
    9.24  	frame->setFrameType (Rectangle);
    9.25  	move (absPos.x(), absPos.y() );
    10.1 --- a/mapeditor.cpp	Mon Sep 12 19:52:51 2005 +0000
    10.2 +++ b/mapeditor.cpp	Thu Sep 22 12:14:23 2005 +0000
    10.3 @@ -62,6 +62,7 @@
    10.4  extern TextEditor *textEditor;
    10.5  extern int statusbarTime;
    10.6  extern Main *mainWindow;
    10.7 +extern QString tmpVymDir;
    10.8  extern FlagRowObj *systemFlagsDefault;
    10.9  extern FlagRowObj *standardFlagsDefault;
   10.10  extern MapEditor *clipboardME;
   10.11 @@ -139,6 +140,7 @@
   10.12  
   10.13  extern Settings settings;
   10.14  
   10.15 +int MapEditor::mapNum=0;	// make instance
   10.16  
   10.17  ///////////////////////////////////////////////////////////////////////
   10.18  ///////////////////////////////////////////////////////////////////////
   10.19 @@ -147,6 +149,7 @@
   10.20    QCanvasView(parent,name,f), urlOperator(0), imageBuffer(0)
   10.21  {
   10.22  	//cout << "Constructor ME "<<this<<endl;
   10.23 +	mapNum++;
   10.24  
   10.25      viewport()->setAcceptDrops(true);
   10.26  
   10.27 @@ -355,8 +358,7 @@
   10.28  	fileName="unnamed";
   10.29  	mapName="";
   10.30  
   10.31 -
   10.32 -	undosTotal=15;	
   10.33 +	undosTotal=settings.readNumEntry("/vym/mapeditor/undoLevels",50);
   10.34  	undosAvail=0;	
   10.35  	undoNum=0;
   10.36  	
   10.37 @@ -389,7 +391,6 @@
   10.38    }
   10.39  
   10.40  	//cout <<"Destructor MapEditor\n";
   10.41 -	if (isInteractive) delTmpDirs();
   10.42  
   10.43  	// Save Settings
   10.44  	//settings.writeEntry( "/vym/mapeditor/editmode/autoselect",  );
   10.45 @@ -484,15 +485,9 @@
   10.46  void MapEditor::makeTmpDirs()
   10.47  {
   10.48  	// Create unique temporary directories
   10.49 -	char tmpdir[]="/tmp/vym-XXXXXX";	
   10.50 -	// TODO set permissions and maybe use QT method for portability
   10.51 -	tmpMapDir=mkdtemp(tmpdir);
   10.52 -	QString bakMapDir;
   10.53 -	for (int i=undosTotal;i>0;i--)
   10.54 -	{
   10.55 -		bakMapDir=tmpMapDir+QString("/undo-%1").arg(i);
   10.56 -		makeSubDirs(bakMapDir);
   10.57 -	}	
   10.58 +	tmpMapDir=tmpVymDir+QString("/mapeditor-%1").arg(mapNum);
   10.59 +	QDir d;
   10.60 +	d.mkdir (tmpMapDir,true);
   10.61  }
   10.62  
   10.63  void MapEditor::delTmpDirs()
   10.64 @@ -639,8 +634,12 @@
   10.65  	
   10.66  	QString backupXML;
   10.67  	QString bakMapDir=QDir::convertSeparators (QString(tmpMapDir+"/undo-%1").arg(undoNum));
   10.68 -	QString bakMapPath=bakMapDir+"/map.xml";
   10.69 -
   10.70 +	QString bakMapPath=QDir::convertSeparators(bakMapDir+"/map.xml");
   10.71 +
   10.72 +	// Create bakMapDir if not available
   10.73 +	QDir d(bakMapDir);
   10.74 +	if (!d.exists()) 
   10.75 +		makeSubDirs (bakMapDir);
   10.76  
   10.77  	// Save current selection 
   10.78  	QString redoSelection="";
   10.79 @@ -1222,7 +1221,7 @@
   10.80  
   10.81  void MapEditor::exportASCII()
   10.82  {
   10.83 -	// FIXME still experimental
   10.84 +	// TODO still experimental
   10.85  	Export ex;
   10.86  	ex.setMapCenter(mapCenter);
   10.87  
   10.88 @@ -1264,7 +1263,7 @@
   10.89  
   10.90  void MapEditor::exportLaTeX()
   10.91  {
   10.92 -	// FIXME still experimental
   10.93 +	// TODO still experimental
   10.94  	QFileDialog *fd=new QFileDialog( this, tr("VYM - Export (LaTex)"));
   10.95  	fd->addFilter ("TEX (*.tex)");
   10.96  	fd->setCaption("VYM - Export (LaTex) (still experimental)");
   10.97 @@ -1306,7 +1305,7 @@
   10.98  
   10.99  void MapEditor::exportOOPresentation()
  10.100  {
  10.101 -	// FIXME still experimental
  10.102 +	// TODO still experimental
  10.103  	/*
  10.104  	QFileDialog *fd=new QFileDialog( this, tr("VYM - Export (Open Office 1.3.x Presentation)"));
  10.105  	fd->addFilter ("Open Office 1.3.x presentation (*.sxi)");
  10.106 @@ -1416,9 +1415,7 @@
  10.107  				// repositioning makes testing nicer,
  10.108  				// but is not needed usually:
  10.109  				if (clipboardME->isVisible())
  10.110 -				{
  10.111  					clipboardME->getMapCenter()->reposition();  
  10.112 -				}	
  10.113  				else
  10.114  					clipboardME->hide();
  10.115  			}
  10.116 @@ -1491,8 +1488,6 @@
  10.117  	parseAtom (undoCommand);
  10.118  	mapCenter->reposition();
  10.119  
  10.120 -	//mapChanged=false;  FIXME  still needed???
  10.121 -
  10.122  	//if (!redoSelection.isEmpty())
  10.123  	//	select (redoSelection);
  10.124  
  10.125 @@ -1538,7 +1533,7 @@
  10.126  	if (!undoSelection.isEmpty())
  10.127  		select (undoSelection);
  10.128  
  10.129 -/* TODO remove testing
  10.130 +/* TODO testing
  10.131  	cout << "ME::undo() begin\n";
  10.132  	cout << "    undosTotal="<<undosTotal<<endl;
  10.133  	cout << "    undosAvail="<<undosAvail<<endl;
  10.134 @@ -1554,8 +1549,6 @@
  10.135  	parseAtom (undoCommand);
  10.136  	mapCenter->reposition();
  10.137  
  10.138 -	//mapChanged=false;  FIXME  still needed???
  10.139 -
  10.140  	//if (!redoSelection.isEmpty())
  10.141  	//	select (redoSelection);
  10.142  
  10.143 @@ -1701,7 +1694,7 @@
  10.144  
  10.145  void MapEditor::move(const int &x, const int &y)
  10.146  {
  10.147 -	// FIXME  no saveState, because this is only internal at undo so far
  10.148 +	// TODO no saveState, because this is only internal at undo so far
  10.149  	if (selection) selection->move(x,y);
  10.150  	if (typeid(*selection) == typeid(FloatImageObj))
  10.151  		((FloatImageObj*)selection)->setRelPos();
  10.152 @@ -1824,7 +1817,7 @@
  10.153  		 (typeid(*selection) == typeid(BranchObj) || 
  10.154  		  typeid(*selection) == typeid(MapCenterObj) ) ) 
  10.155  	{
  10.156 -		saveState(selection);	//FIXME undoCommand
  10.157 +		saveState(selection);	//TODO undoCommand
  10.158  
  10.159  		BranchObj* bo1 = (BranchObj*) selection;
  10.160  		bool wasScrolled=false;
  10.161 @@ -1942,7 +1935,7 @@
  10.162  			saveState(selection->getParObj());
  10.163  		else
  10.164  			// Mainbranch, save whole map
  10.165 -			// FIXME Better would be to insert mainbranch again at pos
  10.166 +			// TODO Better would be to insert mainbranch again at pos
  10.167  			// But undoCommand is missing right now
  10.168  			saveState();
  10.169  		BranchObj* bo=dynamic_cast <BranchObj*> (selection);
  10.170 @@ -2428,7 +2421,7 @@
  10.171  		if (typeid(*selection) == typeid(BranchObj) ||
  10.172  			typeid(*selection) == typeid(MapCenterObj))
  10.173  		{
  10.174 -			saveState(selection);	//FIXME undoCommand
  10.175 +			saveState(selection);	//TODO undoCommand
  10.176  			BranchObj *bo=(BranchObj*)selection;
  10.177  			bo->setColor(actColor, false); // color links, color childs
  10.178  		}    
  10.179 @@ -2454,7 +2447,7 @@
  10.180  {
  10.181  	if (selection)
  10.182  	{
  10.183 -		saveState(selection);// FIXME undoCommand	
  10.184 +		saveState(selection);// TODO undoCommand	
  10.185  		((BranchObj*)selection)->toggleStandardFlag (f,actionSettingsUseFlagGroups);
  10.186  	}	
  10.187  }
  10.188 @@ -2658,7 +2651,7 @@
  10.189  		if (bo->getDepth()==1)
  10.190  			saveState();
  10.191  		else	
  10.192 -			saveState(selection->getParObj());	// FIXME undoCommand
  10.193 +			saveState(selection->getParObj());	// TODO undoCommand
  10.194  		QString sel=selection->getSelectString();
  10.195  		unselect();
  10.196  		par->removeBranchHere(bo);
  10.197 @@ -2715,7 +2708,7 @@
  10.198  	// Finally show dialog
  10.199  	if (dia.exec() == QDialog::Accepted)
  10.200  	{
  10.201 -		saveState();	//FIXME undoCommand
  10.202 +		saveState();	//TODO undoCommand
  10.203  		mapCenter->setAuthor (dia.getAuthor() );
  10.204  		mapCenter->setComment (dia.getComment() );
  10.205  	}
  10.206 @@ -2882,7 +2875,7 @@
  10.207  {
  10.208  	linkstyle=ls;
  10.209  
  10.210 -	saveState();	// FIXME undoCommand
  10.211 +	saveState();	// TODO undoCommand
  10.212  	BranchObj *bo;
  10.213  	bo=mapCenter->first();
  10.214  	bo=bo->next();
  10.215 @@ -2976,7 +2969,7 @@
  10.216  	QColor col = QColorDialog::getColor( defLinkColor, this );
  10.217  	if ( !col.isValid() ) return;
  10.218  	setLinkColor( col );
  10.219 -	saveState();	//FIXME undoCommand
  10.220 +	saveState();	//TODO undoCommand
  10.221  
  10.222  }
  10.223  
  10.224 @@ -3030,7 +3023,7 @@
  10.225  			QString fn=fd->selectedFile();
  10.226  			lastImageDir=fn.left(fn.findRev ("/"));
  10.227  			bo->addFloatImage();
  10.228 -			// FIXME check if load was successful
  10.229 +			// TODO check if load was successful
  10.230  			bo->getLastFloatImage()->load(fn);
  10.231  			bo->getLastFloatImage()->setOriginalFilename(fn);
  10.232  			mapCenter->reposition();
  10.233 @@ -3240,7 +3233,7 @@
  10.234  				}
  10.235  				if (dia.deleteXLink())
  10.236  					((BranchObj*)selection)->deleteXLinkAt(i);
  10.237 -				saveState();	//FIXME undoCommand
  10.238 +				saveState();	//TODO undoCommand
  10.239  			}
  10.240  		}	
  10.241  	}
  10.242 @@ -3249,12 +3242,8 @@
  10.243  void MapEditor::testFunction()
  10.244  {
  10.245  	cout << "MapEditor::testFunction() called\n";
  10.246 -	if (selection && 
  10.247 -		(typeid(*selection) == typeid(BranchObj)) )
  10.248 -	{
  10.249 -		QString s=((BranchObj*)selection)->getHeading();
  10.250 -		parseAtom(s);
  10.251 -	}
  10.252 +	QDir d("/fasl");
  10.253 +	removeDir (d);
  10.254  }
  10.255  
  10.256  void MapEditor::ensureSelectionVisible()
  10.257 @@ -3458,7 +3447,10 @@
  10.258      // Move the selected MapObj
  10.259      if ( selection && movingObj) 
  10.260      {	
  10.261 -		ensureSelectionVisible ();
  10.262 +		// To avoid jumping of the CanvasView, only 
  10.263 +		// ensureSelectionVisible, if not tmp linked
  10.264 +		if (!selection->hasParObjTmp())
  10.265 +			ensureSelectionVisible ();
  10.266  		
  10.267  		// Now move the selection, but add relative position 
  10.268  		// (movingObj_start) where selection was chosen with 
  10.269 @@ -3633,7 +3625,7 @@
  10.270  			tmpXLink->setEnd ( ((BranchObj*)(dst)) );
  10.271  			tmpXLink->updateXLink();
  10.272  			tmpXLink->activate();
  10.273 -			saveState();	//FIXME undoCommand
  10.274 +			saveState();	//TODO undoCommand
  10.275  		} else
  10.276  		{
  10.277  			delete(tmpXLink);
  10.278 @@ -3787,7 +3779,7 @@
  10.279  
  10.280  bool isUnicode16(const QByteArray &d) 
  10.281  {
  10.282 -  // FIXME: make more precise check for unicode 16.
  10.283 +  // TODO: make more precise check for unicode 16.
  10.284    // Guess unicode16 if any of second bytes are zero
  10.285    unsigned int length = max(0,d.size()-2)/2;
  10.286    for (unsigned int i = 0; i<length ; i++)
  10.287 @@ -3897,7 +3889,7 @@
  10.288  
  10.289  		if (update) 
  10.290  		{
  10.291 -			saveState();	//FIXME undo Command
  10.292 +			saveState();	//TODO undo Command
  10.293  			mapCenter->reposition();
  10.294  			adjustCanvasSize();
  10.295  			canvas()->update();
    11.1 --- a/mapeditor.h	Mon Sep 12 19:52:51 2005 +0000
    11.2 +++ b/mapeditor.h	Thu Sep 22 12:14:23 2005 +0000
    11.3 @@ -216,6 +216,7 @@
    11.4  	bool printFooter;			// Print footer below map
    11.5  
    11.6  	bool zipped;				// should map be zipped
    11.7 +static	int mapNum;				// unique number for Editor
    11.8  	QString fileName;			// short name of file (for tab)
    11.9  	QString filePath;			// path to file which will be saved
   11.10  	QString fileDir;			// dir where file is saved
    12.1 --- a/misc.cpp	Mon Sep 12 19:52:51 2005 +0000
    12.2 +++ b/misc.cpp	Thu Sep 22 12:14:23 2005 +0000
    12.3 @@ -2,6 +2,7 @@
    12.4  
    12.5  #include <qregexp.h>
    12.6  #include <qpoint.h>
    12.7 +#include <stdlib.h>
    12.8  
    12.9  #include "misc.h"
   12.10  
   12.11 @@ -123,8 +124,29 @@
   12.12  	return d;
   12.13  }
   12.14  
   12.15 +QString makeUniqueDir (QString s)
   12.16 +{
   12.17 +	char *p;
   12.18 +	int bytes=s.length();
   12.19 +	p=(char*) malloc (bytes+1);
   12.20 +	int i;
   12.21 +	for (i=0;i<bytes;i++)
   12.22 +		p[i]=s.at(i).latin1();
   12.23 +	p[bytes]=0;	
   12.24 +	QString r=mkdtemp (p);
   12.25 +	free (p);
   12.26 +	return r;
   12.27 +}
   12.28 +
   12.29  void removeDir(QDir d)
   12.30  {
   12.31 +	if (d.path().left(4)!="/tmp")
   12.32 +	{
   12.33 +		// FIXME testing
   12.34 +		qWarning ("misc.cpp::removeDir should remove "+d.path()+" - aborted.");
   12.35 +		return;
   12.36 +	}
   12.37 +
   12.38  	// Traverse directories
   12.39  	d.setFilter( QDir::Dirs| QDir::Hidden | QDir::NoSymLinks );
   12.40  	const QFileInfoList *dirlist = d.entryInfoList();
    13.1 --- a/misc.h	Mon Sep 12 19:52:51 2005 +0000
    13.2 +++ b/misc.h	Thu Sep 22 12:14:23 2005 +0000
    13.3 @@ -17,6 +17,7 @@
    13.4  QPoint normalise (const QPoint &);
    13.5  QString maskPath (QString );
    13.6  QString convertToRel (const QString &,const QString &);
    13.7 +QString makeUniqueDir (QString);
    13.8  void removeDir(QDir);
    13.9  QString quotemeta(const QString&);	
   13.10  int max (int,int);
    14.1 --- a/settings.cpp	Mon Sep 12 19:52:51 2005 +0000
    14.2 +++ b/settings.cpp	Thu Sep 22 12:14:23 2005 +0000
    14.3 @@ -126,6 +126,7 @@
    14.4  					*itv=value;
    14.5  				else
    14.6  					*itv="";
    14.7 +				*itv=value;
    14.8  				return;
    14.9  			}
   14.10  			itk++;
    15.1 --- a/version.h	Mon Sep 12 19:52:51 2005 +0000
    15.2 +++ b/version.h	Thu Sep 22 12:14:23 2005 +0000
    15.3 @@ -2,6 +2,6 @@
    15.4  #define VERSION_H
    15.5  
    15.6  #define __VYM_VERSION__ "1.7.5"
    15.7 -#define __BUILD_DATE__ "September 12, 2005"
    15.8 +#define __BUILD_DATE__ "September 22, 2005"
    15.9  
   15.10  #endif