# HG changeset patch
# User insilmaril
# Date 1249296132 0
# Node ID 5987f9f15bac8134fa02895ca7977b1ab4dfd427
# Parent  9db215a4ad53c987ec03e021b3e335b4c5511583
Fixed problem with images included in branches. Added missing adaptormodel.* files

diff -r 9db215a4ad53 -r 5987f9f15bac adaptormodel.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/adaptormodel.cpp	Mon Aug 03 10:42:12 2009 +0000
@@ -0,0 +1,57 @@
+#include "adaptormodel.h"
+#include <QtCore/QMetaObject>
+#include <QtCore/QString>
+#include <QtCore/QVariant>
+
+#include "vymmodel.h"
+
+AdaptorModel::AdaptorModel(QObject *obj)
+         : QDBusAbstractAdaptor(obj)
+{
+	model=static_cast <VymModel*> (obj);
+	setAutoRelaySignals (true);
+}
+
+AdaptorModel::~AdaptorModel()
+{
+    // destructor
+}
+
+void AdaptorModel::setModel(VymModel *vm)
+{
+	model=vm;
+}
+
+QString AdaptorModel::caption()
+{
+	return m_caption;
+}
+
+void AdaptorModel::setCaption (const QString &newCaption)
+{
+	m_caption=newCaption;
+}
+
+QDBusVariant AdaptorModel::query(const QString &query)
+{
+	QString s;
+	if (model)
+		s=model->getHeading();
+	else
+		s="oops, no vymModel?";
+
+	return QDBusVariant (s);
+}
+
+QDBusVariant AdaptorModel::getHeading()
+{
+	QString s;
+	if (model)
+		s=model->getHeading();
+	else
+		s="oops, no vymModel?";
+
+	return QDBusVariant (s);
+}
+
+
diff -r 9db215a4ad53 -r 5987f9f15bac adaptormodel.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/adaptormodel.h	Mon Aug 03 10:42:12 2009 +0000
@@ -0,0 +1,35 @@
+#ifndef ADAPTORModel_H
+#define ADAPTORModel_H
+
+#include <QtCore/QObject>
+#include <QtDBus/QtDBus>
+
+class VymModel;
+class QString;
+
+class AdaptorModel: public QDBusAbstractAdaptor
+{
+    Q_OBJECT
+    Q_CLASSINFO("D-Bus Interface", "org.insilmaril.Adaptor")
+	Q_PROPERTY(QString caption READ caption WRITE setCaption)
+private:
+	VymModel *model;
+
+public:
+    AdaptorModel(QObject *obj);
+    virtual ~AdaptorModel();
+	void setModel (VymModel *vm);
+
+public: // PROPERTIES
+	QString m_caption;
+	QString caption();
+	void setCaption(const QString &newCaption);
+public slots: // METHODS
+   QDBusVariant query(const QString &query);
+   QDBusVariant getHeading();
+
+Q_SIGNALS: // SIGNALS
+    void crashed();
+};
+
+#endif
diff -r 9db215a4ad53 -r 5987f9f15bac branchitem.cpp
--- a/branchitem.cpp	Mon Jul 27 12:53:17 2009 +0000
+++ b/branchitem.cpp	Mon Aug 03 10:42:12 2009 +0000
@@ -14,6 +14,9 @@
 	scrolled=false;
 	tmpUnscrolled=false;
 	type=Branch;
+
+	includeImagesVer=false;
+	includeImagesHor=false;
 }
 
 BranchItem::~BranchItem()
@@ -98,7 +101,7 @@
 		+scrolledAttr 
 	//	+areaAttr 
 	//	+idAttr 
-	//	+getIncludeImageAttr() 
+		+getIncludeImageAttr() 
 		);
     incIndent();
 
@@ -258,6 +261,46 @@
 	}	
 }
 
