1.8.67 Bugfixes
authorinsilmaril
Mon, 19 Feb 2007 12:01:52 +0000
changeset 4289ae68208e2ff
parent 427 fb74fa7bfb4c
child 429 69a4c16bd85b
1.8.67 Bugfixes
exports.cpp
exportxhtmldialog.cpp
file.cpp
headingobj.cpp
headingobj.h
mainwindow.cpp
mapeditor.cpp
mapeditor.h
xml.cpp
     1.1 --- a/exports.cpp	Mon Feb 12 09:28:47 2007 +0000
     1.2 +++ b/exports.cpp	Mon Feb 19 12:01:52 2007 +0000
     1.3 @@ -166,6 +166,7 @@
     1.4  	if (mapCenter) me=mapCenter->getMapEditor();
     1.5  	if (me)
     1.6  	{
     1.7 +		cout << "starting KDE export\n";
     1.8  		WarningDialog dia;
     1.9  		dia.showCancelButton (true);
    1.10  		dia.setText(QObject::tr("Exporting the %1 bookmarks will overwrite\nyour existing bookmarks file.").arg("KDE"));
    1.11 @@ -179,9 +180,11 @@
    1.12  			p.setInputFile (tmpDir.path()+"/"+me->getMapName()+".xml");
    1.13  			p.setOutputFile (tmpDir.home().path()+"/.kde/share/apps/konqueror/bookmarks.xml");
    1.14  			p.setXSLFile (vymBaseDir.path()+"/styles/vym2kdebookmarks.xsl");
    1.15 +			cout << "Trying to call vym2kde\n";
    1.16  			p.process();
    1.17  
    1.18  			QString ub=vymBaseDir.path()+"/scripts/update-bookmarks";
    1.19 +			cout << "Trying to call "<<ub.ascii()<<endl;
    1.20  			QProcess *proc= new QProcess ;
    1.21  			proc->start( ub);
    1.22  			if (!proc->waitForStarted())
     2.1 --- a/exportxhtmldialog.cpp	Mon Feb 12 09:28:47 2007 +0000
     2.2 +++ b/exportxhtmldialog.cpp	Mon Feb 19 12:01:52 2007 +0000
     2.3 @@ -394,8 +394,7 @@
     2.4  					   tr("Could not start %1").arg(spath) );
     2.5  	} else
     2.6  	{
     2.7 -		scriptProc->waitFinished();
     2.8 -		if (scriptProc->exitStatus()!=QProcess::NormalExit )
     2.9 +		if (!scriptProc->waitForFinished())
    2.10  			QMessageBox::critical( 0, tr( "Critical Error" ),
    2.11  			   tr("%1 didn't exit normally").arg(spath) +
    2.12  			   scriptProc->getErrout() );
     3.1 --- a/file.cpp	Mon Feb 12 09:28:47 2007 +0000
     3.2 +++ b/file.cpp	Mon Feb 19 12:01:52 2007 +0000
     3.3 @@ -210,7 +210,7 @@
     3.4  		{
     3.5  			if (zipProc->exitCode()>0)
     3.6  			{
     3.7 -				if (zipProc->exitStatus()==9)
     3.8 +				if (zipProc->exitCode()==9)
     3.9  					// no zipped file, but maybe .xml or old version? Try again.
    3.10  					err=nozip;
    3.11  				else	
     4.1 --- a/headingobj.cpp	Mon Feb 12 09:28:47 2007 +0000
     4.2 +++ b/headingobj.cpp	Mon Feb 19 12:01:52 2007 +0000
     4.3 @@ -90,12 +90,13 @@
     4.4      bbox.setSize (QSizeF(w,h));
     4.5  }
     4.6  
     4.7 -QGraphicsTextItem* HeadingObj::newLine(QString s)
     4.8 +QGraphicsSimpleTextItem* HeadingObj::newLine(QString s)
     4.9  {
    4.10 -    QGraphicsTextItem *t=scene->addText(s);
    4.11 +    QGraphicsSimpleTextItem *t=new QGraphicsSimpleTextItem (s,0,scene);
    4.12      t->setFont (font);
    4.13      t->setZValue(Z_TEXT);
    4.14 -    t->setDefaultTextColor(color);
    4.15 +    //t->setDefaultTextColor(color);
    4.16 +    t->setBrush(color);
    4.17      return t;
    4.18  }
    4.19  
    4.20 @@ -217,7 +218,8 @@
    4.21      {
    4.22  		color=c;
    4.23  		for (int i=0; i<textline.size(); ++i)
    4.24 -			textline.at(i)->setDefaultTextColor(c);
    4.25 +			//textline.at(i)->setDefaultTextColor(c);
    4.26 +			textline.at(i)->setBrush(c);
    4.27      }	    
    4.28  }
    4.29  
     5.1 --- a/headingobj.h	Mon Feb 12 09:28:47 2007 +0000
     5.2 +++ b/headingobj.h	Mon Feb 19 12:01:52 2007 +0000
     5.3 @@ -15,7 +15,7 @@
     5.4      virtual void positionBBox();
     5.5  	virtual void calcBBoxSize();
     5.6  private:
     5.7 -    QGraphicsTextItem* newLine(QString);		// generate new textline
     5.8 +    QGraphicsSimpleTextItem* newLine(QString);		// generate new textline
     5.9  public:    
    5.10      virtual void setText(QString);
    5.11      virtual QString text();
    5.12 @@ -30,7 +30,7 @@
    5.13  protected:
    5.14      QString heading;
    5.15      int textwidth;								// width for formatting text
    5.16 -    QList <QGraphicsTextItem*> textline;		// a part of e.g. the parabel
    5.17 +    QList <QGraphicsSimpleTextItem*> textline;	// a part of e.g. the parabel
    5.18      QColor color;
    5.19      QFont font;
    5.20  };
     6.1 --- a/mainwindow.cpp	Mon Feb 12 09:28:47 2007 +0000
     6.2 +++ b/mainwindow.cpp	Mon Feb 19 12:01:52 2007 +0000
     6.3 @@ -1780,7 +1780,7 @@
     6.4  			if (!file.exists() )
     6.5  			{
     6.6  				// mapname.xml does not exist, well, 
     6.7 -				// maybe some renamed the mapname.vym file...
     6.8 +				// maybe someone renamed the mapname.vym file...
     6.9  				// Try to find any .xml in the toplevel 
    6.10  				// directory of the .vym file
    6.11  				QStringList flist=QDir (tmpMapDir).entryList("*.xml");
    6.12 @@ -2793,7 +2793,7 @@
    6.13  void Main::editUnScrollAll()
    6.14  {
    6.15  	if (currentMapEditor())
    6.16 -		currentMapEditor()->unScrollAll();	
    6.17 +		currentMapEditor()->unscrollChilds();	
    6.18  }
    6.19  
    6.20  void Main::editNewBranch()
     7.1 --- a/mapeditor.cpp	Mon Feb 12 09:28:47 2007 +0000
     7.2 +++ b/mapeditor.cpp	Mon Feb 19 12:01:52 2007 +0000
     7.3 @@ -3003,17 +3003,21 @@
     7.4  	}
     7.5  }
     7.6  
     7.7 -void MapEditor::unScrollAll()
     7.8 +void MapEditor::unscrollChilds() // FIXME saveState missing
     7.9  {
    7.10 -	BranchObj *bo;
    7.11 -	bo=mapCenter->first();
    7.12 -	while (bo) 
    7.13 +	BranchObj *bo=xelection.getBranch();
    7.14 +	if (bo)
    7.15  	{
    7.16 -		if (bo->isScrolled()) bo->toggleScroll();
    7.17 -		bo=bo->next();
    7.18 -	}
    7.19 +		bo->first();
    7.20 +		while (bo) 
    7.21 +		{
    7.22 +			if (bo->isScrolled()) bo->toggleScroll();
    7.23 +			bo=bo->next();
    7.24 +		}
    7.25 +	}	
    7.26  }
    7.27  
    7.28 +
    7.29  void MapEditor::loadFloatImage ()
    7.30  {
    7.31  	BranchObj *bo=xelection.getBranch();
    7.32 @@ -3268,10 +3272,8 @@
    7.33  	WarningDialog dia;
    7.34  	dia.showCancelButton (true);
    7.35  	dia.setText("This is a longer \nWarning");
    7.36 -	/*
    7.37  	dia.setCaption("Warning: Flux problem");
    7.38  	dia.setShowAgainName("/warnings/mapeditor");
    7.39 -	*/
    7.40  	if (dia.exec()==QDialog::Accepted)
    7.41  		cout << "accepted!\n";
    7.42  	else	
    7.43 @@ -3603,8 +3605,6 @@
    7.44  					else	
    7.45  						lmosel->move(p.x() -movingObj_start.x(), p.y()-movingObj_start.y() -lmosel->getTopPad());
    7.46  				} 
    7.47 -				// reposition subbranch
    7.48 -				lmosel->reposition();	
    7.49  
    7.50  				if (lmo && (lmo!=lmosel) && xelection.getBranch() ) 
    7.51  				{
    7.52 @@ -3621,6 +3621,8 @@
    7.53  				{
    7.54  					lmosel->unsetParObjTmp();
    7.55  				}		
    7.56 +				// reposition subbranch
    7.57 +				lmosel->reposition();	
    7.58  			} // depth>0
    7.59  
    7.60  		} // no FloatImageObj
    7.61 @@ -3863,30 +3865,34 @@
    7.62  			QString s;
    7.63  			QString heading;
    7.64  			BranchObj *bo;
    7.65 -			for (int i=0; i<uris.count();++i)
    7.66 +			for (int i=0; i<uris.count();i++)
    7.67  			{
    7.68 -				bo=sel->addBranch();
    7.69 -				if (bo)
    7.70 +				// Workaround to avoid adding empty branches
    7.71 +				if (!uris.at(i).toString().isEmpty())
    7.72  				{
    7.73 -					s=uris.at(i).toLocalFile();
    7.74 -					if (!s.isEmpty()) 
    7.75 +					bo=sel->addBranch();
    7.76 +					if (bo)
    7.77  					{
    7.78 -                       QString file = QDir::convertSeparators(s);
    7.79 -                       heading = QFileInfo(file).baseName();
    7.80 -                       files.append(file);
    7.81 -                       if (file.endsWith(".vym", false))
    7.82 -                           bo->setVymLink(file);
    7.83 -                       else
    7.84 -                           bo->setURL(uris.at(i).toString());
    7.85 -                   } else 
    7.86 -				   {
    7.87 -                       bo->setURL(uris.at(i).toString());
    7.88 -                   }
    7.89 -
    7.90 -                   if (!heading.isEmpty())
    7.91 -                       bo->setHeading(heading);
    7.92 -                   else
    7.93 -                       bo->setHeading(uris.at(i).toString());
    7.94 +						s=uris.at(i).toLocalFile();
    7.95 +						if (!s.isEmpty()) 
    7.96 +						{
    7.97 +						   QString file = QDir::convertSeparators(s);
    7.98 +						   heading = QFileInfo(file).baseName();
    7.99 +						   files.append(file);
   7.100 +						   if (file.endsWith(".vym", false))
   7.101 +							   bo->setVymLink(file);
   7.102 +						   else
   7.103 +							   bo->setURL(uris.at(i).toString());
   7.104 +					   } else 
   7.105 +					   {
   7.106 +						   bo->setURL(uris.at(i).toString());
   7.107 +					   }
   7.108 +
   7.109 +					   if (!heading.isEmpty())
   7.110 +						   bo->setHeading(heading);
   7.111 +					   else
   7.112 +						   bo->setHeading(uris.at(i).toString());
   7.113 +					}
   7.114  				}
   7.115  			}
   7.116  			mapCenter->reposition();
     8.1 --- a/mapeditor.h	Mon Feb 12 09:28:47 2007 +0000
     8.2 +++ b/mapeditor.h	Mon Feb 19 12:01:52 2007 +0000
     8.3 @@ -161,7 +161,7 @@
     8.4  	bool scrollBranch();
     8.5  	bool unscrollBranch();
     8.6      void toggleScroll();
     8.7 -    void unScrollAll();
     8.8 +    void unscrollChilds();
     8.9  	void loadFloatImage ();
    8.10  	void saveFloatImage ();
    8.11  	void setFrame(const FrameType &);
     9.1 --- a/xml.cpp	Mon Feb 12 09:28:47 2007 +0000
     9.2 +++ b/xml.cpp	Mon Feb 19 12:01:52 2007 +0000
     9.3 @@ -23,6 +23,7 @@
     9.4  
     9.5  QString mapBuilderHandler::errorProtocol() { return errorProt; }
     9.6  
     9.7 +
     9.8  bool mapBuilderHandler::startDocument()
     9.9  {
    9.10      errorProt = "";
    9.11 @@ -52,10 +53,12 @@
    9.12  {
    9.13      QColor col;
    9.14  	/* Testing
    9.15 -	cout << "startElement <"<< eName.ascii()<<
    9.16 -		">  state="<<state <<
    9.17 -		"  laststate="<<stateStack.last()<<
    9.18 -		"   loadMode="<<loadMode<<endl;
    9.19 +	cout << "startElement <"<< eName.ascii()
    9.20 +		<<">  state="<<state 
    9.21 +		<<"  laststate="<<stateStack.last()
    9.22 +		<<"   loadMode="<<loadMode
    9.23 +		<<"       line="<<QXmlDefaultHandler::lineNumber()
    9.24 +		<<endl;
    9.25  	*/	
    9.26  	stateStack.append (state);	
    9.27      if ( state == StateInit && (eName == "vymmap")  )