diff -r 192e1392ba6a -r 12958f987bcf exports.cpp --- a/exports.cpp Wed Jul 16 10:44:44 2008 +0000 +++ b/exports.cpp Wed Jul 16 10:46:14 2008 +0000 @@ -251,92 +251,77 @@ //////////////////////////////////////////////////////////////////////// void ExportKDEBookmarks::doExport() { - MapEditor *me=model->getMapEditor(); - if (me) + WarningDialog dia; + dia.showCancelButton (true); + dia.setText(QObject::tr("Exporting the %1 bookmarks will overwrite\nyour existing bookmarks file.").arg("KDE")); + dia.setCaption(QObject::tr("Warning: Overwriting %1 bookmarks").arg("KDE")); + dia.setShowAgainName("/exports/KDE/overwriteKDEBookmarks"); + if (dia.exec()==QDialog::Accepted) { - WarningDialog dia; - dia.showCancelButton (true); - dia.setText(QObject::tr("Exporting the %1 bookmarks will overwrite\nyour existing bookmarks file.").arg("KDE")); - dia.setCaption(QObject::tr("Warning: Overwriting %1 bookmarks").arg("KDE")); - dia.setShowAgainName("/exports/KDE/overwriteKDEBookmarks"); - if (dia.exec()==QDialog::Accepted) + model->exportXML(tmpDir.path(),false); + + XSLTProc p; + p.setInputFile (tmpDir.path()+"/"+model->getMapName()+".xml"); + p.setOutputFile (tmpDir.home().path()+"/.kde/share/apps/konqueror/bookmarks.xml"); + p.setXSLFile (vymBaseDir.path()+"/styles/vym2kdebookmarks.xsl"); + p.process(); + + QString ub=vymBaseDir.path()+"/scripts/update-bookmarks"; + QProcess *proc= new QProcess ; + proc->start( ub); + if (!proc->waitForStarted()) { - me->exportXML(tmpDir.path(),false); - - XSLTProc p; - p.setInputFile (tmpDir.path()+"/"+me->getMapName()+".xml"); - p.setOutputFile (tmpDir.home().path()+"/.kde/share/apps/konqueror/bookmarks.xml"); - p.setXSLFile (vymBaseDir.path()+"/styles/vym2kdebookmarks.xsl"); - p.process(); - - QString ub=vymBaseDir.path()+"/scripts/update-bookmarks"; - QProcess *proc= new QProcess ; - proc->start( ub); - if (!proc->waitForStarted()) - { - QMessageBox::warning(0, - QObject::tr("Warning"), - QObject::tr("Couldn't find script %1\nto notifiy Browsers of changed bookmarks.").arg(ub)); - } - } + QMessageBox::warning(0, + QObject::tr("Warning"), + QObject::tr("Couldn't find script %1\nto notifiy Browsers of changed bookmarks.").arg(ub)); + } } - } //////////////////////////////////////////////////////////////////////// void ExportFirefoxBookmarks::doExport() { - MapEditor *me=model->getMapEditor(); - if (me) + WarningDialog dia; + dia.showCancelButton (true); + dia.setText(QObject::tr("Exporting the %1 bookmarks will overwrite\nyour existing bookmarks file.").arg("Firefox")); + dia.setCaption(QObject::tr("Warning: Overwriting %1 bookmarks").arg("Firefox")); + dia.setShowAgainName("/vym/warnings/overwriteImportBookmarks"); + if (dia.exec()==QDialog::Accepted) { - WarningDialog dia; - dia.showCancelButton (true); - dia.setText(QObject::tr("Exporting the %1 bookmarks will overwrite\nyour existing bookmarks file.").arg("Firefox")); - dia.setCaption(QObject::tr("Warning: Overwriting %1 bookmarks").arg("Firefox")); - dia.setShowAgainName("/vym/warnings/overwriteImportBookmarks"); - if (dia.exec()==QDialog::Accepted) - { - me->exportXML(tmpDir.path(),false); + model->exportXML(tmpDir.path(),false); /* - XSLTProc p; - p.setInputFile (tmpDir.path()+"/"+me->getMapName()+".xml"); - p.setOutputFile (tmpDir.home().path()+"/.kde/share/apps/konqueror/bookmarks.xml"); - p.setXSLFile (vymBaseDir.path()+"/styles/vym2kdebookmarks.xsl"); - p.process(); + XSLTProc p; + p.setInputFile (tmpDir.path()+"/"+me->getMapName()+".xml"); + p.setOutputFile (tmpDir.home().path()+"/.kde/share/apps/konqueror/bookmarks.xml"); + p.setXSLFile (vymBaseDir.path()+"/styles/vym2kdebookmarks.xsl"); + p.process(); - QString ub=vymBaseDir.path()+"/scripts/update-bookmarks"; - QProcess *proc = new QProcess( ); - proc->addArgument(ub); + QString ub=vymBaseDir.path()+"/scripts/update-bookmarks"; + QProcess *proc = new QProcess( ); + proc->addArgument(ub); - if ( !proc->start() ) - { - QMessageBox::warning(0, - QObject::tr("Warning"), - QObject::tr("Couldn't find script %1\nto notifiy Browsers of changed bookmarks.").arg(ub)); - } + if ( !proc->start() ) + { + QMessageBox::warning(0, + QObject::tr("Warning"), + QObject::tr("Couldn't find script %1\nto notifiy Browsers of changed bookmarks.").arg(ub)); + } */ - - } } } //////////////////////////////////////////////////////////////////////// void ExportTaskjuggler::doExport() { - MapEditor *me=model->getMapEditor(); - if (me) - { - me->exportXML(tmpDir.path(),false); + model->exportXML(tmpDir.path(),false); - XSLTProc p; - p.setInputFile (tmpDir.path()+"/"+me->getMapName()+".xml"); - p.setOutputFile (outputFile); - p.setXSLFile (vymBaseDir.path()+"/styles/vym2taskjuggler.xsl"); - p.process(); - } - + XSLTProc p; + p.setInputFile (tmpDir.path()+"/"+model->getMapName()+".xml"); + p.setOutputFile (outputFile); + p.setXSLFile (vymBaseDir.path()+"/styles/vym2taskjuggler.xsl"); + p.process(); } ////////////////////////////////////////////////////////////////////////