+void BranchItem::setIncludeImagesVer(bool b)
+{
+	includeImagesVer=b;
+	/* calcBBoxSize(); FIXME-2
+	positionBBox();
+	requestReposition();
+	*/
+}
+
+bool BranchItem::getIncludeImagesVer()
+{
+	return includeImagesVer;
+}
+
+void BranchItem::setIncludeImagesHor(bool b)
+{
+	includeImagesHor=b;
+	/* calcBBoxSize(); FIXME-2
+	positionBBox();
+	requestReposition();
+	*/
+}
+
+bool BranchItem::getIncludeImagesHor()
+{
+	return includeImagesHor;
+}
+
+QString BranchItem::getIncludeImageAttr()
+{
+	QString a;
+	if (includeImagesVer)
+		a=attribut ("incImgV","true");
+	if (includeImagesHor)
+		a+=attribut ("incImgH","true");
+	return a;	
+}
+
+
+
 TreeItem* BranchItem::findMapItem (QPointF p, TreeItem* excludeTI)
 {
 	// Search branches
@@ -303,7 +346,7 @@
 
 
 /*
-	// Search float images
+	// Search float images //FIXME-4
     for (int i=0; i<floatimage.size(); ++i )
 		if (floatimage.at(i)->inBox(p) && 
 			(floatimage.at(i) != excludeLMO) && 
diff -r 9db215a4ad53 -r 5987f9f15bac branchitem.h
--- a/branchitem.h	Mon Jul 27 12:53:17 2009 +0000
+++ b/branchitem.h	Mon Aug 03 10:42:12 2009 +0000
@@ -34,6 +34,20 @@
 	virtual void tmpUnscroll();				// unscroll scrolled parents temporary e.g. during "find" process
 	virtual void resetTmpUnscroll();		// scroll all tmp scrolled parents again e.g. when unselecting
 
+
+protected:
+	bool includeImagesVer;			//! include floatimages in bbox vertically
+	bool includeImagesHor;			//! include floatimages in bbox horizontally
+public:
+	void setIncludeImagesVer(bool);
+	bool getIncludeImagesVer();
+	void setIncludeImagesHor(bool);
+	bool getIncludeImagesHor();
+	QString getIncludeImageAttr();
+
+public:
+
+
 	TreeItem* findMapItem (QPointF p,TreeItem* excludeTI);	//! search map for branches or images. Ignore excludeTI, where search is started 
 	virtual TreeItem* findID (QString sid);	//! search map for object with ID string
 
diff -r 9db215a4ad53 -r 5987f9f15bac branchobj.cpp
--- a/branchobj.cpp	Mon Jul 27 12:53:17 2009 +0000
+++ b/branchobj.cpp	Mon Aug 03 10:42:12 2009 +0000
@@ -86,18 +86,12 @@
 		absPos=getRandPos();
 		absPos+=parObj->getChildPos();
 	}
-
-	includeImagesVer=false;
-	includeImagesHor=false;
 }
 
 void BranchObj::copy (BranchObj* other)
 {
     OrnamentedObj::copy(other);
 
-	for (int i=0; i<other->floatimage.size(); ++i)
-		addFloatImage  (other->floatimage.at(i));
-	
 	setVisibility (other->visible);
 
 	angle=other->angle;
@@ -109,9 +103,6 @@
 {
 	//setVisibility (true); //FIXME-4 needed?
 
-	while (!floatimage.isEmpty())
-		delete floatimage.takeFirst();
-
 	while (!xlink.isEmpty())
 		delete xlink.takeFirst();
 }
@@ -218,15 +209,15 @@
 		standardFlags->setVisibility(v);
 		LinkableMapObj::setVisibility (v);
 		int i;
-		for (i=0; i<floatimage.size(); ++i)
-			floatimage.at(i)->setVisibility (v);
+		for (i=0; i<treeItem->imageCount(); ++i)
+			treeItem->getImageObjNum(i)->setVisibility (v);
 		for (i=0; i<xlink.size(); ++i)	
 			xlink.at(i)->setVisibility ();	
 
 		// Only change children, if I am not scrolled
 		if (! bi->isScrolled() && (bi->depth() < toDepth))
 		{
-			// Now go recursivly through all children
+			// Now go recursivly through all children //FIXME-3 are there multiple calls for lower level items???
 			for (i=0; i<treeItem->branchCount(); ++i)
 				treeItem->getBranchObjNum(i)->setVisibility (v,toDepth);	
 		}
@@ -264,8 +255,8 @@
 
 void BranchObj::positionContents()
 {
-    for (int i=0; i<floatimage.size(); ++i )
-		floatimage.at(i)->reposition();
+	for (int i=0; i<treeItem->imageCount(); ++i)
+		treeItem->getImageObjNum(i)->reposition();
 	OrnamentedObj::positionContents();
 }
 
@@ -344,37 +335,38 @@
 	QPointF rp;
 
 	topPad=botPad=leftPad=rightPad=0;
-	if (includeImagesVer || includeImagesHor)
+	bool incV=((BranchItem*)treeItem)->getIncludeImagesVer();
+	bool incH=((BranchItem*)treeItem)->getIncludeImagesHor();
+	if (incH || incV)
 	{
-		if (treeItem->imageCount()>0)
+		FloatImageObj *fio;
+		for (int i=0; i<treeItem->imageCount(); ++i )	
 		{
-			for (int i=0; i<floatimage.size(); ++i )
+			fio=treeItem->getImageObjNum(i);
+			rp=fio->getRelPos();
+			if (incV)
 			{
-				rp=floatimage.at(i)->getRelPos();
-				if (includeImagesVer)
+				if (rp.y() < 0) 
+					topPad=max (topPad,-rp.y()-h);
+				if (rp.y()+fio->height() > 0)
+					botPad=max (botPad,rp.y()+fio->height());
+			}		
+			if (incH)
+			{
+				if (orientation==LinkableMapObj::RightOfCenter)
 				{
-					if (rp.y() < 0) 
-						topPad=max (topPad,-rp.y()-h);
-					if (rp.y()+floatimage.at(i)->height() > 0)
-						botPad=max (botPad,rp.y()+floatimage.at(i)->height());
-				}		
-				if (includeImagesHor)
+					if (-rp.x()-w > 0) 
+						leftPad=max (leftPad,-rp.x()-w);
+					if (rp.x()+fio->width() > 0)
+						rightPad=max (rightPad,rp.x()+fio->width());
+				} else
 				{
-					if (orientation==LinkableMapObj::RightOfCenter)
-					{
-						if (-rp.x()-w > 0) 
-							leftPad=max (leftPad,-rp.x()-w);
-						if (rp.x()+floatimage.at(i)->width() > 0)
-							rightPad=max (rightPad,rp.x()+floatimage.at(i)->width());
-					} else
-					{
-						if (rp.x()< 0) 
-							leftPad=max (leftPad,-rp.x());
-						if (rp.x()+floatimage.at(i)->width() > w)
-							rightPad=max (rightPad,rp.x()+floatimage.at(i)->width()-w);
-					}
-				}		
-			}	
+					if (rp.x()< 0) 
+						leftPad=max (leftPad,-rp.x());
+					if (rp.x()+fio->width() > w)
+						rightPad=max (rightPad,rp.x()+fio->width()-w);
+				}
+			}		
 		}	
 		h+=topPad+botPad;
 		w+=leftPad+rightPad;
@@ -478,9 +470,7 @@
 			changed=true;
 		}	
 	}
-
-	if (changed)
-		updateContentSize();
+	updateContentSize();
 }
 
 
@@ -523,47 +513,9 @@
 	return NULL;
 }
 
-void BranchObj::setIncludeImagesVer(bool b)
-{
-	includeImagesVer=b;
-	calcBBoxSize();
-	positionBBox();
-	requestReposition();
-}
-
-bool BranchObj::getIncludeImagesVer()
-{
-	return includeImagesVer;
-}
-
-void BranchObj::setIncludeImagesHor(bool b)
-{
-	includeImagesHor=b;
-	calcBBoxSize();
-	positionBBox();
-	requestReposition();
-}
-
-bool BranchObj::getIncludeImagesHor()
-{
-	return includeImagesHor;
-}
-
-QString BranchObj::getIncludeImageAttr()
-{
-	QString a;
-	if (includeImagesVer)
-		a=attribut ("incImgV","true");
-	else
-		a=attribut ("incImgV","false");
-	if (includeImagesHor)
-		a+=attribut ("incImgH","true");
-	else
-		a+=attribut ("incImgH","false");
-	return a;	
-}
-
-FloatImageObj* BranchObj::addFloatImage ()
+ 
+// FIXME-3 FloatImageObj* BranchObj::addFloatImage ()
+/*
 {
 	FloatImageObj *newfi=new FloatImageObj (scene,this);
 	floatimage.append (newfi);
@@ -571,15 +523,15 @@
 		newfi->setVisibility (false);
 	else	
 		newfi->setVisibility(visible);
-		/*
-	calcBBoxSize();
-	positionBBox();
-	*/
+	//calcBBoxSize();
+	//positionBBox();
 	requestReposition();
 	return newfi;
 }
