diff -r 30cd58b70d02 -r 16b250a57c17 exports.cpp --- a/exports.cpp Tue Jul 19 15:57:49 2005 +0000 +++ b/exports.cpp Fri Jul 22 15:38:06 2005 +0000 @@ -1,6 +1,9 @@ #include "exports.h" +#include + #include "linkablemapobj.h" +#include "texteditor.h" Export::Export() @@ -8,24 +11,6 @@ indentPerDepth=" "; } -bool Export::setOutputDir(QString dirname) -{ - outdir.setPath (dirname); - if ( outdir.exists() ) - { - // FIXME - // ask for confirmation - // then delete outdir - return true; - } else - { - // try to create directory - //return outdir.mkdir (outdir.absPath()); - // FIXME - return true; - } -} - void Export::setPath (const QString &p) { filepath=p; @@ -41,7 +26,7 @@ QFile file (filepath); if ( !file.open( IO_WriteOnly ) ) { - // FIXME + // FIXME experimental, testing cout << "Export::exportMap couldn't open "<first(); while (bo) @@ -60,18 +45,24 @@ // Write heading // write (actIndent + getSectionString(bo) + bo->getHeading()+ "\n"); - if (bo->getDepth()==1) - ts << (getSectionString(bo) + bo->getHeading()+ "\n"); + if (bo->getDepth()==0) + { + ts << (bo->getHeading()+ "\n"); + for (i=0;igetHeading().length();i++) ts<<"="; + ts << "\n"; + } else if (bo->getDepth()==1) + ts << ("\n"+getSectionString(bo) + bo->getHeading()+ "\n"); + else if (bo->getDepth()==2) + ts << (actIndent + " o " + bo->getHeading()+ "\n"); else ts << (actIndent + " - " + bo->getHeading()+ "\n"); // If necessary, write note if (!bo->getNote().isEmpty()) { - ts << ("-------------------Begin of Note-----------------\n"); - ts << (bo->getNote()); - ts << ("\n"); - ts << ("-------------------End of Note-------------------\n"); + s =textConvertToASCII(bo->getNote()); + s=s.replace ("\n","\n"+actIndent); + ts << (s+"\n\n"); } bo=bo->next(); @@ -97,36 +88,3 @@ return r + " "; } -void Export::exportAsHTML() -{ - // FIXME just testing... - // Main loop over all branches - QString s; - QString actIndent(""); - int i; - BranchObj *bo; - bo=mapCenter->first(); - while (bo) - { - // Make indentstring - for (i=0;igetDepth();i++) actIndent+= indentPerDepth; - - // Write heading - write (actIndent + getSectionString(bo) + bo->getHeading()+ "\n"); - - // If necessary, write note - if (!bo->getNote().isEmpty()) - { - write (bo->getNote()); - } - - bo=bo->next(); - actIndent=""; - } -} - -void Export::write(QString s) -{ - cout << s; -} -