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/fetch/z3950fetcher.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/fetch/z3950fetcher.cpp')
-rw-r--r-- | src/fetch/z3950fetcher.cpp | 268 |
1 files changed, 134 insertions, 134 deletions
diff --git a/src/fetch/z3950fetcher.cpp b/src/fetch/z3950fetcher.cpp index 5e045cf..465df5c 100644 --- a/src/fetch/z3950fetcher.cpp +++ b/src/fetch/z3950fetcher.cpp @@ -46,21 +46,21 @@ #include <kaccelmanager.h> #include <kseparator.h> -#include <qfile.h> -#include <qlayout.h> -#include <qlabel.h> -#include <qwhatsthis.h> -#include <qdom.h> +#include <tqfile.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqwhatsthis.h> +#include <tqdom.h> namespace { static const int Z3950_DEFAULT_PORT = 210; - static const QString Z3950_DEFAULT_ESN = QString::fromLatin1("F"); + static const TQString Z3950_DEFAULT_ESN = TQString::tqfromLatin1("F"); } using Tellico::Fetch::Z3950Fetcher; -Z3950Fetcher::Z3950Fetcher(QObject* parent_, const char* name_) - : Fetcher(parent_, name_), m_conn(0), m_port(Z3950_DEFAULT_PORT), m_esn(Z3950_DEFAULT_ESN), +Z3950Fetcher::Z3950Fetcher(TQObject* tqparent_, const char* name_) + : Fetcher(tqparent_, name_), m_conn(0), m_port(Z3950_DEFAULT_PORT), m_esn(Z3950_DEFAULT_ESN), m_started(false), m_done(true), m_MARC21XMLHandler(0), m_UNIMARCXMLHandler(0), m_MODSHandler(0) { } @@ -76,11 +76,11 @@ Z3950Fetcher::~Z3950Fetcher() { m_conn = 0; } -QString Z3950Fetcher::defaultName() { +TQString Z3950Fetcher::defaultName() { return i18n("z39.50 Server"); } -QString Z3950Fetcher::source() const { +TQString Z3950Fetcher::source() const { return m_name.isEmpty() ? defaultName() : m_name; } @@ -89,7 +89,7 @@ bool Z3950Fetcher::canFetch(int type) const { } void Z3950Fetcher::readConfigHook(const KConfigGroup& config_) { - QString preset = config_.readEntry("Preset"); + TQString preset = config_.readEntry("Preset"); if(preset.isEmpty()) { m_host = config_.readEntry("Host"); int p = config_.readNumEntry("Port", Z3950_DEFAULT_PORT); @@ -103,16 +103,16 @@ void Z3950Fetcher::readConfigHook(const KConfigGroup& config_) { m_password = config_.readEntry("Password"); } else { m_preset = preset; - QString serverFile = locate("appdata", QString::fromLatin1("z3950-servers.cfg")); + TQString serverFile = locate("appdata", TQString::tqfromLatin1("z3950-servers.cfg")); if(!serverFile.isEmpty()) { KConfig cfg(serverFile, true /* read-only */, false /* read KDE */); - const QStringList servers = cfg.groupList(); - for(QStringList::ConstIterator server = servers.begin(); server != servers.end(); ++server) { + const TQStringList servers = cfg.groupList(); + for(TQStringList::ConstIterator server = servers.begin(); server != servers.end(); ++server) { cfg.setGroup(*server); - const QString id = *server; + const TQString id = *server; if(id == preset) { - const QString name = cfg.readEntry("Name"); + const TQString name = cfg.readEntry("Name"); m_host = cfg.readEntry("Host"); m_port = cfg.readNumEntry("Port", Z3950_DEFAULT_PORT); m_dbname = cfg.readEntry("Database"); @@ -133,7 +133,7 @@ void Z3950Fetcher::saveConfigHook(KConfigGroup& config_) { config_.sync(); } -void Z3950Fetcher::search(FetchKey key_, const QString& value_) { +void Z3950Fetcher::search(FetchKey key_, const TQString& value_) { #ifdef HAVE_YAZ m_started = true; m_done = false; @@ -146,43 +146,43 @@ void Z3950Fetcher::search(FetchKey key_, const QString& value_) { m_value = value_; m_started = true; - QString svalue = m_value; - QRegExp rx1(QString::fromLatin1("['\"].*\\1")); + TQString svalue = m_value; + TQRegExp rx1(TQString::tqfromLatin1("['\"].*\\1")); if(!rx1.exactMatch(svalue)) { svalue.prepend('"').append('"'); } switch(key_) { case Title: - m_pqn = QString::fromLatin1("@attr 1=4 ") + svalue; + m_pqn = TQString::tqfromLatin1("@attr 1=4 ") + svalue; break; case Person: -// m_pqn = QString::fromLatin1("@or "); -// m_pqn += QString::fromLatin1("@attr 1=1 \"") + m_value + '"'; - m_pqn = QString::fromLatin1(" @attr 1=1003 ") + svalue; +// m_pqn = TQString::tqfromLatin1("@or "); +// m_pqn += TQString::tqfromLatin1("@attr 1=1 \"") + m_value + '"'; + m_pqn = TQString::tqfromLatin1(" @attr 1=1003 ") + svalue; break; case ISBN: { m_pqn.truncate(0); - QString s = m_value; + TQString s = m_value; s.remove('-'); - QStringList isbnList = QStringList::split(QString::fromLatin1("; "), s); + TQStringList isbnList = TQStringList::split(TQString::tqfromLatin1("; "), s); // also going to search for isbn10 values - for(QStringList::Iterator it = isbnList.begin(); it != isbnList.end(); ++it) { - if((*it).startsWith(QString::fromLatin1("978"))) { - QString isbn10 = ISBNValidator::isbn10(*it); + for(TQStringList::Iterator it = isbnList.begin(); it != isbnList.end(); ++it) { + if((*it).startsWith(TQString::tqfromLatin1("978"))) { + TQString isbn10 = ISBNValidator::isbn10(*it); isbn10.remove('-'); isbnList.insert(it, isbn10); } } const int count = isbnList.count(); if(count > 1) { - m_pqn = QString::fromLatin1("@or "); + m_pqn = TQString::tqfromLatin1("@or "); } for(int i = 0; i < count; ++i) { - m_pqn += QString::fromLatin1(" @attr 1=7 ") + isbnList[i]; + m_pqn += TQString::tqfromLatin1(" @attr 1=7 ") + isbnList[i]; if(i < count-2) { - m_pqn += QString::fromLatin1(" @or"); + m_pqn += TQString::tqfromLatin1(" @or"); } } } @@ -190,21 +190,21 @@ void Z3950Fetcher::search(FetchKey key_, const QString& value_) { case LCCN: { m_pqn.truncate(0); - QString s = m_value; + TQString s = m_value; s.remove('-'); - QStringList lccnList = QStringList::split(QString::fromLatin1("; "), s); + TQStringList lccnList = TQStringList::split(TQString::tqfromLatin1("; "), s); while(!lccnList.isEmpty()) { - m_pqn += QString::fromLatin1(" @or @attr 1=9 ") + lccnList.front(); + m_pqn += TQString::tqfromLatin1(" @or @attr 1=9 ") + lccnList.front(); if(lccnList.count() > 1) { - m_pqn += QString::fromLatin1(" @or"); + m_pqn += TQString::tqfromLatin1(" @or"); } - m_pqn += QString::fromLatin1(" @attr 1=9 ") + LCCNValidator::formalize(lccnList.front()); + m_pqn += TQString::tqfromLatin1(" @attr 1=9 ") + LCCNValidator::formalize(lccnList.front()); lccnList.pop_front(); } } break; case Keyword: - m_pqn = QString::fromLatin1("@attr 1=1016 ") + svalue; + m_pqn = TQString::tqfromLatin1("@attr 1=1016 ") + svalue; break; case Raw: m_pqn = m_value; @@ -214,7 +214,7 @@ void Z3950Fetcher::search(FetchKey key_, const QString& value_) { stop(); return; } -// m_pqn = QString::fromLatin1("@attr 1=7 0253333490"); +// m_pqn = TQString::tqfromLatin1("@attr 1=7 0253333490"); myLog() << "Z3950Fetcher::search() - PQN query = " << m_pqn << endl; if(m_conn) { @@ -256,7 +256,7 @@ bool Z3950Fetcher::initMARC21Handler() { return true; } - QString xsltfile = locate("appdata", QString::fromLatin1("MARC21slim2MODS3.xsl")); + TQString xsltfile = locate("appdata", TQString::tqfromLatin1("MARC21slim2MODS3.xsl")); if(xsltfile.isEmpty()) { kdWarning() << "Z3950Fetcher::initHandlers() - can not locate MARC21slim2MODS3.xsl." << endl; return false; @@ -280,7 +280,7 @@ bool Z3950Fetcher::initUNIMARCHandler() { return true; } - QString xsltfile = locate("appdata", QString::fromLatin1("UNIMARC2MODS3.xsl")); + TQString xsltfile = locate("appdata", TQString::tqfromLatin1("UNIMARC2MODS3.xsl")); if(xsltfile.isEmpty()) { kdWarning() << "Z3950Fetcher::initHandlers() - can not locate UNIMARC2MODS3.xsl." << endl; return false; @@ -304,7 +304,7 @@ bool Z3950Fetcher::initMODSHandler() { return true; } - QString xsltfile = locate("appdata", QString::fromLatin1("mods2tellico.xsl")); + TQString xsltfile = locate("appdata", TQString::tqfromLatin1("mods2tellico.xsl")); if(xsltfile.isEmpty()) { kdWarning() << "Z3950Fetcher::initHandlers() - can not locate mods2tellico.xsl." << endl; return false; @@ -342,7 +342,7 @@ void Z3950Fetcher::process() { m_conn->start(); } -void Z3950Fetcher::handleResult(const QString& result_) { +void Z3950Fetcher::handleResult(const TQString& result_) { if(result_.isEmpty()) { myDebug() << "Z3950Fetcher::handleResult() - empty record found, maybe the character encoding or record format is wrong?" << endl; return; @@ -351,18 +351,18 @@ void Z3950Fetcher::handleResult(const QString& result_) { #if 0 kdWarning() << "Remove debug from z3950fetcher.cpp" << endl; { - QFile f1(QString::fromLatin1("/tmp/marc.xml")); + TQFile f1(TQString::tqfromLatin1("/tmp/marc.xml")); if(f1.open(IO_WriteOnly)) { // if(f1.open(IO_WriteOnly | IO_Append)) { - QTextStream t(&f1); - t.setEncoding(QTextStream::UnicodeUTF8); + TQTextStream t(&f1); + t.setEncoding(TQTextStream::UnicodeUTF8); t << result_; } f1.close(); } #endif // assume always utf-8 - QString str, msg; + TQString str, msg; Data::CollPtr coll = 0; // not marc, has to be grs-1 if(m_syntax == Latin1Literal("grs-1")) { @@ -385,11 +385,11 @@ void Z3950Fetcher::handleResult(const QString& result_) { #if 0 kdWarning() << "Remove debug from z3950fetcher.cpp" << endl; { - QFile f2(QString::fromLatin1("/tmp/mods.xml")); + TQFile f2(TQString::tqfromLatin1("/tmp/mods.xml")); // if(f2.open(IO_WriteOnly)) { if(f2.open(IO_WriteOnly | IO_Append)) { - QTextStream t(&f2); - t.setEncoding(QTextStream::UnicodeUTF8); + TQTextStream t(&f2); + t.setEncoding(TQTextStream::UnicodeUTF8); t << str; } f2.close(); @@ -416,21 +416,21 @@ void Z3950Fetcher::handleResult(const QString& result_) { const StringMap customFields = Z3950Fetcher::customFields(); for(StringMap::ConstIterator it = customFields.begin(); it != customFields.end(); ++it) { - if(!m_fields.contains(it.key())) { + if(!m_fields.tqcontains(it.key())) { coll->removeField(it.key()); } } Data::EntryVec entries = coll->entries(); for(Data::EntryVec::Iterator entry = entries.begin(); entry != entries.end(); ++entry) { - QString desc = entry->field(QString::fromLatin1("author")) + '/' - + entry->field(QString::fromLatin1("publisher")); - if(!entry->field(QString::fromLatin1("cr_year")).isEmpty()) { - desc += QChar('/') + entry->field(QString::fromLatin1("cr_year")); - } else if(!entry->field(QString::fromLatin1("pub_year")).isEmpty()){ - desc += QChar('/') + entry->field(QString::fromLatin1("pub_year")); + TQString desc = entry->field(TQString::tqfromLatin1("author")) + '/' + + entry->field(TQString::tqfromLatin1("publisher")); + if(!entry->field(TQString::tqfromLatin1("cr_year")).isEmpty()) { + desc += TQChar('/') + entry->field(TQString::tqfromLatin1("cr_year")); + } else if(!entry->field(TQString::tqfromLatin1("pub_year")).isEmpty()){ + desc += TQChar('/') + entry->field(TQString::tqfromLatin1("pub_year")); } - SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(QString::fromLatin1("isbn"))); + SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(TQString::tqfromLatin1("isbn"))); m_entries.insert(r->uid, entry); emit signalResultFound(r); } @@ -445,7 +445,7 @@ Tellico::Data::EntryPtr Z3950Fetcher::fetchEntry(uint uid_) { return m_entries[uid_]; } -void Z3950Fetcher::customEvent(QCustomEvent* event_) { +void Z3950Fetcher::customEvent(TQCustomEvent* event_) { if(!m_conn) { return; } @@ -480,20 +480,20 @@ void Z3950Fetcher::customEvent(QCustomEvent* event_) { void Z3950Fetcher::updateEntry(Data::EntryPtr entry_) { // myDebug() << "Z3950Fetcher::updateEntry() - " << source() << ": " << entry_->title() << endl; - QString isbn = entry_->field(QString::fromLatin1("isbn")); + TQString isbn = entry_->field(TQString::tqfromLatin1("isbn")); if(!isbn.isEmpty()) { search(Fetch::ISBN, isbn); return; } - QString lccn = entry_->field(QString::fromLatin1("lccn")); + TQString lccn = entry_->field(TQString::tqfromLatin1("lccn")); if(!lccn.isEmpty()) { search(Fetch::LCCN, lccn); return; } // optimistically try searching for title and rely on Collection::sameEntry() to figure things out - QString t = entry_->field(QString::fromLatin1("title")); + TQString t = entry_->field(TQString::tqfromLatin1("title")); if(!t.isEmpty()) { search(Fetch::Title, t); return; @@ -503,123 +503,123 @@ void Z3950Fetcher::updateEntry(Data::EntryPtr entry_) { emit signalDone(this); // always need to emit this if not continuing with the search } -Tellico::Fetch::ConfigWidget* Z3950Fetcher::configWidget(QWidget* parent_) const { - return new Z3950Fetcher::ConfigWidget(parent_, this); +Tellico::Fetch::ConfigWidget* Z3950Fetcher::configWidget(TQWidget* tqparent_) const { + return new Z3950Fetcher::ConfigWidget(tqparent_, this); } -Z3950Fetcher::ConfigWidget::ConfigWidget(QWidget* parent_, const Z3950Fetcher* fetcher_/*=0*/) - : Fetch::ConfigWidget(parent_) { - QGridLayout* l = new QGridLayout(optionsWidget(), 7, 2); +Z3950Fetcher::ConfigWidget::ConfigWidget(TQWidget* tqparent_, const Z3950Fetcher* fetcher_/*=0*/) + : Fetch::ConfigWidget(tqparent_) { + TQGridLayout* l = new TQGridLayout(optionsWidget(), 7, 2); l->setSpacing(4); l->setColStretch(1, 10); int row = -1; - m_usePreset = new QCheckBox(i18n("Use preset &server:"), optionsWidget()); + m_usePreset = new TQCheckBox(i18n("Use preset &server:"), optionsWidget()); l->addWidget(m_usePreset, ++row, 0); - connect(m_usePreset, SIGNAL(toggled(bool)), SLOT(slotTogglePreset(bool))); + connect(m_usePreset, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotTogglePreset(bool))); m_serverCombo = new GUI::ComboBox(optionsWidget()); - connect(m_serverCombo, SIGNAL(activated(int)), SLOT(slotPresetChanged())); + connect(m_serverCombo, TQT_SIGNAL(activated(int)), TQT_SLOT(slotPresetChanged())); l->addWidget(m_serverCombo, row, 1); ++row; l->addMultiCellWidget(new KSeparator(optionsWidget()), row, row, 0, 1); l->setRowSpacing(row, 10); - QLabel* label = new QLabel(i18n("Hos&t: "), optionsWidget()); + TQLabel* label = new TQLabel(i18n("Hos&t: "), optionsWidget()); l->addWidget(label, ++row, 0); m_hostEdit = new GUI::LineEdit(optionsWidget()); - connect(m_hostEdit, SIGNAL(textChanged(const QString&)), SLOT(slotSetModified())); - connect(m_hostEdit, SIGNAL(textChanged(const QString&)), SIGNAL(signalName(const QString&))); + connect(m_hostEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotSetModified())); + connect(m_hostEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SIGNAL(signalName(const TQString&))); l->addWidget(m_hostEdit, row, 1); - QString w = i18n("Enter the host name of the server."); - QWhatsThis::add(label, w); - QWhatsThis::add(m_hostEdit, w); + TQString w = i18n("Enter the host name of the server."); + TQWhatsThis::add(label, w); + TQWhatsThis::add(m_hostEdit, w); label->setBuddy(m_hostEdit); - label = new QLabel(i18n("&Port: "), optionsWidget()); + label = new TQLabel(i18n("&Port: "), optionsWidget()); l->addWidget(label, ++row, 0); m_portSpinBox = new KIntSpinBox(0, 999999, 1, Z3950_DEFAULT_PORT, 10, optionsWidget()); - connect(m_portSpinBox, SIGNAL(valueChanged(int)), SLOT(slotSetModified())); + connect(m_portSpinBox, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slotSetModified())); l->addWidget(m_portSpinBox, row, 1); - w = i18n("Enter the port number of the server. The default is %1.").arg(Z3950_DEFAULT_PORT); - QWhatsThis::add(label, w); - QWhatsThis::add(m_portSpinBox, w); + w = i18n("Enter the port number of the server. The default is %1.").tqarg(Z3950_DEFAULT_PORT); + TQWhatsThis::add(label, w); + TQWhatsThis::add(m_portSpinBox, w); label->setBuddy(m_portSpinBox); - label = new QLabel(i18n("&Database: "), optionsWidget()); + label = new TQLabel(i18n("&Database: "), optionsWidget()); l->addWidget(label, ++row, 0); m_databaseEdit = new GUI::LineEdit(optionsWidget()); - connect(m_databaseEdit, SIGNAL(textChanged(const QString&)), SLOT(slotSetModified())); + connect(m_databaseEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotSetModified())); l->addWidget(m_databaseEdit, row, 1); w = i18n("Enter the database name used by the server."); - QWhatsThis::add(label, w); - QWhatsThis::add(m_databaseEdit, w); + TQWhatsThis::add(label, w); + TQWhatsThis::add(m_databaseEdit, w); label->setBuddy(m_databaseEdit); - label = new QLabel(i18n("Ch&aracter set: "), optionsWidget()); + label = new TQLabel(i18n("Ch&aracter set: "), optionsWidget()); l->addWidget(label, ++row, 0); m_charSetCombo = new KComboBox(true, optionsWidget()); - m_charSetCombo->insertItem(QString::null); - m_charSetCombo->insertItem(QString::fromLatin1("marc8")); - m_charSetCombo->insertItem(QString::fromLatin1("iso-8859-1")); - m_charSetCombo->insertItem(QString::fromLatin1("utf-8")); - connect(m_charSetCombo, SIGNAL(textChanged(const QString&)), SLOT(slotSetModified())); + m_charSetCombo->insertItem(TQString()); + m_charSetCombo->insertItem(TQString::tqfromLatin1("marc8")); + m_charSetCombo->insertItem(TQString::tqfromLatin1("iso-8859-1")); + m_charSetCombo->insertItem(TQString::tqfromLatin1("utf-8")); + connect(m_charSetCombo, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotSetModified())); l->addWidget(m_charSetCombo, row, 1); w = i18n("Enter the character set encoding used by the z39.50 server. The most likely choice " "is MARC-8, although ISO-8859-1 is common as well."); - QWhatsThis::add(label, w); - QWhatsThis::add(m_charSetCombo, w); + TQWhatsThis::add(label, w); + TQWhatsThis::add(m_charSetCombo, w); label->setBuddy(m_charSetCombo); - label = new QLabel(i18n("&Format: "), optionsWidget()); + label = new TQLabel(i18n("&Format: "), optionsWidget()); l->addWidget(label, ++row, 0); m_syntaxCombo = new GUI::ComboBox(optionsWidget()); - m_syntaxCombo->insertItem(i18n("Auto-detect"), QString()); - m_syntaxCombo->insertItem(QString::fromLatin1("MODS"), QString::fromLatin1("mods")); - m_syntaxCombo->insertItem(QString::fromLatin1("MARC21"), QString::fromLatin1("marc21")); - m_syntaxCombo->insertItem(QString::fromLatin1("UNIMARC"), QString::fromLatin1("unimarc")); - m_syntaxCombo->insertItem(QString::fromLatin1("USMARC"), QString::fromLatin1("usmarc")); - m_syntaxCombo->insertItem(QString::fromLatin1("GRS-1"), QString::fromLatin1("grs-1")); - connect(m_syntaxCombo, SIGNAL(textChanged(const QString&)), SLOT(slotSetModified())); + m_syntaxCombo->insertItem(i18n("Auto-detect"), TQString()); + m_syntaxCombo->insertItem(TQString::tqfromLatin1("MODS"), TQString::tqfromLatin1("mods")); + m_syntaxCombo->insertItem(TQString::tqfromLatin1("MARC21"), TQString::tqfromLatin1("marc21")); + m_syntaxCombo->insertItem(TQString::tqfromLatin1("UNIMARC"), TQString::tqfromLatin1("unimarc")); + m_syntaxCombo->insertItem(TQString::tqfromLatin1("USMARC"), TQString::tqfromLatin1("usmarc")); + m_syntaxCombo->insertItem(TQString::tqfromLatin1("GRS-1"), TQString::tqfromLatin1("grs-1")); + connect(m_syntaxCombo, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotSetModified())); l->addWidget(m_syntaxCombo, row, 1); w = i18n("Enter the data format used by the z39.50 server. Tellico will attempt to " "automatically detect the best setting if <i>auto-detect</i> is selected."); - QWhatsThis::add(label, w); - QWhatsThis::add(m_syntaxCombo, w); + TQWhatsThis::add(label, w); + TQWhatsThis::add(m_syntaxCombo, w); label->setBuddy(m_syntaxCombo); - label = new QLabel(i18n("&User: "), optionsWidget()); + label = new TQLabel(i18n("&User: "), optionsWidget()); l->addWidget(label, ++row, 0); m_userEdit = new GUI::LineEdit(optionsWidget()); m_userEdit->setHint(i18n("Optional")); - connect(m_userEdit, SIGNAL(textChanged(const QString&)), SLOT(slotSetModified())); + connect(m_userEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotSetModified())); l->addWidget(m_userEdit, row, 1); w = i18n("Enter the authentication user name used by the z39.50 database. Most servers " "do not need one."); - QWhatsThis::add(label, w); - QWhatsThis::add(m_userEdit, w); + TQWhatsThis::add(label, w); + TQWhatsThis::add(m_userEdit, w); label->setBuddy(m_userEdit); - label = new QLabel(i18n("Pass&word: "), optionsWidget()); + label = new TQLabel(i18n("Pass&word: "), optionsWidget()); l->addWidget(label, ++row, 0); m_passwordEdit = new GUI::LineEdit(optionsWidget()); m_passwordEdit->setHint(i18n("Optional")); - m_passwordEdit->setEchoMode(QLineEdit::Password); - connect(m_passwordEdit, SIGNAL(textChanged(const QString&)), SLOT(slotSetModified())); + m_passwordEdit->setEchoMode(TQLineEdit::Password); + connect(m_passwordEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotSetModified())); l->addWidget(m_passwordEdit, row, 1); w = i18n("Enter the authentication password used by the z39.50 database. Most servers " "do not need one. The password will be saved in plain text in the Tellico " "configuration file."); - QWhatsThis::add(label, w); - QWhatsThis::add(m_passwordEdit, w); + TQWhatsThis::add(label, w); + TQWhatsThis::add(m_passwordEdit, w); label->setBuddy(m_passwordEdit); l->setRowStretch(++row, 1); // now add additional fields widget - addFieldsWidget(Z3950Fetcher::customFields(), fetcher_ ? fetcher_->m_fields : QStringList()); + addFieldsWidget(Z3950Fetcher::customFields(), fetcher_ ? fetcher_->m_fields : TQStringList()); - loadPresets(fetcher_ ? fetcher_->m_preset : QString::null); + loadPresets(fetcher_ ? fetcher_->m_preset : TQString()); if(fetcher_) { m_hostEdit->setText(fetcher_->m_host); m_portSpinBox->setValue(fetcher_->m_port); @@ -646,13 +646,13 @@ Z3950Fetcher::ConfigWidget::~ConfigWidget() { void Z3950Fetcher::ConfigWidget::saveConfig(KConfigGroup& config_) { if(m_usePreset->isChecked()) { - QString presetID = m_serverCombo->currentData().toString(); + TQString presetID = m_serverCombo->currentData().toString(); config_.writeEntry("Preset", presetID); return; } config_.deleteEntry("Preset"); - QString s = m_hostEdit->text().stripWhiteSpace(); + TQString s = m_hostEdit->text().stripWhiteSpace(); if(!s.isEmpty()) { config_.writeEntry("Host", s); } @@ -689,9 +689,9 @@ void Z3950Fetcher::ConfigWidget::saveConfig(KConfigGroup& config_) { // static Tellico::StringMap Z3950Fetcher::customFields() { StringMap map; - map[QString::fromLatin1("address")] = i18n("Address"); - map[QString::fromLatin1("abstract")] = i18n("Abstract"); - map[QString::fromLatin1("illustrator")] = i18n("Illustrator"); + map[TQString::tqfromLatin1("address")] = i18n("Address"); + map[TQString::tqfromLatin1("abstract")] = i18n("Abstract"); + map[TQString::tqfromLatin1("illustrator")] = i18n("Illustrator"); return map; } @@ -719,15 +719,15 @@ void Z3950Fetcher::ConfigWidget::slotPresetChanged() { emit signalName(m_serverCombo->currentText()); } -void Z3950Fetcher::ConfigWidget::loadPresets(const QString& current_) { - QString lang = KGlobal::locale()->languageList().first(); - QString lang2A; +void Z3950Fetcher::ConfigWidget::loadPresets(const TQString& current_) { + TQString lang = KGlobal::locale()->languageList().first(); + TQString lang2A; { - QString dummy; + TQString dummy; KGlobal::locale()->splitLocale(lang, lang2A, dummy, dummy); } - QString serverFile = locate("appdata", QString::fromLatin1("z3950-servers.cfg")); + TQString serverFile = locate("appdata", TQString::tqfromLatin1("z3950-servers.cfg")); if(serverFile.isEmpty()) { kdWarning() << "Z3950Fetcher::loadPresets() - no z3950 servers file found" << endl; return; @@ -736,30 +736,30 @@ void Z3950Fetcher::ConfigWidget::loadPresets(const QString& current_) { int idx = -1; KConfig cfg(serverFile, true /* read-only */, false /* read KDE */); - const QStringList servers = cfg.groupList(); + const TQStringList servers = cfg.groupList(); // I want the list of servers sorted by name - QMap<QString, QString> serverNameMap; - for(QStringList::ConstIterator server = servers.constBegin(); server != servers.constEnd(); ++server) { + TQMap<TQString, TQString> serverNameMap; + for(TQStringList::ConstIterator server = servers.constBegin(); server != servers.constEnd(); ++server) { if((*server).isEmpty()) { myDebug() << "Z3950Fetcher::ConfigWidget::loadPresets() - empty id" << endl; continue; } cfg.setGroup(*server); - const QString name = cfg.readEntry("Name"); + const TQString name = cfg.readEntry("Name"); if(!name.isEmpty()) { serverNameMap.insert(name, *server); } } - for(QMap<QString, QString>::ConstIterator it = serverNameMap.constBegin(); it != serverNameMap.constEnd(); ++it) { - const QString name = it.key(); - const QString id = it.data(); + for(TQMap<TQString, TQString>::ConstIterator it = serverNameMap.constBegin(); it != serverNameMap.constEnd(); ++it) { + const TQString name = it.key(); + const TQString id = it.data(); cfg.setGroup(id); m_serverCombo->insertItem(i18n(name.utf8()), id); if(current_.isEmpty() && idx == -1) { // set the initial selection to something depending on the language - const QStringList locales = cfg.readListEntry("Locale"); - if(locales.findIndex(lang) > -1 || locales.findIndex(lang2A) > -1) { + const TQStringList locales = cfg.readListEntry("Locale"); + if(locales.tqfindIndex(lang) > -1 || locales.tqfindIndex(lang2A) > -1) { idx = m_serverCombo->count() - 1; } } else if(id == current_) { @@ -771,11 +771,11 @@ void Z3950Fetcher::ConfigWidget::loadPresets(const QString& current_) { } } -QString Z3950Fetcher::ConfigWidget::preferredName() const { +TQString Z3950Fetcher::ConfigWidget::preferredName() const { if(m_usePreset->isChecked()) { return m_serverCombo->currentText(); } - QString s = m_hostEdit->text(); + TQString s = m_hostEdit->text(); return s.isEmpty() ? i18n("z39.50 Server") : s; } |