xml-vym.cpp
author insilmaril
Mon, 27 Apr 2009 12:07:15 +0000
changeset 756 a8a5c7288f57
parent 754 db0ec4bcf416
child 758 04039e47ac74
permissions -rw-r--r--
relinking branches and removing branches works
     1 #include "xml-vym.h"
     2 
     3 #include <QMessageBox>
     4 #include <QColor>
     5 #include <QTextStream>
     6 #include <iostream>
     7 #include <typeinfo>
     8 
     9 #include "branchitem.h"
    10 #include "misc.h"
    11 #include "settings.h"
    12 #include "linkablemapobj.h"
    13 #include "mainwindow.h"
    14 #include "version.h"
    15 
    16 static FloatObj *lastFloat;
    17 static OrnamentedObj *lastOO;
    18 
    19 extern Main *mainWindow;
    20 extern Settings settings;
    21 extern QString vymVersion;
    22 
    23 bool parseVYMHandler::startDocument()
    24 {
    25     errorProt = "";
    26     state = StateInit;
    27     laststate = StateInit;
    28 	stateStack.clear();
    29 	stateStack.append(StateInit);
    30 	htmldata="";
    31 	isVymPart=false;
    32     return true;
    33 }
    34 
    35 bool parseVYMHandler::startElement  ( const QString&, const QString&,
    36                     const QString& eName, const QXmlAttributes& atts ) 
    37 {
    38     QColor col;
    39 	/* Testing
    40 	cout << "startElement <"<< qPrintable(eName)
    41 		<<">  state="<<state 
    42 		<<"  laststate="<<stateStack.last()
    43 		<<"   loadMode="<<loadMode
    44 	//	<<"       line="<<QXmlDefaultHandler::lineNumber()
    45 		<<endl;
    46 	*/	
    47 	stateStack.append (state);	
    48     if ( state == StateInit && (eName == "vymmap")  ) 
    49 	{
    50         state = StateMap;
    51 		branchesTotal=branchesCurrent=0;
    52 
    53 		if (loadMode==NewMap )
    54 		{
    55 			// Create mapCenter
    56 			model->clear();
    57 			lastBranchItem=NULL;
    58 
    59 			if (!atts.value( "author").isEmpty() )
    60 				model->setAuthor(atts.value( "author" ) );
    61 			if (!atts.value( "comment").isEmpty() )
    62 				model->setComment (atts.value( "comment" ) );
    63 			if (!atts.value( "branchCount").isEmpty() )
    64 			{
    65 				branchesTotal=atts.value("branchCount").toInt();
    66 				if (branchesTotal>10)
    67 				{
    68 					mainWindow->setProgressMinimum (0);
    69 					mainWindow->setProgressMaximum (branchesTotal);
    70 					mainWindow->setProgressValue(0);
    71 				}
    72 			} else
    73 			{
    74 				mainWindow->setProgressMinimum (0);
    75 				mainWindow->setProgressMaximum (0);
    76 				mainWindow->setProgressValue(0);
    77 			}
    78 
    79 				
    80 			if (!atts.value( "backgroundColor").isEmpty() )
    81 			{
    82 				col.setNamedColor(atts.value("backgroundColor"));
    83 				model->getScene()->setBackgroundBrush(col);
    84 			}	    
    85 			if (!atts.value( "selectionColor").isEmpty() )
    86 			{
    87 				col.setNamedColor(atts.value("selectionColor"));
    88 				model->setSelectionColor(col);
    89 			}	    
    90 			if (!atts.value( "linkColorHint").isEmpty() ) 
    91 			{
    92 				if (atts.value("linkColorHint")=="HeadingColor")
    93 					model->setMapLinkColorHint(LinkableMapObj::HeadingColor);
    94 				else
    95 					model->setMapLinkColorHint(LinkableMapObj::DefaultColor);
    96 			}
    97 			if (!atts.value( "linkStyle").isEmpty() ) 
    98 				model->setMapLinkStyle(atts.value("linkStyle"));
    99 			if (!atts.value( "linkColor").isEmpty() ) 
   100 			{
   101 				col.setNamedColor(atts.value("linkColor"));
   102 				model->setMapDefLinkColor(col);
   103 			}	
   104 			if (!atts.value( "defXLinkColor").isEmpty() ) 
   105 			{
   106 				col.setNamedColor(atts.value("defXLinkColor"));
   107 				model->setMapDefXLinkColor(col);
   108 			}	
   109 			if (!atts.value( "defXLinkWidth").isEmpty() ) 
   110 				model->setMapDefXLinkWidth(atts.value("defXLinkWidth").toInt ());
   111 		}	
   112 		// Check version
   113 		if (!atts.value( "version").isEmpty() ) 
   114 		{
   115 			if (!checkVersion(atts.value("version")))
   116 				QMessageBox::warning( 0, "Warning: Version Problem" ,
   117 				   "<h3>Map is newer than VYM</h3>"
   118 				   "<p>The map you are just trying to load was "
   119 				   "saved using vym " +atts.value("version")+". "
   120 				   "The version of this vym is " + vymVersion + 
   121 				   ". If you run into problems after pressing "
   122 				   "the ok-button below, updating vym should help.");
   123 			else	   
   124 				model->setVersion(atts.value( "version" ));
   125 
   126 		}
   127 
   128 	} else if ( eName == "select" && state == StateMap ) 
   129 	{
   130 		state=StateMapSelect;
   131 	} else if ( eName == "setting" && state == StateMap ) 
   132 	{
   133 		state=StateMapSetting;
   134 		if (loadMode==NewMap)
   135 			readSettingAttr (atts);
   136 	} else if ( eName == "mapcenter" && state == StateMap ) 
   137 	{
   138 		state=StateMapCenter;
   139 		if (loadMode==NewMap)
   140 		{	
   141 			// Really use the found mapcenter as MCO in a new map
   142 
   143 			lastBranchItem=(BranchItem*)model->createMapCenter(); 
   144 		} else
   145 		{
   146 			// Treat the found mapcenter as a branch 
   147 			// in an existing map
   148 			BranchItem *bi=model->getSelectedBranchItem();
   149 			if (bi)
   150 			{
   151 				lastBranchItem=bi;
   152 				if (loadMode==ImportAdd)
   153 				{
   154 					model->createBranch();
   155 					lastBranchItem=model->getSelectedBranchItem();
   156 				} //else
   157 					//FIXME-3 lastBranch->clear();
   158 			} else
   159 				return false;
   160 		}
   161 		readBranchAttr (atts);
   162 	} else if ( 
   163 		(eName == "standardflag" ||eName == "standardFlag") && 
   164 		(state == StateMapCenter || state==StateBranch)) 
   165 	{
   166 		state=StateStandardFlag;
   167 	} else if ( eName == "heading" && (state == StateMapCenter||state==StateBranch)) 
   168 	{
   169 		laststate=state;
   170 		state=StateHeading;
   171 		if (!atts.value( "textColor").isEmpty() ) 
   172 		{
   173 			col.setNamedColor(atts.value("textColor"));
   174 			//FIXME-2 lastBranch->setColor(col );
   175 		}	    
   176 	} else if ( eName == "note" && 
   177 				(state == StateMapCenter ||state==StateBranch))
   178 	{	// only for backward compatibility (<1.4.6). Use htmlnote now.
   179 		state=StateNote;
   180 		if (!readNoteAttr (atts) ) return false;
   181 	} else if ( eName == "htmlnote" && state == StateMapCenter) 
   182 	{
   183 		laststate=state;
   184 		state=StateHtmlNote;
   185     } else if ( eName == "floatimage" && 
   186 				(state == StateMapCenter ||state==StateBranch)) 
   187 	{
   188 		state=StateFloatImage;
   189         //FIXME-2lastBranch->addFloatImage();
   190 		//FIXME-2lastFloat=lastBranch->getLastFloatImage();
   191 		if (!readFloatImageAttr(atts)) return false;
   192 	} else if ( (eName == "branch"||eName=="floatimage") && state == StateMap) 
   193 	{
   194 		// This is used in vymparts, which have no mapcenter!
   195 		isVymPart=true;
   196 		TreeItem *ti=model->getSelectedItem();
   197 		if (!ti)
   198 		{
   199 			// If a vym part is _loaded_ (not imported), 
   200 			// selection==lmo==NULL
   201 			// Treat it like ImportAdd then...
   202 			loadMode=ImportAdd;
   203 			// FIXME-3 lmo=model->first()->getLMO();		
   204 			// Do we really have no MCO when loading?????
   205 			cout << "xml-vym aborted\n";
   206 		}	
   207 		if (ti && ti->isBranchLikeType() )
   208 		{
   209 			lastBranchItem=(BranchItem*)ti;
   210 			if (eName=="branch")
   211 			{
   212 				state=StateBranch;
   213 				if (loadMode==ImportAdd)
   214 				{
   215 					model->createBranch();
   216 					lastBranchItem=model->getSelectedBranchItem();
   217 					
   218 				} else
   219 					//FIXME-2 lastBranch->clear();
   220 				readBranchAttr (atts);
   221 			} else if (eName=="floatimage")
   222 			{
   223 				state=StateFloatImage;
   224 				//FIXME-2 lastBranch->addFloatImage();
   225 				//FIXME-2 lastFloat=lastBranch->getLastFloatImage();
   226 				if (!readFloatImageAttr(atts)) return false;
   227 			} else return false;
   228 		} else return false;
   229 	} else if ( eName == "branch" && state == StateMapCenter) 
   230 	{
   231 		state=StateBranch;
   232 		model->createBranch();
   233 		lastBranchItem=model->getSelectedBranchItem();
   234 		readBranchAttr (atts);
   235 	} else if ( eName == "htmlnote" && state == StateBranch) 
   236 	{
   237 		laststate=state;
   238 		state=StateHtmlNote;
   239 		no.clear();
   240 		if (!atts.value( "fonthint").isEmpty() ) 
   241 			no.setFontHint(atts.value ("fonthint") );
   242 	} else if ( eName == "frame" && (state == StateBranch||state==StateMapCenter)) 
   243 	{
   244 		laststate=state;
   245 		state=StateFrame;
   246 		if (!readFrameAttr(atts)) return false;
   247     } else if ( eName == "xlink" && state == StateBranch ) 
   248 	{
   249 		state=StateBranchXLink;
   250 		if (!readXLinkAttr (atts)) return false;
   251     } else if ( eName == "branch" && state == StateBranch ) 
   252 	{
   253 		model->createBranch();
   254 		lastBranchItem=model->getSelectedBranchItem();
   255 		readBranchAttr (atts);
   256     } else if ( eName == "html" && state == StateHtmlNote ) 
   257 	{
   258 		state=StateHtml;
   259 		htmldata="<"+eName;
   260 		readHtmlAttr(atts);
   261 		htmldata+=">";
   262     } else if ( state == StateHtml ) 
   263 	{
   264 		// accept all while in html mode,
   265 		htmldata+="<"+eName;
   266 		readHtmlAttr(atts);
   267 		htmldata+=">";
   268     } else
   269         return false;   // Error
   270     return true;
   271 }
   272 
   273 bool parseVYMHandler::endElement  ( const QString&, const QString&, const QString &eName)
   274 {
   275 	/* Testing
   276 	cout << "endElement </" <<qPrintable(eName)
   277 		<<">  state=" <<state 
   278 		<<"  laststate=" <<laststate
   279 		<<"  stateStack="<<stateStack.last() 
   280 		<<endl;
   281 	*/
   282     switch ( state ) 
   283 	{
   284 		case StateMap:
   285 			mainWindow->removeProgressBar();
   286 			break;
   287         case StateBranch: 
   288 			model->selectParent();
   289 			lastBranchItem=model->getSelectedBranchItem();
   290 			lastBranchItem->setLastSelectedBranch (0);	// Reset last selected to first child branch
   291             break;
   292         case StateHtml: 
   293 			htmldata+="</"+eName+">";
   294 			if (eName=="html")
   295 			{
   296 				state=StateHtmlNote;  
   297 				htmldata.replace ("<br></br>","<br />");
   298 				no.setNote (htmldata);
   299 				lastBranchItem->setNoteObj (no);
   300 			}	
   301 			break;
   302 		default: 
   303 			break;
   304     }  
   305 	state=stateStack.takeLast();	
   306 	return true;
   307 }
   308 
   309 bool parseVYMHandler::characters   ( const QString& ch)
   310 {
   311 	//cout << "characters \""<<ch<<"\"  state="<<state <<"  laststate="<<laststate<<endl;
   312 
   313 	QString ch_org=quotemeta (ch);
   314     QString ch_simplified=ch.simplifyWhiteSpace();
   315     if ( ch_simplified.isEmpty() ) return true;
   316 
   317     switch ( state ) 
   318     {
   319         case StateInit: break;
   320         case StateMap: break; 
   321 		case StateMapSelect:
   322 			model->select(ch_simplified);
   323 			break;
   324 		case StateMapSetting:break;
   325         case StateMapCenter: break;
   326         case StateNote:
   327 			lastBranchItem->setNote(ch_simplified);
   328 			break;
   329         case StateBranch: break;
   330         case StateStandardFlag: 
   331             //FIXME-2 lastBranchItem->activateStandardFlag(ch_simplified); 
   332             break;
   333         case StateFloatImage: break;
   334         case StateHtmlNote: break;
   335         case StateHtml:
   336 			htmldata+=ch_org;
   337 			break;
   338         case StateHeading: 
   339             model->setHeading(ch_simplified);
   340             break;
   341         default: 
   342 			return false;
   343     }
   344     return true;
   345 }
   346 
   347 QString parseVYMHandler::errorString() 
   348 {
   349     return "the document is not in the VYM file format";
   350 }
   351 
   352 bool parseVYMHandler::readBranchAttr (const QXmlAttributes& a)	//FIXME-2
   353 {
   354 	branchesCurrent++;
   355 	mainWindow->setProgressValue (branchesCurrent);
   356 	//lastOO=lastBranch;
   357 	//lastBranchItem=(BranchItem*)(lastBranch->getTreeItem());
   358 
   359 	if (!readOOAttr(a)) return false;
   360 /*
   361 
   362 	if (!a.value( "scrolled").isEmpty() )
   363 		lastBranchItem->toggleScroll();
   364 	if (!a.value( "frameType").isEmpty() ) 
   365 		lastOO->setFrameType (a.value("frameType")); //Compatibility 1.8.1
   366 
   367 	if (!a.value( "incImgV").isEmpty() ) 
   368 	{	
   369 		if (a.value("incImgV")=="true")
   370 			lastBranch->setIncludeImagesVer(true);
   371 		else	
   372 			lastBranch->setIncludeImagesVer(false);
   373 	}	
   374 	if (!a.value( "incImgH").isEmpty() ) 
   375 	{	
   376 		if (a.value("incImgH")=="true")
   377 			lastBranch->setIncludeImagesHor(true);
   378 		else	
   379 			lastBranch->setIncludeImagesHor(false);
   380 	}	
   381 */	
   382 	return true;	
   383 }
   384 
   385 bool parseVYMHandler::readFrameAttr (const QXmlAttributes& a)
   386 {
   387 	bool ok;
   388 	int x;
   389 	if (lastOO)
   390 	{
   391 		if (!a.value( "frameType").isEmpty() ) 
   392 			lastOO->setFrameType (a.value("frameType"));
   393 		if (!a.value( "penColor").isEmpty() ) 
   394 			lastOO->setFramePenColor (a.value("penColor"));
   395 		if (!a.value( "brushColor").isEmpty() ) 
   396 			lastOO->setFrameBrushColor (a.value("brushColor"));
   397 		if (!a.value( "padding").isEmpty() ) 
   398 		{
   399 			x=a.value("padding").toInt(&ok);
   400 			if (ok) lastOO->setFramePadding(x);
   401 		}	
   402 		if (!a.value( "borderWidth").isEmpty() ) 
   403 		{
   404 			x=a.value("borderWidth").toInt(&ok);
   405 			if (ok) lastOO->setFrameBorderWidth(x);
   406 		}	
   407 	}		
   408 	return true;
   409 }
   410 
   411 bool parseVYMHandler::readOOAttr (const QXmlAttributes& a)
   412 {
   413 	BranchObj *bo=(BranchObj*)lastBranchItem->getLMO();
   414 	if (bo)
   415 	{
   416 		bool okx,oky;
   417 		float x,y;
   418 		if (!a.value( "relPosX").isEmpty() ) 
   419 		{
   420 			if (!a.value( "relPosY").isEmpty() ) 
   421 			{
   422 				x=a.value("relPosX").toFloat (&okx);
   423 				y=a.value("relPosY").toFloat (&oky);
   424 				if (okx && oky  )
   425 				{
   426 					bo->setUseRelPos (true);
   427 					bo->move2RelPos (x,y);
   428 				}	
   429 				else
   430 					return false;   // Couldn't read relPos
   431 			}           
   432 		}           
   433 		if (!a.value( "absPosX").isEmpty() && loadMode==NewMap ) 
   434 		{
   435 			if (!a.value( "absPosY").isEmpty() ) 
   436 			{
   437 				x=a.value("absPosX").toFloat (&okx);
   438 				y=a.value("absPosY").toFloat (&oky);
   439 				if (okx && oky  )
   440 					bo->move(x,y);
   441 				else
   442 					return false;   // Couldn't read absPos
   443 			}           
   444 		}           
   445 		/* FIXME-2
   446 		if (!a.value( "id").isEmpty() ) 
   447 			lastBranchItem->setID (a.value ("id"));
   448 		if (!a.value( "url").isEmpty() ) 
   449 			lastOO->setURL (a.value ("url"));
   450 		if (!a.value( "vymLink").isEmpty() ) 
   451 			lastOO->setVymLink (a.value ("vymLink"));
   452 		if (!a.value( "hideInExport").isEmpty() ) 
   453 			if (a.value("hideInExport")=="true")
   454 				lastOO->getTreeItem()->setHideInExport(true);
   455 
   456 		if (!a.value( "hideLink").isEmpty()) 
   457 		{
   458 			if (a.value ("hideLink") =="true")
   459 				lastOO->setHideLinkUnselected(true);
   460 			else	
   461 				lastOO->setHideLinkUnselected(false);
   462 		}	
   463 		*/
   464 	}
   465 	return true;	
   466 }
   467 
   468 bool parseVYMHandler::readNoteAttr (const QXmlAttributes& a)
   469 {	// only for backward compatibility (<1.4.6). Use htmlnote now.
   470 	no.clear();
   471 	QString fn;
   472 	if (!a.value( "href").isEmpty() ) 
   473 	{
   474 		// Load note
   475 		fn=parseHREF(a.value ("href") );
   476 		QFile file (fn);
   477 		QString s;						// Reading a note
   478 
   479 		if ( !file.open( QIODevice::ReadOnly) )
   480 		{
   481 			qWarning ("parseVYMHandler::readNoteAttr:  Couldn't load "+fn);
   482 			return false;
   483 		}	
   484 		QTextStream stream( &file );
   485 		QString lines;
   486 		while ( !stream.atEnd() ) {
   487 			lines += stream.readLine()+"\n"; 
   488 		}
   489 		file.close();
   490 
   491 		lines ="<html><head><meta name=\"qrichtext\" content=\"1\" /></head><body>"+lines + "</p></body></html>";
   492 		no.setNote (lines);
   493 	}		
   494 	if (!a.value( "fonthint").isEmpty() ) 
   495 		no.setFontHint(a.value ("fonthint") );
   496 	lastBranchItem->setNoteObj(no);
   497 	return true;
   498 }
   499 
   500 bool parseVYMHandler::readFloatImageAttr (const QXmlAttributes& a)
   501 {
   502 	lastOO=lastFloat;
   503 	
   504 	//if (!readOOAttr(a)) return false;
   505 
   506 	if (!a.value( "useOrientation").isEmpty() ) 
   507 	{
   508 		if (a.value ("useOrientation") =="true")
   509 			lastFloat->setUseOrientation (true);
   510 		else	
   511 			lastFloat->setUseOrientation (false);
   512 	}	
   513 	if (!a.value( "href").isEmpty() )
   514 	{
   515 		// Load FloatImage
   516 		if (!lastFloat->load (parseHREF(a.value ("href") ) ))
   517 		{
   518 			QMessageBox::warning( 0, "Warning: " ,
   519 				"Couldn't load float image\n"+parseHREF(a.value ("href") ));
   520 			//FIXME-2 lastBranch->removeFloatImage(((FloatImageObj*)(lastFloat)));
   521 			lastFloat=NULL;
   522 			return true;
   523 		}
   524 		
   525 	}	
   526 	if (!a.value( "floatExport").isEmpty() ) 
   527 	{
   528 		// Only for compatibility. THis is not used since 1.7.11 
   529 		if (a.value ("floatExport") =="true")
   530 			lastFloat->setFloatExport(true);
   531 		else	
   532 			lastFloat->setFloatExport (false);
   533 	}	
   534 	if (!a.value( "zPlane").isEmpty() ) 
   535 		lastFloat->setZValue (a.value("zPlane").toInt ());
   536     float x,y;
   537     bool okx,oky;
   538 	if (!a.value( "relPosX").isEmpty() ) 
   539 	{
   540 		if (!a.value( "relPosY").isEmpty() ) 
   541 		{
   542 			// read relPos
   543 			x=a.value("relPosX").toFloat (&okx);
   544 			y=a.value("relPosY").toFloat (&oky);
   545 			if (okx && oky) 
   546 				
   547 				{
   548 					lastFloat->setRelPos (QPointF (x,y) );
   549 					// make sure floats in mapcenter are repositioned to relative pos
   550 					//FIXME-2 if (lastBranchItem->depth()==0) lastBranch->positionContents();
   551 				}
   552 			else
   553 				// Couldn't read relPos
   554 				return false;  
   555 		}           
   556 	}	
   557 	
   558 	if (!readOOAttr(a)) return false;
   559 
   560 	if (!a.value ("orgName").isEmpty() )
   561 	{
   562 		((FloatImageObj*)(lastFloat))->setOriginalFilename (a.value("orgName"));
   563 	}
   564 	return true;
   565 }
   566 
   567 bool parseVYMHandler::readXLinkAttr (const QXmlAttributes& a)
   568 {
   569 	QColor col;
   570 	bool okx;
   571 	bool success=false;
   572 	XLinkObj *xlo=new XLinkObj (model->getScene());
   573 	if (!a.value( "color").isEmpty() ) 
   574 	{
   575 		col.setNamedColor(a.value("color"));
   576 		xlo->setColor (col);
   577 	}
   578 
   579 	if (!a.value( "width").isEmpty() ) 
   580 	{
   581 		xlo->setWidth(a.value ("width").toInt (&okx, 10));
   582 	}
   583 
   584 	// Connecting by select string for compatibility with version < 1.8.76
   585 	if (!a.value( "beginBranch").isEmpty() ) 
   586 	{ 
   587 		if (!a.value( "endBranch").isEmpty() ) 
   588 		{
   589 			TreeItem *ti=model->findBySelectString (a.value( "beginBranch"));
   590 			if (ti && ti->isBranchLikeType())
   591 			{
   592 			/* FIXME-2 xLinks
   593 				xlo->setBegin ((BranchObj*)lmo);
   594 				lmo=model->findBySelectString (a.value( "endBranch"));
   595 				if (lmo && typeid (*lmo)==typeid (BranchObj))
   596 				{
   597 					xlo->setEnd ((BranchObj*)(lmo));
   598 					xlo->activate();
   599 					success=true;
   600 				}
   601 			*/
   602 			}
   603 		}           
   604 	}	
   605 
   606 	// object ID is used starting in version 1.8.76
   607 	/* FIXME-2 xLinks
   608 	if (!a.value( "beginID").isEmpty() ) 
   609 	{ 
   610 		if (!a.value( "endID").isEmpty() ) 
   611 		{
   612 			LinkableMapObj *lmo=model->findID (a.value( "beginID"));
   613 			if (lmo && typeid (*lmo)==typeid (BranchObj))
   614 			{
   615 				xlo->setBegin ((BranchObj*)lmo);
   616 				lmo=model->findID (a.value( "endID"));
   617 				if (lmo && typeid (*lmo)==typeid (BranchObj))
   618 				{
   619 					xlo->setEnd ((BranchObj*)(lmo));
   620 					xlo->activate();
   621 					success=true;
   622 				}
   623 			}
   624 		}           
   625 	}	
   626 	*/
   627 	if (!success) delete (xlo);
   628 	return true;	// xLinks can only be established at the "end branch", return true
   629 }
   630 
   631 bool parseVYMHandler::readHtmlAttr (const QXmlAttributes& a)
   632 {
   633 	for (int i=1; i<=a.count(); i++)
   634 		htmldata+=" "+a.localName(i-1)+"=\""+a.value(i-1)+"\"";
   635 	return true;
   636 }
   637 
   638 bool parseVYMHandler::readSettingAttr (const QXmlAttributes& a)
   639 {
   640 	if (!a.value( "key").isEmpty() ) 
   641 	{
   642 		if (!a.value( "value").isEmpty() ) 
   643 			settings.setLocalEntry (model->getDestPath(), a.value ("key"), a.value ("value"));
   644 		else
   645 			return false;
   646 		
   647 	} else
   648 		return false;
   649 	
   650 	return true;
   651 }