[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdenonbeta/krecipes/src/exporters
From: Jason Kivlighn <confederacy2 () excite ! com>
Date: 2003-11-30 22:53:30
[Download RAW message or body]
CVS commit by jkivlighn:
-Export authors
-Fix doctype
-Delete temporary photo created immediately
M +15 -3 cookmlexporter.cpp 1.3
--- kdenonbeta/krecipes/src/exporters/cookmlexporter.cpp #1.2:1.3
@@ -36,5 +36,5 @@ QString CookMLExporter::createContent( c
{
QDomImplementation dom_imp;
- QDomDocument doc = dom_imp.createDocument( QString::null, "cookml", \
dom_imp.createDocumentType( "cookml", "SYSTEM", "cookml.dtd") ); + \
QDomDocument doc = dom_imp.createDocument( QString::null, "cookml", \
dom_imp.createDocumentType( "cookml", QString::null, "cookml.dtd") );
QDomElement cookml_tag = doc.documentElement();
@@ -60,5 +60,5 @@ QString CookMLExporter::createContent( c
head_tag.setAttribute("servingqty",recipe->persons);
head_tag.setAttribute("servingtype",i18n("Persons"));
- head_tag.setAttribute("rid",i18n(""));
+ head_tag.setAttribute("rid",i18n("")); //FIXME:what's \
this...recipe ID?? recipe_tag.appendChild( head_tag );
@@ -73,8 +73,19 @@ QString CookMLExporter::createContent( c
}
+ QPtrListIterator<Element> author_it( \
recipe->authorList ); + Element *author;
+ while ( (author = author_it.current()) != 0 )
+ {
+ ++author_it;
+ QDomElement sourceline_tag = \
doc.createElement("sourceline"); + \
sourceline_tag.appendChild( doc.createTextNode(author->name) ); + \
head_tag.appendChild(sourceline_tag); + }
+
QDomElement picbin_tag = doc.createElement( \
"picbin"); picbin_tag.setAttribute("format","JPG");
- KTempFile* fn = new KTempFile(locateLocal("tmp", \
"kre"), ".jpg", 0600); + KTempFile* fn = new \
KTempFile(locateLocal("tmp", "cml"), ".jpg", 0600); + \
fn->setAutoDelete(true); recipe->photo.save(fn->name(), "JPEG");
QByteArray data;
@@ -83,4 +94,5 @@ QString CookMLExporter::createContent( c
data = (fn->file())->readAll();
fn->close();
+ delete fn;
}
picbin_tag.appendChild( doc.createTextNode( \
KCodecs::base64Encode(data, true) ) );
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic