diff options
Diffstat (limited to 'krecipes/src/exporters/htmlbookexporter.cpp')
-rw-r--r-- | krecipes/src/exporters/htmlbookexporter.cpp | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/krecipes/src/exporters/htmlbookexporter.cpp b/krecipes/src/exporters/htmlbookexporter.cpp index e1e98f4..72f09c3 100644 --- a/krecipes/src/exporters/htmlbookexporter.cpp +++ b/krecipes/src/exporters/htmlbookexporter.cpp @@ -10,15 +10,15 @@ #include "htmlbookexporter.h" -#include <qfile.h> -#include <qstylesheet.h> +#include <ntqfile.h> +#include <ntqstylesheet.h> #include <kdebug.h> #include "backends/recipedb.h" #include "datablocks/categorytree.h" -HTMLBookExporter::HTMLBookExporter( CategoryTree *categories, const QString& basedir, const QString &format ) : +HTMLBookExporter::HTMLBookExporter( CategoryTree *categories, const TQString& basedir, const TQString &format ) : HTMLExporter( basedir+"/index", format ), m_categories(categories), m_basedir(basedir) { } @@ -32,74 +32,74 @@ int HTMLBookExporter::headerFlags() const return RecipeDB::Categories | RecipeDB::Title; } -QString HTMLBookExporter::createContent( const RecipeList& recipes ) +TQString HTMLBookExporter::createContent( const RecipeList& recipes ) { RecipeList::const_iterator recipe_it; for ( recipe_it = recipes.begin(); recipe_it != recipes.end(); ++recipe_it ) { for ( ElementList::const_iterator cat_it = ( *recipe_it ).categoryList.begin(); cat_it != ( *recipe_it ).categoryList.end(); ++cat_it ) { - QMap<QString,QTextStream*>::iterator stream_it = fileMap.find( (*cat_it).name ); + TQMap<TQString,TQTextStream*>::iterator stream_it = fileMap.find( (*cat_it).name ); (**stream_it) << "<br /><br />"; - (**stream_it) << QString("<a name=\""+(*recipe_it).title+"\" />"); + (**stream_it) << TQString("<a name=\""+(*recipe_it).title+"\" />"); (**stream_it) << HTMLExporter::createContent(*recipe_it); - (**stream_it) << QString("[ <a href=\"#top\">Top</a> ]"); - (**stream_it) << QString("[ <a href=\"index.html\">Back</a> ]"); + (**stream_it) << TQString("[ <a href=\"#top\">Top</a> ]"); + (**stream_it) << TQString("[ <a href=\"index.html\">Back</a> ]"); (**stream_it) << "<br /><br />"; } } - return QString::null; + return TQString::null; } -QString HTMLBookExporter::createHeader( const RecipeList &list ) +TQString HTMLBookExporter::createHeader( const RecipeList &list ) { - QString output = HTMLExporter::createHeader(list); + TQString output = HTMLExporter::createHeader(list); - QString catLinks; - QTextStream catLinksStream(&catLinks,IO_WriteOnly); + TQString catLinks; + TQTextStream catLinksStream(&catLinks,IO_WriteOnly); createCategoryStructure(catLinksStream,list); return output+"<h1>Krecipes Recipes</h1><div>"+catLinks+"</li></ul></div>"; } -QString HTMLBookExporter::createFooter() +TQString HTMLBookExporter::createFooter() { - QMap<QString,QTextStream*>::const_iterator it; + TQMap<TQString,TQTextStream*>::const_iterator it; for ( it = fileMap.begin(); it != fileMap.end(); ++it ) { (**it) << HTMLExporter::createFooter(); (*it)->device()->close(); //does it matter the order of deletion here? - QIODevice *file = (*it)->device(); + TQIODevice *file = (*it)->device(); delete *it; delete file; } - QString output = HTMLExporter::createFooter(); + TQString output = HTMLExporter::createFooter(); return output; } -void HTMLBookExporter::createCategoryStructure( QTextStream &xml, const RecipeList &recipes ) +void HTMLBookExporter::createCategoryStructure( TQTextStream &xml, const RecipeList &recipes ) { - QValueList<int> categoriesUsed; + TQValueList<int> categoriesUsed; for ( RecipeList::const_iterator recipe_it = recipes.begin(); recipe_it != recipes.end(); ++recipe_it ) { for ( ElementList::const_iterator cat_it = ( *recipe_it ).categoryList.begin(); cat_it != ( *recipe_it ).categoryList.end(); ++cat_it ) { - QMap<QString,QTextStream*>::iterator stream_it = fileMap.find( (*cat_it).name ); + TQMap<TQString,TQTextStream*>::iterator stream_it = fileMap.find( (*cat_it).name ); if ( categoriesUsed.find( ( *cat_it ).id ) == categoriesUsed.end() ) { categoriesUsed << ( *cat_it ).id; - QString catPageName = m_basedir+"/"+escape((*cat_it).name)+".html"; - QFile *catPage = new QFile( catPageName ); + TQString catPageName = m_basedir+"/"+escape((*cat_it).name)+".html"; + TQFile *catPage = new TQFile( catPageName ); catPage->open( IO_WriteOnly ); - QTextStream *stream = new QTextStream( catPage ); - stream->setEncoding( QTextStream::UnicodeUTF8 ); + TQTextStream *stream = new TQTextStream( catPage ); + stream->setEncoding( TQTextStream::UnicodeUTF8 ); (*stream) << HTMLExporter::createHeader(recipes); - (*stream) << QString("<a name=\"top\" />"); + (*stream) << TQString("<a name=\"top\" />"); (*stream) << "<h1>"<<(*cat_it).name<<"</h1>"; stream_it = fileMap.insert((*cat_it).name,stream); } - (**stream_it) << QString("[ <a href=\"#" + (*recipe_it).title + "\">" + (*recipe_it).title + "</a> ]"); + (**stream_it) << TQString("[ <a href=\"#" + (*recipe_it).title + "\">" + (*recipe_it).title + "</a> ]"); } } @@ -113,7 +113,7 @@ void HTMLBookExporter::createCategoryStructure( QTextStream &xml, const RecipeLi } } -bool HTMLBookExporter::removeIfUnused( const QValueList<int> &cat_ids, CategoryTree *parent, bool parent_should_show ) +bool HTMLBookExporter::removeIfUnused( const TQValueList<int> &cat_ids, CategoryTree *parent, bool parent_should_show ) { for ( CategoryTree * it = parent->firstChild(); it; it = it->nextSibling() ) { if ( cat_ids.find( it->category.id ) != cat_ids.end() ) { @@ -137,13 +137,13 @@ bool HTMLBookExporter::removeIfUnused( const QValueList<int> &cat_ids, CategoryT return parent_should_show; } -void HTMLBookExporter::writeCategoryStructure( QTextStream &xml, const CategoryTree *categoryTree ) +void HTMLBookExporter::writeCategoryStructure( TQTextStream &xml, const CategoryTree *categoryTree ) { if ( categoryTree->category.id != -2 ) { if ( categoryTree->category.id != -1 ) { - QString catPageName = QStyleSheet::escape(categoryTree->category.name)+".html"; + TQString catPageName = TQStyleSheet::escape(categoryTree->category.name)+".html"; - xml << "\t<li>\n\t\t<a href=\""+catPageName+"\">"+QStyleSheet::escape( categoryTree->category.name ).replace("\"",""") + "</a>\n"; + xml << "\t<li>\n\t\t<a href=\""+catPageName+"\">"+TQStyleSheet::escape( categoryTree->category.name ).replace("\"",""") + "</a>\n"; } for ( CategoryTree * child_it = categoryTree->firstChild(); child_it; child_it = child_it->nextSibling() ) { |