+*/
 
-FloatImageObj* BranchObj::addFloatImage (FloatImageObj *fio)
+//FIXME-3 FloatImageObj* BranchObj::addFloatImage (FloatImageObj *fio)
+/*
 {
 	FloatImageObj *newfi=new FloatImageObj (scene,this);
 	floatimage.append (newfi);
@@ -588,15 +540,14 @@
 		newfi->setVisibility (false);
 	else	
 		newfi->setVisibility(visible);
-		/*
-	calcBBoxSize();
-	positionBBox();
-	*/
+	//calcBBoxSize();
+	//positionBBox();
 	requestReposition();
 	return newfi;
 }
+*/
 
-FloatImageObj* BranchObj::getFirstFloatImage ()
+/* FIXME-3 FloatImageObj* BranchObj::getFirstFloatImage ()
 {
     return floatimage.first();
 }
@@ -606,7 +557,7 @@
     return floatimage.last();
 }
 
-FloatImageObj* BranchObj::getFloatImageNum (const uint &i)
+FIXME -3 FloatImageObj* BranchObj::getFloatImageNum (const uint &i)
 {
     return floatimage.at(i);
 }
@@ -619,6 +570,7 @@
 	positionBBox();
 	requestReposition();
 }
+*/
 
 void BranchObj::savePosInAngle ()
 {
@@ -849,11 +801,9 @@
 			(have been NULL at least in calcBBoxSizeWithChilds...)
 */			
 
-/*
-	FIXME-3 for (int i=0; i<floatimage.size(); ++i)
-		if (!floatimage.at(i)->isHidden())
-			r=addBBox(floatimage.at(i)->getTotalBBox(),r);
-	*/	
+	for (int i=0; i<treeItem->imageCount(); ++i)
+		if (!treeItem->isHidden())
+			r=addBBox(treeItem->getImageObjNum(i)->getTotalBBox(),r);
 	return r;
 }
 
