summaryrefslogtreecommitdiffstats
path: root/src/translators/pilotdbexporter.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-02 06:40:27 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-02 06:40:27 +0000
commit2595a15ebeb6fc46b7cb241d01ec0c2460ec2111 (patch)
tree18a8f0f4ac5a86dacfa74c3537551ec39bc85e75 /src/translators/pilotdbexporter.cpp
parent1d90725a4001fab9d3922b2cbcceeee5e2d1686f (diff)
downloadtellico-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/pilotdbexporter.cpp')
-rw-r--r--src/translators/pilotdbexporter.cpp68
1 files changed, 34 insertions, 34 deletions
diff --git a/src/translators/pilotdbexporter.cpp b/src/translators/pilotdbexporter.cpp
index b9e7367..03115e9 100644
--- a/src/translators/pilotdbexporter.cpp
+++ b/src/translators/pilotdbexporter.cpp
@@ -24,12 +24,12 @@
#include <kglobal.h>
#include <kcharsets.h>
-#include <qlayout.h>
-#include <qgroupbox.h>
-#include <qcheckbox.h>
-#include <qwhatsthis.h>
-#include <qtextcodec.h>
-#include <qdatetime.h>
+#include <tqlayout.h>
+#include <tqgroupbox.h>
+#include <tqcheckbox.h>
+#include <tqwhatsthis.h>
+#include <tqtextcodec.h>
+#include <tqdatetime.h>
using Tellico::Export::PilotDBExporter;
@@ -39,12 +39,12 @@ PilotDBExporter::PilotDBExporter() : Tellico::Export::Exporter(),
m_checkBackup(0) {
}
-QString PilotDBExporter::formatString() const {
+TQString PilotDBExporter::formatString() const {
return i18n("PilotDB");
}
-QString PilotDBExporter::fileFilter() const {
- return i18n("*.pdb|Pilot Database Files (*.pdb)") + QChar('\n') + i18n("*|All Files");
+TQString PilotDBExporter::fileFilter() const {
+ return i18n("*.pdb|Pilot Database Files (*.pdb)") + TQChar('\n') + i18n("*|All Files");
}
bool PilotDBExporter::exec() {
@@ -55,14 +55,14 @@ bool PilotDBExporter::exec() {
// This is something of a hidden preference cause I don't want to put it in the GUI right now
// Latin1 by default
- QTextCodec* codec = 0;
+ TQTextCodec* codec = 0;
{
// Latin1 is default
- KConfigGroup group(KGlobal::config(), QString::fromLatin1("ExportOptions - %1").arg(formatString()));
+ KConfigGroup group(KGlobal::config(), TQString::tqfromLatin1("ExportOptions - %1").tqarg(formatString()));
codec = KGlobal::charsets()->codecForName(group.readEntry("Charset"));
}
if(!codec) {
- kdWarning() << "PilotDBExporter::exec() - no QTextCodec!" << endl;
+ kdWarning() << "PilotDBExporter::exec() - no TQTextCodec!" << endl;
return false;
#ifndef NDEBUG
} else {
@@ -89,7 +89,7 @@ bool PilotDBExporter::exec() {
case Data::Field::Choice:
// the charSeparator is actually defined in DB.h
db.appendField(codec->fromUnicode(fIt->title()).data(), PalmLib::FlatFile::Field::LIST,
- codec->fromUnicode(fIt->allowed().join(QChar('/'))).data());
+ codec->fromUnicode(fIt->allowed().join(TQChar('/'))).data());
outputFields.append(fIt);
break;
@@ -141,9 +141,9 @@ bool PilotDBExporter::exec() {
if(m_columns.count() > 0) {
PalmLib::FlatFile::ListView lv;
lv.name = codec->fromUnicode(i18n("View Columns")).data();
- for(QStringList::ConstIterator it = m_columns.begin(); it != m_columns.end(); ++it) {
+ for(TQStringList::ConstIterator it = m_columns.begin(); it != m_columns.end(); ++it) {
PalmLib::FlatFile::ListViewColumn col;
- col.field = coll->fieldTitles().findIndex(*it);
+ col.field = coll->fieldTitles().tqfindIndex(*it);
lv.push_back(col);
}
db.appendListView(lv);
@@ -153,11 +153,11 @@ bool PilotDBExporter::exec() {
Data::FieldVec::ConstIterator fIt, end = outputFields.constEnd();
bool format = options() & Export::ExportFormatted;
- QRegExp br(QString::fromLatin1("<br/?>"), false /*case-sensitive*/);
- QRegExp tags(QString::fromLatin1("<.*>"));
+ TQRegExp br(TQString::tqfromLatin1("<br/?>"), false /*case-sensitive*/);
+ TQRegExp tags(TQString::tqfromLatin1("<.*>"));
tags.setMinimal(true);
- QString value;
+ TQString value;
for(Data::EntryVec::ConstIterator entryIt = entries().begin(); entryIt != entries().end(); ++entryIt) {
PalmLib::FlatFile::Record record;
unsigned i = 0;
@@ -165,11 +165,11 @@ bool PilotDBExporter::exec() {
value = entryIt->field(fIt->name(), format);
if(fIt->type() == Data::Field::Date) {
- QStringList s = QStringList::split('-', value, true);
+ TQStringList s = TQStringList::split('-', value, true);
bool ok = true;
- int y = s.count() > 0 ? s[0].toInt(&ok) : QDate::currentDate().year();
+ int y = s.count() > 0 ? s[0].toInt(&ok) : TQDate::tqcurrentDate().year();
if(!ok) {
- y = QDate::currentDate().year();
+ y = TQDate::tqcurrentDate().year();
}
int m = s.count() > 1 ? s[1].toInt(&ok) : 1;
if(!ok) {
@@ -179,11 +179,11 @@ bool PilotDBExporter::exec() {
if(!ok) {
d = 1;
}
- QDate date(y, m, d);
- value = date.toString(QString::fromLatin1("yyyy/MM/dd"));
+ TQDate date(y, m, d);
+ value = date.toString(TQString::tqfromLatin1("yyyy/MM/dd"));
} else if(fIt->type() == Data::Field::Para) {
- value.replace(br, QChar('\n'));
- value.replace(tags, QString::null);
+ value.tqreplace(br, TQChar('\n'));
+ value.tqreplace(tags, TQString());
}
// the number of fields in the record must match the number of fields in the database
record.appendField(PilotDB::string2field(db.field_type(i),
@@ -199,32 +199,32 @@ bool PilotDBExporter::exec() {
return FileHandler::writeDataURL(url(), pdb.data(), options() & Export::ExportForce);
}
-QWidget* PilotDBExporter::widget(QWidget* parent_, const char* name_/*=0*/) {
- if(m_widget && m_widget->parent() == parent_) {
+TQWidget* PilotDBExporter::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("PilotDB Options"), m_widget);
+ TQGroupBox* box = new TQGroupBox(1, Qt::Horizontal, i18n("PilotDB Options"), m_widget);
l->addWidget(box);
- m_checkBackup = new QCheckBox(i18n("Set PDA backup flag for database"), box);
+ m_checkBackup = new TQCheckBox(i18n("Set PDA backup flag for database"), box);
m_checkBackup->setChecked(m_backup);
- QWhatsThis::add(m_checkBackup, i18n("Set PDA backup flag for database"));
+ TQWhatsThis::add(m_checkBackup, i18n("Set PDA backup flag for database"));
l->addStretch(1);
return m_widget;
}
void PilotDBExporter::readOptions(KConfig* config_) {
- KConfigGroup group(config_, QString::fromLatin1("ExportOptions - %1").arg(formatString()));
+ KConfigGroup group(config_, TQString::tqfromLatin1("ExportOptions - %1").tqarg(formatString()));
m_backup = group.readBoolEntry("Backup", m_backup);
}
void PilotDBExporter::saveOptions(KConfig* config_) {
- KConfigGroup group(config_, QString::fromLatin1("ExportOptions - %1").arg(formatString()));
+ KConfigGroup group(config_, TQString::tqfromLatin1("ExportOptions - %1").tqarg(formatString()));
m_backup = m_checkBackup->isChecked();
group.writeEntry("Backup", m_backup);
}