diff options
Diffstat (limited to 'src/translators/htmlexporter.cpp')
-rw-r--r-- | src/translators/htmlexporter.cpp | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/src/translators/htmlexporter.cpp b/src/translators/htmlexporter.cpp index 31701d4..333ebfd 100644 --- a/src/translators/htmlexporter.cpp +++ b/src/translators/htmlexporter.cpp @@ -34,7 +34,7 @@ #include <tqdom.h> #include <tqgroupbox.h> -#include <layout.h> +#include <tqlayout.h> #include <tqcheckbox.h> #include <tqwhatsthis.h> #include <tqfile.h> @@ -59,7 +59,7 @@ HTMLExporter::HTMLExporter() : Tellico::Export::Exporter(), m_imageWidth(0), m_imageHeight(0), m_widget(0), - m_xsltFile(TQString::fromLatin1("tellico2html.xsl")) { + m_xsltFile(TQString::tqfromLatin1("tellico2html.xsl")) { } HTMLExporter::HTMLExporter(Data::CollPtr coll_) : Tellico::Export::Exporter(coll_), @@ -73,7 +73,7 @@ HTMLExporter::HTMLExporter(Data::CollPtr coll_) : Tellico::Export::Exporter(coll m_imageWidth(0), m_imageHeight(0), m_widget(0), - m_xsltFile(TQString::fromLatin1("tellico2html.xsl")) { + m_xsltFile(TQString::tqfromLatin1("tellico2html.xsl")) { } HTMLExporter::~HTMLExporter() { @@ -201,7 +201,7 @@ bool HTMLExporter::loadXSLTFile() { } if(!m_collectionURL.isEmpty()) { - TQString s = TQString::fromLatin1("../") + m_collectionURL.fileName(); + TQString s = TQString::tqfromLatin1("../") + m_collectionURL.fileName(); m_handler->addStringParam("collection-file", s.utf8()); } @@ -209,7 +209,7 @@ bool HTMLExporter::loadXSLTFile() { // if parseDOM, that means we want the locations to be the actual location // otherwise, we assume it'll be relative if(m_parseDOM && m_dataDir.isEmpty()) { - m_dataDir = KGlobal::dirs()->findResourceDir("appdata", TQString::fromLatin1("pics/tellico.png")); + m_dataDir = KGlobal::dirs()->findResourceDir("appdata", TQString::tqfromLatin1("pics/tellico.png")); } else if(!m_parseDOM) { m_dataDir.truncate(0); } @@ -250,7 +250,7 @@ TQString HTMLExporter::text() { exporter.setOptions(options() | Export::ExportUTF8 | Export::ExportImages); TQDomDocument output = exporter.exportXML(); #if 0 - TQFile f(TQString::fromLatin1("/tmp/test.xml")); + TQFile f(TQString::tqfromLatin1("/tmp/test.xml")); if(f.open(IO_WriteOnly)) { TQTextStream t(&f); t << output.toString(); @@ -260,7 +260,7 @@ TQString HTMLExporter::text() { TQString text = m_handler->applyStylesheet(output.toString()); #if 0 - TQFile f2(TQString::fromLatin1("/tmp/test.html")); + TQFile f2(TQString::tqfromLatin1("/tmp/test.html")); if(f2.open(IO_WriteOnly)) { TQTextStream t(&f2); t << text; @@ -279,7 +279,7 @@ void HTMLExporter::setFormattingOptions(Data::CollPtr coll) { if(file != i18n("Untitled")) { m_handler->addStringParam("filename", TQFile::encodeName(file)); } - m_handler->addStringParam("cdate", KGlobal::locale()->formatDate(TQDate::currentDate()).utf8()); + m_handler->addStringParam("cdate", KGlobal::locale()->formatDate(TQDate::tqcurrentDate()).utf8()); m_handler->addParam("show-headers", m_printHeaders ? "true()" : "false()"); m_handler->addParam("group-entries", m_printGrouped ? "true()" : "false()"); @@ -317,7 +317,7 @@ void HTMLExporter::setFormattingOptions(Data::CollPtr coll) { } else { s = coll->fieldTitleByName(m_groupBy[0]); } - sortString = i18n("(grouped by %1)").arg(s); + sortString = i18n("(grouped by %1)").tqarg(s); TQString groupFields; for(TQStringList::ConstIterator it = m_groupBy.begin(); it != m_groupBy.end(); ++it) { @@ -326,20 +326,20 @@ void HTMLExporter::setFormattingOptions(Data::CollPtr coll) { continue; } if(f->flags() & Data::Field::AllowMultiple) { - groupFields += TQString::fromLatin1("tc:") + *it + TQString::fromLatin1("s/tc:") + *it; + groupFields += TQString::tqfromLatin1("tc:") + *it + TQString::tqfromLatin1("s/tc:") + *it; } else { - groupFields += TQString::fromLatin1("tc:") + *it; + groupFields += TQString::tqfromLatin1("tc:") + *it; } int ncols = 0; if(f->type() == Data::Field::Table) { bool ok; - ncols = Tellico::toUInt(f->property(TQString::fromLatin1("columns")), &ok); + ncols = Tellico::toUInt(f->property(TQString::tqfromLatin1("columns")), &ok); if(!ok) { ncols = 1; } } if(ncols > 1) { - groupFields += TQString::fromLatin1("/tc:column[1]"); + groupFields += TQString::tqfromLatin1("/tc:column[1]"); } if(*it != m_groupBy.last()) { groupFields += '|'; @@ -484,19 +484,19 @@ TQWidget* HTMLExporter::widget(TQWidget* parent_, const char* name_/*=0*/) { } void HTMLExporter::readOptions(KConfig* config_) { - KConfigGroup exportConfig(config_, TQString::fromLatin1("ExportOptions - %1").arg(formatString())); + KConfigGroup exportConfig(config_, TQString::tqfromLatin1("ExportOptions - %1").tqarg(formatString())); m_printHeaders = exportConfig.readBoolEntry("Print Field Headers", m_printHeaders); m_printGrouped = exportConfig.readBoolEntry("Print Grouped", m_printGrouped); m_exportEntryFiles = exportConfig.readBoolEntry("Export Entry Files", m_exportEntryFiles); // read current entry export template m_entryXSLTFile = Config::templateName(collection()->type()); - m_entryXSLTFile = locate("appdata", TQString::fromLatin1("entry-templates/") - + m_entryXSLTFile + TQString::fromLatin1(".xsl")); + m_entryXSLTFile = locate("appdata", TQString::tqfromLatin1("entry-templates/") + + m_entryXSLTFile + TQString::tqfromLatin1(".xsl")); } void HTMLExporter::saveOptions(KConfig* config_) { - KConfigGroup cfg(config_, TQString::fromLatin1("ExportOptions - %1").arg(formatString())); + KConfigGroup cfg(config_, TQString::tqfromLatin1("ExportOptions - %1").tqarg(formatString())); m_printHeaders = m_checkPrintHeaders->isChecked(); cfg.writeEntry("Print Field Headers", m_printHeaders); m_printGrouped = m_checkPrintGrouped->isChecked(); @@ -521,16 +521,16 @@ KURL HTMLExporter::fileDir() const { } KURL fileDir = url(); // cd to directory of target URL - fileDir.cd(TQString::fromLatin1("..")); + fileDir.cd(TQString::tqfromLatin1("..")); fileDir.addPath(fileDirName()); return fileDir; } TQString HTMLExporter::fileDirName() const { if(!m_collectionURL.isEmpty()) { - return TQString::fromLatin1("/"); + return TQString::tqfromLatin1("/"); } - return url().fileName().section('.', 0, 0) + TQString::fromLatin1("_files/"); + return url().fileName().section('.', 0, 0) + TQString::tqfromLatin1("_files/"); } // how ugly is this? @@ -569,10 +569,10 @@ TQString HTMLExporter::handleLink(const TQString& link_) { // if we're exporting entry files, we want pics/ to // go in pics/ - const bool isPic = link_.startsWith(m_dataDir + TQString::fromLatin1("pics/")); + const bool isPic = link_.startsWith(m_dataDir + TQString::tqfromLatin1("pics/")); TQString midDir; if(m_exportEntryFiles && isPic) { - midDir = TQString::fromLatin1("pics/"); + midDir = TQString::tqfromLatin1("pics/"); } // pictures are special since they might not exist when the HTML is exported, since they might get copied later // on the other hand, don't change the file location if it doesn't exist @@ -592,7 +592,7 @@ TQString HTMLExporter::analyzeInternalCSS(const TQString& str_) { TQString str = str_; int start = 0; int end = 0; - const TQString url = TQString::fromLatin1("url("); + const TQString url = TQString::tqfromLatin1("url("); for(int pos = str.find(url); pos >= 0; pos = str.find(url, pos+1)) { pos += 4; // url( if(str[pos] == '"' || str[pos] == '\'') { @@ -678,7 +678,7 @@ bool HTMLExporter::writeEntryFiles() { // I can't reliable encode a string as a URI, so I'm punting, and I'll just replace everything but // a-zA-Z0-9 with an underscore. This MUST match the filename template in tellico2html.xsl // the id is used so uniqueness is guaranteed - const TQRegExp badChars(TQString::fromLatin1("[^-a-zA-Z0-9]")); + const TQRegExp badChars(TQString::tqfromLatin1("[^-a-zA-Z0-9]")); bool formatted = options() & Export::ExportFormatted; KURL outputFile = fileDir(); @@ -693,8 +693,8 @@ bool HTMLExporter::writeEntryFiles() { exporter.setCollectionURL(url()); bool parseDOM = true; - const TQString title = TQString::fromLatin1("title"); - const TQString html = TQString::fromLatin1(".html"); + const TQString title = TQString::tqfromLatin1("title"); + const TQString html = TQString::tqfromLatin1(".html"); bool multipleTitles = collection()->fieldByName(title)->flags() & Data::Field::AllowMultiple; Data::EntryVec entries = this->entries(); // not const since the pointer has to be copied for(Data::EntryVecIt entryIt = entries.begin(); entryIt != entries.end() && !m_cancelled; ++entryIt, ++j) { @@ -733,14 +733,14 @@ bool HTMLExporter::writeEntryFiles() { // the images in "pics/" are special data images, copy them always // since the entry files may refer to them, but we don't know that TQStringList dataImages; - dataImages << TQString::fromLatin1("checkmark.png"); + dataImages << TQString::tqfromLatin1("checkmark.png"); for(uint i = 1; i <= 10; ++i) { - dataImages << TQString::fromLatin1("stars%1.png").arg(i); + dataImages << TQString::tqfromLatin1("stars%1.png").tqarg(i); } KURL dataDir; - dataDir.setPath(KGlobal::dirs()->findResourceDir("appdata", TQString::fromLatin1("pics/tellico.png")) + "pics/"); + dataDir.setPath(KGlobal::dirs()->findResourceDir("appdata", TQString::tqfromLatin1("pics/tellico.png")) + "pics/"); KURL target = fileDir(); - target.addPath(TQString::fromLatin1("pics/")); + target.addPath(TQString::tqfromLatin1("pics/")); KIO::NetAccess::mkdir(target, m_widget); for(TQStringList::ConstIterator it = dataImages.begin(); it != dataImages.end(); ++it) { dataDir.setFileName(*it); |