diff -r 9db215a4ad53 -r 5987f9f15bac branchobj.h
--- a/branchobj.h	Mon Jul 27 12:53:17 2009 +0000
+++ b/branchobj.h	Mon Aug 03 10:42:12 2009 +0000
@@ -54,18 +54,14 @@
 	virtual XLinkObj* XLinkAt (int);		// return reference of XLinkObj 
 	virtual BranchObj* XLinkTargetAt (int);
 
-	void setIncludeImagesVer(bool);
-	bool getIncludeImagesVer();
-	void setIncludeImagesHor(bool);
-	bool getIncludeImagesHor();
-	QString getIncludeImageAttr();
-
+/* FIXME-3
 	virtual FloatImageObj* addFloatImage();
 	virtual FloatImageObj* addFloatImage(FloatImageObj*);
 	virtual void removeFloatImage(FloatImageObj*);
     virtual FloatImageObj* getFirstFloatImage();
     virtual FloatImageObj* getLastFloatImage();
-	virtual FloatImageObj* getFloatImageNum(const uint &);
+*/	
+//FIXME-3	virtual FloatImageObj* getFloatImageNum(const uint &);
 protected:	
 	virtual void savePosInAngle();					// write pos in angle for resorting			
 public:	
@@ -86,16 +82,13 @@
 	virtual bool animate();
 
 protected:
-	QList<FloatImageObj*> floatimage;// child images
+	//FIXME-3 QList<FloatImageObj*> floatimage;// child images
 	QList<XLinkObj*> xlink;			// xlinks to other branches
 
 	AnimPoint anim;
 
 public:	
 	float angle;					// used in mainbranch to reorder mainbranches
-protected:	
-	bool includeImagesVer;			// include floatimages in bbox vertically
-	bool includeImagesHor;			// include floatimages in bbox horizontally
 };
 
 
diff -r 9db215a4ad53 -r 5987f9f15bac branchpropwindow.cpp
--- a/branchpropwindow.cpp	Mon Jul 27 12:53:17 2009 +0000
+++ b/branchpropwindow.cpp	Mon Aug 03 10:42:12 2009 +0000
@@ -17,6 +17,7 @@
 	setCaption(vymName +" - " +tr ("Property Editor","Window caption"));
 
 	branch=NULL;
+	branchItem=NULL;
 	model=NULL;
 
 	ui.tabWidget->setEnabled(false);
@@ -28,7 +29,7 @@
 	ui.framePenColorButton->setPixmap (pix);
 	ui.frameBrushColorButton->setPixmap (pix);
 
