1.1 --- a/exports.cpp Wed Feb 25 12:44:10 2009 +0000
1.2 +++ b/exports.cpp Fri Mar 05 19:15:08 2010 +0000
1.3 @@ -249,7 +249,7 @@
1.4 }
1.5
1.6 ////////////////////////////////////////////////////////////////////////
1.7 -void ExportKDEBookmarks::doExport()
1.8 +void ExportKDE3Bookmarks::doExport()
1.9 {
1.10 MapEditor *me=model->getMapEditor();
1.11 if (me)
1.12 @@ -257,7 +257,7 @@
1.13 WarningDialog dia;
1.14 dia.showCancelButton (true);
1.15 dia.setText(QObject::tr("Exporting the %1 bookmarks will overwrite\nyour existing bookmarks file.").arg("KDE"));
1.16 - dia.setCaption(QObject::tr("Warning: Overwriting %1 bookmarks").arg("KDE"));
1.17 + dia.setCaption(QObject::tr("Warning: Overwriting %1 bookmarks").arg("KDE 3"));
1.18 dia.setShowAgainName("/exports/KDE/overwriteKDEBookmarks");
1.19 if (dia.exec()==QDialog::Accepted)
1.20 {
1.21 @@ -280,6 +280,40 @@
1.22 }
1.23 }
1.24 }
1.25 +}
1.26 +
1.27 +////////////////////////////////////////////////////////////////////////
1.28 +void ExportKDE4Bookmarks::doExport()
1.29 +{
1.30 + MapEditor *me=model->getMapEditor();
1.31 + if (me)
1.32 + {
1.33 + WarningDialog dia;
1.34 + dia.showCancelButton (true);
1.35 + dia.setText(QObject::tr("Exporting the %1 bookmarks will overwrite\nyour existing bookmarks file.").arg("KDE"));
1.36 + dia.setCaption(QObject::tr("Warning: Overwriting %1 bookmarks").arg("KDE 4"));
1.37 + dia.setShowAgainName("/exports/KDE/overwriteKDEBookmarks");
1.38 + if (dia.exec()==QDialog::Accepted)
1.39 + {
1.40 + me->exportXML(tmpDir.path(),false);
1.41 +
1.42 + XSLTProc p;
1.43 + p.setInputFile (tmpDir.path()+"/"+me->getMapName()+".xml");
1.44 + p.setOutputFile (tmpDir.home().path()+"/.kde4/share/apps/konqueror/bookmarks.xml");
1.45 + p.setXSLFile (vymBaseDir.path()+"/styles/vym2kdebookmarks.xsl");
1.46 + p.process();
1.47 +
1.48 + QString ub=vymBaseDir.path()+"/scripts/update-bookmarks";
1.49 + QProcess *proc= new QProcess ;
1.50 + proc->start( ub);
1.51 + if (!proc->waitForStarted())
1.52 + {
1.53 + QMessageBox::warning(0,
1.54 + QObject::tr("Warning"),
1.55 + QObject::tr("Couldn't find script %1\nto notifiy Browsers of changed bookmarks.").arg(ub));
1.56 + }
1.57 + }
1.58 + }
1.59
1.60 }
1.61