diff -r 7a96bd401351 -r 401f76b830d1 exports.cpp --- a/exports.cpp Sun Jan 30 12:58:47 2005 +0000 +++ b/exports.cpp Mon Aug 08 16:15:57 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; -} -