-	// Create Model and View to hold attributes 
+	// Create Model and View to hold attributes		// FIXME-3
 	/*
 	attributeModel = new QStandardItemModel (1,3,this);
 	attributeModel->setHeaderData(0, Qt::Horizontal, tr("Name","Branchprop window: Attribute name"));
@@ -58,97 +59,101 @@
 	settings.setValue( "/satellite/propertywindow/showWithMain",isVisible() );
 }
 
-void BranchPropertyWindow::setBranch (BranchObj *bo)	
+void BranchPropertyWindow::setBranch (BranchItem *bi)	
 {
 	disconnectSignals();
-	branch=bo;
-	if (bo) 
+	branchItem=bi;
+	if (branchItem)
 	{
-		BranchItem *bi=(BranchItem*)(bo->getTreeItem());
-		ui.tabWidget->setEnabled (true);
 
-		// Frame
-		FrameObj::FrameType t=branch->getFrameType();
-		if (t==FrameObj::NoFrame)
+		branch=(BranchObj*)(branchItem->getLMO());
+		if (branch)		// FIXME-3 move to branchItem later, when Frame is ported...
 		{
-			ui.frameTypeCombo->setCurrentIndex (0);
-			penColor=Qt::white;
-			brushColor=Qt::white;
-			ui.colorGroupBox->setEnabled (false);
-			ui.framePaddingSpinBox->setEnabled (false);
-			ui.frameWidthSpinBox->setEnabled (false);
-			ui.framePaddingLabel->setEnabled (false);
-			ui.frameBorderLabel->setEnabled (false);
-		} else	
-		{
-			penColor=bo->getFramePenColor();
-			brushColor=bo->getFrameBrushColor();
-			QPixmap pix( 16,16);
-			pix.fill (penColor);
-			ui.framePenColorButton->setPixmap (pix);
-			pix.fill (brushColor);
-			ui.frameBrushColorButton->setPixmap (pix);
-			ui.colorGroupBox->setEnabled (true);
-			ui.framePaddingSpinBox->setEnabled (true);
-			ui.framePaddingSpinBox->setValue (bo->getFramePadding());
-			ui.frameWidthSpinBox->setEnabled (true);
-			ui.frameWidthSpinBox->setValue (bo->getFrameBorderWidth());
-			ui.framePaddingLabel->setEnabled (true);
-			ui.frameBorderLabel->setEnabled (true);
+			ui.tabWidget->setEnabled (true);
 
-			switch (t)
+			// Frame
+			FrameObj::FrameType t=branch->getFrameType();
+			if (t==FrameObj::NoFrame)
 			{
-				case FrameObj::Rectangle: 
-					ui.frameTypeCombo->setCurrentIndex (1);
-					break;
-				case FrameObj::Ellipse: 
-					ui.frameTypeCombo->setCurrentIndex (2);
-					break;
-				default: 
-					break;
+				ui.frameTypeCombo->setCurrentIndex (0);
+				penColor=Qt::white;
+				brushColor=Qt::white;
+				ui.colorGroupBox->setEnabled (false);
+				ui.framePaddingSpinBox->setEnabled (false);
+				ui.frameWidthSpinBox->setEnabled (false);
+				ui.framePaddingLabel->setEnabled (false);
+				ui.frameBorderLabel->setEnabled (false);
+			} else	
+			{
+				penColor=branch->getFramePenColor();
+				brushColor=branch->getFrameBrushColor();
+				QPixmap pix( 16,16);
+				pix.fill (penColor);
+				ui.framePenColorButton->setPixmap (pix);
+				pix.fill (brushColor);
+				ui.frameBrushColorButton->setPixmap (pix);
+				ui.colorGroupBox->setEnabled (true);
+				ui.framePaddingSpinBox->setEnabled (true);
+				ui.framePaddingSpinBox->setValue (branch->getFramePadding());
+				ui.frameWidthSpinBox->setEnabled (true);
+				ui.frameWidthSpinBox->setValue (branch->getFrameBorderWidth());
+				ui.framePaddingLabel->setEnabled (true);
+				ui.frameBorderLabel->setEnabled (true);
+
+				switch (t)
+				{
+					case FrameObj::Rectangle: 
+						ui.frameTypeCombo->setCurrentIndex (1);
+						break;
+					case FrameObj::Ellipse: 
+						ui.frameTypeCombo->setCurrentIndex (2);
+						break;
+					default: 
+						break;
+				}
+			}	
+			
+			// Link
+			if (branchItem->getHideLinkUnselected())
+				ui.hideLinkIfUnselected->setCheckState (Qt::Checked);
+			else	
+				ui.hideLinkIfUnselected->setCheckState (Qt::Unchecked);
+
+			// Layout
+			if (branchItem->getIncludeImagesVer())
+				ui.incImgVer->setCheckState (Qt::Checked);
+			else	
+				ui.incImgVer->setCheckState (Qt::Unchecked);
+			if (branchItem->getIncludeImagesHor())
+				ui.incImgHor->setCheckState (Qt::Checked);
+			else	
+				ui.incImgHor->setCheckState (Qt::Unchecked);
+
+	/*
+			// Attributes
+			attributeModel->removeRows(0, attributeModel->rowCount(), QModelIndex());
+
+			// FIXME-3 some samples for attribute testing
+			QStringList attrTypes=mapEditor->attributeTable()->getTypes();
+			for (int i=0; i<attrTypes.count()-1;i++)
+			{
+				attributeModel->insertRow (i,QModelIndex ());
+				attributeModel->setData(attributeModel->index(i, 0, QModelIndex()), QString ("Name %1").arg(i));
+				attributeModel->setData(attributeModel->index(i, 1, QModelIndex()), i);
+				attributeModel->setData(attributeModel->index(i, 2, QModelIndex()), attrTypes.at(i));
 			}
-		}	
-		
-		// Link
-		if (bi->getHideLinkUnselected())
-			ui.hideLinkIfUnselected->setCheckState (Qt::Checked);
-		else	
-			ui.hideLinkIfUnselected->setCheckState (Qt::Unchecked);
 
-		// Layout
-		if (branch->getIncludeImagesVer())
-			ui.incImgVer->setCheckState (Qt::Checked);
-		else	
-			ui.incImgVer->setCheckState (Qt::Unchecked);
-		if (branch->getIncludeImagesHor())
-			ui.incImgHor->setCheckState (Qt::Checked);
-		else	
-			ui.incImgHor->setCheckState (Qt::Unchecked);
 
-/*
-		// Attributes
-		attributeModel->removeRows(0, attributeModel->rowCount(), QModelIndex());
+			ui.attributeTableView->resizeColumnsToContents();
 
-		// FIXME-3 some samples for attribute testing
-		QStringList attrTypes=mapEditor->attributeTable()->getTypes();
-		for (int i=0; i<attrTypes.count()-1;i++)
-		{
-			attributeModel->insertRow (i,QModelIndex ());
-			attributeModel->setData(attributeModel->index(i, 0, QModelIndex()), QString ("Name %1").arg(i));
-			attributeModel->setData(attributeModel->index(i, 1, QModelIndex()), i);
-			attributeModel->setData(attributeModel->index(i, 2, QModelIndex()), attrTypes.at(i));
-		}
+			// Initialize Delegate
+			delegate.setAttributeTable (mapEditor->attributeTable());
+			ui.attributeTableView->setItemDelegate (&delegate);
+	*/
 
