1.1 --- a/exports.cpp Mon May 21 13:05:26 2007 +0000
1.2 +++ b/exports.cpp Wed May 30 15:23:07 2007 +0000
1.3 @@ -111,7 +111,6 @@
1.4 return r + " ";
1.5 }
1.6
1.7 -
1.8 ////////////////////////////////////////////////////////////////////////
1.9 void ExportASCII::doExport()
1.10 {
1.11 @@ -131,7 +130,6 @@
1.12 bo=mapCenter->first();
1.13 while (bo)
1.14 {
1.15 - cout << "export bo="<<bo->getHeading().ascii()<<endl;
1.16 // Make indentstring
1.17 for (i=0;i<bo->getDepth();i++) actIndent+= indentPerDepth;
1.18
1.19 @@ -162,6 +160,50 @@
1.20 file.close();
1.21 }
1.22
1.23 +
1.24 +////////////////////////////////////////////////////////////////////////
1.25 +void ExportCSV::doExport()
1.26 +{
1.27 + QFile file (outputFile);
1.28 + if ( !file.open( QIODevice::WriteOnly ) )
1.29 + {
1.30 + qWarning ("ExportBase::exportXML couldn't open "+outputFile);
1.31 + return;
1.32 + }
1.33 + QTextStream ts( &file ); // use LANG decoding here...
1.34 +
1.35 + // Write header
1.36 + ts << "\"Note\"" <<endl;
1.37 +
1.38 + // Main loop over all branches
1.39 + QString s;
1.40 + QString actIndent("");
1.41 + int i,j;
1.42 + BranchObj *bo;
1.43 + bo=mapCenter->first();
1.44 + while (bo)
1.45 + {
1.46 + // If necessary, write note
1.47 + if (!bo->getNote().isEmpty())
1.48 + {
1.49 + s =bo->getNoteASCII();
1.50 + s=s.replace ("\n","\n"+actIndent);
1.51 + ts << ("\""+s+"\",");
1.52 + } else
1.53 + ts <<"\"\",";
1.54 +
1.55 + // Make indentstring
1.56 + for (i=0;i<bo->getDepth();i++) actIndent+= "\"\",";
1.57 +
1.58 + // Write heading
1.59 + ts << actIndent << "\"" << bo->getHeading()<<"\""<<endl;
1.60 +
1.61 + bo=bo->next();
1.62 + actIndent="";
1.63 + }
1.64 + file.close();
1.65 +}
1.66 +
1.67 ////////////////////////////////////////////////////////////////////////
1.68 void ExportKDEBookmarks::doExport()
1.69 {