diff -r 6a7db028088e -r 626fd85b1f69 exports.cpp --- a/exports.cpp Mon May 08 13:25:46 2006 +0000 +++ b/exports.cpp Tue Sep 05 15:05:18 2006 +0000 @@ -1,6 +1,8 @@ -#include +#include #include -#include +#include +//Added by qt3to4: +#include #include "exports.h" #include "file.h" @@ -18,7 +20,10 @@ { indentPerDepth=" "; // Create tmpdir - tmpDir.setPath (makeUniqueDir("/tmp/vym-XXXXXX")); + // FIXME not neededtmpDir.setPath (makeUniqueDir("/tmp/vym-XXXXXX")); + if (!tmpDir.cd ("tmp")) + qWarning ("Could not access temporary directory for export"); + // FIXME there's more needed here... } ExportBase::~ExportBase() @@ -57,7 +62,7 @@ if (mapCenter && mapCenter->getMapEditor()) { QFileDialog *fd=new QFileDialog( mapCenter->getMapEditor(), caption); - fd->addFilter (filter); + fd->setFilter (filter); fd->setCaption(caption); fd->setMode( QFileDialog::AnyFile ); fd->show(); @@ -71,7 +76,7 @@ QMessageBox::Warning, QMessageBox::Yes | QMessageBox::Default, QMessageBox::Cancel | QMessageBox::Escape, - QMessageBox::NoButton ); + Qt::NoButton ); mb.setButtonText( QMessageBox::Yes, QObject::tr("Overwrite") ); mb.setButtonText( QMessageBox::No, QObject::tr("Cancel")); ExportBase ex; @@ -116,9 +121,8 @@ void ExportASCII::doExport() { QFile file (outputFile); - if ( !file.open( IO_WriteOnly ) ) + if ( !file.open( QIODevice::WriteOnly ) ) { - // FIXME experimental, testing qWarning ("ExportBase::exportXML couldn't open "+outputFile); return; } @@ -127,8 +131,7 @@ // Main loop over all branches QString s; QString actIndent(""); - int i; - uint j; + int i,j; BranchObj *bo; bo=mapCenter->first(); while (bo) @@ -184,17 +187,14 @@ p.process(); QString ub=vymBaseDir.path()+"/scripts/update-bookmarks"; - QProcess *proc = new QProcess( ); - proc->addArgument(ub); - - if ( !proc->start() ) + 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)); } - - } } @@ -248,8 +248,6 @@ if (me) { me->exportXML(tmpDir.path()); - //FIXME testing - cout << "tmpDir="<getMapName()+".xml"); @@ -269,7 +267,7 @@ // it will not add a preamble, or anything // that makes a full LaTex document. QFile file (outputFile); - if ( !file.open( IO_WriteOnly ) ) { + if ( !file.open( QIODevice::WriteOnly ) ) { QMessageBox::critical (0,QObject::tr("Critical Export Error"),QObject::tr("Could not write %1").arg(outputFile)); mainWindow->statusMessage(QString(QObject::tr("Export failed."))); return; @@ -405,7 +403,7 @@ // Write modified content QFile f (contentFile); - if ( !f.open( IO_WriteOnly ) ) + if ( !f.open( QIODevice::WriteOnly ) ) { QMessageBox::critical (0,QObject::tr("Critical Export Error"),QObject::tr("Could not write %1").arg(contentFile)); mainWindow->statusMessage(QString(QObject::tr("Export failed.")));