-
-		ui.attributeTableView->resizeColumnsToContents();
-
-		// Initialize Delegate
-		delegate.setAttributeTable (mapEditor->attributeTable());
-		ui.attributeTableView->setItemDelegate (&delegate);
-*/
-
-		// Finally activate signals
-		connectSignals();
+			// Finally activate signals
+			connectSignals();
+		} // BranchObj	
 	} else
 	{
 		ui.tabWidget->setEnabled (false);
@@ -159,7 +164,7 @@
 {
 	model=m;
 	if (model) 
-		setBranch (model->getSelectedBranchObj() );
+		setBranch (model->getSelectedBranchItem() );
 	else
 		ui.tabWidget->setEnabled (false);
 		
@@ -180,7 +185,7 @@
 				model->setFramePadding (5); 
 				break;
 		}
-		setBranch (branch);
+		setBranch (branchItem);
 	}	
 }
 
@@ -222,7 +227,7 @@
 
 void BranchPropertyWindow::linkHideUnselectedChanged (int i)
 {
-	if (!branch) return;
+	if (!branchItem) return;
 	model->setHideLinkUnselected(i);
 }
 
diff -r 9db215a4ad53 -r 5987f9f15bac branchpropwindow.h
--- a/branchpropwindow.h	Mon Jul 27 12:53:17 2009 +0000
+++ b/branchpropwindow.h	Mon Aug 03 10:42:12 2009 +0000
@@ -20,7 +20,7 @@
 public:
 	BranchPropertyWindow (QWidget *parent=0);
 	~BranchPropertyWindow ();
-	void setBranch (BranchObj *);
+	void setBranch (BranchItem *);
 	void setModel (VymModel *);
 
 private slots:
@@ -48,6 +48,7 @@
 	Ui::BranchPropertyWindow ui;
 
 	BranchObj *branch;
+	BranchItem *branchItem;
 	VymModel *model;
 
 	QColor penColor;
diff -r 9db215a4ad53 -r 5987f9f15bac linkablemapobj.cpp
--- a/linkablemapobj.cpp	Mon Jul 27 12:53:17 2009 +0000
+++ b/linkablemapobj.cpp	Mon Aug 03 10:42:12 2009 +0000
@@ -440,6 +440,7 @@
 	// updateLinkGeometry is called from move, but called from constructor we don't
 	// have parents yet...
 
+//cout <<"LMO::updateLinkGeometry: "<<treeItem->getHeadingStd()<<"  "<<parObj<<endl;
 	if (!parObj)	
 	{
 		// If I am a mapcenter, set childPos to middle of MapCenterObj
@@ -460,7 +461,8 @@
 			bottomlineY=bbox.top() + bbox.height()/2;	// draw link to middle (of frame)
 			break;
 		case Bottom:
-			bottomlineY=bbox.bottom()-1;	// draw link to bottom of box
+			//bottomlineY=bbox.bottom()-1;	// draw link to bottom of box
+			bottomlineY=bbox.bottom()-botPad;
 			break;
 	}
 	
@@ -567,7 +569,7 @@
 {
 }
 
