exports.cpp
changeset 654 10bd509b235c
parent 613 8fb5b3956b3e
child 688 d0086df58648
     1.1 --- a/exports.cpp	Wed Oct 24 12:21:24 2007 +0000
     1.2 +++ b/exports.cpp	Wed Jan 16 15:45:19 2008 +0000
     1.3 @@ -42,9 +42,9 @@
     1.4  	return outputFile;
     1.5  }
     1.6  
     1.7 -void ExportBase::setMapCenter(MapCenterObj *mc)
     1.8 +void ExportBase::setModel(VymModel *m)
     1.9  {
    1.10 -	mapCenter=mc;
    1.11 +	model=m;
    1.12  }
    1.13  
    1.14  void ExportBase::setCaption (const QString &s)
    1.15 @@ -59,9 +59,10 @@
    1.16  
    1.17  bool ExportBase::execDialog()
    1.18  {
    1.19 -	if (mapCenter && mapCenter->getMapEditor())
    1.20 +	//MapEditor *me=model.getMapEditor(); FIXME needed?
    1.21 +	// if (model->mapCenters.count() && me)
    1.22  	{
    1.23 -		QFileDialog *fd=new QFileDialog( mapCenter->getMapEditor(), caption);
    1.24 +		QFileDialog *fd=new QFileDialog( 0, caption);
    1.25  		fd->setFilter (filter);
    1.26  		fd->setCaption(caption);
    1.27  		fd->setMode( QFileDialog::AnyFile );
    1.28 @@ -145,7 +146,7 @@
    1.29  	QString curIndent;
    1.30  	int i;
    1.31  	BranchObj *bo;
    1.32 -	bo=mapCenter->first();
    1.33 +	bo=model->first();
    1.34  	while (bo) 
    1.35  	{
    1.36  		// Make indentstring
    1.37 @@ -189,7 +190,7 @@
    1.38  				ts << QString (s+"\n");
    1.39  			}
    1.40  		}
    1.41 -		bo=bo->next();
    1.42 +		bo=model->next(bo);
    1.43  	}
    1.44  	file.close();
    1.45  }
    1.46 @@ -221,7 +222,7 @@
    1.47  	QString curIndent("");
    1.48  	int i;
    1.49  	BranchObj *bo;
    1.50 -	bo=mapCenter->first();
    1.51 +	bo=model->first();
    1.52  	while (bo) 
    1.53  	{
    1.54  		if (!bo->hasHiddenExportParent() )
    1.55 @@ -242,7 +243,7 @@
    1.56  			ts << curIndent << "\"" << bo->getHeading()<<"\""<<endl;
    1.57  		}
    1.58  		
    1.59 -		bo=bo->next();
    1.60 +		bo=model->next(bo);
    1.61  		curIndent="";
    1.62  	}
    1.63  	file.close();
    1.64 @@ -251,8 +252,7 @@
    1.65  ////////////////////////////////////////////////////////////////////////
    1.66  void ExportKDEBookmarks::doExport() 
    1.67  {
    1.68 -	MapEditor *me=NULL;
    1.69 -	if (mapCenter) me=mapCenter->getMapEditor();
    1.70 +	MapEditor *me=model->getMapEditor();
    1.71  	if (me)
    1.72  	{
    1.73  		WarningDialog dia;
    1.74 @@ -287,8 +287,7 @@
    1.75  ////////////////////////////////////////////////////////////////////////
    1.76  void ExportFirefoxBookmarks::doExport() 
    1.77  {
    1.78 -	MapEditor *me=NULL;
    1.79 -	if (mapCenter) me=mapCenter->getMapEditor();
    1.80 +	MapEditor *me=model->getMapEditor();
    1.81  	if (me)
    1.82  	{
    1.83  		WarningDialog dia;
    1.84 @@ -327,8 +326,7 @@
    1.85  ////////////////////////////////////////////////////////////////////////
    1.86  void ExportTaskjuggler::doExport() 
    1.87  {
    1.88 -	MapEditor *me=NULL;
    1.89 -	if (mapCenter) me=mapCenter->getMapEditor();
    1.90 +	MapEditor *me=model->getMapEditor();
    1.91  	if (me)
    1.92  	{
    1.93  		me->exportXML(tmpDir.path(),false);
    1.94 @@ -364,7 +362,7 @@
    1.95    // QString curIndent("");
    1.96    // int i;
    1.97    BranchObj *bo;
    1.98 -  bo=mapCenter->first();
    1.99 +  bo=model->first();
   1.100    while (bo) {
   1.101  	if (!bo->hasHiddenExportParent() )
   1.102  	{
   1.103 @@ -391,7 +389,7 @@
   1.104  		  ts << ("\n");
   1.105  		}
   1.106  	}
   1.107 -    bo=bo->next();
   1.108 +    bo=model->next(bo);
   1.109     }
   1.110    file.close();
   1.111  }
   1.112 @@ -443,6 +441,7 @@
   1.113  {
   1.114  	QString allPages;
   1.115  
   1.116 +/* FIXME not adapted to multiple mapCenters yet
   1.117  	// Insert new content
   1.118  	content.replace ("<!-- INSERT TITLE -->",quotemeta(mapCenter->getHeading()));
   1.119  	content.replace ("<!-- INSERT AUTHOR -->",quotemeta(mapCenter->getAuthor()));
   1.120 @@ -506,6 +505,7 @@
   1.121  
   1.122  	// zip tmpdir to destination
   1.123  	zipDir (tmpDir,outputFile);	
   1.124 +*/
   1.125  }
   1.126  
   1.127  bool ExportOO::setConfigFile (const QString &cf)