diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-02 06:40:27 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-02 06:40:27 +0000 |
commit | 2595a15ebeb6fc46b7cb241d01ec0c2460ec2111 (patch) | |
tree | 18a8f0f4ac5a86dacfa74c3537551ec39bc85e75 /src/translators/htmlexporter.cpp | |
parent | 1d90725a4001fab9d3922b2cbcceeee5e2d1686f (diff) | |
download | tellico-2595a15ebeb6fc46b7cb241d01ec0c2460ec2111.tar.gz tellico-2595a15ebeb6fc46b7cb241d01ec0c2460ec2111.zip |
TQt4 port tellico
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/tellico@1239054 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/translators/htmlexporter.cpp')
-rw-r--r-- | src/translators/htmlexporter.cpp | 240 |
1 files changed, 120 insertions, 120 deletions
diff --git a/src/translators/htmlexporter.cpp b/src/translators/htmlexporter.cpp index e947793..b8a38c0 100644 --- a/src/translators/htmlexporter.cpp +++ b/src/translators/htmlexporter.cpp @@ -32,14 +32,14 @@ #include <kapplication.h> #include <klocale.h> -#include <qdom.h> -#include <qgroupbox.h> -#include <qlayout.h> -#include <qcheckbox.h> -#include <qwhatsthis.h> -#include <qfile.h> -#include <qhbox.h> -#include <qlabel.h> +#include <tqdom.h> +#include <tqgroupbox.h> +#include <tqlayout.h> +#include <tqcheckbox.h> +#include <tqwhatsthis.h> +#include <tqfile.h> +#include <tqhbox.h> +#include <tqlabel.h> extern "C" { #include <libxml/HTMLparser.h> @@ -59,7 +59,7 @@ HTMLExporter::HTMLExporter() : Tellico::Export::Exporter(), m_imageWidth(0), m_imageHeight(0), m_widget(0), - m_xsltFile(QString::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(QString::fromLatin1("tellico2html.xsl")) { + m_xsltFile(TQString::tqfromLatin1("tellico2html.xsl")) { } HTMLExporter::~HTMLExporter() { @@ -81,12 +81,12 @@ HTMLExporter::~HTMLExporter() { m_handler = 0; } -QString HTMLExporter::formatString() const { +TQString HTMLExporter::formatString() const { return i18n("HTML"); } -QString HTMLExporter::fileFilter() const { - return i18n("*.html|HTML Files (*.html)") + QChar('\n') + i18n("*|All Files"); +TQString HTMLExporter::fileFilter() const { + return i18n("*.html|HTML Files (*.html)") + TQChar('\n') + i18n("*|All Files"); } void HTMLExporter::reset() { @@ -118,9 +118,9 @@ bool HTMLExporter::exec() { m_cancelled = false; // TODO: maybe need label? if(options() & ExportProgress) { - ProgressItem& item = ProgressManager::self()->newProgressItem(this, QString::null, true); + ProgressItem& item = ProgressManager::self()->newProgressItem(this, TQString(), true); item.setTotalSteps(100); - connect(&item, SIGNAL(signalCancelled(ProgressItem*)), SLOT(slotCancel())); + connect(&item, TQT_SIGNAL(signalCancelled(ProgressItem*)), TQT_SLOT(slotCancel())); } // ok if not ExportProgress, no worries ProgressItem::Done done(this); @@ -141,9 +141,9 @@ bool HTMLExporter::exec() { xmlChar* c; int bytes; htmlDocDumpMemory(htmlDoc, &c, &bytes); - QString allText; + TQString allText; if(bytes > 0) { - allText = QString::fromUtf8(reinterpret_cast<const char*>(c), bytes); + allText = TQString::fromUtf8(reinterpret_cast<const char*>(c), bytes); xmlFree(c); } @@ -158,7 +158,7 @@ bool HTMLExporter::exec() { } bool HTMLExporter::loadXSLTFile() { - QString xsltfile = locate("appdata", m_xsltFile); + TQString xsltfile = locate("appdata", m_xsltFile); if(xsltfile.isNull()) { myDebug() << "HTMLExporter::loadXSLTFile() - no xslt file for " << m_xsltFile << endl; return false; @@ -167,9 +167,9 @@ bool HTMLExporter::loadXSLTFile() { KURL u; u.setPath(xsltfile); // do NOT do namespace processing, it messes up the XSL declaration since - // QDom thinks there are no elements in the Tellico namespace and as a result + // TQDom thinks there are no elements in the Tellico namespace and as a result // removes the namespace declaration - QDomDocument dom = FileHandler::readXMLFile(u, false); + TQDomDocument dom = FileHandler::readXMLFile(u, false); if(dom.isNull()) { myDebug() << "HTMLExporter::loadXSLTFile() - error loading xslt file: " << xsltfile << endl; return false; @@ -186,7 +186,7 @@ bool HTMLExporter::loadXSLTFile() { } delete m_handler; - m_handler = new XSLTHandler(dom, QFile::encodeName(xsltfile), true /*translate*/); + m_handler = new XSLTHandler(dom, TQFile::encodeName(xsltfile), true /*translate*/); if(!m_handler->isValid()) { delete m_handler; m_handler = 0; @@ -195,13 +195,13 @@ bool HTMLExporter::loadXSLTFile() { if(m_exportEntryFiles) { // export entries to same place as all the other date files - m_handler->addStringParam("entrydir", QFile::encodeName(fileDir().fileName())+ '/'); + m_handler->addStringParam("entrydir", TQFile::encodeName(fileDir().fileName())+ '/'); // be sure to link all the entries m_handler->addParam("link-entries", "true()"); } if(!m_collectionURL.isEmpty()) { - QString s = QString::fromLatin1("../") + m_collectionURL.fileName(); + TQString s = TQString::tqfromLatin1("../") + m_collectionURL.fileName(); m_handler->addStringParam("collection-file", s.utf8()); } @@ -209,12 +209,12 @@ 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", QString::fromLatin1("pics/tellico.png")); + m_dataDir = KGlobal::dirs()->findResourceDir("appdata", TQString::tqfromLatin1("pics/tellico.png")); } else if(!m_parseDOM) { m_dataDir.truncate(0); } if(!m_dataDir.isEmpty()) { - m_handler->addStringParam("datadir", QFile::encodeName(m_dataDir)); + m_handler->addStringParam("datadir", TQFile::encodeName(m_dataDir)); } setFormattingOptions(collection()); @@ -222,16 +222,16 @@ bool HTMLExporter::loadXSLTFile() { return m_handler->isValid(); } -QString HTMLExporter::text() { +TQString HTMLExporter::text() { if((!m_handler || !m_handler->isValid()) && !loadXSLTFile()) { kdWarning() << "HTMLExporter::text() - error loading xslt file: " << m_xsltFile << endl; - return QString::null; + return TQString(); } Data::CollPtr coll = collection(); if(!coll) { myDebug() << "HTMLExporter::text() - no collection pointer!" << endl; - return QString::null; + return TQString(); } if(m_groupBy.isEmpty()) { @@ -248,21 +248,21 @@ QString HTMLExporter::text() { exporter.setIncludeGroups(m_printGrouped); // yes, this should be in utf8, always exporter.setOptions(options() | Export::ExportUTF8 | Export::ExportImages); - QDomDocument output = exporter.exportXML(); + TQDomDocument output = exporter.exportXML(); #if 0 - QFile f(QString::fromLatin1("/tmp/test.xml")); + TQFile f(TQString::tqfromLatin1("/tmp/test.xml")); if(f.open(IO_WriteOnly)) { - QTextStream t(&f); + TQTextStream t(&f); t << output.toString(); } f.close(); #endif - QString text = m_handler->applyStylesheet(output.toString()); + TQString text = m_handler->applyStylesheet(output.toString()); #if 0 - QFile f2(QString::fromLatin1("/tmp/test.html")); + TQFile f2(TQString::tqfromLatin1("/tmp/test.html")); if(f2.open(IO_WriteOnly)) { - QTextStream t(&f2); + TQTextStream t(&f2); t << text; // t << "\n\n-------------------------------------------------------\n\n"; // t << Tellico::i18nReplace(text); @@ -275,15 +275,15 @@ QString HTMLExporter::text() { } void HTMLExporter::setFormattingOptions(Data::CollPtr coll) { - QString file = Kernel::self()->URL().fileName(); + TQString file = Kernel::self()->URL().fileName(); if(file != i18n("Untitled")) { - m_handler->addStringParam("filename", QFile::encodeName(file)); + m_handler->addStringParam("filename", TQFile::encodeName(file)); } - m_handler->addStringParam("cdate", KGlobal::locale()->formatDate(QDate::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()"); - QStringList sortTitles; + TQStringList sortTitles; if(!m_sort1.isEmpty()) { sortTitles << m_sort1; } @@ -292,7 +292,7 @@ void HTMLExporter::setFormattingOptions(Data::CollPtr coll) { } // the third sort column may be same as first - if(!m_sort3.isEmpty() && sortTitles.findIndex(m_sort3) == -1) { + if(!m_sort3.isEmpty() && sortTitles.tqfindIndex(m_sort3) == -1) { sortTitles << m_sort3; } @@ -308,38 +308,38 @@ void HTMLExporter::setFormattingOptions(Data::CollPtr coll) { // no longer showing "sorted by..." since the column headers are clickable // but still use "grouped by" - QString sortString; + TQString sortString; if(m_printGrouped) { - QString s; + TQString s; // if more than one, then it's the People pseudo-group if(m_groupBy.count() > 1) { s = i18n("People"); } else { s = coll->fieldTitleByName(m_groupBy[0]); } - sortString = i18n("(grouped by %1)").arg(s); + sortString = i18n("(grouped by %1)").tqarg(s); - QString groupFields; - for(QStringList::ConstIterator it = m_groupBy.begin(); it != m_groupBy.end(); ++it) { + TQString groupFields; + for(TQStringList::ConstIterator it = m_groupBy.begin(); it != m_groupBy.end(); ++it) { Data::FieldPtr f = coll->fieldByName(*it); if(!f) { continue; } if(f->flags() & Data::Field::AllowMultiple) { - groupFields += QString::fromLatin1("tc:") + *it + QString::fromLatin1("s/tc:") + *it; + groupFields += TQString::tqfromLatin1("tc:") + *it + TQString::tqfromLatin1("s/tc:") + *it; } else { - groupFields += QString::fromLatin1("tc:") + *it; + groupFields += TQString::tqfromLatin1("tc:") + *it; } int ncols = 0; if(f->type() == Data::Field::Table) { bool ok; - ncols = Tellico::toUInt(f->property(QString::fromLatin1("columns")), &ok); + ncols = Tellico::toUInt(f->property(TQString::tqfromLatin1("columns")), &ok); if(!ok) { ncols = 1; } } if(ncols > 1) { - groupFields += QString::fromLatin1("/tc:column[1]"); + groupFields += TQString::tqfromLatin1("/tc:column[1]"); } if(*it != m_groupBy.last()) { groupFields += '|'; @@ -350,29 +350,29 @@ void HTMLExporter::setFormattingOptions(Data::CollPtr coll) { m_handler->addStringParam("sort-title", sortString.utf8()); } - QString pageTitle = coll->title(); - pageTitle += QChar(' ') + sortString; + TQString pageTitle = coll->title(); + pageTitle += TQChar(' ') + sortString; m_handler->addStringParam("page-title", pageTitle.utf8()); - QStringList showFields; - for(QStringList::ConstIterator it = m_columns.begin(); it != m_columns.end(); ++it) { + TQStringList showFields; + for(TQStringList::ConstIterator it = m_columns.begin(); it != m_columns.end(); ++it) { showFields << coll->fieldNameByTitle(*it); } - m_handler->addStringParam("column-names", showFields.join(QChar(' ')).utf8()); + m_handler->addStringParam("column-names", showFields.join(TQChar(' ')).utf8()); if(m_imageWidth > 0 && m_imageHeight > 0) { - m_handler->addParam("image-width", QCString().setNum(m_imageWidth)); - m_handler->addParam("image-height", QCString().setNum(m_imageHeight)); + m_handler->addParam("image-width", TQCString().setNum(m_imageWidth)); + m_handler->addParam("image-height", TQCString().setNum(m_imageHeight)); } // add system colors to stylesheet const int type = coll->type(); - m_handler->addStringParam("font", Config::templateFont(type).family().latin1()); - m_handler->addStringParam("fontsize", QCString().setNum(Config::templateFont(type).pointSize())); - m_handler->addStringParam("bgcolor", Config::templateBaseColor(type).name().latin1()); - m_handler->addStringParam("fgcolor", Config::templateTextColor(type).name().latin1()); - m_handler->addStringParam("color1", Config::templateHighlightedTextColor(type).name().latin1()); - m_handler->addStringParam("color2", Config::templateHighlightedBaseColor(type).name().latin1()); + m_handler->addStringParam("font", TQString(Config::templateFont(type).family()).latin1()); + m_handler->addStringParam("fontsize", TQCString().setNum(Config::templateFont(type).pointSize())); + m_handler->addStringParam("bgcolor", TQString(Config::templateBaseColor(type).name()).latin1()); + m_handler->addStringParam("fgcolor", TQString(Config::templateTextColor(type).name()).latin1()); + m_handler->addStringParam("color1", TQString(Config::templateHighlightedTextColor(type).name()).latin1()); + m_handler->addStringParam("color2", TQString(Config::templateHighlightedBaseColor(type).name()).latin1()); // add locale code to stylesheet (for sorting) m_handler->addStringParam("lang", KGlobal::locale()->languagesTwoAlpha().first().utf8()); @@ -381,7 +381,7 @@ void HTMLExporter::setFormattingOptions(Data::CollPtr coll) { void HTMLExporter::writeImages(Data::CollPtr coll_) { // keep track of which image fields to write, this is for field names StringSet imageFields; - for(QStringList::ConstIterator it = m_columns.begin(); it != m_columns.end(); ++it) { + for(TQStringList::ConstIterator it = m_columns.begin(); it != m_columns.end(); ++it) { if(coll_->fieldByTitle(*it)->type() == Data::Field::Image) { imageFields.add(*it); } @@ -402,7 +402,7 @@ void HTMLExporter::writeImages(Data::CollPtr coll_) { // all of them are going to get written to tmp file bool useTemp = url().isEmpty(); KURL imgDir; - QString imgDirRelative; + TQString imgDirRelative; // really some convoluted logic here // basically, four cases. 1) we're writing to a tmp file, for printing probably // so then write all the images to the tmp directory, 2) we're exporting to HTML, and @@ -423,16 +423,16 @@ void HTMLExporter::writeImages(Data::CollPtr coll_) { imgDirRelative = KURL::relativeURL(url(), imgDir); createDir(); } - m_handler->addStringParam("imgdir", QFile::encodeName(imgDirRelative)); + m_handler->addStringParam("imgdir", TQFile::encodeName(imgDirRelative)); int count = 0; const int processCount = 100; // process after every 100 events - QStringList fieldsList = imageFields.toList(); + TQStringList fieldsList = imageFields.toList(); StringSet imageSet; // track which images are written - for(QStringList::ConstIterator fieldName = fieldsList.begin(); fieldName != fieldsList.end(); ++fieldName) { + for(TQStringList::ConstIterator fieldName = fieldsList.begin(); fieldName != fieldsList.end(); ++fieldName) { for(Data::EntryVec::ConstIterator entryIt = entries().begin(); entryIt != entries().end(); ++entryIt) { - QString id = entryIt->field(*fieldName); + TQString id = entryIt->field(*fieldName); // if no id or is already writen, continue if(id.isEmpty() || imageSet.has(id)) { continue; @@ -454,29 +454,29 @@ void HTMLExporter::writeImages(Data::CollPtr coll_) { } } -QWidget* HTMLExporter::widget(QWidget* parent_, const char* name_/*=0*/) { - if(m_widget && m_widget->parent() == parent_) { +TQWidget* HTMLExporter::widget(TQWidget* tqparent_, const char* name_/*=0*/) { + if(m_widget && TQT_BASE_OBJECT(m_widget->tqparent()) == TQT_BASE_OBJECT(tqparent_)) { return m_widget; } - m_widget = new QWidget(parent_, name_); - QVBoxLayout* l = new QVBoxLayout(m_widget); + m_widget = new TQWidget(tqparent_, name_); + TQVBoxLayout* l = new TQVBoxLayout(m_widget); - QGroupBox* box = new QGroupBox(1, Qt::Horizontal, i18n("HTML Options"), m_widget); + TQGroupBox* box = new TQGroupBox(1, Qt::Horizontal, i18n("HTML Options"), m_widget); l->addWidget(box); - m_checkPrintHeaders = new QCheckBox(i18n("Print field headers"), box); - QWhatsThis::add(m_checkPrintHeaders, i18n("If checked, the field names will be " + m_checkPrintHeaders = new TQCheckBox(i18n("Print field headers"), box); + TQWhatsThis::add(m_checkPrintHeaders, i18n("If checked, the field names will be " "printed as table headers.")); m_checkPrintHeaders->setChecked(m_printHeaders); - m_checkPrintGrouped = new QCheckBox(i18n("Group the entries"), box); - QWhatsThis::add(m_checkPrintGrouped, i18n("If checked, the entries will be grouped by " + m_checkPrintGrouped = new TQCheckBox(i18n("Group the entries"), box); + TQWhatsThis::add(m_checkPrintGrouped, i18n("If checked, the entries will be grouped by " "the selected field.")); m_checkPrintGrouped->setChecked(m_printGrouped); - m_checkExportEntryFiles = new QCheckBox(i18n("Export individual entry files"), box); - QWhatsThis::add(m_checkExportEntryFiles, i18n("If checked, individual files will be created for each entry.")); + m_checkExportEntryFiles = new TQCheckBox(i18n("Export individual entry files"), box); + TQWhatsThis::add(m_checkExportEntryFiles, i18n("If checked, individual files will be created for each entry.")); m_checkExportEntryFiles->setChecked(m_exportEntryFiles); l->addStretch(1); @@ -484,19 +484,19 @@ QWidget* HTMLExporter::widget(QWidget* parent_, const char* name_/*=0*/) { } void HTMLExporter::readOptions(KConfig* config_) { - KConfigGroup exportConfig(config_, QString::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", QString::fromLatin1("entry-templates/") - + m_entryXSLTFile + QString::fromLatin1(".xsl")); + m_entryXSLTFile = locate("appdata", TQString::tqfromLatin1("entry-templates/") + + m_entryXSLTFile + TQString::tqfromLatin1(".xsl")); } void HTMLExporter::saveOptions(KConfig* config_) { - KConfigGroup cfg(config_, QString::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(); @@ -505,13 +505,13 @@ void HTMLExporter::saveOptions(KConfig* config_) { cfg.writeEntry("Export Entry Files", m_exportEntryFiles); } -void HTMLExporter::setXSLTFile(const QString& filename_) { +void HTMLExporter::setXSLTFile(const TQString& filename_) { if(m_xsltFile == filename_) { return; } m_xsltFile = filename_; - m_xsltFilePath = QString::null; + m_xsltFilePath = TQString(); reset(); } @@ -521,25 +521,25 @@ KURL HTMLExporter::fileDir() const { } KURL fileDir = url(); // cd to directory of target URL - fileDir.cd(QString::fromLatin1("..")); + fileDir.cd(TQString::tqfromLatin1("..")); fileDir.addPath(fileDirName()); return fileDir; } -QString HTMLExporter::fileDirName() const { +TQString HTMLExporter::fileDirName() const { if(!m_collectionURL.isEmpty()) { - return QString::fromLatin1("/"); + return TQString::tqfromLatin1("/"); } - return url().fileName().section('.', 0, 0) + QString::fromLatin1("_files/"); + return url().fileName().section('.', 0, 0) + TQString::tqfromLatin1("_files/"); } // how ugly is this? const xmlChar* HTMLExporter::handleLink(const xmlChar* link_) { - return reinterpret_cast<xmlChar*>(qstrdup(handleLink(QString::fromUtf8(reinterpret_cast<const char*>(link_))).utf8())); + return reinterpret_cast<xmlChar*>(qstrdup(handleLink(TQString::fromUtf8(reinterpret_cast<const char*>(link_))).utf8())); } -QString HTMLExporter::handleLink(const QString& link_) { - if(m_links.contains(link_)) { +TQString HTMLExporter::handleLink(const TQString& link_) { + if(m_links.tqcontains(link_)) { return m_links[link_]; } // assume that if the link_ is not relative, then we don't need to copy it @@ -569,10 +569,10 @@ QString HTMLExporter::handleLink(const QString& link_) { // if we're exporting entry files, we want pics/ to // go in pics/ - const bool isPic = link_.startsWith(m_dataDir + QString::fromLatin1("pics/")); - QString midDir; + const bool isPic = link_.startsWith(m_dataDir + TQString::tqfromLatin1("pics/")); + TQString midDir; if(m_exportEntryFiles && isPic) { - midDir = QString::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 @@ -585,28 +585,28 @@ QString HTMLExporter::handleLink(const QString& link_) { } const xmlChar* HTMLExporter::analyzeInternalCSS(const xmlChar* str_) { - return reinterpret_cast<xmlChar*>(qstrdup(analyzeInternalCSS(QString::fromUtf8(reinterpret_cast<const char*>(str_))).utf8())); + return reinterpret_cast<xmlChar*>(qstrdup(analyzeInternalCSS(TQString::fromUtf8(reinterpret_cast<const char*>(str_))).utf8())); } -QString HTMLExporter::analyzeInternalCSS(const QString& str_) { - QString str = str_; +TQString HTMLExporter::analyzeInternalCSS(const TQString& str_) { + TQString str = str_; int start = 0; int end = 0; - const QString url = QString::fromLatin1("url("); - for(int pos = str.find(url); pos >= 0; pos = str.find(url, pos+1)) { + const TQString url = TQString::tqfromLatin1("url("); + for(int pos = str.tqfind(url); pos >= 0; pos = str.tqfind(url, pos+1)) { pos += 4; // url( if(str[pos] == '"' || str[pos] == '\'') { ++pos; } start = pos; - pos = str.find(')', start); + pos = str.tqfind(')', start); end = pos; if(str[pos-1] == '"' || str[pos-1] == '\'') { --end; } - str.replace(start, end-start, handleLink(str.mid(start, end-start))); + str.tqreplace(start, end-start, handleLink(str.mid(start, end-start))); } return str; } @@ -633,7 +633,7 @@ bool HTMLExporter::copyFiles() { } const uint start = 20; const uint maxProgress = m_exportEntryFiles ? 40 : 80; - const uint stepSize = QMAX(1, m_files.count()/maxProgress); + const uint stepSize = TQMAX(1, m_files.count()/maxProgress); uint j = 0; createDir(); @@ -656,7 +656,7 @@ bool HTMLExporter::copyFiles() { } if(j%stepSize == 0) { if(options() & ExportProgress) { - ProgressManager::self()->setProgress(this, QMIN(start+j/stepSize, 99)); + ProgressManager::self()->setProgress(this, TQMIN(start+j/stepSize, 99)); } kapp->processEvents(); } @@ -671,19 +671,19 @@ bool HTMLExporter::writeEntryFiles() { } const uint start = 60; - const uint stepSize = QMAX(1, entries().count()/40); + const uint stepSize = TQMAX(1, entries().count()/40); uint j = 0; // now worry about actually exporting entry files // 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 QRegExp badChars(QString::fromLatin1("[^-a-zA-Z0-9]")); + const TQRegExp badChars(TQString::tqfromLatin1("[^-a-zA-Z0-9]")); bool formatted = options() & Export::ExportFormatted; KURL outputFile = fileDir(); - GUI::CursorSaver cs(Qt::waitCursor); + GUI::CursorSaver cs(TQt::waitCursor); HTMLExporter exporter(collection()); long opt = options() | Export::ExportForce; @@ -693,19 +693,19 @@ bool HTMLExporter::writeEntryFiles() { exporter.setCollectionURL(url()); bool parseDOM = true; - const QString title = QString::fromLatin1("title"); - const QString html = QString::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) { - QString file = entryIt->field(title, formatted); + TQString file = entryIt->field(title, formatted); // but only use the first title if it has multiple if(multipleTitles) { file = file.section(';', 0, 0); } - file.replace(badChars, QChar('_')); - file += QChar('-') + QString::number(entryIt->id()) + html; + file.tqreplace(badChars, TQChar('_')); + file += TQChar('-') + TQString::number(entryIt->id()) + html; outputFile.setFileName(file); exporter.setEntries(Data::EntryVec(entryIt)); @@ -725,24 +725,24 @@ bool HTMLExporter::writeEntryFiles() { if(j%stepSize == 0) { if(options() & ExportProgress) { - ProgressManager::self()->setProgress(this, QMIN(start+j/stepSize, 99)); + ProgressManager::self()->setProgress(this, TQMIN(start+j/stepSize, 99)); } kapp->processEvents(); } } // 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 - QStringList dataImages; - dataImages << QString::fromLatin1("checkmark.png"); + TQStringList dataImages; + dataImages << TQString::tqfromLatin1("checkmark.png"); for(uint i = 1; i <= 10; ++i) { - dataImages << QString::fromLatin1("stars%1.png").arg(i); + dataImages << TQString::tqfromLatin1("stars%1.png").tqarg(i); } KURL dataDir; - dataDir.setPath(KGlobal::dirs()->findResourceDir("appdata", QString::fromLatin1("pics/tellico.png")) + "pics/"); + dataDir.setPath(KGlobal::dirs()->findResourceDir("appdata", TQString::tqfromLatin1("pics/tellico.png")) + "pics/"); KURL target = fileDir(); - target.addPath(QString::fromLatin1("pics/")); + target.addPath(TQString::tqfromLatin1("pics/")); KIO::NetAccess::mkdir(target, m_widget); - for(QStringList::ConstIterator it = dataImages.begin(); it != dataImages.end(); ++it) { + for(TQStringList::ConstIterator it = dataImages.begin(); it != dataImages.end(); ++it) { dataDir.setFileName(*it); target.setFileName(*it); KIO::NetAccess::copy(dataDir, target, m_widget); @@ -764,12 +764,12 @@ void HTMLExporter::parseDOM(xmlNode* node_) { bool parseChildren = true; if(node_->type == XML_ELEMENT_NODE) { - const QCString nodeName = QCString(reinterpret_cast<const char*>(node_->name)).upper(); + const TQCString nodeName = TQCString(reinterpret_cast<const char*>(node_->name)).upper(); xmlElement* elem = reinterpret_cast<xmlElement*>(node_); // to speed up things, check now for nodename if(nodeName == "IMG" || nodeName == "SCRIPT" || nodeName == "LINK") { for(xmlAttribute* attr = elem->attributes; attr; attr = reinterpret_cast<xmlAttribute*>(attr->next)) { - QCString attrName = QCString(reinterpret_cast<const char*>(attr->name)).upper(); + TQCString attrName = TQCString(reinterpret_cast<const char*>(attr->name)).upper(); if( (attrName == "SRC" && (nodeName == "IMG" || nodeName == "SCRIPT")) || (attrName == "HREF" && nodeName == "LINK")) { |