-void LinkableMapObj::requestReposition()
+void LinkableMapObj::requestReposition()	//FIXME-3 needed?
 {
 	if (!repositionRequest)
 	{
diff -r 9db215a4ad53 -r 5987f9f15bac main.cpp
--- a/main.cpp	Mon Jul 27 12:53:17 2009 +0000
+++ b/main.cpp	Mon Aug 03 10:42:12 2009 +0000
@@ -4,8 +4,6 @@
 #include <iostream>
 using namespace std;
 
-#include "adaptor.h"  //FIXME-3
-
 #include "flagrow.h"
 #include "flagrowobj.h"
 #include "mainwindow.h"
@@ -228,6 +226,7 @@
 		return 0;
 	}	
 
+	// Enable some last minute cleanup
     QObject::connect( &app, SIGNAL(lastWindowClosed()), &app, SLOT(quit()) );
 
     return app.exec();
diff -r 9db215a4ad53 -r 5987f9f15bac mainwindow.cpp
--- a/mainwindow.cpp	Mon Jul 27 12:53:17 2009 +0000
+++ b/mainwindow.cpp	Mon Aug 03 10:42:12 2009 +0000
@@ -3248,7 +3248,7 @@
 
 void Main::changeSelection (VymModel *model, const QItemSelection &newsel, const QItemSelection &oldsel)
 {
-	branchPropertyWindow->setModel (model ); //FIXME-2 this used to be called from BranchObj::select(). Maybe use signal now...
+	branchPropertyWindow->setModel (model ); //FIXME-3 this used to be called from BranchObj::select(). Maybe use signal now...
 
 	if (model && model==currentModel() )
 	{
@@ -3363,7 +3363,7 @@
 		{
 			if (selbi)
 			{
-				// Take care of links  // FIXME-1
+				// Take care of links  // updateActions: FIXME-1
 				/*
 				if (bo->countXLinks()==0)
 				{
diff -r 9db215a4ad53 -r 5987f9f15bac mapeditor.cpp
--- a/mapeditor.cpp	Mon Jul 27 12:53:17 2009 +0000
+++ b/mapeditor.cpp	Mon Aug 03 10:42:12 2009 +0000
@@ -1059,6 +1059,7 @@
 					"moveRel "+pnow,
 					QString("Move %1 to relative position %2").arg(model->getObjectName(seli)).arg(pnow));
 
+				cout << "ME::release mouse\n";
 				fio->getParObj()->requestReposition();
 				model->reposition();
 			}	
@@ -1417,10 +1418,10 @@
 	
 	if (ti->isBranchLikeType())
 	{
+	//	cout << "  ->updating...\n";
 		BranchObj *bo=(BranchObj*) ( ((MapItem*)ti)->getLMO());
 		bo->updateData();
 	}
-
 }
 
 void MapEditor::setSelectionColor (QColor col)
diff -r 9db215a4ad53 -r 5987f9f15bac ornamentedobj.cpp
--- a/ornamentedobj.cpp	Mon Jul 27 12:53:17 2009 +0000
+++ b/ornamentedobj.cpp	Mon Aug 03 10:42:12 2009 +0000
@@ -163,8 +163,11 @@
 	return frame->getBrushColor ();
 }
 
-void OrnamentedObj::positionContents()
+//#include <iostream>  
+//using namespace std;
+void OrnamentedObj::positionContents()	//FIXME-4 called multiple times for each object after moving an image with mouse
 {
+//cout << "OO::positionContents topPad="<<topPad<<"  botPad="<<botPad<<"  "<<treeItem->getHeadingStd()<<endl;
 	double d=frame->getPadding()/2;
 	double x=absPos.x();
 	double y=absPos.y();
@@ -182,8 +185,8 @@
 					);
 	standardFlags->move (ox +x + heading->getWidth() + systemFlags->getBBox().width() , oy + y );
 
-	ornamentsBBox.moveTopLeft ( QPointF ((int)(ox+x),(int)(oy+y)));
-	clickBox.moveTopLeft (QPointF ((int)(ox + x), (int)(oy + y)));
+	ornamentsBBox.moveTopLeft ( QPointF (ox+x,oy+y));
+	clickBox.moveTopLeft (QPointF (ox + x, oy + y));
 }
 
 void OrnamentedObj::move (double x, double y)
diff -r 9db215a4ad53 -r 5987f9f15bac version.h
--- a/version.h	Mon Jul 27 12:53:17 2009 +0000
+++ b/version.h	Mon Aug 03 10:42:12 2009 +0000
@@ -7,7 +7,7 @@
 #define __VYM_VERSION "1.13.0"
 //#define __VYM_CODENAME "Codename: RC-1"
 #define __VYM_CODENAME "Codename: development version, not for production!"
-#define __VYM_BUILD_DATE "2009-07-07"
+#define __VYM_BUILD_DATE "2009-08-03"
 
 
 bool checkVersion(const QString &);
diff -r 9db215a4ad53 -r 5987f9f15bac vym.pro
--- a/vym.pro	Mon Jul 27 12:53:17 2009 +0000
+++ b/vym.pro	Mon Aug 03 10:42:12 2009 +0000
@@ -1,7 +1,7 @@
 TEMPLATE	= app
 LANGUAGE	= C++
 
-CONFIG	+= qt warn_on release debug
+CONFIG	+= qt warn_on debug
 CONFIG += x86 ppc
 CONFIG += qdbus
 
diff -r 9db215a4ad53 -r 5987f9f15bac vymmodel.cpp
--- a/vymmodel.cpp	Mon Jul 27 12:53:17 2009 +0000
+++ b/vymmodel.cpp	Mon Aug 03 10:42:12 2009 +0000
@@ -1497,7 +1497,6 @@
 			QString("Set heading of %1 to \"%2\"").arg(getObjectName(selbi)).arg(s) );
 		selbi->setHeading(s );
 		emitDataHasChanged ( selbi);	//FIXME-3 maybe emit signal from TreeItem? 
-
 		reposition();
 		emitSelectionChanged();
 	}
@@ -1727,55 +1726,46 @@
 	}	
 }
 
-void VymModel::setIncludeImagesVer(bool b)	//FIXME-2
-{
-/*
+void VymModel::setIncludeImagesVer(bool b)
+{
 	BranchItem *bi=getSelectedBranchItem();
-	if (ti)
+	if (bi)
 	{
-		BranchObj *bo=bi->getLMO();
-		if (bo)
-		{
-			QString u= b ? "false" : "true";
-			QString r=!b ? "false" : "true";
-			
-			saveState(
-				bo,
-				QString("setIncludeImagesVertically (%1)").arg(u),
-				bo, 
-				QString("setIncludeImagesVertically (%1)").arg(r),
-				QString("Include images vertically in %1").arg(getObjectName(bo))
-			);	
-			bo->setIncludeImagesVer(b);
-			reposition();
-		}	
+		QString u= b ? "false" : "true";
+		QString r=!b ? "false" : "true";
+		
+		saveState(
+			bi,
+			QString("setIncludeImagesVertically (%1)").arg(u),
+			bi, 
+			QString("setIncludeImagesVertically (%1)").arg(r),
+			QString("Include images vertically in %1").arg(getObjectName(bi))
+		);	
+		bi->setIncludeImagesVer(b);
+		emitDataHasChanged ( bi);	
+		reposition();
 	}	
-*/}
-
-void VymModel::setIncludeImagesHor(bool b)	//FIXME-2
-{
-/*
-	TreeItem *bi=getSelectedBranchItem();
-	if (ti)
+}
+
+void VymModel::setIncludeImagesHor(bool b)	
+{
+	BranchItem *bi=getSelectedBranchItem();
+	if (bi)
 	{
-		BranchObj *bo=bi->getLMO();
-		if (bo)
-		{
-			QString u= b ? "false" : "true";
-			QString r=!b ? "false" : "true";
-			
-			saveState(
-				bo,
-				QString("setIncludeImagesHorizontally (%1)").arg(u),
-				bo, 
-				QString("setIncludeImagesHorizontally (%1)").arg(r),
-				QString("Include images horizontally in %1").arg(getObjectName(bo))
-			);	
-			bo->setIncludeImagesHor(b);
-			reposition();
-		}	
+		QString u= b ? "false" : "true";
+		QString r=!b ? "false" : "true";
+		
+		saveState(
+			bi,
+			QString("setIncludeImagesHorizontally (%1)").arg(u),
+			bi, 
+			QString("setIncludeImagesHorizontally (%1)").arg(r),
+			QString("Include images horizontally in %1").arg(getObjectName(bi))
+		);	
+		bi->setIncludeImagesHor(b);
+		emitDataHasChanged ( bi);
+		reposition();
 	}	
-	*/
 }
 
 void VymModel::setHideLinkUnselected (bool b)//FIXME-2
@@ -2235,7 +2225,7 @@
 	return false;
 }
 
-void VymModel::deleteSelection()
+void VymModel::deleteSelection()	// FIXME-2 include fix for deleted mapcenters from 1.12.4
 {
 	BranchItem *selbi=getSelectedBranchItem();
 
@@ -4160,7 +4150,7 @@
 	}
 }	
 
-void VymModel::setMapBackgroundImage (const QString &fn)	//FIXME-2 missing savestate
+void VymModel::setMapBackgroundImage (const QString &fn)	//FIXME-2 missing savestate, move to ME
 {
 	QColor oldcol=mapScene->backgroundBrush().color();
 	/*
@@ -4473,7 +4463,7 @@
     }
 }
 
-/* FIXME-3
+/* FIXME-3 Playing with DBUS...
 QDBusVariant VymModel::query (const QString &query)
 {
 	TreeItem *selti=getSelectedItem();
@@ -4484,6 +4474,11 @@
 }
 */
 
+void VymModel::testslot()	//FIXME-3
+{
+	cout << "VM::testslot called\n";
+}
+
 void VymModel::selectMapSelectionColor()
 {
 	QColor col = QColorDialog::getColor( defLinkColor, NULL);
diff -r 9db215a4ad53 -r 5987f9f15bac vymmodel.h
--- a/vymmodel.h	Mon Jul 27 12:53:17 2009 +0000
+++ b/vymmodel.h	Mon Aug 03 10:42:12 2009 +0000
@@ -540,6 +540,9 @@
 private:
 AdaptorModel *adaptorModel; //FIXME-3
 
+public slots:
+	void testslot();
+
 ////////////////////////////////////////////
 // Selection related 
 ////////////////////////////////////////////
diff -r 9db215a4ad53 -r 5987f9f15bac xml-vym.cpp
--- a/xml-vym.cpp	Mon Jul 27 12:53:17 2009 +0000
+++ b/xml-vym.cpp	Mon Aug 03 10:42:12 2009 +0000
@@ -354,7 +354,7 @@
     return "the document is not in the VYM file format";
 }
 
-bool parseVYMHandler::readBranchAttr (const QXmlAttributes& a)	//FIXME-2
+bool parseVYMHandler::readBranchAttr (const QXmlAttributes& a)	
 {
 	mainWindow->setProgressValue (branchesCurrent++);
 
@@ -363,12 +363,13 @@
 	if (!readOOAttr(a)) return false;
 
 	if (!a.value( "scrolled").isEmpty() )
-		lastBranch->toggleScroll();	//FIXME-3 in endElement unscroll again, if branch is still empty 
+		lastBranch->toggleScroll();	
 		// (interesting for import of KDE bookmarks)
-/*
-	if (!a.value( "frameType").isEmpty() ) 
+
+/*	if (!a.value( "frameType").isEmpty() )  FIXME-2
 		lastOO->setFrameType (a.value("frameType")); //Compatibility 1.8.1
 
+*/	
 	if (!a.value( "incImgV").isEmpty() ) 
 	{	
 		if (a.value("incImgV")=="true")
@@ -383,7 +384,6 @@
 		else	
 			lastBranch->setIncludeImagesHor(false);
 	}	
-*/	
 	return true;	
 }