exports.cpp
changeset 742 54d44ecd6097
parent 741 1b4d1ea6ea8c
child 746 ee6b0f3a4c2f
     1.1 --- a/exports.cpp	Fri Mar 06 15:02:58 2009 +0000
     1.2 +++ b/exports.cpp	Thu Mar 19 11:45:28 2009 +0000
     1.3 @@ -262,11 +262,41 @@
     1.4  }
     1.5  
     1.6  ////////////////////////////////////////////////////////////////////////
     1.7 -void ExportKDEBookmarks::doExport() 
     1.8 +void ExportKDE3Bookmarks::doExport() 
     1.9  {
    1.10  	WarningDialog dia;
    1.11  	dia.showCancelButton (true);
    1.12  	dia.setText(QObject::tr("Exporting the %1 bookmarks will overwrite\nyour existing bookmarks file.").arg("KDE"));
    1.13 +	dia.setCaption(QObject::tr("Warning: Overwriting %1 bookmarks").arg("KDE 3"));
    1.14 +	dia.setShowAgainName("/exports/KDE/overwriteKDEBookmarks");
    1.15 +	if (dia.exec()==QDialog::Accepted)
    1.16 +	{
    1.17 +		model->exportXML(tmpDir.path(),false);
    1.18 +
    1.19 +		XSLTProc p;
    1.20 +		p.setInputFile (tmpDir.path()+"/"+model->getMapName()+".xml");
    1.21 +		p.setOutputFile (tmpDir.home().path()+"/.kde/share/apps/konqueror/bookmarks.xml");
    1.22 +		p.setXSLFile (vymBaseDir.path()+"/styles/vym2kdebookmarks.xsl");
    1.23 +		p.process();
    1.24 +
    1.25 +		QString ub=vymBaseDir.path()+"/scripts/update-bookmarks";
    1.26 +		QProcess *proc= new QProcess ;
    1.27 +		proc->start( ub);
    1.28 +		if (!proc->waitForStarted())
    1.29 +		{
    1.30 +			QMessageBox::warning(0, 
    1.31 +				QObject::tr("Warning"),
    1.32 +				QObject::tr("Couldn't find script %1\nto notifiy Browsers of changed bookmarks.").arg(ub));
    1.33 +		}	
    1.34 +	}
    1.35 +}
    1.36 +
    1.37 +////////////////////////////////////////////////////////////////////////
    1.38 +void ExportKDE4Bookmarks::doExport() 
    1.39 +{
    1.40 +	WarningDialog dia;
    1.41 +	dia.showCancelButton (true);
    1.42 +	dia.setText(QObject::tr("Exporting the %1 bookmarks will overwrite\nyour existing bookmarks file.").arg("KDE 4"));
    1.43  	dia.setCaption(QObject::tr("Warning: Overwriting %1 bookmarks").arg("KDE"));
    1.44  	dia.setShowAgainName("/exports/KDE/overwriteKDEBookmarks");
    1.45  	if (dia.exec()==QDialog::Accepted)
    1.46 @@ -275,7 +305,7 @@
    1.47  
    1.48  		XSLTProc p;
    1.49  		p.setInputFile (tmpDir.path()+"/"+model->getMapName()+".xml");
    1.50 -		p.setOutputFile (tmpDir.home().path()+"/.kde/share/apps/konqueror/bookmarks.xml");
    1.51 +		p.setOutputFile (tmpDir.home().path()+"/.kde4/share/apps/konqueror/bookmarks.xml");
    1.52  		p.setXSLFile (vymBaseDir.path()+"/styles/vym2kdebookmarks.xsl");
    1.53  		p.process();
    1.54