diff options
171 files changed, 3073 insertions, 3073 deletions
diff --git a/src/borrowerdialog.cpp b/src/borrowerdialog.cpp index f25416a..8de9b18 100644 --- a/src/borrowerdialog.cpp +++ b/src/borrowerdialog.cpp @@ -21,20 +21,20 @@ #include <kabc/stdaddressbook.h> #include <kiconloader.h> -#include <tqlayout.h> +#include <layout.h> using Tellico::BorrowerDialog; BorrowerDialog::Item::Item(KListView* parent_, const KABC::Addressee& add_) : KListViewItem(parent_), m_uid(add_.uid()) { setText(0, add_.realName()); - setPixmap(0, SmallIcon(TQString::tqfromLatin1("kaddressbook"))); + setPixmap(0, SmallIcon(TQString::fromLatin1("kaddressbook"))); } BorrowerDialog::Item::Item(KListView* parent_, const Data::Borrower& bor_) : KListViewItem(parent_), m_uid(bor_.uid()) { setText(0, bor_.name()); - setPixmap(0, SmallIcon(TQString::tqfromLatin1("tellico"))); + setPixmap(0, SmallIcon(TQString::fromLatin1("tellico"))); } // default button is going to be used as a print button, so it's separated diff --git a/src/borroweritem.cpp b/src/borroweritem.cpp index 798cbd5..f43e502 100644 --- a/src/borroweritem.cpp +++ b/src/borroweritem.cpp @@ -22,7 +22,7 @@ using Tellico::BorrowerItem; BorrowerItem::BorrowerItem(GUI::ListView* parent_, Data::BorrowerPtr borrower_) : GUI::CountedItem(parent_), m_borrower(borrower_) { setText(0, borrower_->name()); - setPixmap(0, SmallIcon(TQString::tqfromLatin1("kaddressbook"))); + setPixmap(0, SmallIcon(TQString::fromLatin1("kaddressbook"))); } int BorrowerItem::count() const { diff --git a/src/calendarhandler.cpp b/src/calendarhandler.cpp index 303bad1..dedcd73 100644 --- a/src/calendarhandler.cpp +++ b/src/calendarhandler.cpp @@ -156,14 +156,14 @@ bool CalendarHandler::checkCalendar(KCal::CalendarResources* resources) { KCal::CalendarResourceManager* manager = resources->resourceManager(); if(manager->isEmpty()) { kdWarning() << "Tellico::CalendarHandler::checkCalendar() - adding default calendar" << endl; - KConfig config(TQString::tqfromLatin1("korganizerrc")); + KConfig config(TQString::fromLatin1("korganizerrc")); config.setGroup("General"); TQString fileName = config.readPathEntry("Active Calendar"); TQString resourceName; KCal::ResourceCalendar* defaultResource = 0; if(fileName.isEmpty()) { - fileName = locateLocal("appdata", TQString::tqfromLatin1("std.ics")); + fileName = locateLocal("appdata", TQString::fromLatin1("std.ics")); resourceName = i18n("Default Calendar"); defaultResource = new KCal::ResourceLocal(fileName); } else { @@ -200,7 +200,7 @@ void CalendarHandler::populateTodo(KCal::Todo* todo_, Data::LoanPtr loan_) { todo_->setDtDue(loan_->dueDate()); todo_->setHasDueDate(true); TQString person = loan_->borrower()->name(); - TQString summary = i18n("Tellico: %1 is due to return \"%2\"").tqarg(person).tqarg(loan_->entry()->title()); + TQString summary = i18n("Tellico: %1 is due to return \"%2\"").arg(person).arg(loan_->entry()->title()); todo_->setSummary(summary); TQString note = loan_->note(); if(note.isEmpty()) { @@ -228,7 +228,7 @@ void CalendarHandler::populateTodo(KCal::Todo* todo_, Data::LoanPtr loan_) { TQString CalendarHandler::timezone() { TQString zone; - KConfig korgcfg(locate(TQString::tqfromLatin1("config"), TQString::tqfromLatin1("korganizerrc"))); + KConfig korgcfg(locate(TQString::fromLatin1("config"), TQString::fromLatin1("korganizerrc"))); korgcfg.setGroup("Time & Date"); TQString tz(korgcfg.readEntry("TimeZoneId")); if(!tz.isEmpty()) { @@ -239,7 +239,7 @@ TQString CalendarHandler::timezone() { int len = ::readlink("/etc/localtime", zonefilebuf, PATH_MAX); if(len > 0 && len < PATH_MAX) { zone = TQString::fromLocal8Bit(zonefilebuf, len); - zone = zone.mid(zone.find(TQString::tqfromLatin1("zoneinfo/")) + 9); + zone = zone.mid(zone.find(TQString::fromLatin1("zoneinfo/")) + 9); } else { tzset(); zone = tzname[0]; diff --git a/src/cite/clipboard.cpp b/src/cite/clipboard.cpp index f242a22..9be7fd0 100644 --- a/src/cite/clipboard.cpp +++ b/src/cite/clipboard.cpp @@ -18,7 +18,7 @@ #include <klocale.h> #include <tqapplication.h> -#include <tqclipboard.h> +#include <clipboard.h> using Tellico::Cite::Clipboard; @@ -35,16 +35,16 @@ bool Clipboard::cite(Data::EntryVec entries_) { return false; } - TQString s = TQString::tqfromLatin1("\\cite{"); + TQString s = TQString::fromLatin1("\\cite{"); for(Data::EntryVecIt it = entries_.begin(); it != entries_.end(); ++it) { s += BibtexHandler::bibtexKey(it.data()); if(!it.nextEnd()) { - s += TQString::tqfromLatin1(", "); + s += TQString::fromLatin1(", "); } } s += '}'; - TQClipboard *cb = TQApplication::tqclipboard(); + TQClipboard *cb = TQApplication::clipboard(); cb->setText(s, TQClipboard::Clipboard); return true; } diff --git a/src/cite/lyxpipe.cpp b/src/cite/lyxpipe.cpp index 4943a8a..4b305d1 100644 --- a/src/cite/lyxpipe.cpp +++ b/src/cite/lyxpipe.cpp @@ -44,10 +44,10 @@ bool Lyxpipe::cite(Data::EntryVec entries_) { } TQString lyxpipe = Config::lyxpipe(); - lyxpipe += TQString::tqfromLatin1(".in"); + lyxpipe += TQString::fromLatin1(".in"); // myDebug() << "Lyxpipe::cite() - " << lyxpipe << endl; - TQString errorStr = i18n("<qt>Tellico is unable to write to the server pipe at <b>%1</b>.</qt>").tqarg(lyxpipe); + TQString errorStr = i18n("<qt>Tellico is unable to write to the server pipe at <b>%1</b>.</qt>").arg(lyxpipe); TQFile file(lyxpipe); if(!file.exists()) { @@ -72,7 +72,7 @@ bool Lyxpipe::cite(Data::EntryVec entries_) { output += s; if(!it.nextEnd() && !output.isEmpty()) { // pybliographer uses comma-space, and pyblink expects the space there - output += TQString::tqfromLatin1(", "); + output += TQString::fromLatin1(", "); } } if(output.isEmpty()) { diff --git a/src/cite/ooo/ooohandler.cpp b/src/cite/ooo/ooohandler.cpp index d36b3e4..6af495c 100644 --- a/src/cite/ooo/ooohandler.cpp +++ b/src/cite/ooo/ooohandler.cpp @@ -50,12 +50,12 @@ rtl::OUString OOOHandler::TQString2OU(const TQString& str) { const uint len = str.length(); sal_Unicode* uni = new sal_Unicode[len + 1]; - const TQChar* qPtr = str.tqunicode(); + const TQChar* qPtr = str.unicode(); const TQChar* qEnd = qPtr + len; sal_Unicode* uPtr = uni; while (qPtr != qEnd) { - *(uPtr++) = (*(qPtr++)).tqunicode(); + *(uPtr++) = (*(qPtr++)).unicode(); } *uPtr = 0; diff --git a/src/cite/openoffice.cpp b/src/cite/openoffice.cpp index 3955677..4712e95 100644 --- a/src/cite/openoffice.cpp +++ b/src/cite/openoffice.cpp @@ -31,7 +31,7 @@ #include <klocale.h> #include <tqiconset.h> -#include <tqlayout.h> +#include <layout.h> #include <tqradiobutton.h> #include <tqbuttongroup.h> #include <tqfile.h> @@ -43,7 +43,7 @@ class OpenOffice::Private { friend class OpenOffice; Private() : handler(0), port(-1) { - KLibrary* library = Tellico::openLibrary(TQString::tqfromLatin1("tellico_ooo")); + KLibrary* library = Tellico::openLibrary(TQString::fromLatin1("tellico_ooo")); if(library) { void* func = library->symbol("handler"); if(func) { @@ -79,11 +79,11 @@ bool OpenOffice::connect() { return false; } - StatusBar::self()->settqStatus(i18n("Connecting to OpenOffice.org...")); + StatusBar::self()->setStatus(i18n("Connecting to OpenOffice.org...")); if(d->port == -1) { KConfigGroup config(kapp->config(), "OpenOffice.org"); - d->host = config.readEntry("Host", TQString::tqfromLatin1("localhost")); + d->host = config.readEntry("Host", TQString::fromLatin1("localhost")); d->port = config.readNumEntry("Port", 2083); d->pipe = config.readPathEntry("Pipe"); // the ooohandler will depend on pipe.isEmpty() to indicate the port should be used @@ -116,7 +116,7 @@ bool OpenOffice::connect() { break; } } - StatusBar::self()->cleartqStatus(); + StatusBar::self()->clearStatus(); return success; } @@ -136,7 +136,7 @@ bool OpenOffice::cite(Data::EntryVec entries_) { return false; } - const TQString bibtex = TQString::tqfromLatin1("bibtex"); + const TQString bibtex = TQString::fromLatin1("bibtex"); Data::FieldVec vec = coll->fields(); for(Data::EntryVecIt entry = entries_.begin(); entry != entries_.end(); ++entry) { Cite::Map values; @@ -165,7 +165,7 @@ bool OpenOffice::connectionDialog() { true, i18n("OpenOffice.org Connection"), KDialogBase::Ok|KDialogBase::Cancel|KDialogBase::Help); - dlg.setHelp(TQString::tqfromLatin1("openoffice-org")); + dlg.setHelp(TQString::fromLatin1("openoffice-org")); TQWidget* widget = new TQWidget(&dlg); TQBoxLayout* topLayout = new TQVBoxLayout(widget, KDialog::spacingHint()); @@ -173,7 +173,7 @@ bool OpenOffice::connectionDialog() { // is there a better way to do a multi-line label than to insert newlines in the text? TQBoxLayout* blay = new TQHBoxLayout(topLayout); TQLabel* l = new TQLabel(widget); - l->setPixmap(DesktopIcon(TQString::tqfromLatin1("ooo_writer"), 64)); + l->setPixmap(DesktopIcon(TQString::fromLatin1("ooo_writer"), 64)); blay->addWidget(l); l = new TQLabel(widget); l->setText(i18n("Tellico was unable to connect to OpenOffice.org. " @@ -235,7 +235,7 @@ bool OpenOffice::connectionDialog() { if(radioTCP->isChecked()) { h = hostEdit->text(); if(h.isEmpty()) { - h = TQString::tqfromLatin1("localhost"); + h = TQString::fromLatin1("localhost"); } p = portSpin->value(); } else { diff --git a/src/collection.cpp b/src/collection.cpp index 02200ff..b2dbb6f 100644 --- a/src/collection.cpp +++ b/src/collection.cpp @@ -30,7 +30,7 @@ using Tellico::Data::Collection; const char* Collection::s_emptyGroupTitle = I18N_NOOP("(Empty)"); -const TQString Collection::s_peopleGroupName = TQString::tqfromLatin1("_people"); +const TQString Collection::s_peopleGroupName = TQString::fromLatin1("_people"); Collection::Collection(const TQString& title_) : TQObject(), KShared(), m_nextEntryId(0), m_title(title_), m_entryIdDict(997) @@ -135,7 +135,7 @@ bool Collection::mergeField(FieldPtr newField_) { if(newField_->type() == Field::Table2) { newField_->setType(Data::Field::Table); - newField_->setProperty(TQString::tqfromLatin1("columns"), TQChar('2')); + newField_->setProperty(TQString::fromLatin1("columns"), TQChar('2')); } // the original field type is kept @@ -258,9 +258,9 @@ bool Collection::modifyField(FieldPtr newField_) { // keep track of if the entry groups will need to be reset bool resetGroups = false; - // if format is different, go ahead and tqinvalidate all formatted entry values + // if format is different, go ahead and invalidate all formatted entry values if(oldField->formatFlag() != newField_->formatFlag()) { - // tqinvalidate cached format strings of all entry attributes of this name + // invalidate cached format strings of all entry attributes of this name for(EntryVecIt it = m_entries.begin(); it != m_entries.end(); ++it) { it->invalidateFormattedFieldValue(fieldName); } @@ -794,7 +794,7 @@ int Collection::sameEntry(Data::EntryPtr entry1_, Data::EntryPtr entry2_) const // start with twice the title score // and since the minimum is > 10, then need more than just a perfect title match - int res = 2*Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("title"), this); + int res = 2*Entry::compareValues(entry1_, entry2_, TQString::fromLatin1("title"), this); // then add score for each field FieldVec fields = entry1_->collection()->fields(); for(Data::FieldVecIt it = fields.begin(); it != fields.end(); ++it) { @@ -825,13 +825,13 @@ bool Collection::mergeEntry(EntryPtr e1, EntryPtr e2, bool overwrite_, bool askU continue; } else if(field->type() == Field::Para) { // for paragraph fields, concatenate the values, if they're not equal - e1->setField(field, e1->field(field) + TQString::tqfromLatin1("<br/><br/>") + e2->field(field)); + e1->setField(field, e1->field(field) + TQString::fromLatin1("<br/><br/>") + e2->field(field)); ret = true; } else if(field->type() == Field::Table) { // if field F is a table-type field (album tracks, files, etc.), merge rows (keep their position) // if e1's F val in [row i, column j] empty, replace with e2's val at same position // if different (non-empty) vals at same position, CONFLICT! - const TQString sep = TQString::tqfromLatin1("::"); + const TQString sep = TQString::fromLatin1("::"); TQStringList vals1 = e1->fields(field, false); TQStringList vals2 = e2->fields(field, false); while(vals1.count() < vals2.count()) { @@ -876,7 +876,7 @@ bool Collection::mergeEntry(EntryPtr e1, EntryPtr e2, bool overwrite_, bool askU } } if(ret) { - e1->setField(field, vals1.join(TQString::tqfromLatin1("; "))); + e1->setField(field, vals1.join(TQString::fromLatin1("; "))); } } else if(field->flags() & Data::Field::AllowMultiple) { // if field F allows multiple values and not a Table (see above case), @@ -892,7 +892,7 @@ bool Collection::mergeEntry(EntryPtr e1, EntryPtr e2, bool overwrite_, bool askU } // not sure if I think it should be sorted or not // items1.sort(); - e1->setField(field, items1.join(TQString::tqfromLatin1("; "))); + e1->setField(field, items1.join(TQString::fromLatin1("; "))); ret = true; } else if(askUser_ && e1->field(field) != e2->field(field)) { int ret = Kernel::self()->askAndMerge(e1, e2, field); diff --git a/src/collectionfactory.cpp b/src/collectionfactory.cpp index 974d254..e6f4178 100644 --- a/src/collectionfactory.cpp +++ b/src/collectionfactory.cpp @@ -79,7 +79,7 @@ Tellico::Data::CollPtr CollectionFactory::collection(int type_, bool addFields_) } Data::CollPtr c = new Data::Collection(i18n("My Collection")); - Data::FieldPtr f = new Data::Field(TQString::tqfromLatin1("title"), i18n("Title")); + Data::FieldPtr f = new Data::Field(TQString::fromLatin1("title"), i18n("Title")); f->setCategory(i18n("General")); f->setFlags(Data::Field::NoDelete); f->setFormatFlag(Data::Field::FormatTitle); @@ -140,60 +140,60 @@ Tellico::CollectionNameMap CollectionFactory::nameMap() { TQString CollectionFactory::typeName(int type_) { switch(type_) { case Data::Collection::Book: - return TQString::tqfromLatin1("book"); + return TQString::fromLatin1("book"); break; case Data::Collection::Video: - return TQString::tqfromLatin1("video"); + return TQString::fromLatin1("video"); break; case Data::Collection::Album: - return TQString::tqfromLatin1("album"); + return TQString::fromLatin1("album"); break; case Data::Collection::Bibtex: - return TQString::tqfromLatin1("bibtex"); + return TQString::fromLatin1("bibtex"); break; case Data::Collection::ComicBook: - return TQString::tqfromLatin1("comic"); + return TQString::fromLatin1("comic"); break; case Data::Collection::Wine: - return TQString::tqfromLatin1("wine"); + return TQString::fromLatin1("wine"); break; case Data::Collection::Coin: - return TQString::tqfromLatin1("coin"); + return TQString::fromLatin1("coin"); break; case Data::Collection::Stamp: - return TQString::tqfromLatin1("stamp"); + return TQString::fromLatin1("stamp"); break; case Data::Collection::Card: - return TQString::tqfromLatin1("card"); + return TQString::fromLatin1("card"); break; case Data::Collection::Game: - return TQString::tqfromLatin1("game"); + return TQString::fromLatin1("game"); break; case Data::Collection::File: - return TQString::tqfromLatin1("file"); + return TQString::fromLatin1("file"); break; case Data::Collection::BoardGame: - return TQString::tqfromLatin1("boardgame"); + return TQString::fromLatin1("boardgame"); break; case Data::Collection::Base: - return TQString::tqfromLatin1("entry"); + return TQString::fromLatin1("entry"); break; default: kdWarning() << "CollectionFactory::collection() - collection type not implemented: " << type_ << endl; - return TQString::tqfromLatin1("entry"); + return TQString::fromLatin1("entry"); break; } } diff --git a/src/collectionfieldsdialog.cpp b/src/collectionfieldsdialog.cpp index 61102a2..fec6fe7 100644 --- a/src/collectionfieldsdialog.cpp +++ b/src/collectionfieldsdialog.cpp @@ -30,7 +30,7 @@ #include <kaccelmanager.h> #include <tqgroupbox.h> -#include <tqlayout.h> +#include <layout.h> #include <tqhbox.h> #include <tqvbox.h> #include <tqlabel.h> @@ -82,10 +82,10 @@ CollectionFieldsDialog::CollectionFieldsDialog(Data::CollPtr coll_, TQWidget* pa TQHBox* hb1 = new TQHBox(fieldsGroup); hb1->setSpacing(KDialog::spacingHint()); m_btnNew = new KPushButton(i18n("New Field", "&New"), hb1); - m_btnNew->setIconSet(BarIcon(TQString::tqfromLatin1("filenew"), KIcon::SizeSmall)); + m_btnNew->setIconSet(BarIcon(TQString::fromLatin1("filenew"), KIcon::SizeSmall)); TQWhatsThis::add(m_btnNew, i18n("Add a new field to the collection")); m_btnDelete = new KPushButton(i18n("Delete Field", "&Delete"), hb1); - m_btnDelete->setIconSet(BarIconSet(TQString::tqfromLatin1("editdelete"), KIcon::SizeSmall)); + m_btnDelete->setIconSet(BarIconSet(TQString::fromLatin1("editdelete"), KIcon::SizeSmall)); TQWhatsThis::add(m_btnDelete, i18n("Remove a field from the collection")); connect(m_btnNew, TQT_SIGNAL(clicked()), TQT_SLOT(slotNew()) ); @@ -94,13 +94,13 @@ CollectionFieldsDialog::CollectionFieldsDialog(Data::CollPtr coll_, TQWidget* pa TQHBox* hb2 = new TQHBox(fieldsGroup); hb2->setSpacing(KDialog::spacingHint()); m_btnUp = new KPushButton(hb2); - m_btnUp->setPixmap(BarIcon(TQString::tqfromLatin1("up"), KIcon::SizeSmall)); + m_btnUp->setPixmap(BarIcon(TQString::fromLatin1("up"), KIcon::SizeSmall)); TQWhatsThis::add(m_btnUp, i18n("Move this field up in the list. The list order is important " - "for the tqlayout of the entry editor.")); + "for the layout of the entry editor.")); m_btnDown = new KPushButton(hb2); - m_btnDown->setPixmap(BarIcon(TQString::tqfromLatin1("down"), KIcon::SizeSmall)); + m_btnDown->setPixmap(BarIcon(TQString::fromLatin1("down"), KIcon::SizeSmall)); TQWhatsThis::add(m_btnDown, i18n("Move this field down in the list. The list order is important " - "for the tqlayout of the entry editor.")); + "for the layout of the entry editor.")); connect(m_btnUp, TQT_SIGNAL(clicked()), TQT_SLOT(slotMoveUp()) ); connect(m_btnDown, TQT_SIGNAL(clicked()), TQT_SLOT(slotMoveDown())); @@ -113,13 +113,13 @@ CollectionFieldsDialog::CollectionFieldsDialog(Data::CollPtr coll_, TQWidget* pa TQWidget* grid = new TQWidget(propGroup); // (parent, nrows, ncols, margin, spacing) - TQGridLayout* tqlayout = new TQGridLayout(grid, 4, 4, 0, KDialog::spacingHint()); + TQGridLayout* layout = new TQGridLayout(grid, 4, 4, 0, KDialog::spacingHint()); int row = -1; TQLabel* label = new TQLabel(i18n("&Title:"), grid); - tqlayout->addWidget(label, ++row, 0); + layout->addWidget(label, ++row, 0); m_titleEdit = new KLineEdit(grid); - tqlayout->addWidget(m_titleEdit, row, 1); + layout->addWidget(m_titleEdit, row, 1); label->setBuddy(m_titleEdit); TQString whats = i18n("The title of the field"); TQWhatsThis::add(label, whats); @@ -127,11 +127,11 @@ CollectionFieldsDialog::CollectionFieldsDialog(Data::CollPtr coll_, TQWidget* pa connect(m_titleEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotModified())); label = new TQLabel(i18n("T&ype:"), grid); - tqlayout->addWidget(label, row, 2); + layout->addWidget(label, row, 2); m_typeCombo = new KComboBox(grid); - tqlayout->addWidget(m_typeCombo, row, 3); + layout->addWidget(m_typeCombo, row, 3); label->setBuddy(m_typeCombo); - whats = TQString::tqfromLatin1("<qt>"); + whats = TQString::fromLatin1("<qt>"); whats += i18n("The type of the field determines what values may be used. "); whats += i18n("<i>Simple Text</i> is used for most fields. "); whats += i18n("<i>Paragraph</i> is for large text blocks. "); @@ -146,7 +146,7 @@ CollectionFieldsDialog::CollectionFieldsDialog(Data::CollPtr coll_, TQWidget* pa whats += i18n("A <i>Dependent</i> field depends on the values of other " "fields, and is formatted according to the field description. "); whats += i18n("A <i>Read Only</i> is for internal values, possibly useful for import and export. "); - whats += TQString::tqfromLatin1("</qt>"); + whats += TQString::fromLatin1("</qt>"); TQWhatsThis::add(label, whats); TQWhatsThis::add(m_typeCombo, whats); // the typeTitles match the fieldMap().values() but in a better order @@ -155,9 +155,9 @@ CollectionFieldsDialog::CollectionFieldsDialog(Data::CollPtr coll_, TQWidget* pa connect(m_typeCombo, TQT_SIGNAL(activated(const TQString&)), TQT_SLOT(slotTypeChanged(const TQString&))); label = new TQLabel(i18n("Cate&gory:"), grid); - tqlayout->addWidget(label, ++row, 0); + layout->addWidget(label, ++row, 0); m_catCombo = new KComboBox(true, grid); - tqlayout->addWidget(m_catCombo, row, 1); + layout->addWidget(m_catCombo, row, 1); label->setBuddy(m_catCombo); whats = i18n("The field category determines where the field is placed in the editor."); TQWhatsThis::add(label, whats); @@ -177,10 +177,10 @@ CollectionFieldsDialog::CollectionFieldsDialog(Data::CollPtr coll_, TQWidget* pa connect(m_catCombo, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotModified())); label = new TQLabel(i18n("Descr&iption:"), grid); - tqlayout->addWidget(label, ++row, 0); + layout->addWidget(label, ++row, 0); m_descEdit = new KLineEdit(grid); m_descEdit->setMinimumWidth(150); - tqlayout->addMultiCellWidget(m_descEdit, row, row, 1, 3); + layout->addMultiCellWidget(m_descEdit, row, row, 1, 3); label->setBuddy(m_descEdit); /* TRANSLATORS: Do not translate %{year} and %{title}. */ whats = i18n("The description is a useful reminder of what information is contained in the " @@ -191,9 +191,9 @@ CollectionFieldsDialog::CollectionFieldsDialog(Data::CollPtr coll_, TQWidget* pa connect(m_descEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotModified())); label = new TQLabel(i18n("&Default value:"), grid); - tqlayout->addWidget(label, ++row, 0); + layout->addWidget(label, ++row, 0); m_defaultEdit = new KLineEdit(grid); - tqlayout->addMultiCellWidget(m_defaultEdit, row, row, 1, 3); + layout->addMultiCellWidget(m_defaultEdit, row, row, 1, 3); label->setBuddy(m_defaultEdit); whats = i18n("<qt>A default value can be set for new entries.</qt>"); TQWhatsThis::add(label, whats); @@ -201,9 +201,9 @@ CollectionFieldsDialog::CollectionFieldsDialog(Data::CollPtr coll_, TQWidget* pa connect(m_defaultEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotModified())); label = new TQLabel(i18n("A&llowed values:"), grid); - tqlayout->addWidget(label, ++row, 0); + layout->addWidget(label, ++row, 0); m_allowEdit = new KLineEdit(grid); - tqlayout->addMultiCellWidget(m_allowEdit, row, row, 1, 3); + layout->addMultiCellWidget(m_allowEdit, row, row, 1, 3); label->setBuddy(m_allowEdit); whats = i18n("<qt>For <i>Choice</i>-type fields, these are the only values allowed. They are " "placed in a combo box. The possible values have to be separated by a semi-colon, " @@ -213,10 +213,10 @@ CollectionFieldsDialog::CollectionFieldsDialog(Data::CollPtr coll_, TQWidget* pa connect(m_allowEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotModified())); label = new TQLabel(i18n("Extended &properties:"), grid); - tqlayout->addWidget(label, ++row, 0); + layout->addWidget(label, ++row, 0); m_btnExtended = new KPushButton(i18n("&Set..."), grid); - m_btnExtended->setIconSet(BarIcon(TQString::tqfromLatin1("bookmark"), KIcon::SizeSmall)); - tqlayout->addWidget(m_btnExtended, row, 1); + m_btnExtended->setIconSet(BarIcon(TQString::fromLatin1("bookmark"), KIcon::SizeSmall)); + layout->addWidget(m_btnExtended, row, 1); label->setBuddy(m_btnExtended); whats = i18n("Extended field properties are used to specify things such as the corresponding bibtex field."); TQWhatsThis::add(label, whats); @@ -265,7 +265,7 @@ CollectionFieldsDialog::CollectionFieldsDialog(Data::CollPtr coll_, TQWidget* pa enableButtonOK(false); enableButtonApply(false); - setHelp(TQString::tqfromLatin1("fields-dialog")); + setHelp(TQString::fromLatin1("fields-dialog")); // initially the m_typeCombo is populated with all types, but as soon as something is // selected in the fields box, the combo box is cleared and filled with the allowable @@ -320,7 +320,7 @@ void CollectionFieldsDialog::applyChanges() { i18n("<qt>Removing allowed values from the <i>%1</i> field which " "currently exist in the collection may cause data corruption. " "Do you want to keep your modified values or cancel and revert " - "to the current ones?</qt>").tqarg(field->title()), + "to the current ones?</qt>").arg(field->title()), TQString(), i18n("Keep modified values")); if(ret != KMessageBox::Continue) { @@ -328,8 +328,8 @@ void CollectionFieldsDialog::applyChanges() { field->setAllowed(oldValues); } else { // rating field Data::FieldPtr oldField = m_coll->fieldByName(field->name()); - field->setProperty(TQString::tqfromLatin1("minimum"), oldField->property(TQString::tqfromLatin1("minimum"))); - field->setProperty(TQString::tqfromLatin1("maximum"), oldField->property(TQString::tqfromLatin1("maximum"))); + field->setProperty(TQString::fromLatin1("minimum"), oldField->property(TQString::fromLatin1("minimum"))); + field->setProperty(TQString::fromLatin1("maximum"), oldField->property(TQString::fromLatin1("maximum"))); } } break; @@ -404,12 +404,12 @@ void CollectionFieldsDialog::slotNew() { return; } - TQString name = TQString::tqfromLatin1("custom") + TQString::number(m_newFields.count()+1); + TQString name = TQString::fromLatin1("custom") + TQString::number(m_newFields.count()+1); int count = m_newFields.count() + 1; - TQString title = i18n("New Field") + TQString::tqfromLatin1(" %1").tqarg(count); + TQString title = i18n("New Field") + TQString::fromLatin1(" %1").arg(count); while(m_fieldsBox->findItem(title)) { ++count; - title = i18n("New Field") + TQString::tqfromLatin1(" %1").tqarg(count); + title = i18n("New Field") + TQString::fromLatin1(" %1").arg(count); } Data::FieldPtr field = new Data::Field(name, title); @@ -544,7 +544,7 @@ void CollectionFieldsDialog::slotHighlightedChanged(int index_) { slotTypeChanged(fieldMap[field->type()]); // just setting the text doesn't emit the activated signal if(field->type() == Data::Field::Choice) { - m_allowEdit->setText(field->allowed().join(TQString::tqfromLatin1("; "))); + m_allowEdit->setText(field->allowed().join(TQString::fromLatin1("; "))); } else { m_allowEdit->clear(); } @@ -605,10 +605,10 @@ void CollectionFieldsDialog::updateField() { // name needs to be a valid XML element name TQString name = XML::elementName(m_titleEdit->text().lower()); if(name.isEmpty()) { // might end up with empty string - name = TQString::tqfromLatin1("custom") + TQString::number(m_newFields.count()+1); + name = TQString::fromLatin1("custom") + TQString::number(m_newFields.count()+1); } while(m_coll->hasField(name)) { // ensure name uniqueness - name += TQString::tqfromLatin1("-new"); + name += TQString::fromLatin1("-new"); } field->setName(name); } @@ -625,18 +625,18 @@ void CollectionFieldsDialog::updateField() { } if(field->type() == Data::Field::Choice) { - const TQRegExp rx(TQString::tqfromLatin1("\\s*;\\s*")); + const TQRegExp rx(TQString::fromLatin1("\\s*;\\s*")); field->setAllowed(TQStringList::split(rx, m_allowEdit->text())); - field->setProperty(TQString::tqfromLatin1("minimum"), TQString()); - field->setProperty(TQString::tqfromLatin1("maximum"), TQString()); + field->setProperty(TQString::fromLatin1("minimum"), TQString()); + field->setProperty(TQString::fromLatin1("maximum"), TQString()); } else if(field->type() == Data::Field::Rating) { - TQString v = field->property(TQString::tqfromLatin1("minimum")); + TQString v = field->property(TQString::fromLatin1("minimum")); if(v.isEmpty()) { - field->setProperty(TQString::tqfromLatin1("minimum"), TQString::number(1)); + field->setProperty(TQString::fromLatin1("minimum"), TQString::number(1)); } - v = field->property(TQString::tqfromLatin1("maximum")); + v = field->property(TQString::fromLatin1("maximum")); if(v.isEmpty()) { - field->setProperty(TQString::tqfromLatin1("maximum"), TQString::number(5)); + field->setProperty(TQString::fromLatin1("maximum"), TQString::number(5)); } } @@ -744,8 +744,8 @@ void CollectionFieldsDialog::slotDefault() { TQString caption = i18n("Revert Field Properties"); TQString text = i18n("<qt><p>Do you really want to revert the properties for the <em>%1</em> " - "field back to their default values?</p></qt>").tqarg(m_currentField->title()); - TQString dontAsk = TQString::tqfromLatin1("RevertFieldProperties"); + "field back to their default values?</p></qt>").arg(m_currentField->title()); + TQString dontAsk = TQString::fromLatin1("RevertFieldProperties"); int ret = KMessageBox::warningContinueCancel(this, text, caption, i18n("Revert"), dontAsk); if(ret != KMessageBox::Continue) { return; @@ -760,7 +760,7 @@ void CollectionFieldsDialog::slotDefault() { slotTypeChanged(fieldMap[defaultField->type()]); // just setting the text doesn't emit the activated signal if(defaultField->type() == Data::Field::Choice) { - m_allowEdit->setText(defaultField->allowed().join(TQString::tqfromLatin1("; "))); + m_allowEdit->setText(defaultField->allowed().join(TQString::fromLatin1("; "))); } else { m_allowEdit->clear(); } @@ -866,7 +866,7 @@ bool CollectionFieldsDialog::slotShowExtendedProperties() { // separate edit box TQString dv = m_currentField->defaultValue(); StringMap props = m_currentField->propertyList(); - props.remove(TQString::tqfromLatin1("default")); + props.remove(TQString::fromLatin1("default")); StringMapDialog dlg(props, this, "ExtendedPropertiesDialog", true); dlg.setCaption(i18n("Extended Field Properties")); @@ -874,7 +874,7 @@ bool CollectionFieldsDialog::slotShowExtendedProperties() { if(dlg.exec() == TQDialog::Accepted) { props = dlg.stringMap(); if(!dv.isEmpty()) { - props.insert(TQString::tqfromLatin1("default"), dv); + props.insert(TQString::fromLatin1("default"), dv); } m_currentField->setPropertyList(props); slotModified(); @@ -931,26 +931,26 @@ bool CollectionFieldsDialog::checkValues() { // check for rating values outside bounds if(m_currentField->type() == Data::Field::Rating) { bool ok; // ok to ignore this here - int low = Tellico::toUInt(m_currentField->property(TQString::tqfromLatin1("minimum")), &ok); - int high = Tellico::toUInt(m_currentField->property(TQString::tqfromLatin1("maximum")), &ok); + int low = Tellico::toUInt(m_currentField->property(TQString::fromLatin1("minimum")), &ok); + int high = Tellico::toUInt(m_currentField->property(TQString::fromLatin1("maximum")), &ok); while(low < 1 || low > 9 || high < 1 || high > 10 || low >= high) { KMessageBox::sorry(this, i18n("The range for a rating field must be between 1 and 10, " "and the lower bound must be less than the higher bound. " "Please enter different low and high properties.")); if(slotShowExtendedProperties()) { - low = Tellico::toUInt(m_currentField->property(TQString::tqfromLatin1("minimum")), &ok); - high = Tellico::toUInt(m_currentField->property(TQString::tqfromLatin1("maximum")), &ok); + low = Tellico::toUInt(m_currentField->property(TQString::fromLatin1("minimum")), &ok); + high = Tellico::toUInt(m_currentField->property(TQString::fromLatin1("maximum")), &ok); } else { return false; } } } else if(m_currentField->type() == Data::Field::Table) { bool ok; // ok to ignore this here - int ncols = Tellico::toUInt(m_currentField->property(TQString::tqfromLatin1("columns")), &ok); + int ncols = Tellico::toUInt(m_currentField->property(TQString::fromLatin1("columns")), &ok); // also enforced in GUI::TableFieldWidget if(ncols > 10) { KMessageBox::sorry(this, i18n("Tables are limited to a maximum of ten columns.")); - m_currentField->setProperty(TQString::tqfromLatin1("columns"), TQString::tqfromLatin1("10")); + m_currentField->setProperty(TQString::fromLatin1("columns"), TQString::fromLatin1("10")); } } diff --git a/src/collections/bibtexcollection.cpp b/src/collections/bibtexcollection.cpp index dbe34ff..3e580bb 100644 --- a/src/collections/bibtexcollection.cpp +++ b/src/collections/bibtexcollection.cpp @@ -31,21 +31,21 @@ BibtexCollection::BibtexCollection(bool addFields_, const TQString& title_ /*=nu if(addFields_) { addFields(defaultFields()); } - setDefaultGroupField(TQString::tqfromLatin1("author")); + setDefaultGroupField(TQString::fromLatin1("author")); // Bibtex has some default macros for the months - addMacro(TQString::tqfromLatin1("jan"), TQString()); - addMacro(TQString::tqfromLatin1("feb"), TQString()); - addMacro(TQString::tqfromLatin1("mar"), TQString()); - addMacro(TQString::tqfromLatin1("apr"), TQString()); - addMacro(TQString::tqfromLatin1("may"), TQString()); - addMacro(TQString::tqfromLatin1("jun"), TQString()); - addMacro(TQString::tqfromLatin1("jul"), TQString()); - addMacro(TQString::tqfromLatin1("aug"), TQString()); - addMacro(TQString::tqfromLatin1("sep"), TQString()); - addMacro(TQString::tqfromLatin1("oct"), TQString()); - addMacro(TQString::tqfromLatin1("nov"), TQString()); - addMacro(TQString::tqfromLatin1("dec"), TQString()); + addMacro(TQString::fromLatin1("jan"), TQString()); + addMacro(TQString::fromLatin1("feb"), TQString()); + addMacro(TQString::fromLatin1("mar"), TQString()); + addMacro(TQString::fromLatin1("apr"), TQString()); + addMacro(TQString::fromLatin1("may"), TQString()); + addMacro(TQString::fromLatin1("jun"), TQString()); + addMacro(TQString::fromLatin1("jul"), TQString()); + addMacro(TQString::fromLatin1("aug"), TQString()); + addMacro(TQString::fromLatin1("sep"), TQString()); + addMacro(TQString::fromLatin1("oct"), TQString()); + addMacro(TQString::fromLatin1("nov"), TQString()); + addMacro(TQString::fromLatin1("dec"), TQString()); } Tellico::Data::FieldVec BibtexCollection::defaultFields() { @@ -53,189 +53,189 @@ Tellico::Data::FieldVec BibtexCollection::defaultFields() { FieldPtr field; /******************* General ****************************/ - field = new Field(TQString::tqfromLatin1("title"), i18n("Title")); - field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("title")); + field = new Field(TQString::fromLatin1("title"), i18n("Title")); + field->setProperty(TQString::fromLatin1("bibtex"), TQString::fromLatin1("title")); field->setCategory(i18n("General")); field->setFlags(Field::NoDelete); field->setFormatFlag(Field::FormatTitle); list.append(field); TQStringList types; - types << TQString::tqfromLatin1("article") << TQString::tqfromLatin1("book") - << TQString::tqfromLatin1("booklet") << TQString::tqfromLatin1("inbook") - << TQString::tqfromLatin1("incollection") << TQString::tqfromLatin1("inproceedings") - << TQString::tqfromLatin1("manual") << TQString::tqfromLatin1("mastersthesis") - << TQString::tqfromLatin1("misc") << TQString::tqfromLatin1("phdthesis") - << TQString::tqfromLatin1("proceedings") << TQString::tqfromLatin1("techreport") - << TQString::tqfromLatin1("unpublished") << TQString::tqfromLatin1("periodical") - << TQString::tqfromLatin1("conference"); - field = new Field(TQString::tqfromLatin1("entry-type"), i18n("Entry Type"), types); - field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("entry-type")); + types << TQString::fromLatin1("article") << TQString::fromLatin1("book") + << TQString::fromLatin1("booklet") << TQString::fromLatin1("inbook") + << TQString::fromLatin1("incollection") << TQString::fromLatin1("inproceedings") + << TQString::fromLatin1("manual") << TQString::fromLatin1("mastersthesis") + << TQString::fromLatin1("misc") << TQString::fromLatin1("phdthesis") + << TQString::fromLatin1("proceedings") << TQString::fromLatin1("techreport") + << TQString::fromLatin1("unpublished") << TQString::fromLatin1("periodical") + << TQString::fromLatin1("conference"); + field = new Field(TQString::fromLatin1("entry-type"), i18n("Entry Type"), types); + field->setProperty(TQString::fromLatin1("bibtex"), TQString::fromLatin1("entry-type")); field->setCategory(i18n(bibtex_general)); field->setFlags(Field::AllowGrouped | Field::NoDelete); field->setDescription(i18n("These entry types are specific to bibtex. See the bibtex documentation.")); list.append(field); - field = new Field(TQString::tqfromLatin1("author"), i18n("Author")); - field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("author")); + field = new Field(TQString::fromLatin1("author"), i18n("Author")); + field->setProperty(TQString::fromLatin1("bibtex"), TQString::fromLatin1("author")); field->setCategory(i18n(bibtex_general)); field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped); field->setFormatFlag(Field::FormatName); list.append(field); - field = new Field(TQString::tqfromLatin1("bibtex-key"), i18n("Bibtex Key")); - field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("key")); + field = new Field(TQString::fromLatin1("bibtex-key"), i18n("Bibtex Key")); + field->setProperty(TQString::fromLatin1("bibtex"), TQString::fromLatin1("key")); field->setCategory(i18n("General")); field->setFlags(Field::NoDelete); list.append(field); - field = new Field(TQString::tqfromLatin1("booktitle"), i18n("Book Title")); - field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("booktitle")); + field = new Field(TQString::fromLatin1("booktitle"), i18n("Book Title")); + field->setProperty(TQString::fromLatin1("bibtex"), TQString::fromLatin1("booktitle")); field->setCategory(i18n(bibtex_general)); field->setFormatFlag(Field::FormatTitle); list.append(field); - field = new Field(TQString::tqfromLatin1("editor"), i18n("Editor")); - field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("editor")); + field = new Field(TQString::fromLatin1("editor"), i18n("Editor")); + field->setProperty(TQString::fromLatin1("bibtex"), TQString::fromLatin1("editor")); field->setCategory(i18n(bibtex_general)); field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped); field->setFormatFlag(Field::FormatName); list.append(field); - field = new Field(TQString::tqfromLatin1("organization"), i18n("Organization")); - field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("organization")); + field = new Field(TQString::fromLatin1("organization"), i18n("Organization")); + field->setProperty(TQString::fromLatin1("bibtex"), TQString::fromLatin1("organization")); field->setCategory(i18n(bibtex_general)); field->setFlags(Field::AllowCompletion | Field::AllowGrouped); field->setFormatFlag(Field::FormatPlain); list.append(field); -// field = new Field(TQString::tqfromLatin1("institution"), i18n("Institution")); -// field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("institution")); +// field = new Field(TQString::fromLatin1("institution"), i18n("Institution")); +// field->setProperty(TQString::fromLatin1("bibtex"), TQString::fromLatin1("institution")); // field->setCategory(i18n(bibtex_general)); // field->setFlags(Field::AllowDelete); // field->setFormatFlag(Field::FormatTitle); // list.append(field); /******************* Publishing ****************************/ - field = new Field(TQString::tqfromLatin1("publisher"), i18n("Publisher")); - field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("publisher")); + field = new Field(TQString::fromLatin1("publisher"), i18n("Publisher")); + field->setProperty(TQString::fromLatin1("bibtex"), TQString::fromLatin1("publisher")); field->setCategory(i18n(bibtex_publishing)); field->setFlags(Field::AllowCompletion | Field::AllowGrouped); field->setFormatFlag(Field::FormatPlain); list.append(field); - field = new Field(TQString::tqfromLatin1("address"), i18n("Address")); - field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("address")); + field = new Field(TQString::fromLatin1("address"), i18n("Address")); + field->setProperty(TQString::fromLatin1("bibtex"), TQString::fromLatin1("address")); field->setCategory(i18n(bibtex_publishing)); field->setFlags(Field::AllowCompletion | Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("edition"), i18n("Edition")); - field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("edition")); + field = new Field(TQString::fromLatin1("edition"), i18n("Edition")); + field->setProperty(TQString::fromLatin1("bibtex"), TQString::fromLatin1("edition")); field->setCategory(i18n(bibtex_publishing)); field->setFlags(Field::AllowCompletion); list.append(field); // don't make it a nuumber, it could have latex processing commands in it - field = new Field(TQString::tqfromLatin1("pages"), i18n("Pages")); - field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("pages")); + field = new Field(TQString::fromLatin1("pages"), i18n("Pages")); + field->setProperty(TQString::fromLatin1("bibtex"), TQString::fromLatin1("pages")); field->setCategory(i18n(bibtex_publishing)); list.append(field); - field = new Field(TQString::tqfromLatin1("year"), i18n("Year"), Field::Number); - field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("year")); + field = new Field(TQString::fromLatin1("year"), i18n("Year"), Field::Number); + field->setProperty(TQString::fromLatin1("bibtex"), TQString::fromLatin1("year")); field->setCategory(i18n(bibtex_publishing)); field->setFlags(Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("isbn"), i18n("ISBN#")); - field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("isbn")); + field = new Field(TQString::fromLatin1("isbn"), i18n("ISBN#")); + field->setProperty(TQString::fromLatin1("bibtex"), TQString::fromLatin1("isbn")); field->setCategory(i18n(bibtex_publishing)); field->setDescription(i18n("International Standard Book Number")); list.append(field); - field = new Field(TQString::tqfromLatin1("journal"), i18n("Journal")); - field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("journal")); + field = new Field(TQString::fromLatin1("journal"), i18n("Journal")); + field->setProperty(TQString::fromLatin1("bibtex"), TQString::fromLatin1("journal")); field->setCategory(i18n(bibtex_publishing)); field->setFlags(Field::AllowCompletion | Field::AllowGrouped); field->setFormatFlag(Field::FormatPlain); list.append(field); - field = new Field(TQString::tqfromLatin1("doi"), i18n("DOI")); - field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("doi")); + field = new Field(TQString::fromLatin1("doi"), i18n("DOI")); + field->setProperty(TQString::fromLatin1("bibtex"), TQString::fromLatin1("doi")); field->setCategory(i18n(bibtex_publishing)); field->setDescription(i18n("Digital Object Identifier")); list.append(field); // could make this a string list, but since bibtex import could have funky values // keep it an editbox - field = new Field(TQString::tqfromLatin1("month"), i18n("Month")); - field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("month")); + field = new Field(TQString::fromLatin1("month"), i18n("Month")); + field->setProperty(TQString::fromLatin1("bibtex"), TQString::fromLatin1("month")); field->setCategory(i18n(bibtex_publishing)); field->setFlags(Field::AllowCompletion); list.append(field); - field = new Field(TQString::tqfromLatin1("number"), i18n("Number"), Field::Number); - field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("number")); + field = new Field(TQString::fromLatin1("number"), i18n("Number"), Field::Number); + field->setProperty(TQString::fromLatin1("bibtex"), TQString::fromLatin1("number")); field->setCategory(i18n(bibtex_publishing)); list.append(field); - field = new Field(TQString::tqfromLatin1("howpublished"), i18n("How Published")); - field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("howpublished")); + field = new Field(TQString::fromLatin1("howpublished"), i18n("How Published")); + field->setProperty(TQString::fromLatin1("bibtex"), TQString::fromLatin1("howpublished")); field->setCategory(i18n(bibtex_publishing)); list.append(field); -// field = new Field(TQString::tqfromLatin1("school"), i18n("School")); -// field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("school")); +// field = new Field(TQString::fromLatin1("school"), i18n("School")); +// field->setProperty(TQString::fromLatin1("bibtex"), TQString::fromLatin1("school")); // field->setCategory(i18n(bibtex_publishing)); // field->setFlags(Field::AllowCompletion | Field::AllowGrouped); // list.append(field); /******************* Classification ****************************/ - field = new Field(TQString::tqfromLatin1("chapter"), i18n("Chapter"), Field::Number); - field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("chapter")); + field = new Field(TQString::fromLatin1("chapter"), i18n("Chapter"), Field::Number); + field->setProperty(TQString::fromLatin1("bibtex"), TQString::fromLatin1("chapter")); field->setCategory(i18n(bibtex_misc)); list.append(field); - field = new Field(TQString::tqfromLatin1("series"), i18n("Series")); - field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("series")); + field = new Field(TQString::fromLatin1("series"), i18n("Series")); + field->setProperty(TQString::fromLatin1("bibtex"), TQString::fromLatin1("series")); field->setCategory(i18n(bibtex_misc)); field->setFlags(Field::AllowCompletion | Field::AllowGrouped); field->setFormatFlag(Field::FormatTitle); list.append(field); - field = new Field(TQString::tqfromLatin1("volume"), i18n("Volume"), Field::Number); - field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("volume")); + field = new Field(TQString::fromLatin1("volume"), i18n("Volume"), Field::Number); + field->setProperty(TQString::fromLatin1("bibtex"), TQString::fromLatin1("volume")); field->setCategory(i18n(bibtex_misc)); list.append(field); - field = new Field(TQString::tqfromLatin1("crossref"), i18n("Cross-Reference")); - field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("crossref")); + field = new Field(TQString::fromLatin1("crossref"), i18n("Cross-Reference")); + field->setProperty(TQString::fromLatin1("bibtex"), TQString::fromLatin1("crossref")); field->setCategory(i18n(bibtex_misc)); list.append(field); -// field = new Field(TQString::tqfromLatin1("annote"), i18n("Annotation")); -// field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("annote")); +// field = new Field(TQString::fromLatin1("annote"), i18n("Annotation")); +// field->setProperty(TQString::fromLatin1("bibtex"), TQString::fromLatin1("annote")); // field->setCategory(i18n(bibtex_misc)); // list.append(field); - field = new Field(TQString::tqfromLatin1("keyword"), i18n("Keywords")); - field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("keywords")); + field = new Field(TQString::fromLatin1("keyword"), i18n("Keywords")); + field->setProperty(TQString::fromLatin1("bibtex"), TQString::fromLatin1("keywords")); field->setCategory(i18n(bibtex_misc)); field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("url"), i18n("URL"), Field::URL); - field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("url")); + field = new Field(TQString::fromLatin1("url"), i18n("URL"), Field::URL); + field->setProperty(TQString::fromLatin1("bibtex"), TQString::fromLatin1("url")); field->setCategory(i18n(bibtex_misc)); list.append(field); - field = new Field(TQString::tqfromLatin1("abstract"), i18n("Abstract"), Data::Field::Para); - field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("abstract")); + field = new Field(TQString::fromLatin1("abstract"), i18n("Abstract"), Data::Field::Para); + field->setProperty(TQString::fromLatin1("bibtex"), TQString::fromLatin1("abstract")); list.append(field); - field = new Field(TQString::tqfromLatin1("note"), i18n("Notes"), Field::Para); - field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("note")); + field = new Field(TQString::fromLatin1("note"), i18n("Notes"), Field::Para); + field->setProperty(TQString::fromLatin1("bibtex"), TQString::fromLatin1("note")); list.append(field); return list; @@ -248,7 +248,7 @@ bool BibtexCollection::addField(FieldPtr field_) { // myDebug() << "BibtexCollection::addField()" << endl; bool success = Collection::addField(field_); if(success) { - TQString bibtex = field_->property(TQString::tqfromLatin1("bibtex")); + TQString bibtex = field_->property(TQString::fromLatin1("bibtex")); if(!bibtex.isEmpty()) { m_bibtexFieldDict.insert(bibtex, field_); } @@ -263,13 +263,13 @@ bool BibtexCollection::modifyField(FieldPtr newField_) { // myDebug() << "BibtexCollection::modifyField()" << endl; bool success = Collection::modifyField(newField_); FieldPtr oldField = fieldByName(newField_->name()); - TQString oldBibtex = oldField->property(TQString::tqfromLatin1("bibtex")); - TQString newBibtex = newField_->property(TQString::tqfromLatin1("bibtex")); + TQString oldBibtex = oldField->property(TQString::fromLatin1("bibtex")); + TQString newBibtex = newField_->property(TQString::fromLatin1("bibtex")); if(!oldBibtex.isEmpty()) { success &= m_bibtexFieldDict.remove(oldBibtex); } if(!newBibtex.isEmpty()) { - oldField->setProperty(TQString::tqfromLatin1("bibtex"), newBibtex); + oldField->setProperty(TQString::fromLatin1("bibtex"), newBibtex); m_bibtexFieldDict.insert(newBibtex, oldField); } return success; @@ -281,7 +281,7 @@ bool BibtexCollection::deleteField(FieldPtr field_, bool force_) { } // myDebug() << "BibtexCollection::deleteField()" << endl; bool success = true; - TQString bibtex = field_->property(TQString::tqfromLatin1("bibtex")); + TQString bibtex = field_->property(TQString::fromLatin1("bibtex")); if(!bibtex.isEmpty()) { success &= m_bibtexFieldDict.remove(bibtex); } @@ -295,28 +295,28 @@ Tellico::Data::FieldPtr BibtexCollection::fieldByBibtexName(const TQString& bibt // same as BookCollection::sameEntry() int BibtexCollection::sameEntry(Data::EntryPtr entry1_, Data::EntryPtr entry2_) const { // equal isbn's or lccn's are easy, give it a weight of 100 - if(Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("isbn"), this) > 0 || - Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("lccn"), this) > 0 || - Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("doi"), this) > 0 || - Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("pmid"), this) > 0 || - Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("arxiv"), this) > 0) { + if(Entry::compareValues(entry1_, entry2_, TQString::fromLatin1("isbn"), this) > 0 || + Entry::compareValues(entry1_, entry2_, TQString::fromLatin1("lccn"), this) > 0 || + Entry::compareValues(entry1_, entry2_, TQString::fromLatin1("doi"), this) > 0 || + Entry::compareValues(entry1_, entry2_, TQString::fromLatin1("pmid"), this) > 0 || + Entry::compareValues(entry1_, entry2_, TQString::fromLatin1("arxiv"), this) > 0) { return 100; // good match } - int res = 3*Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("title"), this); + int res = 3*Entry::compareValues(entry1_, entry2_, TQString::fromLatin1("title"), this); // if(res == 0) { // myDebug() << "BookCollection::sameEntry() - different titles for " << entry1_->title() << " vs. " // << entry2_->title() << endl; // } - res += Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("author"), this); - res += Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("cr_year"), this); - res += Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("pub_year"), this); - res += Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("binding"), this); + res += Entry::compareValues(entry1_, entry2_, TQString::fromLatin1("author"), this); + res += Entry::compareValues(entry1_, entry2_, TQString::fromLatin1("cr_year"), this); + res += Entry::compareValues(entry1_, entry2_, TQString::fromLatin1("pub_year"), this); + res += Entry::compareValues(entry1_, entry2_, TQString::fromLatin1("binding"), this); return res; } // static Tellico::Data::CollPtr BibtexCollection::convertBookCollection(CollPtr coll_) { - const TQString bibtex = TQString::tqfromLatin1("bibtex"); + const TQString bibtex = TQString::fromLatin1("bibtex"); KSharedPtr<BibtexCollection> coll = new BibtexCollection(false, coll_->title()); FieldVec fields = coll_->fields(); for(FieldVec::Iterator fIt = fields.begin(); fIt != fields.end(); ++fIt) { @@ -344,17 +344,17 @@ Tellico::Data::CollPtr BibtexCollection::convertBookCollection(CollPtr coll_) { || name == Latin1Literal("series")) { field->setProperty(bibtex, name); } else if(name == Latin1Literal("series_num")) { - field->setProperty(bibtex, TQString::tqfromLatin1("number")); + field->setProperty(bibtex, TQString::fromLatin1("number")); } else if(name == Latin1Literal("pur_price")) { - field->setProperty(bibtex, TQString::tqfromLatin1("price")); + field->setProperty(bibtex, TQString::fromLatin1("price")); } else if(name == Latin1Literal("cr_year")) { - field->setProperty(bibtex, TQString::tqfromLatin1("year")); + field->setProperty(bibtex, TQString::fromLatin1("year")); } else if(name == Latin1Literal("bibtex-id")) { - field->setProperty(bibtex, TQString::tqfromLatin1("key")); + field->setProperty(bibtex, TQString::fromLatin1("key")); } else if(name == Latin1Literal("keyword")) { - field->setProperty(bibtex, TQString::tqfromLatin1("keywords")); + field->setProperty(bibtex, TQString::fromLatin1("keywords")); } else if(name == Latin1Literal("comments")) { - field->setProperty(bibtex, TQString::tqfromLatin1("note")); + field->setProperty(bibtex, TQString::fromLatin1("note")); } coll->addField(field); } @@ -365,14 +365,14 @@ Tellico::Data::CollPtr BibtexCollection::convertBookCollection(CollPtr coll_) { if(!coll->hasField(it->name()) && (it->flags() & Field::NoDelete)) { // but don't add a Bibtex Key if there's already a bibtex-id if(it->property(bibtex) != Latin1Literal("key") - || !coll->hasField(TQString::tqfromLatin1("bibtex-id"))) { + || !coll->hasField(TQString::fromLatin1("bibtex-id"))) { coll->addField(it); } } } // set the entry-type to book - FieldPtr field = coll->fieldByBibtexName(TQString::tqfromLatin1("entry-type")); + FieldPtr field = coll->fieldByBibtexName(TQString::fromLatin1("entry-type")); TQString entryTypeName; if(field) { entryTypeName = field->name(); @@ -385,7 +385,7 @@ Tellico::Data::CollPtr BibtexCollection::convertBookCollection(CollPtr coll_) { Data::EntryPtr entry = new Entry(*entryIt); entry->setCollection(coll.data()); if(!entryTypeName.isEmpty()) { - entry->setField(entryTypeName, TQString::tqfromLatin1("book")); + entry->setField(entryTypeName, TQString::fromLatin1("book")); } newEntries.append(entry); } diff --git a/src/collections/boardgamecollection.cpp b/src/collections/boardgamecollection.cpp index ac7fe69..2f09199 100644 --- a/src/collections/boardgamecollection.cpp +++ b/src/collections/boardgamecollection.cpp @@ -27,82 +27,82 @@ BoardGameCollection::BoardGameCollection(bool addFields_, const TQString& title_ if(addFields_) { addFields(defaultFields()); } - setDefaultGroupField(TQString::tqfromLatin1("genre")); + setDefaultGroupField(TQString::fromLatin1("genre")); } Tellico::Data::FieldVec BoardGameCollection::defaultFields() { FieldVec list; FieldPtr field; - field = new Field(TQString::tqfromLatin1("title"), i18n("Title")); + field = new Field(TQString::fromLatin1("title"), i18n("Title")); field->setCategory(i18n(boardgame_general)); field->setFlags(Field::NoDelete); field->setFormatFlag(Field::FormatTitle); list.append(field); - field = new Field(TQString::tqfromLatin1("genre"), i18n("Genre")); + field = new Field(TQString::fromLatin1("genre"), i18n("Genre")); field->setCategory(i18n(boardgame_general)); field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped); field->setFormatFlag(Field::FormatPlain); list.append(field); - field = new Field(TQString::tqfromLatin1("mechanism"), i18n("Mechanism")); + field = new Field(TQString::fromLatin1("mechanism"), i18n("Mechanism")); field->setCategory(i18n(boardgame_general)); field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped); field->setFormatFlag(Field::FormatPlain); list.append(field); - field = new Field(TQString::tqfromLatin1("year"), i18n("Release Year"), Field::Number); + field = new Field(TQString::fromLatin1("year"), i18n("Release Year"), Field::Number); field->setCategory(i18n(boardgame_general)); field->setFlags(Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("publisher"), i18n("Publisher")); + field = new Field(TQString::fromLatin1("publisher"), i18n("Publisher")); field->setCategory(i18n(boardgame_general)); field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped); field->setFormatFlag(Field::FormatPlain); list.append(field); - field = new Field(TQString::tqfromLatin1("designer"), i18n("Designer")); + field = new Field(TQString::fromLatin1("designer"), i18n("Designer")); field->setCategory(i18n(boardgame_general)); field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped); field->setFormatFlag(Field::FormatPlain); list.append(field); - field = new Field(TQString::tqfromLatin1("num-player"), i18n("Number of Players"), Field::Number); + field = new Field(TQString::fromLatin1("num-player"), i18n("Number of Players"), Field::Number); field->setCategory(i18n(boardgame_general)); field->setFlags(Field::AllowMultiple | Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("description"), i18n("Description"), Field::Para); + field = new Field(TQString::fromLatin1("description"), i18n("Description"), Field::Para); list.append(field); - field = new Field(TQString::tqfromLatin1("rating"), i18n("Rating"), Field::Rating); + field = new Field(TQString::fromLatin1("rating"), i18n("Rating"), Field::Rating); field->setCategory(i18n(boardgame_personal)); field->setFlags(Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("pur_date"), i18n("Purchase Date")); + field = new Field(TQString::fromLatin1("pur_date"), i18n("Purchase Date")); field->setCategory(i18n(boardgame_personal)); field->setFormatFlag(Field::FormatDate); list.append(field); - field = new Field(TQString::tqfromLatin1("gift"), i18n("Gift"), Field::Bool); + field = new Field(TQString::fromLatin1("gift"), i18n("Gift"), Field::Bool); field->setCategory(i18n(boardgame_personal)); list.append(field); - field = new Field(TQString::tqfromLatin1("pur_price"), i18n("Purchase Price")); + field = new Field(TQString::fromLatin1("pur_price"), i18n("Purchase Price")); field->setCategory(i18n(boardgame_personal)); list.append(field); - field = new Field(TQString::tqfromLatin1("loaned"), i18n("Loaned"), Field::Bool); + field = new Field(TQString::fromLatin1("loaned"), i18n("Loaned"), Field::Bool); field->setCategory(i18n(boardgame_personal)); list.append(field); - field = new Field(TQString::tqfromLatin1("cover"), i18n("Cover"), Field::Image); + field = new Field(TQString::fromLatin1("cover"), i18n("Cover"), Field::Image); list.append(field); - field = new Field(TQString::tqfromLatin1("comments"), i18n("Comments"), Field::Para); + field = new Field(TQString::fromLatin1("comments"), i18n("Comments"), Field::Para); field->setCategory(i18n(boardgame_personal)); list.append(field); diff --git a/src/collections/bookcollection.cpp b/src/collections/bookcollection.cpp index 21c5d90..72ff534 100644 --- a/src/collections/bookcollection.cpp +++ b/src/collections/bookcollection.cpp @@ -29,31 +29,31 @@ BookCollection::BookCollection(bool addFields_, const TQString& title_ /*=null*/ if(addFields_) { addFields(defaultFields()); } - setDefaultGroupField(TQString::tqfromLatin1("author")); + setDefaultGroupField(TQString::fromLatin1("author")); } Tellico::Data::FieldVec BookCollection::defaultFields() { FieldVec list; FieldPtr field; - field = new Field(TQString::tqfromLatin1("title"), i18n("Title")); + field = new Field(TQString::fromLatin1("title"), i18n("Title")); field->setCategory(i18n("General")); field->setFlags(Field::NoDelete); field->setFormatFlag(Field::FormatTitle); list.append(field); - field = new Field(TQString::tqfromLatin1("subtitle"), i18n("Subtitle")); + field = new Field(TQString::fromLatin1("subtitle"), i18n("Subtitle")); field->setCategory(i18n(book_general)); field->setFormatFlag(Field::FormatTitle); list.append(field); - field = new Field(TQString::tqfromLatin1("author"), i18n("Author")); + field = new Field(TQString::fromLatin1("author"), i18n("Author")); field->setCategory(i18n(book_general)); field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped); field->setFormatFlag(Field::FormatName); list.append(field); - field = new Field(TQString::tqfromLatin1("editor"), i18n("Editor")); + field = new Field(TQString::fromLatin1("editor"), i18n("Editor")); field->setCategory(i18n(book_general)); field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped); field->setFormatFlag(Field::FormatName); @@ -62,119 +62,119 @@ Tellico::Data::FieldVec BookCollection::defaultFields() { TQStringList binding; binding << i18n("Hardback") << i18n("Paperback") << i18n("Trade Paperback") << i18n("E-Book") << i18n("Magazine") << i18n("Journal"); - field = new Field(TQString::tqfromLatin1("binding"), i18n("Binding"), binding); + field = new Field(TQString::fromLatin1("binding"), i18n("Binding"), binding); field->setCategory(i18n(book_general)); field->setFlags(Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("pur_date"), i18n("Purchase Date")); + field = new Field(TQString::fromLatin1("pur_date"), i18n("Purchase Date")); field->setCategory(i18n(book_general)); field->setFormatFlag(Field::FormatDate); list.append(field); - field = new Field(TQString::tqfromLatin1("pur_price"), i18n("Purchase Price")); + field = new Field(TQString::fromLatin1("pur_price"), i18n("Purchase Price")); field->setCategory(i18n(book_general)); list.append(field); - field = new Field(TQString::tqfromLatin1("publisher"), i18n("Publisher")); + field = new Field(TQString::fromLatin1("publisher"), i18n("Publisher")); field->setCategory(i18n(book_publishing)); field->setFlags(Field::AllowCompletion | Field::AllowGrouped); field->setFormatFlag(Field::FormatPlain); list.append(field); - field = new Field(TQString::tqfromLatin1("edition"), i18n("Edition")); + field = new Field(TQString::fromLatin1("edition"), i18n("Edition")); field->setCategory(i18n(book_publishing)); field->setFlags(Field::AllowCompletion); field->setFormatFlag(Field::FormatPlain); list.append(field); - field = new Field(TQString::tqfromLatin1("cr_year"), i18n("Copyright Year"), Field::Number); + field = new Field(TQString::fromLatin1("cr_year"), i18n("Copyright Year"), Field::Number); field->setCategory(i18n(book_publishing)); field->setFlags(Field::AllowGrouped | Field::AllowMultiple); list.append(field); - field = new Field(TQString::tqfromLatin1("pub_year"), i18n("Publication Year"), Field::Number); + field = new Field(TQString::fromLatin1("pub_year"), i18n("Publication Year"), Field::Number); field->setCategory(i18n(book_publishing)); field->setFlags(Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("isbn"), i18n("ISBN#")); + field = new Field(TQString::fromLatin1("isbn"), i18n("ISBN#")); field->setCategory(i18n(book_publishing)); field->setDescription(i18n("International Standard Book Number")); list.append(field); - field = new Field(TQString::tqfromLatin1("lccn"), i18n("LCCN#")); + field = new Field(TQString::fromLatin1("lccn"), i18n("LCCN#")); field->setCategory(i18n(book_publishing)); field->setDescription(i18n("Library of Congress Control Number")); list.append(field); - field = new Field(TQString::tqfromLatin1("pages"), i18n("Pages"), Field::Number); + field = new Field(TQString::fromLatin1("pages"), i18n("Pages"), Field::Number); field->setCategory(i18n(book_publishing)); list.append(field); - field = new Field(TQString::tqfromLatin1("translator"), i18n("Translator")); + field = new Field(TQString::fromLatin1("translator"), i18n("Translator")); field->setCategory(i18n(book_publishing)); field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped); field->setFormatFlag(Field::FormatName); list.append(field); - field = new Field(TQString::tqfromLatin1("language"), i18n("Language")); + field = new Field(TQString::fromLatin1("language"), i18n("Language")); field->setCategory(i18n(book_publishing)); field->setFlags(Field::AllowCompletion | Field::AllowGrouped | Field::AllowMultiple); list.append(field); - field = new Field(TQString::tqfromLatin1("genre"), i18n("Genre")); + field = new Field(TQString::fromLatin1("genre"), i18n("Genre")); field->setCategory(i18n(book_classification)); field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped); list.append(field); // in document versions < 3, this was "keywords" and not "keyword" // but the title didn't change, only the name - field = new Field(TQString::tqfromLatin1("keyword"), i18n("Keywords")); + field = new Field(TQString::fromLatin1("keyword"), i18n("Keywords")); field->setCategory(i18n(book_classification)); field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("series"), i18n("Series")); + field = new Field(TQString::fromLatin1("series"), i18n("Series")); field->setCategory(i18n(book_classification)); field->setFlags(Field::AllowCompletion | Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("series_num"), i18n("Series Number"), Field::Number); + field = new Field(TQString::fromLatin1("series_num"), i18n("Series Number"), Field::Number); field->setCategory(i18n(book_classification)); list.append(field); TQStringList cond; cond << i18n("New") << i18n("Used"); - field = new Field(TQString::tqfromLatin1("condition"), i18n("Condition"), cond); + field = new Field(TQString::fromLatin1("condition"), i18n("Condition"), cond); field->setCategory(i18n(book_classification)); list.append(field); - field = new Field(TQString::tqfromLatin1("signed"), i18n("Signed"), Field::Bool); + field = new Field(TQString::fromLatin1("signed"), i18n("Signed"), Field::Bool); field->setCategory(i18n(book_personal)); list.append(field); - field = new Field(TQString::tqfromLatin1("read"), i18n("Read"), Field::Bool); + field = new Field(TQString::fromLatin1("read"), i18n("Read"), Field::Bool); field->setCategory(i18n(book_personal)); list.append(field); - field = new Field(TQString::tqfromLatin1("gift"), i18n("Gift"), Field::Bool); + field = new Field(TQString::fromLatin1("gift"), i18n("Gift"), Field::Bool); field->setCategory(i18n(book_personal)); list.append(field); - field = new Field(TQString::tqfromLatin1("loaned"), i18n("Loaned"), Field::Bool); + field = new Field(TQString::fromLatin1("loaned"), i18n("Loaned"), Field::Bool); field->setCategory(i18n(book_personal)); list.append(field); - field = new Field(TQString::tqfromLatin1("rating"), i18n("Rating"), Field::Rating); + field = new Field(TQString::fromLatin1("rating"), i18n("Rating"), Field::Rating); field->setCategory(i18n(book_personal)); field->setFlags(Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("cover"), i18n("Front Cover"), Field::Image); + field = new Field(TQString::fromLatin1("cover"), i18n("Front Cover"), Field::Image); list.append(field); - field = new Field(TQString::tqfromLatin1("comments"), i18n("Comments"), Field::Para); + field = new Field(TQString::fromLatin1("comments"), i18n("Comments"), Field::Para); field->setCategory(i18n(book_personal)); list.append(field); @@ -183,19 +183,19 @@ Tellico::Data::FieldVec BookCollection::defaultFields() { int BookCollection::sameEntry(Data::EntryPtr entry1_, Data::EntryPtr entry2_) const { // equal isbn's or lccn's are easy, give it a weight of 100 - if(Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("isbn"), this) > 0 || - Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("lccn"), this) > 0) { + if(Entry::compareValues(entry1_, entry2_, TQString::fromLatin1("isbn"), this) > 0 || + Entry::compareValues(entry1_, entry2_, TQString::fromLatin1("lccn"), this) > 0) { return 100; // good match } - int res = 3*Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("title"), this); + int res = 3*Entry::compareValues(entry1_, entry2_, TQString::fromLatin1("title"), this); // if(res == 0) { // myDebug() << "BookCollection::sameEntry() - different titles for " << entry1_->title() << " vs. " // << entry2_->title() << endl; // } - res += 2*Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("author"), this); - res += Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("cr_year"), this); - res += Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("pub_year"), this); - res += Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("binding"), this); + res += 2*Entry::compareValues(entry1_, entry2_, TQString::fromLatin1("author"), this); + res += Entry::compareValues(entry1_, entry2_, TQString::fromLatin1("cr_year"), this); + res += Entry::compareValues(entry1_, entry2_, TQString::fromLatin1("pub_year"), this); + res += Entry::compareValues(entry1_, entry2_, TQString::fromLatin1("binding"), this); return res; } diff --git a/src/collections/cardcollection.cpp b/src/collections/cardcollection.cpp index 815f5f9..f0f045d 100644 --- a/src/collections/cardcollection.cpp +++ b/src/collections/cardcollection.cpp @@ -27,92 +27,92 @@ CardCollection::CardCollection(bool addFields_, const TQString& title_ /*=null*/ if(addFields_) { addFields(defaultFields()); } - setDefaultGroupField(TQString::tqfromLatin1("series")); + setDefaultGroupField(TQString::fromLatin1("series")); } Tellico::Data::FieldVec CardCollection::defaultFields() { FieldVec list; FieldPtr field; - field = new Field(TQString::tqfromLatin1("title"), i18n("Title"), Field::Dependent); + field = new Field(TQString::fromLatin1("title"), i18n("Title"), Field::Dependent); field->setCategory(i18n(card_general)); - field->setDescription(TQString::tqfromLatin1("%{year} %{brand} %{player}")); + field->setDescription(TQString::fromLatin1("%{year} %{brand} %{player}")); field->setFlags(Field::NoDelete); list.append(field); - field = new Field(TQString::tqfromLatin1("player"), i18n("Player")); + field = new Field(TQString::fromLatin1("player"), i18n("Player")); field->setCategory(i18n(card_general)); field->setFlags(Field::AllowCompletion | Field::AllowGrouped); field->setFormatFlag(Field::FormatName); list.append(field); - field = new Field(TQString::tqfromLatin1("team"), i18n("Team")); + field = new Field(TQString::fromLatin1("team"), i18n("Team")); field->setCategory(i18n(card_general)); field->setFlags(Field::AllowCompletion | Field::AllowGrouped); field->setFormatFlag(Field::FormatTitle); list.append(field); - field = new Field(TQString::tqfromLatin1("brand"), i18n("Brand")); + field = new Field(TQString::fromLatin1("brand"), i18n("Brand")); field->setCategory(i18n(card_general)); field->setFlags(Field::AllowCompletion | Field::AllowGrouped); field->setFormatFlag(Field::FormatPlain); list.append(field); // might not be totally numeric! - field = new Field(TQString::tqfromLatin1("number"), i18n("Card Number")); + field = new Field(TQString::fromLatin1("number"), i18n("Card Number")); field->setCategory(i18n(card_general)); list.append(field); - field = new Field(TQString::tqfromLatin1("year"), i18n("Year"), Field::Number); + field = new Field(TQString::fromLatin1("year"), i18n("Year"), Field::Number); field->setCategory(i18n(card_general)); field->setFlags(Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("series"), i18n("Series")); + field = new Field(TQString::fromLatin1("series"), i18n("Series")); field->setCategory(i18n(card_general)); field->setFlags(Field::AllowCompletion | Field::AllowGrouped); field->setFormatFlag(Field::FormatTitle); list.append(field); - field = new Field(TQString::tqfromLatin1("type"), i18n("Card Type")); + field = new Field(TQString::fromLatin1("type"), i18n("Card Type")); field->setCategory(i18n(card_general)); field->setFlags(Field::AllowCompletion | Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("pur_date"), i18n("Purchase Date")); + field = new Field(TQString::fromLatin1("pur_date"), i18n("Purchase Date")); field->setCategory(i18n(card_personal)); field->setFormatFlag(Field::FormatDate); list.append(field); - field = new Field(TQString::tqfromLatin1("pur_price"), i18n("Purchase Price")); + field = new Field(TQString::fromLatin1("pur_price"), i18n("Purchase Price")); field->setCategory(i18n(card_personal)); list.append(field); - field = new Field(TQString::tqfromLatin1("location"), i18n("Location")); + field = new Field(TQString::fromLatin1("location"), i18n("Location")); field->setCategory(i18n(card_personal)); field->setFlags(Field::AllowCompletion | Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("gift"), i18n("Gift"), Field::Bool); + field = new Field(TQString::fromLatin1("gift"), i18n("Gift"), Field::Bool); field->setCategory(i18n(card_personal)); list.append(field); - field = new Field(TQString::tqfromLatin1("keyword"), i18n("Keywords")); + field = new Field(TQString::fromLatin1("keyword"), i18n("Keywords")); field->setCategory(i18n(card_personal)); field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("quantity"), i18n("Quantity"), Field::Number); + field = new Field(TQString::fromLatin1("quantity"), i18n("Quantity"), Field::Number); field->setCategory(i18n(card_personal)); list.append(field); - field = new Field(TQString::tqfromLatin1("front"), i18n("Front Image"), Field::Image); + field = new Field(TQString::fromLatin1("front"), i18n("Front Image"), Field::Image); list.append(field); - field = new Field(TQString::tqfromLatin1("back"), i18n("Back Image"), Field::Image); + field = new Field(TQString::fromLatin1("back"), i18n("Back Image"), Field::Image); list.append(field); - field = new Field(TQString::tqfromLatin1("comments"), i18n("Comments"), Field::Para); + field = new Field(TQString::fromLatin1("comments"), i18n("Comments"), Field::Para); list.append(field); return list; diff --git a/src/collections/coincollection.cpp b/src/collections/coincollection.cpp index d3a7e01..19499db 100644 --- a/src/collections/coincollection.cpp +++ b/src/collections/coincollection.cpp @@ -27,54 +27,54 @@ CoinCollection::CoinCollection(bool addFields_, const TQString& title_ /*=null*/ if(addFields_) { addFields(defaultFields()); } - setDefaultGroupField(TQString::tqfromLatin1("denomination")); + setDefaultGroupField(TQString::fromLatin1("denomination")); } Tellico::Data::FieldVec CoinCollection::defaultFields() { FieldVec list; FieldPtr field; - field = new Field(TQString::tqfromLatin1("title"), i18n("Title"), Field::Dependent); + field = new Field(TQString::fromLatin1("title"), i18n("Title"), Field::Dependent); field->setCategory(i18n(coin_general)); // not i18n() - field->setDescription(TQString::tqfromLatin1("%{year}%{mintmark} %{type} %{denomination}")); + field->setDescription(TQString::fromLatin1("%{year}%{mintmark} %{type} %{denomination}")); field->setFlags(Field::NoDelete); list.append(field); - field = new Field(TQString::tqfromLatin1("type"), i18n("Type")); + field = new Field(TQString::fromLatin1("type"), i18n("Type")); field->setCategory(i18n(coin_general)); field->setFlags(Field::AllowCompletion | Field::AllowGrouped); field->setFormatFlag(Field::FormatTitle); list.append(field); /* TRANSLATORS: denomination refers to the monetary value. */ - field = new Field(TQString::tqfromLatin1("denomination"), i18n("Denomination")); + field = new Field(TQString::fromLatin1("denomination"), i18n("Denomination")); field->setCategory(i18n(coin_general)); field->setFlags(Field::AllowCompletion | Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("year"), i18n("Year"), Field::Number); + field = new Field(TQString::fromLatin1("year"), i18n("Year"), Field::Number); field->setCategory(i18n(coin_general)); field->setFlags(Field::AllowMultiple | Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("mintmark"), i18n("Mint Mark")); + field = new Field(TQString::fromLatin1("mintmark"), i18n("Mint Mark")); field->setCategory(i18n(coin_general)); field->setFlags(Field::AllowGrouped); field->setFormatFlag(Field::FormatPlain); list.append(field); - field = new Field(TQString::tqfromLatin1("country"), i18n("Country")); + field = new Field(TQString::fromLatin1("country"), i18n("Country")); field->setCategory(i18n(coin_general)); field->setFlags(Field::AllowCompletion | Field::AllowGrouped); field->setFormatFlag(Field::FormatPlain); list.append(field); - field = new Field(TQString::tqfromLatin1("set"), i18n("Coin Set"), Field::Bool); + field = new Field(TQString::fromLatin1("set"), i18n("Coin Set"), Field::Bool); field->setCategory(i18n(coin_general)); list.append(field); - TQStringList grade = TQStringList::split(TQRegExp(TQString::tqfromLatin1("\\s*,\\s*")), + TQStringList grade = TQStringList::split(TQRegExp(TQString::fromLatin1("\\s*,\\s*")), i18n("Coin grade levels - " "Proof-65,Proof-60,Mint State-65,Mint State-60," "Almost Uncirculated-55,Almost Uncirculated-50," @@ -85,47 +85,47 @@ Tellico::Data::FieldVec CoinCollection::defaultFields() { "Extremely Fine-40,Very Fine-30,Very Fine-20,Fine-12," "Very Good-8,Good-4,Fair"), false); - field = new Field(TQString::tqfromLatin1("grade"), i18n("Grade"), grade); + field = new Field(TQString::fromLatin1("grade"), i18n("Grade"), grade); field->setCategory(i18n(coin_general)); field->setFlags(Field::AllowGrouped); list.append(field); - TQStringList service = TQStringList::split(TQRegExp(TQString::tqfromLatin1("\\s*,\\s*")), + TQStringList service = TQStringList::split(TQRegExp(TQString::fromLatin1("\\s*,\\s*")), i18n("Coin grading services - " "PCGS,NGC,ANACS,ICG,ASA,PCI", "PCGS,NGC,ANACS,ICG,ASA,PCI"), false); - field = new Field(TQString::tqfromLatin1("service"), i18n("Grading Service"), service); + field = new Field(TQString::fromLatin1("service"), i18n("Grading Service"), service); field->setCategory(i18n(coin_general)); field->setFlags(Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("pur_date"), i18n("Purchase Date")); + field = new Field(TQString::fromLatin1("pur_date"), i18n("Purchase Date")); field->setCategory(i18n(coin_personal)); field->setFormatFlag(Field::FormatDate); list.append(field); - field = new Field(TQString::tqfromLatin1("pur_price"), i18n("Purchase Price")); + field = new Field(TQString::fromLatin1("pur_price"), i18n("Purchase Price")); field->setCategory(i18n(coin_personal)); list.append(field); - field = new Field(TQString::tqfromLatin1("location"), i18n("Location")); + field = new Field(TQString::fromLatin1("location"), i18n("Location")); field->setCategory(i18n(coin_personal)); field->setFlags(Field::AllowCompletion | Field::AllowGrouped); field->setFormatFlag(Field::FormatPlain); list.append(field); - field = new Field(TQString::tqfromLatin1("gift"), i18n("Gift"), Field::Bool); + field = new Field(TQString::fromLatin1("gift"), i18n("Gift"), Field::Bool); field->setCategory(i18n(coin_personal)); list.append(field); - field = new Field(TQString::tqfromLatin1("obverse"), i18n("Obverse"), Field::Image); + field = new Field(TQString::fromLatin1("obverse"), i18n("Obverse"), Field::Image); list.append(field); - field = new Field(TQString::tqfromLatin1("reverse"), i18n("Reverse"), Field::Image); + field = new Field(TQString::fromLatin1("reverse"), i18n("Reverse"), Field::Image); list.append(field); - field = new Field(TQString::tqfromLatin1("comments"), i18n("Comments"), Field::Para); + field = new Field(TQString::fromLatin1("comments"), i18n("Comments"), Field::Para); field->setCategory(i18n(coin_personal)); list.append(field); diff --git a/src/collections/comicbookcollection.cpp b/src/collections/comicbookcollection.cpp index 36e31a4..e7b7a61 100644 --- a/src/collections/comicbookcollection.cpp +++ b/src/collections/comicbookcollection.cpp @@ -29,125 +29,125 @@ ComicBookCollection::ComicBookCollection(bool addFields_, const TQString& title_ if(addFields_) { addFields(defaultFields()); } - setDefaultGroupField(TQString::tqfromLatin1("series")); + setDefaultGroupField(TQString::fromLatin1("series")); } Tellico::Data::FieldVec ComicBookCollection::defaultFields() { FieldVec list; FieldPtr field; - field = new Field(TQString::tqfromLatin1("title"), i18n("Title")); + field = new Field(TQString::fromLatin1("title"), i18n("Title")); field->setCategory(i18n(comic_general)); field->setFlags(Field::NoDelete); field->setFormatFlag(Field::FormatTitle); list.append(field); - field = new Field(TQString::tqfromLatin1("subtitle"), i18n("Subtitle")); + field = new Field(TQString::fromLatin1("subtitle"), i18n("Subtitle")); field->setCategory(i18n(comic_general)); field->setFormatFlag(Field::FormatTitle); list.append(field); - field = new Field(TQString::tqfromLatin1("writer"), i18n("Writer")); + field = new Field(TQString::fromLatin1("writer"), i18n("Writer")); field->setCategory(i18n(comic_general)); field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped); field->setFormatFlag(Field::FormatName); list.append(field); - field = new Field(TQString::tqfromLatin1("artist"), i18n("Comic Book Illustrator", "Artist")); + field = new Field(TQString::fromLatin1("artist"), i18n("Comic Book Illustrator", "Artist")); field->setCategory(i18n(comic_general)); field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped); field->setFormatFlag(Field::FormatName); list.append(field); - field = new Field(TQString::tqfromLatin1("series"), i18n("Series")); + field = new Field(TQString::fromLatin1("series"), i18n("Series")); field->setCategory(i18n(comic_general)); field->setFlags(Field::AllowCompletion | Field::AllowGrouped); field->setFormatFlag(Field::FormatTitle); list.append(field); - field = new Field(TQString::tqfromLatin1("issue"), i18n("Issue"), Field::Number); + field = new Field(TQString::fromLatin1("issue"), i18n("Issue"), Field::Number); field->setCategory(i18n(comic_general)); field->setFlags(Field::AllowMultiple); list.append(field); - field = new Field(TQString::tqfromLatin1("publisher"), i18n("Publisher")); + field = new Field(TQString::fromLatin1("publisher"), i18n("Publisher")); field->setCategory(i18n(comic_publishing)); field->setFlags(Field::AllowCompletion | Field::AllowGrouped); field->setFormatFlag(Field::FormatPlain); list.append(field); - field = new Field(TQString::tqfromLatin1("edition"), i18n("Edition")); + field = new Field(TQString::fromLatin1("edition"), i18n("Edition")); field->setCategory(i18n(comic_publishing)); field->setFlags(Field::AllowCompletion); field->setFormatFlag(Field::FormatPlain); list.append(field); - field = new Field(TQString::tqfromLatin1("pub_year"), i18n("Publication Year"), Field::Number); + field = new Field(TQString::fromLatin1("pub_year"), i18n("Publication Year"), Field::Number); field->setCategory(i18n(comic_publishing)); field->setFlags(Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("pages"), i18n("Pages"), Field::Number); + field = new Field(TQString::fromLatin1("pages"), i18n("Pages"), Field::Number); field->setCategory(i18n(comic_publishing)); list.append(field); - field = new Field(TQString::tqfromLatin1("country"), i18n("Country")); + field = new Field(TQString::fromLatin1("country"), i18n("Country")); field->setCategory(i18n(comic_publishing)); field->setFlags(Field::AllowCompletion | Field::AllowGrouped | Field::AllowMultiple); field->setFormatFlag(Field::FormatPlain); list.append(field); - field = new Field(TQString::tqfromLatin1("language"), i18n("Language")); + field = new Field(TQString::fromLatin1("language"), i18n("Language")); field->setCategory(i18n(comic_publishing)); field->setFlags(Field::AllowCompletion | Field::AllowGrouped | Field::AllowMultiple); field->setFormatFlag(Field::FormatPlain); list.append(field); - field = new Field(TQString::tqfromLatin1("genre"), i18n("Genre")); + field = new Field(TQString::fromLatin1("genre"), i18n("Genre")); field->setCategory(i18n(comic_classification)); field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped); field->setFormatFlag(Field::FormatPlain); list.append(field); - field = new Field(TQString::tqfromLatin1("keyword"), i18n("Keywords")); + field = new Field(TQString::fromLatin1("keyword"), i18n("Keywords")); field->setCategory(i18n(comic_classification)); field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped); list.append(field); - TQStringList cond = TQStringList::split(TQRegExp(TQString::tqfromLatin1("\\s*,\\s*")), + TQStringList cond = TQStringList::split(TQRegExp(TQString::fromLatin1("\\s*,\\s*")), i18n("Comic book grade levels - " "Mint,Near Mint,Very Fine,Fine,Very Good,Good,Fair,Poor", "Mint,Near Mint,Very Fine,Fine,Very Good,Good,Fair,Poor"), false); - field = new Field(TQString::tqfromLatin1("condition"), i18n("Condition"), cond); + field = new Field(TQString::fromLatin1("condition"), i18n("Condition"), cond); field->setCategory(i18n(comic_classification)); list.append(field); - field = new Field(TQString::tqfromLatin1("pur_date"), i18n("Purchase Date")); + field = new Field(TQString::fromLatin1("pur_date"), i18n("Purchase Date")); field->setCategory(i18n(comic_personal)); field->setFormatFlag(Field::FormatDate); list.append(field); - field = new Field(TQString::tqfromLatin1("pur_price"), i18n("Purchase Price")); + field = new Field(TQString::fromLatin1("pur_price"), i18n("Purchase Price")); field->setCategory(i18n(comic_personal)); list.append(field); - field = new Field(TQString::tqfromLatin1("signed"), i18n("Signed"), Field::Bool); + field = new Field(TQString::fromLatin1("signed"), i18n("Signed"), Field::Bool); field->setCategory(i18n(comic_personal)); list.append(field); - field = new Field(TQString::tqfromLatin1("gift"), i18n("Gift"), Field::Bool); + field = new Field(TQString::fromLatin1("gift"), i18n("Gift"), Field::Bool); field->setCategory(i18n(comic_personal)); list.append(field); - field = new Field(TQString::tqfromLatin1("loaned"), i18n("Loaned"), Field::Bool); + field = new Field(TQString::fromLatin1("loaned"), i18n("Loaned"), Field::Bool); field->setCategory(i18n(comic_personal)); list.append(field); - field = new Field(TQString::tqfromLatin1("cover"), i18n("Front Cover"), Field::Image); + field = new Field(TQString::fromLatin1("cover"), i18n("Front Cover"), Field::Image); list.append(field); - field = new Field(TQString::tqfromLatin1("comments"), i18n("Comments"), Field::Para); + field = new Field(TQString::fromLatin1("comments"), i18n("Comments"), Field::Para); field->setCategory(i18n(comic_personal)); list.append(field); diff --git a/src/collections/filecatalog.cpp b/src/collections/filecatalog.cpp index cf67e2d..fcb0a02 100644 --- a/src/collections/filecatalog.cpp +++ b/src/collections/filecatalog.cpp @@ -26,77 +26,77 @@ FileCatalog::FileCatalog(bool addFields_, const TQString& title_ /*=null*/) if(addFields_) { addFields(defaultFields()); } - setDefaultGroupField(TQString::tqfromLatin1("volume")); + setDefaultGroupField(TQString::fromLatin1("volume")); } Tellico::Data::FieldVec FileCatalog::defaultFields() { FieldVec list; FieldPtr field; - field = new Field(TQString::tqfromLatin1("title"), i18n("Name")); + field = new Field(TQString::fromLatin1("title"), i18n("Name")); field->setCategory(i18n(file_general)); field->setFlags(Field::NoDelete); list.append(field); - field = new Field(TQString::tqfromLatin1("url"), i18n("URL"), Field::URL); + field = new Field(TQString::fromLatin1("url"), i18n("URL"), Field::URL); field->setCategory(i18n(file_general)); list.append(field); - field = new Field(TQString::tqfromLatin1("description"), i18n("Description")); + field = new Field(TQString::fromLatin1("description"), i18n("Description")); field->setCategory(i18n(file_general)); field->setFlags(Field::AllowCompletion | Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("volume"), i18n("Volume")); + field = new Field(TQString::fromLatin1("volume"), i18n("Volume")); field->setCategory(i18n(file_general)); field->setFlags(Field::AllowCompletion | Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("folder"), i18n("Folder")); + field = new Field(TQString::fromLatin1("folder"), i18n("Folder")); field->setCategory(i18n(file_general)); field->setFlags(Field::AllowCompletion | Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("mimetype"), i18n("Mimetype")); + field = new Field(TQString::fromLatin1("mimetype"), i18n("Mimetype")); field->setCategory(i18n(file_general)); field->setFlags(Field::AllowCompletion | Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("size"), i18n("Size")); + field = new Field(TQString::fromLatin1("size"), i18n("Size")); field->setCategory(i18n(file_general)); list.append(field); - field = new Field(TQString::tqfromLatin1("permissions"), i18n("Permissions")); + field = new Field(TQString::fromLatin1("permissions"), i18n("Permissions")); field->setCategory(i18n(file_general)); field->setFlags(Field::AllowCompletion | Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("owner"), i18n("Owner")); + field = new Field(TQString::fromLatin1("owner"), i18n("Owner")); field->setCategory(i18n(file_general)); field->setFlags(Field::AllowCompletion | Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("group"), i18n("Group")); + field = new Field(TQString::fromLatin1("group"), i18n("Group")); field->setCategory(i18n(file_general)); field->setFlags(Field::AllowCompletion | Field::AllowGrouped); list.append(field); // these dates are string fields, not dates, since the time is included - field = new Field(TQString::tqfromLatin1("created"), i18n("Created")); + field = new Field(TQString::fromLatin1("created"), i18n("Created")); field->setCategory(i18n(file_general)); list.append(field); - field = new Field(TQString::tqfromLatin1("modified"), i18n("Modified")); + field = new Field(TQString::fromLatin1("modified"), i18n("Modified")); field->setCategory(i18n(file_general)); list.append(field); - field = new Field(TQString::tqfromLatin1("metainfo"), i18n("Meta Info"), Field::Table); - field->setProperty(TQString::tqfromLatin1("columns"), TQChar('2')); - field->setProperty(TQString::tqfromLatin1("column1"), i18n("Property")); - field->setProperty(TQString::tqfromLatin1("column2"), i18n("Value")); + field = new Field(TQString::fromLatin1("metainfo"), i18n("Meta Info"), Field::Table); + field->setProperty(TQString::fromLatin1("columns"), TQChar('2')); + field->setProperty(TQString::fromLatin1("column1"), i18n("Property")); + field->setProperty(TQString::fromLatin1("column2"), i18n("Value")); list.append(field); - field = new Field(TQString::tqfromLatin1("icon"), i18n("Icon"), Field::Image); + field = new Field(TQString::fromLatin1("icon"), i18n("Icon"), Field::Image); list.append(field); return list; diff --git a/src/collections/gamecollection.cpp b/src/collections/gamecollection.cpp index d218247..4e9cf28 100644 --- a/src/collections/gamecollection.cpp +++ b/src/collections/gamecollection.cpp @@ -27,14 +27,14 @@ GameCollection::GameCollection(bool addFields_, const TQString& title_ /*=null*/ if(addFields_) { addFields(defaultFields()); } - setDefaultGroupField(TQString::tqfromLatin1("platform")); + setDefaultGroupField(TQString::fromLatin1("platform")); } Tellico::Data::FieldVec GameCollection::defaultFields() { FieldVec list; FieldPtr field; - field = new Field(TQString::tqfromLatin1("title"), i18n("Title")); + field = new Field(TQString::fromLatin1("title"), i18n("Title")); field->setCategory(i18n(game_general)); field->setFlags(Field::NoDelete); field->setFormatFlag(Field::FormatTitle); @@ -46,77 +46,77 @@ Tellico::Data::FieldVec GameCollection::defaultFields() { << i18n("Nintendo Wii") << i18n("Nintendo DS") << i18n("GameCube") << i18n("Dreamcast") << i18n("Game Boy Advance") << i18n("Game Boy Color") << i18n("Game Boy") << i18n("Windows Platform", "Windows") << i18n("Mac OS") << i18n("Linux"); - field = new Field(TQString::tqfromLatin1("platform"), i18n("Platform"), platform); + field = new Field(TQString::fromLatin1("platform"), i18n("Platform"), platform); field->setCategory(i18n(game_general)); field->setFlags(Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("genre"), i18n("Genre")); + field = new Field(TQString::fromLatin1("genre"), i18n("Genre")); field->setCategory(i18n(game_general)); field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped); field->setFormatFlag(Field::FormatPlain); list.append(field); - field = new Field(TQString::tqfromLatin1("year"), i18n("Release Year"), Field::Number); + field = new Field(TQString::fromLatin1("year"), i18n("Release Year"), Field::Number); field->setCategory(i18n(game_general)); field->setFlags(Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("publisher"), i18n("Games - Publisher", "Publisher")); + field = new Field(TQString::fromLatin1("publisher"), i18n("Games - Publisher", "Publisher")); field->setCategory(i18n(game_general)); field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped); field->setFormatFlag(Field::FormatPlain); list.append(field); - field = new Field(TQString::tqfromLatin1("developer"), i18n("Developer")); + field = new Field(TQString::fromLatin1("developer"), i18n("Developer")); field->setCategory(i18n(game_general)); field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped); field->setFormatFlag(Field::FormatPlain); list.append(field); - TQStringList cert = TQStringList::split(TQRegExp(TQString::tqfromLatin1("\\s*,\\s*")), + TQStringList cert = TQStringList::split(TQRegExp(TQString::fromLatin1("\\s*,\\s*")), i18n("Video game ratings - " "Unrated, Adults Only, Mature, Teen, Everyone, Early Childhood, Pending", "Unrated, Adults Only, Mature, Teen, Everyone, Early Childhood, Pending"), false); - field = new Field(TQString::tqfromLatin1("certification"), i18n("ESRB Rating"), cert); + field = new Field(TQString::fromLatin1("certification"), i18n("ESRB Rating"), cert); field->setCategory(i18n(game_general)); field->setFlags(Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("description"), i18n("Description"), Field::Para); + field = new Field(TQString::fromLatin1("description"), i18n("Description"), Field::Para); list.append(field); - field = new Field(TQString::tqfromLatin1("rating"), i18n("Personal Rating"), Field::Rating); + field = new Field(TQString::fromLatin1("rating"), i18n("Personal Rating"), Field::Rating); field->setCategory(i18n(game_personal)); field->setFlags(Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("completed"), i18n("Completed"), Field::Bool); + field = new Field(TQString::fromLatin1("completed"), i18n("Completed"), Field::Bool); field->setCategory(i18n(game_personal)); list.append(field); - field = new Field(TQString::tqfromLatin1("pur_date"), i18n("Purchase Date")); + field = new Field(TQString::fromLatin1("pur_date"), i18n("Purchase Date")); field->setCategory(i18n(game_personal)); field->setFormatFlag(Field::FormatDate); list.append(field); - field = new Field(TQString::tqfromLatin1("gift"), i18n("Gift"), Field::Bool); + field = new Field(TQString::fromLatin1("gift"), i18n("Gift"), Field::Bool); field->setCategory(i18n(game_personal)); list.append(field); - field = new Field(TQString::tqfromLatin1("pur_price"), i18n("Purchase Price")); + field = new Field(TQString::fromLatin1("pur_price"), i18n("Purchase Price")); field->setCategory(i18n(game_personal)); list.append(field); - field = new Field(TQString::tqfromLatin1("loaned"), i18n("Loaned"), Field::Bool); + field = new Field(TQString::fromLatin1("loaned"), i18n("Loaned"), Field::Bool); field->setCategory(i18n(game_personal)); list.append(field); - field = new Field(TQString::tqfromLatin1("cover"), i18n("Cover"), Field::Image); + field = new Field(TQString::fromLatin1("cover"), i18n("Cover"), Field::Image); list.append(field); - field = new Field(TQString::tqfromLatin1("comments"), i18n("Comments"), Field::Para); + field = new Field(TQString::fromLatin1("comments"), i18n("Comments"), Field::Para); field->setCategory(i18n(game_personal)); list.append(field); diff --git a/src/collections/musiccollection.cpp b/src/collections/musiccollection.cpp index fde5a04..8d992b8 100644 --- a/src/collections/musiccollection.cpp +++ b/src/collections/musiccollection.cpp @@ -27,14 +27,14 @@ MusicCollection::MusicCollection(bool addFields_, const TQString& title_ /*=null if(addFields_) { addFields(defaultFields()); } - setDefaultGroupField(TQString::tqfromLatin1("artist")); + setDefaultGroupField(TQString::fromLatin1("artist")); } Tellico::Data::FieldVec MusicCollection::defaultFields() { FieldVec list; FieldPtr field; - field = new Field(TQString::tqfromLatin1("title"), i18n("Album")); + field = new Field(TQString::fromLatin1("title"), i18n("Album")); field->setCategory(i18n(music_general)); field->setFlags(Field::NoDelete | Field::AllowCompletion); field->setFormatFlag(Field::FormatTitle); @@ -42,73 +42,73 @@ Tellico::Data::FieldVec MusicCollection::defaultFields() { TQStringList media; media << i18n("Compact Disc") << i18n("DVD") << i18n("Cassette") << i18n("Vinyl"); - field = new Field(TQString::tqfromLatin1("medium"), i18n("Medium"), media); + field = new Field(TQString::fromLatin1("medium"), i18n("Medium"), media); field->setCategory(i18n(music_general)); field->setFlags(Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("artist"), i18n("Artist")); + field = new Field(TQString::fromLatin1("artist"), i18n("Artist")); field->setCategory(i18n(music_general)); field->setFlags(Field::AllowCompletion | Field::AllowGrouped | Field::AllowMultiple); field->setFormatFlag(Field::FormatTitle); // don't use FormatName list.append(field); - field = new Field(TQString::tqfromLatin1("label"), i18n("Label")); + field = new Field(TQString::fromLatin1("label"), i18n("Label")); field->setCategory(i18n(music_general)); field->setFlags(Field::AllowCompletion | Field::AllowGrouped | Field::AllowMultiple); field->setFormatFlag(Field::FormatPlain); list.append(field); - field = new Field(TQString::tqfromLatin1("year"), i18n("Year"), Field::Number); + field = new Field(TQString::fromLatin1("year"), i18n("Year"), Field::Number); field->setCategory(i18n(music_general)); field->setFlags(Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("genre"), i18n("Genre")); + field = new Field(TQString::fromLatin1("genre"), i18n("Genre")); field->setCategory(i18n(music_general)); field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped); field->setFormatFlag(Field::FormatPlain); list.append(field); - field = new Field(TQString::tqfromLatin1("track"), i18n("Tracks"), Field::Table); + field = new Field(TQString::fromLatin1("track"), i18n("Tracks"), Field::Table); field->setFormatFlag(Field::FormatTitle); - field->setProperty(TQString::tqfromLatin1("columns"), TQChar('3')); - field->setProperty(TQString::tqfromLatin1("column1"), i18n("Title")); - field->setProperty(TQString::tqfromLatin1("column2"), i18n("Artist")); - field->setProperty(TQString::tqfromLatin1("column3"), i18n("Length")); + field->setProperty(TQString::fromLatin1("columns"), TQChar('3')); + field->setProperty(TQString::fromLatin1("column1"), i18n("Title")); + field->setProperty(TQString::fromLatin1("column2"), i18n("Artist")); + field->setProperty(TQString::fromLatin1("column3"), i18n("Length")); list.append(field); - field = new Field(TQString::tqfromLatin1("rating"), i18n("Rating"), Field::Rating); + field = new Field(TQString::fromLatin1("rating"), i18n("Rating"), Field::Rating); field->setCategory(i18n(music_personal)); field->setFlags(Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("pur_date"), i18n("Purchase Date")); + field = new Field(TQString::fromLatin1("pur_date"), i18n("Purchase Date")); field->setCategory(i18n(music_personal)); field->setFormatFlag(Field::FormatDate); list.append(field); - field = new Field(TQString::tqfromLatin1("gift"), i18n("Gift"), Field::Bool); + field = new Field(TQString::fromLatin1("gift"), i18n("Gift"), Field::Bool); field->setCategory(i18n(music_personal)); list.append(field); - field = new Field(TQString::tqfromLatin1("pur_price"), i18n("Purchase Price")); + field = new Field(TQString::fromLatin1("pur_price"), i18n("Purchase Price")); field->setCategory(i18n(music_personal)); list.append(field); - field = new Field(TQString::tqfromLatin1("loaned"), i18n("Loaned"), Field::Bool); + field = new Field(TQString::fromLatin1("loaned"), i18n("Loaned"), Field::Bool); field->setCategory(i18n(music_personal)); list.append(field); - field = new Field(TQString::tqfromLatin1("keyword"), i18n("Keywords")); + field = new Field(TQString::fromLatin1("keyword"), i18n("Keywords")); field->setCategory(i18n(music_personal)); field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("cover"), i18n("Cover"), Field::Image); + field = new Field(TQString::fromLatin1("cover"), i18n("Cover"), Field::Image); list.append(field); - field = new Field(TQString::tqfromLatin1("comments"), i18n("Comments"), Field::Para); + field = new Field(TQString::fromLatin1("comments"), i18n("Comments"), Field::Para); field->setCategory(i18n(music_personal)); list.append(field); @@ -117,15 +117,15 @@ Tellico::Data::FieldVec MusicCollection::defaultFields() { int MusicCollection::sameEntry(Data::EntryPtr entry1_, Data::EntryPtr entry2_) const { // not enough for title to be equal, must also have another field - int res = 2*Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("title"), this); + int res = 2*Entry::compareValues(entry1_, entry2_, TQString::fromLatin1("title"), this); // if(res == 0) { // myDebug() << "MusicCollection::sameEntry() - different titles for " << entry1_->title() << " vs. " // << entry2_->title() << endl; // } - res += 2*Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("artist"), this); - res += Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("year"), this); - res += Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("label"), this); - res += Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("medium"), this); + res += 2*Entry::compareValues(entry1_, entry2_, TQString::fromLatin1("artist"), this); + res += Entry::compareValues(entry1_, entry2_, TQString::fromLatin1("year"), this); + res += Entry::compareValues(entry1_, entry2_, TQString::fromLatin1("label"), this); + res += Entry::compareValues(entry1_, entry2_, TQString::fromLatin1("medium"), this); return res; } diff --git a/src/collections/stampcollection.cpp b/src/collections/stampcollection.cpp index f5b8e0c..c41f806 100644 --- a/src/collections/stampcollection.cpp +++ b/src/collections/stampcollection.cpp @@ -28,103 +28,103 @@ StampCollection::StampCollection(bool addFields_, const TQString& title_ /*=null if(addFields_) { addFields(defaultFields()); } - setDefaultGroupField(TQString::tqfromLatin1("denomination")); + setDefaultGroupField(TQString::fromLatin1("denomination")); } Tellico::Data::FieldVec StampCollection::defaultFields() { FieldVec list; FieldPtr field; - field = new Field(TQString::tqfromLatin1("title"), i18n("Title"), Field::Dependent); + field = new Field(TQString::fromLatin1("title"), i18n("Title"), Field::Dependent); field->setCategory(i18n(stamp_general)); - field->setDescription(TQString::tqfromLatin1("%{year} %{description} %{denomination}")); + field->setDescription(TQString::fromLatin1("%{year} %{description} %{denomination}")); field->setFlags(Field::NoDelete); list.append(field); - field = new Field(TQString::tqfromLatin1("description"), i18n("Description")); + field = new Field(TQString::fromLatin1("description"), i18n("Description")); field->setCategory(i18n(stamp_general)); field->setFlags(Field::AllowCompletion | Field::AllowGrouped); field->setFormatFlag(Field::FormatTitle); list.append(field); - field = new Field(TQString::tqfromLatin1("denomination"), i18n("Denomination")); + field = new Field(TQString::fromLatin1("denomination"), i18n("Denomination")); field->setCategory(i18n(stamp_general)); field->setFlags(Field::AllowCompletion | Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("country"), i18n("Country")); + field = new Field(TQString::fromLatin1("country"), i18n("Country")); field->setCategory(i18n(stamp_general)); field->setFormatFlag(Field::FormatPlain); field->setFlags(Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("year"), i18n("Issue Year"), Field::Number); + field = new Field(TQString::fromLatin1("year"), i18n("Issue Year"), Field::Number); field->setCategory(i18n(stamp_general)); field->setFlags(Field::AllowMultiple | Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("color"), i18n("Color")); + field = new Field(TQString::fromLatin1("color"), i18n("Color")); field->setCategory(i18n(stamp_general)); field->setFlags(Field::AllowCompletion | Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("scott"), i18n("Scott#")); + field = new Field(TQString::fromLatin1("scott"), i18n("Scott#")); field->setCategory(i18n(stamp_general)); list.append(field); - TQStringList grade = TQStringList::split(TQRegExp(TQString::tqfromLatin1("\\s*,\\s*")), + TQStringList grade = TQStringList::split(TQRegExp(TQString::fromLatin1("\\s*,\\s*")), i18n("Stamp grade levels - " "Superb,Extremely Fine,Very Fine,Fine,Average,Poor", "Superb,Extremely Fine,Very Fine,Fine,Average,Poor"), false); - field = new Field(TQString::tqfromLatin1("grade"), i18n("Grade"), grade); + field = new Field(TQString::fromLatin1("grade"), i18n("Grade"), grade); field->setCategory(i18n(stamp_condition)); field->setFlags(Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("cancelled"), i18n("Cancelled"), Field::Bool); + field = new Field(TQString::fromLatin1("cancelled"), i18n("Cancelled"), Field::Bool); field->setCategory(i18n(stamp_condition)); list.append(field); /* TRANSLATORS: See http://en.wikipedia.org/wiki/Stamp_hinge */ - field = new Field(TQString::tqfromLatin1("hinged"), i18n("Hinged")); + field = new Field(TQString::fromLatin1("hinged"), i18n("Hinged")); field->setCategory(i18n(stamp_condition)); field->setFlags(Field::AllowCompletion | Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("centering"), i18n("Centering")); + field = new Field(TQString::fromLatin1("centering"), i18n("Centering")); field->setCategory(i18n(stamp_condition)); field->setFlags(Field::AllowCompletion | Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("gummed"), i18n("Gummed")); + field = new Field(TQString::fromLatin1("gummed"), i18n("Gummed")); field->setCategory(i18n(stamp_condition)); field->setFlags(Field::AllowCompletion | Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("pur_date"), i18n("Purchase Date")); + field = new Field(TQString::fromLatin1("pur_date"), i18n("Purchase Date")); field->setCategory(i18n(stamp_personal)); field->setFormatFlag(Field::FormatDate); list.append(field); - field = new Field(TQString::tqfromLatin1("pur_price"), i18n("Purchase Price")); + field = new Field(TQString::fromLatin1("pur_price"), i18n("Purchase Price")); field->setCategory(i18n(stamp_personal)); list.append(field); - field = new Field(TQString::tqfromLatin1("location"), i18n("Location")); + field = new Field(TQString::fromLatin1("location"), i18n("Location")); field->setCategory(i18n(stamp_personal)); field->setFlags(Field::AllowCompletion | Field::AllowGrouped); field->setFormatFlag(Field::FormatPlain); list.append(field); - field = new Field(TQString::tqfromLatin1("gift"), i18n("Gift"), Field::Bool); + field = new Field(TQString::fromLatin1("gift"), i18n("Gift"), Field::Bool); field->setCategory(i18n(stamp_personal)); list.append(field); - field = new Field(TQString::tqfromLatin1("image"), i18n("Image"), Field::Image); + field = new Field(TQString::fromLatin1("image"), i18n("Image"), Field::Image); list.append(field); - field = new Field(TQString::tqfromLatin1("comments"), i18n("Comments"), Field::Para); + field = new Field(TQString::fromLatin1("comments"), i18n("Comments"), Field::Para); list.append(field); return list; diff --git a/src/collections/videocollection.cpp b/src/collections/videocollection.cpp index d8ac081..06f3a6a 100644 --- a/src/collections/videocollection.cpp +++ b/src/collections/videocollection.cpp @@ -29,14 +29,14 @@ VideoCollection::VideoCollection(bool addFields_, const TQString& title_ /*=null if(addFields_) { addFields(defaultFields()); } - setDefaultGroupField(TQString::tqfromLatin1("genre")); + setDefaultGroupField(TQString::fromLatin1("genre")); } Tellico::Data::FieldVec VideoCollection::defaultFields() { FieldVec list; FieldPtr field; - field = new Field(TQString::tqfromLatin1("title"), i18n("Title")); + field = new Field(TQString::fromLatin1("title"), i18n("Title")); field->setCategory(i18n("General")); field->setFlags(Field::NoDelete); field->setFormatFlag(Field::FormatTitle); @@ -44,27 +44,27 @@ Tellico::Data::FieldVec VideoCollection::defaultFields() { TQStringList media; media << i18n("DVD") << i18n("VHS") << i18n("VCD") << i18n("DivX") << i18n("Blu-ray") << i18n("HD DVD"); - field = new Field(TQString::tqfromLatin1("medium"), i18n("Medium"), media); + field = new Field(TQString::fromLatin1("medium"), i18n("Medium"), media); field->setCategory(i18n(video_general)); field->setFlags(Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("year"), i18n("Production Year"), Field::Number); + field = new Field(TQString::fromLatin1("year"), i18n("Production Year"), Field::Number); field->setCategory(i18n(video_general)); field->setFlags(Field::AllowGrouped); list.append(field); - TQStringList cert = TQStringList::split(TQRegExp(TQString::tqfromLatin1("\\s*,\\s*")), + TQStringList cert = TQStringList::split(TQRegExp(TQString::fromLatin1("\\s*,\\s*")), i18n("Movie ratings - " "G (USA),PG (USA),PG-13 (USA),R (USA), U (USA)", "G (USA),PG (USA),PG-13 (USA),R (USA), U (USA)"), false); - field = new Field(TQString::tqfromLatin1("certification"), i18n("Certification"), cert); + field = new Field(TQString::fromLatin1("certification"), i18n("Certification"), cert); field->setCategory(i18n(video_general)); field->setFlags(Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("genre"), i18n("Genre")); + field = new Field(TQString::fromLatin1("genre"), i18n("Genre")); field->setCategory(i18n(video_general)); field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped); field->setFormatFlag(Field::FormatPlain); @@ -79,12 +79,12 @@ Tellico::Data::FieldVec VideoCollection::defaultFields() { << i18n("Region 6") << i18n("Region 7") << i18n("Region 8"); - field = new Field(TQString::tqfromLatin1("region"), i18n("Region"), region); + field = new Field(TQString::fromLatin1("region"), i18n("Region"), region); field->setCategory(i18n(video_general)); field->setFlags(Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("nationality"), i18n("Nationality")); + field = new Field(TQString::fromLatin1("nationality"), i18n("Nationality")); field->setCategory(i18n(video_general)); field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped); field->setFormatFlag(Field::FormatPlain); @@ -92,127 +92,127 @@ Tellico::Data::FieldVec VideoCollection::defaultFields() { TQStringList format; format << i18n("NTSC") << i18n("PAL") << i18n("SECAM"); - field = new Field(TQString::tqfromLatin1("format"), i18n("Format"), format); + field = new Field(TQString::fromLatin1("format"), i18n("Format"), format); field->setCategory(i18n(video_general)); field->setFlags(Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("cast"), i18n("Cast"), Field::Table); - field->setProperty(TQString::tqfromLatin1("columns"), TQChar('2')); - field->setProperty(TQString::tqfromLatin1("column1"), i18n("Actor/Actress")); - field->setProperty(TQString::tqfromLatin1("column2"), i18n("Role")); + field = new Field(TQString::fromLatin1("cast"), i18n("Cast"), Field::Table); + field->setProperty(TQString::fromLatin1("columns"), TQChar('2')); + field->setProperty(TQString::fromLatin1("column1"), i18n("Actor/Actress")); + field->setProperty(TQString::fromLatin1("column2"), i18n("Role")); field->setFormatFlag(Field::FormatName); field->setFlags(Field::AllowGrouped); field->setDescription(i18n("A table for the cast members, along with the roles they play")); list.append(field); - field = new Field(TQString::tqfromLatin1("director"), i18n("Director")); + field = new Field(TQString::fromLatin1("director"), i18n("Director")); field->setCategory(i18n(video_people)); field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped); field->setFormatFlag(Field::FormatName); list.append(field); - field = new Field(TQString::tqfromLatin1("producer"), i18n("Producer")); + field = new Field(TQString::fromLatin1("producer"), i18n("Producer")); field->setCategory(i18n(video_people)); field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped); field->setFormatFlag(Field::FormatName); list.append(field); - field = new Field(TQString::tqfromLatin1("writer"), i18n("Writer")); + field = new Field(TQString::fromLatin1("writer"), i18n("Writer")); field->setCategory(i18n(video_people)); field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped); field->setFormatFlag(Field::FormatName); list.append(field); - field = new Field(TQString::tqfromLatin1("composer"), i18n("Composer")); + field = new Field(TQString::fromLatin1("composer"), i18n("Composer")); field->setCategory(i18n(video_people)); field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped); field->setFormatFlag(Field::FormatName); list.append(field); - field = new Field(TQString::tqfromLatin1("studio"), i18n("Studio")); + field = new Field(TQString::fromLatin1("studio"), i18n("Studio")); field->setCategory(i18n(video_people)); field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped); field->setFormatFlag(Field::FormatPlain); list.append(field); - field = new Field(TQString::tqfromLatin1("language"), i18n("Language Tracks")); + field = new Field(TQString::fromLatin1("language"), i18n("Language Tracks")); field->setCategory(i18n(video_features)); field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped); field->setFormatFlag(Field::FormatPlain); list.append(field); - field = new Field(TQString::tqfromLatin1("subtitle"), i18n("Subtitle Languages")); + field = new Field(TQString::fromLatin1("subtitle"), i18n("Subtitle Languages")); field->setCategory(i18n(video_features)); field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped); field->setFormatFlag(Field::FormatPlain); list.append(field); - field = new Field(TQString::tqfromLatin1("audio-track"), i18n("Audio Tracks")); + field = new Field(TQString::fromLatin1("audio-track"), i18n("Audio Tracks")); field->setCategory(i18n(video_features)); field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped); field->setFormatFlag(Field::FormatPlain); list.append(field); - field = new Field(TQString::tqfromLatin1("running-time"), i18n("Running Time"), Field::Number); + field = new Field(TQString::fromLatin1("running-time"), i18n("Running Time"), Field::Number); field->setCategory(i18n(video_features)); field->setDescription(i18n("The running time of the video (in minutes)")); list.append(field); - field = new Field(TQString::tqfromLatin1("aspect-ratio"), i18n("Aspect Ratio")); + field = new Field(TQString::fromLatin1("aspect-ratio"), i18n("Aspect Ratio")); field->setCategory(i18n(video_features)); field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("widescreen"), i18n("Widescreen"), Field::Bool); + field = new Field(TQString::fromLatin1("widescreen"), i18n("Widescreen"), Field::Bool); field->setCategory(i18n(video_features)); list.append(field); TQStringList color; color << i18n("Color") << i18n("Black & White"); - field = new Field(TQString::tqfromLatin1("color"), i18n("Color Mode"), color); + field = new Field(TQString::fromLatin1("color"), i18n("Color Mode"), color); field->setCategory(i18n(video_features)); field->setFlags(Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("directors-cut"), i18n("Director's Cut"), Field::Bool); + field = new Field(TQString::fromLatin1("directors-cut"), i18n("Director's Cut"), Field::Bool); field->setCategory(i18n(video_features)); list.append(field); - field = new Field(TQString::tqfromLatin1("plot"), i18n("Plot Summary"), Field::Para); + field = new Field(TQString::fromLatin1("plot"), i18n("Plot Summary"), Field::Para); list.append(field); - field = new Field(TQString::tqfromLatin1("rating"), i18n("Personal Rating"), Field::Rating); + field = new Field(TQString::fromLatin1("rating"), i18n("Personal Rating"), Field::Rating); field->setCategory(i18n(video_personal)); field->setFlags(Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("pur_date"), i18n("Purchase Date")); + field = new Field(TQString::fromLatin1("pur_date"), i18n("Purchase Date")); field->setCategory(i18n(video_personal)); field->setFormatFlag(Field::FormatDate); list.append(field); - field = new Field(TQString::tqfromLatin1("gift"), i18n("Gift"), Field::Bool); + field = new Field(TQString::fromLatin1("gift"), i18n("Gift"), Field::Bool); field->setCategory(i18n(video_personal)); list.append(field); - field = new Field(TQString::tqfromLatin1("pur_price"), i18n("Purchase Price")); + field = new Field(TQString::fromLatin1("pur_price"), i18n("Purchase Price")); field->setCategory(i18n(video_personal)); list.append(field); - field = new Field(TQString::tqfromLatin1("loaned"), i18n("Loaned"), Field::Bool); + field = new Field(TQString::fromLatin1("loaned"), i18n("Loaned"), Field::Bool); field->setCategory(i18n(video_personal)); list.append(field); - field = new Field(TQString::tqfromLatin1("keyword"), i18n("Keywords")); + field = new Field(TQString::fromLatin1("keyword"), i18n("Keywords")); field->setCategory(i18n(video_personal)); field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("cover"), i18n("Cover"), Field::Image); + field = new Field(TQString::fromLatin1("cover"), i18n("Cover"), Field::Image); list.append(field); - field = new Field(TQString::tqfromLatin1("comments"), i18n("Comments"), Field::Para); + field = new Field(TQString::fromLatin1("comments"), i18n("Comments"), Field::Para); list.append(field); return list; @@ -221,15 +221,15 @@ Tellico::Data::FieldVec VideoCollection::defaultFields() { int VideoCollection::sameEntry(Data::EntryPtr entry1_, Data::EntryPtr entry2_) const { // not enough for title to be equal, must also have another field // ever possible for a studio to do two movies with identical titles? - int res = 3*Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("title"), this); + int res = 3*Entry::compareValues(entry1_, entry2_, TQString::fromLatin1("title"), this); // if(res == 0) { // myDebug() << "VideoCollection::sameEntry() - different titles for " << entry1_->title() << " vs. " // << entry2_->title() << endl; // } - res += Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("year"), this); - res += Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("director"), this); - res += Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("studio"), this); - res += Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("medium"), this); + res += Entry::compareValues(entry1_, entry2_, TQString::fromLatin1("year"), this); + res += Entry::compareValues(entry1_, entry2_, TQString::fromLatin1("director"), this); + res += Entry::compareValues(entry1_, entry2_, TQString::fromLatin1("studio"), this); + res += Entry::compareValues(entry1_, entry2_, TQString::fromLatin1("medium"), this); return res; } diff --git a/src/collections/winecollection.cpp b/src/collections/winecollection.cpp index bab7617..433188f 100644 --- a/src/collections/winecollection.cpp +++ b/src/collections/winecollection.cpp @@ -27,91 +27,91 @@ WineCollection::WineCollection(bool addFields_, const TQString& title_ /*=null*/ if(addFields_) { addFields(defaultFields()); } - setDefaultGroupField(TQString::tqfromLatin1("type")); + setDefaultGroupField(TQString::fromLatin1("type")); } Tellico::Data::FieldVec WineCollection::defaultFields() { FieldVec list; FieldPtr field; - field = new Field(TQString::tqfromLatin1("title"), i18n("Title"), Field::Dependent); + field = new Field(TQString::fromLatin1("title"), i18n("Title"), Field::Dependent); field->setCategory(i18n(wine_general)); - field->setDescription(TQString::tqfromLatin1("%{vintage} %{producer} %{varietal}")); + field->setDescription(TQString::fromLatin1("%{vintage} %{producer} %{varietal}")); field->setFlags(Field::NoDelete); list.append(field); - field = new Field(TQString::tqfromLatin1("producer"), i18n("Producer")); + field = new Field(TQString::fromLatin1("producer"), i18n("Producer")); field->setCategory(i18n(wine_general)); field->setFlags(Field::AllowCompletion | Field::AllowGrouped); field->setFormatFlag(Field::FormatPlain); list.append(field); - field = new Field(TQString::tqfromLatin1("appellation"), i18n("Appellation")); + field = new Field(TQString::fromLatin1("appellation"), i18n("Appellation")); field->setCategory(i18n(wine_general)); field->setFlags(Field::AllowCompletion | Field::AllowGrouped); field->setFormatFlag(Field::FormatPlain); list.append(field); - field = new Field(TQString::tqfromLatin1("varietal"), i18n("Varietal")); + field = new Field(TQString::fromLatin1("varietal"), i18n("Varietal")); field->setCategory(i18n(wine_general)); field->setFlags(Field::AllowCompletion | Field::AllowGrouped); field->setFormatFlag(Field::FormatPlain); list.append(field); - field = new Field(TQString::tqfromLatin1("vintage"), i18n("Vintage"), Field::Number); + field = new Field(TQString::fromLatin1("vintage"), i18n("Vintage"), Field::Number); field->setCategory(i18n(wine_general)); field->setFlags(Field::AllowGrouped); list.append(field); TQStringList type; type << i18n("Red Wine") << i18n("White Wine") << i18n("Sparkling Wine"); - field = new Field(TQString::tqfromLatin1("type"), i18n("Type"), type); + field = new Field(TQString::fromLatin1("type"), i18n("Type"), type); field->setCategory(i18n(wine_general)); field->setFlags(Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("country"), i18n("Country")); + field = new Field(TQString::fromLatin1("country"), i18n("Country")); field->setCategory(i18n(wine_general)); field->setFlags(Field::AllowCompletion | Field::AllowGrouped); field->setFormatFlag(Field::FormatPlain); list.append(field); - field = new Field(TQString::tqfromLatin1("pur_date"), i18n("Purchase Date")); + field = new Field(TQString::fromLatin1("pur_date"), i18n("Purchase Date")); field->setCategory(i18n(wine_personal)); field->setFormatFlag(Field::FormatDate); list.append(field); - field = new Field(TQString::tqfromLatin1("pur_price"), i18n("Purchase Price")); + field = new Field(TQString::fromLatin1("pur_price"), i18n("Purchase Price")); field->setCategory(i18n(wine_personal)); list.append(field); - field = new Field(TQString::tqfromLatin1("location"), i18n("Location")); + field = new Field(TQString::fromLatin1("location"), i18n("Location")); field->setCategory(i18n(wine_personal)); field->setFlags(Field::AllowCompletion | Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("quantity"), i18n("Quantity"), Field::Number); + field = new Field(TQString::fromLatin1("quantity"), i18n("Quantity"), Field::Number); field->setCategory(i18n(wine_personal)); list.append(field); - field = new Field(TQString::tqfromLatin1("drink-by"), i18n("Drink By"), Field::Number); + field = new Field(TQString::fromLatin1("drink-by"), i18n("Drink By"), Field::Number); field->setCategory(i18n(wine_personal)); field->setFlags(Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("rating"), i18n("Rating"), Field::Rating); + field = new Field(TQString::fromLatin1("rating"), i18n("Rating"), Field::Rating); field->setCategory(i18n(wine_personal)); field->setFlags(Field::AllowGrouped); list.append(field); - field = new Field(TQString::tqfromLatin1("gift"), i18n("Gift"), Field::Bool); + field = new Field(TQString::fromLatin1("gift"), i18n("Gift"), Field::Bool); field->setCategory(i18n(wine_personal)); list.append(field); - field = new Field(TQString::tqfromLatin1("label"), i18n("Label Image"), Field::Image); + field = new Field(TQString::fromLatin1("label"), i18n("Label Image"), Field::Image); list.append(field); - field = new Field(TQString::tqfromLatin1("comments"), i18n("Comments"), Field::Para); + field = new Field(TQString::fromLatin1("comments"), i18n("Comments"), Field::Para); list.append(field); return list; diff --git a/src/commands/addentries.cpp b/src/commands/addentries.cpp index 9460ebd..87d7bc7 100644 --- a/src/commands/addentries.cpp +++ b/src/commands/addentries.cpp @@ -60,5 +60,5 @@ void AddEntries::unexecute() { TQString AddEntries::name() const { return m_entries.count() > 1 ? i18n("Add Entries") - : i18n("Add (Entry Title)", "Add %1").tqarg(m_entries.begin()->title()); + : i18n("Add (Entry Title)", "Add %1").arg(m_entries.begin()->title()); } diff --git a/src/commands/addloans.cpp b/src/commands/addloans.cpp index 8b9bc27..bbef197 100644 --- a/src/commands/addloans.cpp +++ b/src/commands/addloans.cpp @@ -41,7 +41,7 @@ void AddLoans::execute() { bool wasEmpty = m_borrower->isEmpty(); // if there's no loaned field, we'll add one - bool loanExisted = m_loans.begin()->entry()->collection()->hasField(TQString::tqfromLatin1("loaned")); + bool loanExisted = m_loans.begin()->entry()->collection()->hasField(TQString::fromLatin1("loaned")); m_addedLoanField = false; // assume we didn't add the field yet // add the loans to the borrower @@ -54,7 +54,7 @@ void AddLoans::execute() { } if(!loanExisted) { Data::CollPtr c = m_loans.begin()->entry()->collection(); - Data::FieldPtr f = c->fieldByName(TQString::tqfromLatin1("loaned")); + Data::FieldPtr f = c->fieldByName(TQString::fromLatin1("loaned")); if(f) { // notify everything that a new field was added Controller::self()->addedField(c, f); @@ -89,7 +89,7 @@ void AddLoans::unexecute() { } if(m_addedLoanField) { Data::CollPtr c = m_loans.begin()->entry()->collection(); - Data::FieldPtr f = c->fieldByName(TQString::tqfromLatin1("loaned")); + Data::FieldPtr f = c->fieldByName(TQString::fromLatin1("loaned")); if(f) { c->removeField(f); Controller::self()->removedField(c, f); @@ -106,5 +106,5 @@ void AddLoans::unexecute() { TQString AddLoans::name() const { return m_loans.count() > 1 ? i18n("Check-out Items") - : i18n("Check-out (Entry Title)", "Check-out %1").tqarg(m_loans.begin()->entry()->title()); + : i18n("Check-out (Entry Title)", "Check-out %1").arg(m_loans.begin()->entry()->title()); } diff --git a/src/commands/fieldcommand.cpp b/src/commands/fieldcommand.cpp index 5ba080b..43c063a 100644 --- a/src/commands/fieldcommand.cpp +++ b/src/commands/fieldcommand.cpp @@ -101,11 +101,11 @@ void FieldCommand::unexecute() { TQString FieldCommand::name() const { switch(m_mode) { case FieldAdd: - return i18n("Add %1 Field").tqarg(m_activeField->title()); + return i18n("Add %1 Field").arg(m_activeField->title()); case FieldModify: - return i18n("Modify %1 Field").tqarg(m_activeField->title()); + return i18n("Modify %1 Field").arg(m_activeField->title()); case FieldRemove: - return i18n("Delete %1 Field").tqarg(m_activeField->title()); + return i18n("Delete %1 Field").arg(m_activeField->title()); } // hush warnings return TQString(); diff --git a/src/commands/modifyentries.cpp b/src/commands/modifyentries.cpp index 9d8712a..3db5297 100644 --- a/src/commands/modifyentries.cpp +++ b/src/commands/modifyentries.cpp @@ -44,7 +44,7 @@ void ModifyEntries::execute() { } // loans expose a field named "loaned", and the user might modify that without // checking in the loan, so verify that. Heavy-handed, yes... - const TQString loaned = TQString::tqfromLatin1("loaned"); + const TQString loaned = TQString::fromLatin1("loaned"); bool hasLoanField = m_coll->hasField(loaned); for(Data::EntryVecIt entry = m_entries.begin(); hasLoanField && entry != m_entries.end(); ++entry) { if(entry->field(loaned).isEmpty()) { @@ -70,7 +70,7 @@ void ModifyEntries::unexecute() { TQString ModifyEntries::name() const { return m_entries.count() > 1 ? i18n("Modify Entries") - : i18n("Modify (Entry Title)", "Modify %1").tqarg(m_entries.begin()->title()); + : i18n("Modify (Entry Title)", "Modify %1").arg(m_entries.begin()->title()); } void ModifyEntries::swapValues() { diff --git a/src/commands/removeentries.cpp b/src/commands/removeentries.cpp index bf2676b..1fb9b60 100644 --- a/src/commands/removeentries.cpp +++ b/src/commands/removeentries.cpp @@ -46,5 +46,5 @@ void RemoveEntries::unexecute() { TQString RemoveEntries::name() const { return m_entries.count() > 1 ? i18n("Delete Entries") - : i18n("Delete (Entry Title)", "Delete %1").tqarg(m_entries.begin()->title()); + : i18n("Delete (Entry Title)", "Delete %1").arg(m_entries.begin()->title()); } diff --git a/src/commands/removeloans.cpp b/src/commands/removeloans.cpp index 7ee321b..3d39886 100644 --- a/src/commands/removeloans.cpp +++ b/src/commands/removeloans.cpp @@ -77,5 +77,5 @@ void RemoveLoans::unexecute() { TQString RemoveLoans::name() const { return m_loans.count() > 1 ? i18n("Check-in Entries") - : i18n("Check-in (Entry Title)", "Check-in %1").tqarg(m_loans.begin()->entry()->title()); + : i18n("Check-in (Entry Title)", "Check-in %1").arg(m_loans.begin()->entry()->title()); } diff --git a/src/commands/updateentries.cpp b/src/commands/updateentries.cpp index 6b53102..32ab8e0 100644 --- a/src/commands/updateentries.cpp +++ b/src/commands/updateentries.cpp @@ -47,7 +47,7 @@ private: } UpdateEntries::UpdateEntries(Data::CollPtr coll_, Data::EntryPtr oldEntry_, Data::EntryPtr newEntry_, bool overWrite_) - : Group(i18n("Modify (Entry Title)", "Modify %1").tqarg(newEntry_->title())) + : Group(i18n("Modify (Entry Title)", "Modify %1").arg(newEntry_->title())) , m_coll(coll_) , m_oldEntry(oldEntry_) , m_newEntry(newEntry_) diff --git a/src/configdialog.cpp b/src/configdialog.cpp index 9922cbe..5873759 100644 --- a/src/configdialog.cpp +++ b/src/configdialog.cpp @@ -46,7 +46,7 @@ #include <kcolorcombo.h> #include <tqsize.h> -#include <tqlayout.h> +#include <layout.h> #include <tqlabel.h> #include <tqcheckbox.h> #include <tqptrlist.h> @@ -110,7 +110,7 @@ ConfigDialog::ConfigDialog(TQWidget* parent_, const char* name_/*=0*/) setupFetchPage(); updateGeometry(); - TQSize s = tqsizeHint(); + TQSize s = sizeHint(); resize(TQMAX(s.width(), CONFIG_MIN_WIDTH), TQMAX(s.height(), CONFIG_MIN_HEIGHT)); // purely for asthetics make all widgets line up @@ -124,7 +124,7 @@ ConfigDialog::ConfigDialog(TQWidget* parent_, const char* name_/*=0*/) int w = 0; for(TQPtrListIterator<TQWidget> it(widgets); it.current(); ++it) { it.current()->polish(); - w = TQMAX(w, it.current()->tqsizeHint().width()); + w = TQMAX(w, it.current()->sizeHint().width()); } for(TQPtrListIterator<TQWidget> it(widgets); it.current(); ++it) { it.current()->setMinimumWidth(w); @@ -133,7 +133,7 @@ ConfigDialog::ConfigDialog(TQWidget* parent_, const char* name_/*=0*/) enableButtonOK(false); enableButtonApply(false); - setHelp(TQString::tqfromLatin1("general-options")); + setHelp(TQString::fromLatin1("general-options")); connect(this, TQT_SIGNAL(aboutToShowPage(TQWidget*)), TQT_SLOT(slotUpdateHelpLink(TQWidget*))); } @@ -146,19 +146,19 @@ ConfigDialog::~ConfigDialog() { void ConfigDialog::slotUpdateHelpLink(TQWidget* w_) { switch(pageIndex(w_)) { case 0: - setHelp(TQString::tqfromLatin1("general-options")); + setHelp(TQString::fromLatin1("general-options")); break; case 1: - setHelp(TQString::tqfromLatin1("printing-options")); + setHelp(TQString::fromLatin1("printing-options")); break; case 2: - setHelp(TQString::tqfromLatin1("template-options")); + setHelp(TQString::fromLatin1("template-options")); break; case 3: - setHelp(TQString::tqfromLatin1("internet-sources-options")); + setHelp(TQString::fromLatin1("internet-sources-options")); break; default: @@ -194,7 +194,7 @@ void ConfigDialog::slotDefault() { } void ConfigDialog::setupGeneralPage() { - TQPixmap pix = DesktopIcon(TQString::tqfromLatin1("tellico"), KIcon::SizeMedium); + TQPixmap pix = DesktopIcon(TQString::fromLatin1("tellico"), KIcon::SizeMedium); TQFrame* frame = addPage(i18n("General"), i18n("General Options"), pix); TQVBoxLayout* l = new TQVBoxLayout(frame, KDialog::marginHint(), KDialog::spacingHint()); @@ -283,14 +283,14 @@ void ConfigDialog::setupPrintingPage() { TQPixmap pix; KIconLoader* loader = KGlobal::iconLoader(); if(loader) { - pix = loader->loadIcon(TQString::tqfromLatin1("printer1"), KIcon::Desktop, KIcon::SizeMedium, + pix = loader->loadIcon(TQString::fromLatin1("printer1"), KIcon::Desktop, KIcon::SizeMedium, KIcon::DefaultState, 0, true /*canReturnNull */); if(pix.isNull()) { - pix = loader->loadIcon(TQString::tqfromLatin1("printer2"), KIcon::Desktop, KIcon::SizeMedium, + pix = loader->loadIcon(TQString::fromLatin1("printer2"), KIcon::Desktop, KIcon::SizeMedium, KIcon::DefaultState, 0, true /*canReturnNull */); } if(pix.isNull()) { - pix = loader->loadIcon(TQString::tqfromLatin1("print_printer"), KIcon::Desktop, KIcon::SizeMedium); + pix = loader->loadIcon(TQString::fromLatin1("print_printer"), KIcon::Desktop, KIcon::SizeMedium); } } TQFrame* frame = addPage(i18n("Printing"), i18n("Printing Options"), pix); @@ -322,7 +322,7 @@ void ConfigDialog::setupPrintingPage() { TQLabel* lab = new TQLabel(i18n("Maximum image &width:"), grid); m_imageWidthBox = new KIntSpinBox(0, 999, 1, 50, 10, grid); - m_imageWidthBox->setSuffix(TQString::tqfromLatin1(" px")); + m_imageWidthBox->setSuffix(TQString::fromLatin1(" px")); lab->setBuddy(m_imageWidthBox); (void) new TQWidget(grid); TQString whats = i18n("The maximum width of the images in the printout. The aspect ration is preserved."); @@ -335,7 +335,7 @@ void ConfigDialog::setupPrintingPage() { lab = new TQLabel(i18n("&Maximum image height:"), grid); m_imageHeightBox = new KIntSpinBox(0, 999, 1, 50, 10, grid); - m_imageHeightBox->setSuffix(TQString::tqfromLatin1(" px")); + m_imageHeightBox->setSuffix(TQString::fromLatin1(" px")); lab->setBuddy(m_imageHeightBox); (void) new TQWidget(grid); whats = i18n("The maximum height of the images in the printout. The aspect ration is preserved."); @@ -351,7 +351,7 @@ void ConfigDialog::setupPrintingPage() { } void ConfigDialog::setupTemplatePage() { - TQPixmap pix = DesktopIcon(TQString::tqfromLatin1("looknfeel"), KIcon::SizeMedium); + TQPixmap pix = DesktopIcon(TQString::fromLatin1("looknfeel"), KIcon::SizeMedium); TQFrame* frame = addPage(i18n("Templates"), i18n("Template Options"), pix); TQVBoxLayout* l = new TQVBoxLayout(frame, KDialog::marginHint(), KDialog::spacingHint()); @@ -379,7 +379,7 @@ void ConfigDialog::setupTemplatePage() { KPushButton* btn = new KPushButton(i18n("&Preview..."), frame); TQWhatsThis::add(btn, i18n("Show a preview of the template")); - btn->setIconSet(SmallIconSet(TQString::tqfromLatin1("viewmag"))); + btn->setIconSet(SmallIconSet(TQString::fromLatin1("viewmag"))); gridLayout->addWidget(btn, row, 2); connect(btn, TQT_SIGNAL(clicked()), TQT_SLOT(slotShowTemplatePreview())); @@ -399,7 +399,7 @@ void ConfigDialog::setupTemplatePage() { l->addWidget(fontGroup); row = -1; - TQGridLayout* fontLayout = new TQGridLayout(fontGroup->tqlayout()); + TQGridLayout* fontLayout = new TQGridLayout(fontGroup->layout()); fontLayout->setSpacing(KDialogBase::spacingHint()); lab = new TQLabel(i18n("Font:"), fontGroup); @@ -415,7 +415,7 @@ void ConfigDialog::setupTemplatePage() { fontLayout->addWidget(new TQLabel(i18n("Size:"), fontGroup), ++row, 0); m_fontSizeInput = new KIntNumInput(fontGroup); m_fontSizeInput->setRange(5, 30); // 30 is same max as konq config - m_fontSizeInput->setSuffix(TQString::tqfromLatin1("pt")); + m_fontSizeInput->setSuffix(TQString::fromLatin1("pt")); fontLayout->addWidget(m_fontSizeInput, row, 1); connect(m_fontSizeInput, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slotModified())); lab->setBuddy(m_fontSizeInput); @@ -426,7 +426,7 @@ void ConfigDialog::setupTemplatePage() { l->addWidget(colGroup); row = -1; - TQGridLayout* colLayout = new TQGridLayout(colGroup->tqlayout()); + TQGridLayout* colLayout = new TQGridLayout(colGroup->layout()); colLayout->setSpacing(KDialogBase::spacingHint()); lab = new TQLabel(i18n("Background color:"), colGroup); @@ -473,19 +473,19 @@ void ConfigDialog::setupTemplatePage() { box1->setSpacing(KDialog::spacingHint()); KPushButton* b1 = new KPushButton(i18n("Install..."), box1); - b1->setIconSet(SmallIconSet(TQString::tqfromLatin1("add"))); + b1->setIconSet(SmallIconSet(TQString::fromLatin1("add"))); connect(b1, TQT_SIGNAL(clicked()), TQT_SLOT(slotInstallTemplate())); whats = i18n("Click to install a new template directly."); TQWhatsThis::add(b1, whats); KPushButton* b2 = new KPushButton(i18n("Download..."), box1); - b2->setIconSet(SmallIconSet(TQString::tqfromLatin1("knewstuff"))); + b2->setIconSet(SmallIconSet(TQString::fromLatin1("knewstuff"))); connect(b2, TQT_SIGNAL(clicked()), TQT_SLOT(slotDownloadTemplate())); whats = i18n("Click to download additional templates via the Internet."); TQWhatsThis::add(b2, whats); KPushButton* b3 = new KPushButton(i18n("Delete..."), box1); - b3->setIconSet(SmallIconSet(TQString::tqfromLatin1("remove"))); + b3->setIconSet(SmallIconSet(TQString::fromLatin1("remove"))); connect(b3, TQT_SIGNAL(clicked()), TQT_SLOT(slotDeleteTemplate())); whats = i18n("Click to select and remove installed templates."); TQWhatsThis::add(b3, whats); @@ -497,7 +497,7 @@ void ConfigDialog::setupTemplatePage() { } void ConfigDialog::setupFetchPage() { - TQPixmap pix = DesktopIcon(TQString::tqfromLatin1("network"), KIcon::SizeMedium); + TQPixmap pix = DesktopIcon(TQString::fromLatin1("network"), KIcon::SizeMedium); TQFrame* frame = addPage(i18n("Data Sources"), i18n("Data Source Options"), pix); TQHBoxLayout* l = new TQHBoxLayout(frame, KDialog::marginHint(), KDialog::spacingHint()); @@ -515,27 +515,27 @@ void ConfigDialog::setupFetchPage() { leftLayout->addWidget(hb); hb->setSpacing(KDialog::spacingHint()); m_moveUpSourceBtn = new KPushButton(i18n("Move &Up"), hb); - m_moveUpSourceBtn->setIconSet(SmallIconSet(TQString::tqfromLatin1("up"))); + m_moveUpSourceBtn->setIconSet(SmallIconSet(TQString::fromLatin1("up"))); TQWhatsThis::add(m_moveUpSourceBtn, i18n("The order of the data sources sets the order " "that Tellico uses when entries are automatically updated.")); m_moveDownSourceBtn = new KPushButton(i18n("Move &Down"), hb); - m_moveDownSourceBtn->setIconSet(SmallIconSet(TQString::tqfromLatin1("down"))); + m_moveDownSourceBtn->setIconSet(SmallIconSet(TQString::fromLatin1("down"))); TQWhatsThis::add(m_moveDownSourceBtn, i18n("The order of the data sources sets the order " "that Tellico uses when entries are automatically updated.")); // these icons are rather arbitrary, but seem to vaguely fit TQVBoxLayout* vlay = new TQVBoxLayout(l); KPushButton* newSourceBtn = new KPushButton(i18n("&New..."), frame); - newSourceBtn->setIconSet(SmallIconSet(TQString::tqfromLatin1("filenew"))); + newSourceBtn->setIconSet(SmallIconSet(TQString::fromLatin1("filenew"))); TQWhatsThis::add(newSourceBtn, i18n("Click to add a new data source.")); m_modifySourceBtn = new KPushButton(i18n("&Modify..."), frame); - m_modifySourceBtn->setIconSet(SmallIconSet(TQString::tqfromLatin1("network"))); + m_modifySourceBtn->setIconSet(SmallIconSet(TQString::fromLatin1("network"))); TQWhatsThis::add(m_modifySourceBtn, i18n("Click to modify the selected data source.")); m_removeSourceBtn = new KPushButton(i18n("&Delete"), frame); - m_removeSourceBtn->setIconSet(SmallIconSet(TQString::tqfromLatin1("remove"))); + m_removeSourceBtn->setIconSet(SmallIconSet(TQString::fromLatin1("remove"))); TQWhatsThis::add(m_removeSourceBtn, i18n("Click to delete the selected data source.")); m_newStuffBtn = new KPushButton(i18n("Download..."), frame); - m_newStuffBtn->setIconSet(SmallIconSet(TQString::tqfromLatin1("knewstuff"))); + m_newStuffBtn->setIconSet(SmallIconSet(TQString::fromLatin1("knewstuff"))); TQWhatsThis::add(m_newStuffBtn, i18n("Click to download additional data sources via the Internet.")); #if !KDE_IS_VERSION(3,3,90) @@ -587,8 +587,8 @@ void ConfigDialog::readGeneralConfig() { bool autoFormat = Config::autoFormat(); m_cbFormat->setChecked(autoFormat); - const TQRegExp comma(TQString::tqfromLatin1("\\s*,\\s*")); - const TQString semicolon = TQString::tqfromLatin1("; "); + const TQRegExp comma(TQString::fromLatin1("\\s*,\\s*")); + const TQString semicolon = TQString::fromLatin1("; "); m_leCapitals->setText(Config::noCapitalizationString().replace(comma, semicolon)); m_leArticles->setText(Config::articlesString().replace(comma, semicolon)); @@ -609,7 +609,7 @@ void ConfigDialog::readTemplateConfig() { const int collType = Kernel::self()->collectionType(); TQString file = Config::templateName(collType); file.replace('_', ' '); - TQString fileContext = file + TQString::tqfromLatin1(" XSL Template"); + TQString fileContext = file + TQString::fromLatin1(" XSL Template"); m_templateCombo->setCurrentItem(i18n(fileContext.utf8(), file.utf8())); m_fontCombo->setCurrentFont(Config::templateFont(collType).family()); @@ -633,7 +633,7 @@ void ConfigDialog::readFetchConfig() { Fetch::ConfigWidget* cw = it->configWidget(this); if(cw) { // might return 0 when no widget available for fetcher type m_configWidgets.insert(item, cw); - // there's weird tqlayout bug if it's not hidden + // there's weird layout bug if it's not hidden cw->hide(); } kapp->processEvents(); @@ -665,7 +665,7 @@ void ConfigDialog::saveConfiguration() { Config::setAutoCapitalization(m_cbCapitalize->isChecked()); Config::setAutoFormat(m_cbFormat->isChecked()); - const TQRegExp semicolon(TQString::tqfromLatin1("\\s*;\\s*")); + const TQRegExp semicolon(TQString::fromLatin1("\\s*;\\s*")); const TQChar comma = ','; Config::setNoCapitalizationString(m_leCapitals->text().replace(semicolon, comma)); @@ -707,7 +707,7 @@ void ConfigDialog::saveConfiguration() { continue; } m_newStuffConfigWidgets.removeRef(cw); - TQString group = TQString::tqfromLatin1("Data Source %1").tqarg(count); + TQString group = TQString::fromLatin1("Data Source %1").arg(count); // in case we later change the order, clear the group now masterConfig->deleteGroup(group); KConfigGroup configGroup(masterConfig, group); @@ -724,11 +724,11 @@ void ConfigDialog::saveConfiguration() { KConfigGroup sourceGroup(masterConfig, "Data Sources"); sourceGroup.writeEntry("Sources Count", count); // and purge old config groups - TQString group = TQString::tqfromLatin1("Data Source %1").tqarg(count); + TQString group = TQString::fromLatin1("Data Source %1").arg(count); while(masterConfig->hasGroup(group)) { masterConfig->deleteGroup(group); ++count; - group = TQString::tqfromLatin1("Data Source %1").tqarg(count); + group = TQString::fromLatin1("Data Source %1").arg(count); } masterConfig->sync(); @@ -952,7 +952,7 @@ void ConfigDialog::slotShowTemplatePreview() { GUI::PreviewDialog* dlg = new GUI::PreviewDialog(this); const TQString templateName = m_templateCombo->currentData().toString(); - dlg->setXSLTFile(templateName + TQString::tqfromLatin1(".xsl")); + dlg->setXSLTFile(templateName + TQString::fromLatin1(".xsl")); StyleOptions options; options.fontFamily = m_fontCombo->currentFont(); @@ -973,11 +973,11 @@ void ConfigDialog::slotShowTemplatePreview() { } else if(f->type() == Data::Field::Choice) { e->setField(f->name(), f->allowed().front()); } else if(f->type() == Data::Field::Number) { - e->setField(f->name(), TQString::tqfromLatin1("1")); + e->setField(f->name(), TQString::fromLatin1("1")); } else if(f->type() == Data::Field::Bool) { - e->setField(f->name(), TQString::tqfromLatin1("true")); + e->setField(f->name(), TQString::fromLatin1("true")); } else if(f->type() == Data::Field::Rating) { - e->setField(f->name(), TQString::tqfromLatin1("5")); + e->setField(f->name(), TQString::fromLatin1("5")); } else { e->setField(f->name(), f->title()); } @@ -990,7 +990,7 @@ void ConfigDialog::slotShowTemplatePreview() { } void ConfigDialog::loadTemplateList() { - TQStringList files = KGlobal::dirs()->findAllResources("appdata", TQString::tqfromLatin1("entry-templates/*.xsl"), + TQStringList files = KGlobal::dirs()->findAllResources("appdata", TQString::fromLatin1("entry-templates/*.xsl"), false, true); KSortableValueList<TQString, TQString> templates; for(TQStringList::ConstIterator it = files.begin(); it != files.end(); ++it) { @@ -998,7 +998,7 @@ void ConfigDialog::loadTemplateList() { TQString file = fi.fileName().section('.', 0, -2); TQString name = file; name.replace('_', ' '); - TQString title = i18n((name + TQString::tqfromLatin1(" XSL Template")).utf8(), name.utf8()); + TQString title = i18n((name + TQString::fromLatin1(" XSL Template")).utf8(), name.utf8()); templates.insert(title, file); } templates.sort(); @@ -1034,8 +1034,8 @@ void ConfigDialog::slotDownloadTemplate() { } void ConfigDialog::slotDeleteTemplate() { - TQDir dir(Tellico::saveLocation(TQString::tqfromLatin1("entry-templates/"))); - dir.setNameFilter(TQString::tqfromLatin1("*.xsl")); + TQDir dir(Tellico::saveLocation(TQString::fromLatin1("entry-templates/"))); + dir.setNameFilter(TQString::fromLatin1("*.xsl")); dir.setFilter(TQDir::Files | TQDir::Writable); TQStringList files = dir.entryList(); TQMap<TQString, TQString> nameFileMap; diff --git a/src/controller.cpp b/src/controller.cpp index 948d7c0..9e31c6d 100644 --- a/src/controller.cpp +++ b/src/controller.cpp @@ -430,9 +430,9 @@ void Controller::slotDeleteSelectedEntries() { // confirm delete if(m_selectedEntries.count() == 1) { TQString str = i18n("Do you really want to delete this entry?"); - TQString dontAsk = TQString::tqfromLatin1("DeleteEntry"); + TQString dontAsk = TQString::fromLatin1("DeleteEntry"); int ret = KMessageBox::warningContinueCancel(Kernel::self()->widget(), str, i18n("Delete Entry"), - KGuiItem(i18n("&Delete"), TQString::tqfromLatin1("editdelete")), dontAsk); + KGuiItem(i18n("&Delete"), TQString::fromLatin1("editdelete")), dontAsk); if(ret != KMessageBox::Continue) { return; } @@ -443,10 +443,10 @@ void Controller::slotDeleteSelectedEntries() { } TQString str = i18n("Do you really want to delete these entries?"); // historically called DeleteMultipleBooks, don't change - TQString dontAsk = TQString::tqfromLatin1("DeleteMultipleBooks"); + TQString dontAsk = TQString::fromLatin1("DeleteMultipleBooks"); int ret = KMessageBox::warningContinueCancelList(Kernel::self()->widget(), str, names, i18n("Delete Multiple Entries"), - KGuiItem(i18n("&Delete"), TQString::tqfromLatin1("editdelete")), dontAsk); + KGuiItem(i18n("&Delete"), TQString::fromLatin1("editdelete")), dontAsk); if(ret != KMessageBox::Continue) { return; } @@ -607,7 +607,7 @@ void Controller::plugUpdateMenu(TQPopupMenu* popup_) { void Controller::updateActions() const { bool emptySelection = m_selectedEntries.isEmpty(); - m_mainWindow->stateChanged(TQString::tqfromLatin1("empty_selection"), + m_mainWindow->stateChanged(TQString::fromLatin1("empty_selection"), emptySelection ? KXMLGUIClient::StateNoReverse : KXMLGUIClient::StateReverse); for(TQPtrListIterator<KAction> it(m_mainWindow->m_fetchActions); it.current(); ++it) { it.current()->setEnabled(!emptySelection); @@ -748,7 +748,7 @@ void Controller::hideTabs() const { inline bool Controller::canCheckIn() const { for(Data::EntryVec::ConstIterator entry = m_selectedEntries.begin(); entry != m_selectedEntries.end(); ++entry) { - if(entry->field(TQString::tqfromLatin1("loaned")) == Latin1Literal("true")) { + if(entry->field(TQString::fromLatin1("loaned")) == Latin1Literal("true")) { return true; } } diff --git a/src/core/dcopinterface.cpp b/src/core/dcopinterface.cpp index bd7014c..d81d776 100644 --- a/src/core/dcopinterface.cpp +++ b/src/core/dcopinterface.cpp @@ -163,7 +163,7 @@ bool CollectionInterface::addFieldValue(long id_, const TQString& fieldName_, co TQStringList values = entry->fields(fieldName_, false); TQStringList newValues = values; newValues << value_; - if(!entry->setField(fieldName_, newValues.join(TQString::tqfromLatin1("; ")))) { + if(!entry->setField(fieldName_, newValues.join(TQString::fromLatin1("; ")))) { return false; } Kernel::self()->modifyEntries(oldEntry, entry); diff --git a/src/core/drophandler.cpp b/src/core/drophandler.cpp index 0535e61..e609e7b 100644 --- a/src/core/drophandler.cpp +++ b/src/core/drophandler.cpp @@ -63,14 +63,14 @@ bool DropHandler::handleURL(const KURL::List& urls_) { KURL::List tc, pdf, bib, ris; for(KURL::List::ConstIterator it = urls_.begin(); it != urls_.end(); ++it) { KMimeType::Ptr ptr = KMimeType::findByURL(*it); - if(ptr->is(TQString::tqfromLatin1("application/x-tellico"))) { + if(ptr->is(TQString::fromLatin1("application/x-tellico"))) { tc << *it; - } else if(ptr->is(TQString::tqfromLatin1("application/pdf"))) { + } else if(ptr->is(TQString::fromLatin1("application/pdf"))) { pdf << *it; - } else if(ptr->is(TQString::tqfromLatin1("text/x-bibtex")) || - ptr->is(TQString::tqfromLatin1("application/x-bibtex"))) { + } else if(ptr->is(TQString::fromLatin1("text/x-bibtex")) || + ptr->is(TQString::fromLatin1("application/x-bibtex"))) { bib << *it; - } else if(ptr->is(TQString::tqfromLatin1("application/x-research-info-systems"))) { + } else if(ptr->is(TQString::fromLatin1("application/x-research-info-systems"))) { ris << *it; } else { myDebug() << "DropHandler::handleURL() - unrecognized type: " << ptr->name() << " (" << *it << ")" << endl; diff --git a/src/core/tellico_config.cpp b/src/core/tellico_config.cpp index 4984cdb..50ab877 100644 --- a/src/core/tellico_config.cpp +++ b/src/core/tellico_config.cpp @@ -21,430 +21,430 @@ Config *Config::self() } Config::Config( ) - : KConfigSkeleton( TQString::tqfromLatin1( "tellicorc" ) ) + : KConfigSkeleton( TQString::fromLatin1( "tellicorc" ) ) { mSelf = this; - setCurrentGroup( TQString::tqfromLatin1( "TipOfDay" ) ); + setCurrentGroup( TQString::fromLatin1( "TipOfDay" ) ); KConfigSkeleton::ItemBool *itemShowTipOfDay; - itemShowTipOfDay = new KConfigSkeleton::ItemBool( currentGroup(), TQString::tqfromLatin1( "RunOnStart" ), mShowTipOfDay, true ); - addItem( itemShowTipOfDay, TQString::tqfromLatin1( "showTipOfDay" ) ); + itemShowTipOfDay = new KConfigSkeleton::ItemBool( currentGroup(), TQString::fromLatin1( "RunOnStart" ), mShowTipOfDay, true ); + addItem( itemShowTipOfDay, TQString::fromLatin1( "showTipOfDay" ) ); - setCurrentGroup( TQString::tqfromLatin1( "Main Window Options" ) ); + setCurrentGroup( TQString::fromLatin1( "Main Window Options" ) ); TQValueList<int> defaultMainSplitterSizes; KConfigSkeleton::ItemIntList *itemMainSplitterSizes; - itemMainSplitterSizes = new KConfigSkeleton::ItemIntList( currentGroup(), TQString::tqfromLatin1( "Main Splitter Sizes" ), mMainSplitterSizes, defaultMainSplitterSizes ); - addItem( itemMainSplitterSizes, TQString::tqfromLatin1( "MainSplitterSizes" ) ); + itemMainSplitterSizes = new KConfigSkeleton::ItemIntList( currentGroup(), TQString::fromLatin1( "Main Splitter Sizes" ), mMainSplitterSizes, defaultMainSplitterSizes ); + addItem( itemMainSplitterSizes, TQString::fromLatin1( "MainSplitterSizes" ) ); TQValueList<int> defaultSecondarySplitterSizes; KConfigSkeleton::ItemIntList *itemSecondarySplitterSizes; - itemSecondarySplitterSizes = new KConfigSkeleton::ItemIntList( currentGroup(), TQString::tqfromLatin1( "Secondary Splitter Sizes" ), mSecondarySplitterSizes, defaultSecondarySplitterSizes ); - addItem( itemSecondarySplitterSizes, TQString::tqfromLatin1( "SecondarySplitterSizes" ) ); + itemSecondarySplitterSizes = new KConfigSkeleton::ItemIntList( currentGroup(), TQString::fromLatin1( "Secondary Splitter Sizes" ), mSecondarySplitterSizes, defaultSecondarySplitterSizes ); + addItem( itemSecondarySplitterSizes, TQString::fromLatin1( "SecondarySplitterSizes" ) ); - setCurrentGroup( TQString::tqfromLatin1( "Detailed View Options" ) ); + setCurrentGroup( TQString::fromLatin1( "Detailed View Options" ) ); KConfigSkeleton::ItemInt *itemMaxPixmapWidth; - itemMaxPixmapWidth = new KConfigSkeleton::ItemInt( currentGroup(), TQString::tqfromLatin1( "MaxPixmapWidth" ), mMaxPixmapWidth, 50 ); - addItem( itemMaxPixmapWidth, TQString::tqfromLatin1( "MaxPixmapWidth" ) ); + itemMaxPixmapWidth = new KConfigSkeleton::ItemInt( currentGroup(), TQString::fromLatin1( "MaxPixmapWidth" ), mMaxPixmapWidth, 50 ); + addItem( itemMaxPixmapWidth, TQString::fromLatin1( "MaxPixmapWidth" ) ); KConfigSkeleton::ItemInt *itemMaxPixmapHeight; - itemMaxPixmapHeight = new KConfigSkeleton::ItemInt( currentGroup(), TQString::tqfromLatin1( "MaxPixmapHeight" ), mMaxPixmapHeight, 50 ); - addItem( itemMaxPixmapHeight, TQString::tqfromLatin1( "MaxPixmapHeight" ) ); + itemMaxPixmapHeight = new KConfigSkeleton::ItemInt( currentGroup(), TQString::fromLatin1( "MaxPixmapHeight" ), mMaxPixmapHeight, 50 ); + addItem( itemMaxPixmapHeight, TQString::fromLatin1( "MaxPixmapHeight" ) ); - setCurrentGroup( TQString::tqfromLatin1( "Group View Options" ) ); + setCurrentGroup( TQString::fromLatin1( "Group View Options" ) ); KConfigSkeleton::ItemInt *itemGroupViewSortColumn; - itemGroupViewSortColumn = new KConfigSkeleton::ItemInt( currentGroup(), TQString::tqfromLatin1( "SortColumn" ), mGroupViewSortColumn, 0 ); - addItem( itemGroupViewSortColumn, TQString::tqfromLatin1( "groupViewSortColumn" ) ); + itemGroupViewSortColumn = new KConfigSkeleton::ItemInt( currentGroup(), TQString::fromLatin1( "SortColumn" ), mGroupViewSortColumn, 0 ); + addItem( itemGroupViewSortColumn, TQString::fromLatin1( "groupViewSortColumn" ) ); KConfigSkeleton::ItemBool *itemGroupViewSortAscending; - itemGroupViewSortAscending = new KConfigSkeleton::ItemBool( currentGroup(), TQString::tqfromLatin1( "SortAscending" ), mGroupViewSortAscending, true ); - addItem( itemGroupViewSortAscending, TQString::tqfromLatin1( "groupViewSortAscending" ) ); + itemGroupViewSortAscending = new KConfigSkeleton::ItemBool( currentGroup(), TQString::fromLatin1( "SortAscending" ), mGroupViewSortAscending, true ); + addItem( itemGroupViewSortAscending, TQString::fromLatin1( "groupViewSortAscending" ) ); - setCurrentGroup( TQString::tqfromLatin1( "Filter View Options" ) ); + setCurrentGroup( TQString::fromLatin1( "Filter View Options" ) ); KConfigSkeleton::ItemInt *itemFilterViewSortColumn; - itemFilterViewSortColumn = new KConfigSkeleton::ItemInt( currentGroup(), TQString::tqfromLatin1( "SortColumn" ), mFilterViewSortColumn, 0 ); - addItem( itemFilterViewSortColumn, TQString::tqfromLatin1( "filterViewSortColumn" ) ); + itemFilterViewSortColumn = new KConfigSkeleton::ItemInt( currentGroup(), TQString::fromLatin1( "SortColumn" ), mFilterViewSortColumn, 0 ); + addItem( itemFilterViewSortColumn, TQString::fromLatin1( "filterViewSortColumn" ) ); KConfigSkeleton::ItemBool *itemFilterViewSortAscending; - itemFilterViewSortAscending = new KConfigSkeleton::ItemBool( currentGroup(), TQString::tqfromLatin1( "SortAscending" ), mFilterViewSortAscending, true ); - addItem( itemFilterViewSortAscending, TQString::tqfromLatin1( "filterViewSortAscending" ) ); + itemFilterViewSortAscending = new KConfigSkeleton::ItemBool( currentGroup(), TQString::fromLatin1( "SortAscending" ), mFilterViewSortAscending, true ); + addItem( itemFilterViewSortAscending, TQString::fromLatin1( "filterViewSortAscending" ) ); - setCurrentGroup( TQString::tqfromLatin1( "Loan View Options" ) ); + setCurrentGroup( TQString::fromLatin1( "Loan View Options" ) ); KConfigSkeleton::ItemInt *itemLoanViewSortColumn; - itemLoanViewSortColumn = new KConfigSkeleton::ItemInt( currentGroup(), TQString::tqfromLatin1( "SortColumn" ), mLoanViewSortColumn, 0 ); - addItem( itemLoanViewSortColumn, TQString::tqfromLatin1( "loanViewSortColumn" ) ); + itemLoanViewSortColumn = new KConfigSkeleton::ItemInt( currentGroup(), TQString::fromLatin1( "SortColumn" ), mLoanViewSortColumn, 0 ); + addItem( itemLoanViewSortColumn, TQString::fromLatin1( "loanViewSortColumn" ) ); KConfigSkeleton::ItemBool *itemLoanViewSortAscending; - itemLoanViewSortAscending = new KConfigSkeleton::ItemBool( currentGroup(), TQString::tqfromLatin1( "SortAscending" ), mLoanViewSortAscending, true ); - addItem( itemLoanViewSortAscending, TQString::tqfromLatin1( "loanViewSortAscending" ) ); + itemLoanViewSortAscending = new KConfigSkeleton::ItemBool( currentGroup(), TQString::fromLatin1( "SortAscending" ), mLoanViewSortAscending, true ); + addItem( itemLoanViewSortAscending, TQString::fromLatin1( "loanViewSortAscending" ) ); - setCurrentGroup( TQString::tqfromLatin1( "Export Options - Bibtex" ) ); + setCurrentGroup( TQString::fromLatin1( "Export Options - Bibtex" ) ); KConfigSkeleton::ItemBool *itemUseBraces; - itemUseBraces = new KConfigSkeleton::ItemBool( currentGroup(), TQString::tqfromLatin1( "Use Braces" ), mUseBraces, true ); - addItem( itemUseBraces, TQString::tqfromLatin1( "UseBraces" ) ); + itemUseBraces = new KConfigSkeleton::ItemBool( currentGroup(), TQString::fromLatin1( "Use Braces" ), mUseBraces, true ); + addItem( itemUseBraces, TQString::fromLatin1( "UseBraces" ) ); - setCurrentGroup( TQString::tqfromLatin1( "General Options" ) ); + setCurrentGroup( TQString::fromLatin1( "General Options" ) ); KConfigSkeleton::ItemBool *itemShowGroupWidget; - itemShowGroupWidget = new KConfigSkeleton::ItemBool( currentGroup(), TQString::tqfromLatin1( "Show Group Widget" ), mShowGroupWidget, true ); - addItem( itemShowGroupWidget, TQString::tqfromLatin1( "ShowGroupWidget" ) ); + itemShowGroupWidget = new KConfigSkeleton::ItemBool( currentGroup(), TQString::fromLatin1( "Show Group Widget" ), mShowGroupWidget, true ); + addItem( itemShowGroupWidget, TQString::fromLatin1( "ShowGroupWidget" ) ); KConfigSkeleton::ItemBool *itemShowEditWidget; - itemShowEditWidget = new KConfigSkeleton::ItemBool( currentGroup(), TQString::tqfromLatin1( "Show Edit Widget" ), mShowEditWidget, false ); - addItem( itemShowEditWidget, TQString::tqfromLatin1( "ShowEditWidget" ) ); + itemShowEditWidget = new KConfigSkeleton::ItemBool( currentGroup(), TQString::fromLatin1( "Show Edit Widget" ), mShowEditWidget, false ); + addItem( itemShowEditWidget, TQString::fromLatin1( "ShowEditWidget" ) ); KConfigSkeleton::ItemBool *itemShowEntryView; - itemShowEntryView = new KConfigSkeleton::ItemBool( currentGroup(), TQString::tqfromLatin1( "Show Entry View" ), mShowEntryView, true ); - addItem( itemShowEntryView, TQString::tqfromLatin1( "ShowEntryView" ) ); + itemShowEntryView = new KConfigSkeleton::ItemBool( currentGroup(), TQString::fromLatin1( "Show Entry View" ), mShowEntryView, true ); + addItem( itemShowEntryView, TQString::fromLatin1( "ShowEntryView" ) ); TQValueList<KConfigSkeleton::ItemEnum::Choice> valuesImageLocation; { KConfigSkeleton::ItemEnum::Choice choice; - choice.name = TQString::tqfromLatin1( "ImagesInFile" ); + choice.name = TQString::fromLatin1( "ImagesInFile" ); valuesImageLocation.append( choice ); } { KConfigSkeleton::ItemEnum::Choice choice; - choice.name = TQString::tqfromLatin1( "ImagesInAppDir" ); + choice.name = TQString::fromLatin1( "ImagesInAppDir" ); valuesImageLocation.append( choice ); } { KConfigSkeleton::ItemEnum::Choice choice; - choice.name = TQString::tqfromLatin1( "ImagesInLocalDir" ); + choice.name = TQString::fromLatin1( "ImagesInLocalDir" ); valuesImageLocation.append( choice ); } KConfigSkeleton::ItemEnum *itemImageLocation; - itemImageLocation = new KConfigSkeleton::ItemEnum( currentGroup(), TQString::tqfromLatin1( "Image Location" ), mImageLocation, valuesImageLocation, ImagesInFile ); - addItem( itemImageLocation, TQString::tqfromLatin1( "ImageLocation" ) ); + itemImageLocation = new KConfigSkeleton::ItemEnum( currentGroup(), TQString::fromLatin1( "Image Location" ), mImageLocation, valuesImageLocation, ImagesInFile ); + addItem( itemImageLocation, TQString::fromLatin1( "ImageLocation" ) ); KConfigSkeleton::ItemBool *itemAskWriteImagesInFile; - itemAskWriteImagesInFile = new KConfigSkeleton::ItemBool( currentGroup(), TQString::tqfromLatin1( "Ask Write Images In File" ), mAskWriteImagesInFile, true ); - addItem( itemAskWriteImagesInFile, TQString::tqfromLatin1( "AskWriteImagesInFile" ) ); + itemAskWriteImagesInFile = new KConfigSkeleton::ItemBool( currentGroup(), TQString::fromLatin1( "Ask Write Images In File" ), mAskWriteImagesInFile, true ); + addItem( itemAskWriteImagesInFile, TQString::fromLatin1( "AskWriteImagesInFile" ) ); KConfigSkeleton::ItemBool *itemReopenLastFile; - itemReopenLastFile = new KConfigSkeleton::ItemBool( currentGroup(), TQString::tqfromLatin1( "Reopen Last File" ), mReopenLastFile, true ); - addItem( itemReopenLastFile, TQString::tqfromLatin1( "ReopenLastFile" ) ); + itemReopenLastFile = new KConfigSkeleton::ItemBool( currentGroup(), TQString::fromLatin1( "Reopen Last File" ), mReopenLastFile, true ); + addItem( itemReopenLastFile, TQString::fromLatin1( "ReopenLastFile" ) ); KConfigSkeleton::ItemBool *itemAutoCapitalization; - itemAutoCapitalization = new KConfigSkeleton::ItemBool( currentGroup(), TQString::tqfromLatin1( "Auto Capitalization" ), mAutoCapitalization, true ); - addItem( itemAutoCapitalization, TQString::tqfromLatin1( "AutoCapitalization" ) ); + itemAutoCapitalization = new KConfigSkeleton::ItemBool( currentGroup(), TQString::fromLatin1( "Auto Capitalization" ), mAutoCapitalization, true ); + addItem( itemAutoCapitalization, TQString::fromLatin1( "AutoCapitalization" ) ); KConfigSkeleton::ItemBool *itemAutoFormat; - itemAutoFormat = new KConfigSkeleton::ItemBool( currentGroup(), TQString::tqfromLatin1( "Auto Format" ), mAutoFormat, true ); - addItem( itemAutoFormat, TQString::tqfromLatin1( "AutoFormat" ) ); + itemAutoFormat = new KConfigSkeleton::ItemBool( currentGroup(), TQString::fromLatin1( "Auto Format" ), mAutoFormat, true ); + addItem( itemAutoFormat, TQString::fromLatin1( "AutoFormat" ) ); KConfigSkeleton::ItemString *itemLastOpenFile; - itemLastOpenFile = new KConfigSkeleton::ItemString( currentGroup(), TQString::tqfromLatin1( "Last Open File" ), mLastOpenFile ); - addItem( itemLastOpenFile, TQString::tqfromLatin1( "LastOpenFile" ) ); + itemLastOpenFile = new KConfigSkeleton::ItemString( currentGroup(), TQString::fromLatin1( "Last Open File" ), mLastOpenFile ); + addItem( itemLastOpenFile, TQString::fromLatin1( "LastOpenFile" ) ); KConfigSkeleton::ItemString *itemNoCapitalizationString; - itemNoCapitalizationString = new KConfigSkeleton::ItemString( currentGroup(), TQString::tqfromLatin1( "No Capitalization" ), mNoCapitalizationString, i18n("a,an,and,as,at,but,by,for,from,in,into,nor,of,off,on,onto,or,out,over,the,to,up,with") ); - addItem( itemNoCapitalizationString, TQString::tqfromLatin1( "noCapitalizationString" ) ); + itemNoCapitalizationString = new KConfigSkeleton::ItemString( currentGroup(), TQString::fromLatin1( "No Capitalization" ), mNoCapitalizationString, i18n("a,an,and,as,at,but,by,for,from,in,into,nor,of,off,on,onto,or,out,over,the,to,up,with") ); + addItem( itemNoCapitalizationString, TQString::fromLatin1( "noCapitalizationString" ) ); KConfigSkeleton::ItemString *itemArticlesString; - itemArticlesString = new KConfigSkeleton::ItemString( currentGroup(), TQString::tqfromLatin1( "Articles" ), mArticlesString, i18n("the") ); - addItem( itemArticlesString, TQString::tqfromLatin1( "articlesString" ) ); + itemArticlesString = new KConfigSkeleton::ItemString( currentGroup(), TQString::fromLatin1( "Articles" ), mArticlesString, i18n("the") ); + addItem( itemArticlesString, TQString::fromLatin1( "articlesString" ) ); KConfigSkeleton::ItemString *itemNameSuffixesString; - itemNameSuffixesString = new KConfigSkeleton::ItemString( currentGroup(), TQString::tqfromLatin1( "Name Suffixes" ), mNameSuffixesString, i18n("jr.,jr,iii,iv") ); - addItem( itemNameSuffixesString, TQString::tqfromLatin1( "nameSuffixesString" ) ); + itemNameSuffixesString = new KConfigSkeleton::ItemString( currentGroup(), TQString::fromLatin1( "Name Suffixes" ), mNameSuffixesString, i18n("jr.,jr,iii,iv") ); + addItem( itemNameSuffixesString, TQString::fromLatin1( "nameSuffixesString" ) ); KConfigSkeleton::ItemString *itemSurnamePrefixesString; - itemSurnamePrefixesString = new KConfigSkeleton::ItemString( currentGroup(), TQString::tqfromLatin1( "Surname Prefixes" ), mSurnamePrefixesString, i18n("de,van,der,van der,von") ); - addItem( itemSurnamePrefixesString, TQString::tqfromLatin1( "surnamePrefixesString" ) ); + itemSurnamePrefixesString = new KConfigSkeleton::ItemString( currentGroup(), TQString::fromLatin1( "Surname Prefixes" ), mSurnamePrefixesString, i18n("de,van,der,van der,von") ); + addItem( itemSurnamePrefixesString, TQString::fromLatin1( "surnamePrefixesString" ) ); KConfigSkeleton::ItemInt *itemMaxIconSize; - itemMaxIconSize = new KConfigSkeleton::ItemInt( currentGroup(), TQString::tqfromLatin1( "Max Icon Size" ), mMaxIconSize, 96 ); - addItem( itemMaxIconSize, TQString::tqfromLatin1( "MaxIconSize" ) ); + itemMaxIconSize = new KConfigSkeleton::ItemInt( currentGroup(), TQString::fromLatin1( "Max Icon Size" ), mMaxIconSize, 96 ); + addItem( itemMaxIconSize, TQString::fromLatin1( "MaxIconSize" ) ); KConfigSkeleton::ItemInt *itemImageCacheSize; - itemImageCacheSize = new KConfigSkeleton::ItemInt( currentGroup(), TQString::tqfromLatin1( "Image Cache Size" ), mImageCacheSize, (10 * 1024 * 1024) ); - addItem( itemImageCacheSize, TQString::tqfromLatin1( "ImageCacheSize" ) ); + itemImageCacheSize = new KConfigSkeleton::ItemInt( currentGroup(), TQString::fromLatin1( "Image Cache Size" ), mImageCacheSize, (10 * 1024 * 1024) ); + addItem( itemImageCacheSize, TQString::fromLatin1( "ImageCacheSize" ) ); KConfigSkeleton::ItemUInt *itemMaxCustomURLSettings; - itemMaxCustomURLSettings = new KConfigSkeleton::ItemUInt( currentGroup(), TQString::tqfromLatin1( "Max Custom URL Settings" ), mMaxCustomURLSettings, 9 ); - addItem( itemMaxCustomURLSettings, TQString::tqfromLatin1( "MaxCustomURLSettings" ) ); + itemMaxCustomURLSettings = new KConfigSkeleton::ItemUInt( currentGroup(), TQString::fromLatin1( "Max Custom URL Settings" ), mMaxCustomURLSettings, 9 ); + addItem( itemMaxCustomURLSettings, TQString::fromLatin1( "MaxCustomURLSettings" ) ); - setCurrentGroup( TQString::tqfromLatin1( "Printing" ) ); + setCurrentGroup( TQString::fromLatin1( "Printing" ) ); KConfigSkeleton::ItemBool *itemPrintFieldHeaders; - itemPrintFieldHeaders = new KConfigSkeleton::ItemBool( currentGroup(), TQString::tqfromLatin1( "Print Field Headers" ), mPrintFieldHeaders, true ); - addItem( itemPrintFieldHeaders, TQString::tqfromLatin1( "PrintFieldHeaders" ) ); + itemPrintFieldHeaders = new KConfigSkeleton::ItemBool( currentGroup(), TQString::fromLatin1( "Print Field Headers" ), mPrintFieldHeaders, true ); + addItem( itemPrintFieldHeaders, TQString::fromLatin1( "PrintFieldHeaders" ) ); KConfigSkeleton::ItemBool *itemPrintFormatted; - itemPrintFormatted = new KConfigSkeleton::ItemBool( currentGroup(), TQString::tqfromLatin1( "Print Formatted" ), mPrintFormatted, true ); - addItem( itemPrintFormatted, TQString::tqfromLatin1( "PrintFormatted" ) ); + itemPrintFormatted = new KConfigSkeleton::ItemBool( currentGroup(), TQString::fromLatin1( "Print Formatted" ), mPrintFormatted, true ); + addItem( itemPrintFormatted, TQString::fromLatin1( "PrintFormatted" ) ); KConfigSkeleton::ItemBool *itemPrintGrouped; - itemPrintGrouped = new KConfigSkeleton::ItemBool( currentGroup(), TQString::tqfromLatin1( "Print Grouped" ), mPrintGrouped, true ); - addItem( itemPrintGrouped, TQString::tqfromLatin1( "PrintGrouped" ) ); + itemPrintGrouped = new KConfigSkeleton::ItemBool( currentGroup(), TQString::fromLatin1( "Print Grouped" ), mPrintGrouped, true ); + addItem( itemPrintGrouped, TQString::fromLatin1( "PrintGrouped" ) ); KConfigSkeleton::ItemInt *itemMaxImageWidth; - itemMaxImageWidth = new KConfigSkeleton::ItemInt( currentGroup(), TQString::tqfromLatin1( "Max Image Width" ), mMaxImageWidth, 50 ); - addItem( itemMaxImageWidth, TQString::tqfromLatin1( "MaxImageWidth" ) ); + itemMaxImageWidth = new KConfigSkeleton::ItemInt( currentGroup(), TQString::fromLatin1( "Max Image Width" ), mMaxImageWidth, 50 ); + addItem( itemMaxImageWidth, TQString::fromLatin1( "MaxImageWidth" ) ); KConfigSkeleton::ItemInt *itemMaxImageHeight; - itemMaxImageHeight = new KConfigSkeleton::ItemInt( currentGroup(), TQString::tqfromLatin1( "Max Image Height" ), mMaxImageHeight, 50 ); - addItem( itemMaxImageHeight, TQString::tqfromLatin1( "MaxImageHeight" ) ); + itemMaxImageHeight = new KConfigSkeleton::ItemInt( currentGroup(), TQString::fromLatin1( "Max Image Height" ), mMaxImageHeight, 50 ); + addItem( itemMaxImageHeight, TQString::fromLatin1( "MaxImageHeight" ) ); - setCurrentGroup( TQString::tqfromLatin1( "Options - book" ) ); + setCurrentGroup( TQString::fromLatin1( "Options - book" ) ); KConfigSkeleton::ItemString *itemTemplateBook; - itemTemplateBook = new KConfigSkeleton::ItemString( currentGroup(), TQString::tqfromLatin1( "Entry Template" ), mTemplateBook, TQString::tqfromLatin1( "Fancy" ) ); - addItem( itemTemplateBook, TQString::tqfromLatin1( "templateBook" ) ); + itemTemplateBook = new KConfigSkeleton::ItemString( currentGroup(), TQString::fromLatin1( "Entry Template" ), mTemplateBook, TQString::fromLatin1( "Fancy" ) ); + addItem( itemTemplateBook, TQString::fromLatin1( "templateBook" ) ); KConfigSkeleton::ItemFont *itemFontBook; - itemFontBook = new KConfigSkeleton::ItemFont( currentGroup(), TQString::tqfromLatin1( "Template Font" ), mFontBook, KGlobalSettings::generalFont() ); - addItem( itemFontBook, TQString::tqfromLatin1( "fontBook" ) ); + itemFontBook = new KConfigSkeleton::ItemFont( currentGroup(), TQString::fromLatin1( "Template Font" ), mFontBook, KGlobalSettings::generalFont() ); + addItem( itemFontBook, TQString::fromLatin1( "fontBook" ) ); KConfigSkeleton::ItemColor *itemBaseColorBook; - itemBaseColorBook = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Base Color" ), mBaseColorBook, KGlobalSettings::baseColor() ); - addItem( itemBaseColorBook, TQString::tqfromLatin1( "baseColorBook" ) ); + itemBaseColorBook = new KConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Template Base Color" ), mBaseColorBook, KGlobalSettings::baseColor() ); + addItem( itemBaseColorBook, TQString::fromLatin1( "baseColorBook" ) ); KConfigSkeleton::ItemColor *itemTextColorBook; - itemTextColorBook = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Text Color" ), mTextColorBook, KGlobalSettings::textColor() ); - addItem( itemTextColorBook, TQString::tqfromLatin1( "textColorBook" ) ); + itemTextColorBook = new KConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Template Text Color" ), mTextColorBook, KGlobalSettings::textColor() ); + addItem( itemTextColorBook, TQString::fromLatin1( "textColorBook" ) ); KConfigSkeleton::ItemColor *itemHighlightedBaseColorBook; - itemHighlightedBaseColorBook = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Highlight Color" ), mHighlightedBaseColorBook, KGlobalSettings::highlightColor() ); - addItem( itemHighlightedBaseColorBook, TQString::tqfromLatin1( "highlightedBaseColorBook" ) ); + itemHighlightedBaseColorBook = new KConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Template Highlight Color" ), mHighlightedBaseColorBook, KGlobalSettings::highlightColor() ); + addItem( itemHighlightedBaseColorBook, TQString::fromLatin1( "highlightedBaseColorBook" ) ); KConfigSkeleton::ItemColor *itemHighlightedTextColorBook; - itemHighlightedTextColorBook = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Highlighted Text Color" ), mHighlightedTextColorBook, KGlobalSettings::highlightedTextColor() ); - addItem( itemHighlightedTextColorBook, TQString::tqfromLatin1( "highlightedTextColorBook" ) ); + itemHighlightedTextColorBook = new KConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Template Highlighted Text Color" ), mHighlightedTextColorBook, KGlobalSettings::highlightedTextColor() ); + addItem( itemHighlightedTextColorBook, TQString::fromLatin1( "highlightedTextColorBook" ) ); - setCurrentGroup( TQString::tqfromLatin1( "Options - video" ) ); + setCurrentGroup( TQString::fromLatin1( "Options - video" ) ); KConfigSkeleton::ItemString *itemTemplateVideo; - itemTemplateVideo = new KConfigSkeleton::ItemString( currentGroup(), TQString::tqfromLatin1( "Entry Template" ), mTemplateVideo, TQString::tqfromLatin1( "Video" ) ); - addItem( itemTemplateVideo, TQString::tqfromLatin1( "templateVideo" ) ); + itemTemplateVideo = new KConfigSkeleton::ItemString( currentGroup(), TQString::fromLatin1( "Entry Template" ), mTemplateVideo, TQString::fromLatin1( "Video" ) ); + addItem( itemTemplateVideo, TQString::fromLatin1( "templateVideo" ) ); KConfigSkeleton::ItemFont *itemFontVideo; - itemFontVideo = new KConfigSkeleton::ItemFont( currentGroup(), TQString::tqfromLatin1( "Template Font" ), mFontVideo, KGlobalSettings::generalFont() ); - addItem( itemFontVideo, TQString::tqfromLatin1( "fontVideo" ) ); + itemFontVideo = new KConfigSkeleton::ItemFont( currentGroup(), TQString::fromLatin1( "Template Font" ), mFontVideo, KGlobalSettings::generalFont() ); + addItem( itemFontVideo, TQString::fromLatin1( "fontVideo" ) ); KConfigSkeleton::ItemColor *itemBaseColorVideo; - itemBaseColorVideo = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Base Color" ), mBaseColorVideo, KGlobalSettings::baseColor() ); - addItem( itemBaseColorVideo, TQString::tqfromLatin1( "baseColorVideo" ) ); + itemBaseColorVideo = new KConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Template Base Color" ), mBaseColorVideo, KGlobalSettings::baseColor() ); + addItem( itemBaseColorVideo, TQString::fromLatin1( "baseColorVideo" ) ); KConfigSkeleton::ItemColor *itemTextColorVideo; - itemTextColorVideo = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Text Color" ), mTextColorVideo, KGlobalSettings::textColor() ); - addItem( itemTextColorVideo, TQString::tqfromLatin1( "textColorVideo" ) ); + itemTextColorVideo = new KConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Template Text Color" ), mTextColorVideo, KGlobalSettings::textColor() ); + addItem( itemTextColorVideo, TQString::fromLatin1( "textColorVideo" ) ); KConfigSkeleton::ItemColor *itemHighlightedBaseColorVideo; - itemHighlightedBaseColorVideo = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Highlight Color" ), mHighlightedBaseColorVideo, KGlobalSettings::highlightColor() ); - addItem( itemHighlightedBaseColorVideo, TQString::tqfromLatin1( "highlightedBaseColorVideo" ) ); + itemHighlightedBaseColorVideo = new KConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Template Highlight Color" ), mHighlightedBaseColorVideo, KGlobalSettings::highlightColor() ); + addItem( itemHighlightedBaseColorVideo, TQString::fromLatin1( "highlightedBaseColorVideo" ) ); KConfigSkeleton::ItemColor *itemHighlightedTextColorVideo; - itemHighlightedTextColorVideo = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Highlighted Text Color" ), mHighlightedTextColorVideo, KGlobalSettings::highlightedTextColor() ); - addItem( itemHighlightedTextColorVideo, TQString::tqfromLatin1( "highlightedTextColorVideo" ) ); + itemHighlightedTextColorVideo = new KConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Template Highlighted Text Color" ), mHighlightedTextColorVideo, KGlobalSettings::highlightedTextColor() ); + addItem( itemHighlightedTextColorVideo, TQString::fromLatin1( "highlightedTextColorVideo" ) ); - setCurrentGroup( TQString::tqfromLatin1( "Options - album" ) ); + setCurrentGroup( TQString::fromLatin1( "Options - album" ) ); KConfigSkeleton::ItemString *itemTemplateAlbum; - itemTemplateAlbum = new KConfigSkeleton::ItemString( currentGroup(), TQString::tqfromLatin1( "Entry Template" ), mTemplateAlbum, TQString::tqfromLatin1( "Album" ) ); - addItem( itemTemplateAlbum, TQString::tqfromLatin1( "templateAlbum" ) ); + itemTemplateAlbum = new KConfigSkeleton::ItemString( currentGroup(), TQString::fromLatin1( "Entry Template" ), mTemplateAlbum, TQString::fromLatin1( "Album" ) ); + addItem( itemTemplateAlbum, TQString::fromLatin1( "templateAlbum" ) ); KConfigSkeleton::ItemFont *itemFontAlbum; - itemFontAlbum = new KConfigSkeleton::ItemFont( currentGroup(), TQString::tqfromLatin1( "Template Font" ), mFontAlbum, KGlobalSettings::generalFont() ); - addItem( itemFontAlbum, TQString::tqfromLatin1( "fontAlbum" ) ); + itemFontAlbum = new KConfigSkeleton::ItemFont( currentGroup(), TQString::fromLatin1( "Template Font" ), mFontAlbum, KGlobalSettings::generalFont() ); + addItem( itemFontAlbum, TQString::fromLatin1( "fontAlbum" ) ); KConfigSkeleton::ItemColor *itemBaseColorAlbum; - itemBaseColorAlbum = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Base Color" ), mBaseColorAlbum, KGlobalSettings::baseColor() ); - addItem( itemBaseColorAlbum, TQString::tqfromLatin1( "baseColorAlbum" ) ); + itemBaseColorAlbum = new KConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Template Base Color" ), mBaseColorAlbum, KGlobalSettings::baseColor() ); + addItem( itemBaseColorAlbum, TQString::fromLatin1( "baseColorAlbum" ) ); KConfigSkeleton::ItemColor *itemTextColorAlbum; - itemTextColorAlbum = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Text Color" ), mTextColorAlbum, KGlobalSettings::textColor() ); - addItem( itemTextColorAlbum, TQString::tqfromLatin1( "textColorAlbum" ) ); + itemTextColorAlbum = new KConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Template Text Color" ), mTextColorAlbum, KGlobalSettings::textColor() ); + addItem( itemTextColorAlbum, TQString::fromLatin1( "textColorAlbum" ) ); KConfigSkeleton::ItemColor *itemHighlightedBaseColorAlbum; - itemHighlightedBaseColorAlbum = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Highlight Color" ), mHighlightedBaseColorAlbum, KGlobalSettings::highlightColor() ); - addItem( itemHighlightedBaseColorAlbum, TQString::tqfromLatin1( "highlightedBaseColorAlbum" ) ); + itemHighlightedBaseColorAlbum = new KConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Template Highlight Color" ), mHighlightedBaseColorAlbum, KGlobalSettings::highlightColor() ); + addItem( itemHighlightedBaseColorAlbum, TQString::fromLatin1( "highlightedBaseColorAlbum" ) ); KConfigSkeleton::ItemColor *itemHighlightedTextColorAlbum; - itemHighlightedTextColorAlbum = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Highlighted Text Color" ), mHighlightedTextColorAlbum, KGlobalSettings::highlightedTextColor() ); - addItem( itemHighlightedTextColorAlbum, TQString::tqfromLatin1( "highlightedTextColorAlbum" ) ); + itemHighlightedTextColorAlbum = new KConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Template Highlighted Text Color" ), mHighlightedTextColorAlbum, KGlobalSettings::highlightedTextColor() ); + addItem( itemHighlightedTextColorAlbum, TQString::fromLatin1( "highlightedTextColorAlbum" ) ); - setCurrentGroup( TQString::tqfromLatin1( "Options - bibtex" ) ); + setCurrentGroup( TQString::fromLatin1( "Options - bibtex" ) ); KConfigSkeleton::ItemPath *itemLyxpipe; - itemLyxpipe = new KConfigSkeleton::ItemPath( currentGroup(), TQString::tqfromLatin1( "lyxpipe" ), mLyxpipe, TQString::tqfromLatin1( "$HOME/.lyx/lyxpipe" ) ); - addItem( itemLyxpipe, TQString::tqfromLatin1( "lyxpipe" ) ); + itemLyxpipe = new KConfigSkeleton::ItemPath( currentGroup(), TQString::fromLatin1( "lyxpipe" ), mLyxpipe, TQString::fromLatin1( "$HOME/.lyx/lyxpipe" ) ); + addItem( itemLyxpipe, TQString::fromLatin1( "lyxpipe" ) ); KConfigSkeleton::ItemString *itemTemplateBibtex; - itemTemplateBibtex = new KConfigSkeleton::ItemString( currentGroup(), TQString::tqfromLatin1( "Entry Template" ), mTemplateBibtex, TQString::tqfromLatin1( "Fancy" ) ); - addItem( itemTemplateBibtex, TQString::tqfromLatin1( "templateBibtex" ) ); + itemTemplateBibtex = new KConfigSkeleton::ItemString( currentGroup(), TQString::fromLatin1( "Entry Template" ), mTemplateBibtex, TQString::fromLatin1( "Fancy" ) ); + addItem( itemTemplateBibtex, TQString::fromLatin1( "templateBibtex" ) ); KConfigSkeleton::ItemFont *itemFontBibtex; - itemFontBibtex = new KConfigSkeleton::ItemFont( currentGroup(), TQString::tqfromLatin1( "Template Font" ), mFontBibtex, KGlobalSettings::generalFont() ); - addItem( itemFontBibtex, TQString::tqfromLatin1( "fontBibtex" ) ); + itemFontBibtex = new KConfigSkeleton::ItemFont( currentGroup(), TQString::fromLatin1( "Template Font" ), mFontBibtex, KGlobalSettings::generalFont() ); + addItem( itemFontBibtex, TQString::fromLatin1( "fontBibtex" ) ); KConfigSkeleton::ItemColor *itemBaseColorBibtex; - itemBaseColorBibtex = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Base Color" ), mBaseColorBibtex, KGlobalSettings::baseColor() ); - addItem( itemBaseColorBibtex, TQString::tqfromLatin1( "baseColorBibtex" ) ); + itemBaseColorBibtex = new KConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Template Base Color" ), mBaseColorBibtex, KGlobalSettings::baseColor() ); + addItem( itemBaseColorBibtex, TQString::fromLatin1( "baseColorBibtex" ) ); KConfigSkeleton::ItemColor *itemTextColorBibtex; - itemTextColorBibtex = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Text Color" ), mTextColorBibtex, KGlobalSettings::textColor() ); - addItem( itemTextColorBibtex, TQString::tqfromLatin1( "textColorBibtex" ) ); + itemTextColorBibtex = new KConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Template Text Color" ), mTextColorBibtex, KGlobalSettings::textColor() ); + addItem( itemTextColorBibtex, TQString::fromLatin1( "textColorBibtex" ) ); KConfigSkeleton::ItemColor *itemHighlightedBaseColorBibtex; - itemHighlightedBaseColorBibtex = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Highlight Color" ), mHighlightedBaseColorBibtex, KGlobalSettings::highlightColor() ); - addItem( itemHighlightedBaseColorBibtex, TQString::tqfromLatin1( "highlightedBaseColorBibtex" ) ); + itemHighlightedBaseColorBibtex = new KConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Template Highlight Color" ), mHighlightedBaseColorBibtex, KGlobalSettings::highlightColor() ); + addItem( itemHighlightedBaseColorBibtex, TQString::fromLatin1( "highlightedBaseColorBibtex" ) ); KConfigSkeleton::ItemColor *itemHighlightedTextColorBibtex; - itemHighlightedTextColorBibtex = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Highlighted Text Color" ), mHighlightedTextColorBibtex, KGlobalSettings::highlightedTextColor() ); - addItem( itemHighlightedTextColorBibtex, TQString::tqfromLatin1( "highlightedTextColorBibtex" ) ); + itemHighlightedTextColorBibtex = new KConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Template Highlighted Text Color" ), mHighlightedTextColorBibtex, KGlobalSettings::highlightedTextColor() ); + addItem( itemHighlightedTextColorBibtex, TQString::fromLatin1( "highlightedTextColorBibtex" ) ); - setCurrentGroup( TQString::tqfromLatin1( "Options - comic" ) ); + setCurrentGroup( TQString::fromLatin1( "Options - comic" ) ); KConfigSkeleton::ItemString *itemTemplateComicBook; - itemTemplateComicBook = new KConfigSkeleton::ItemString( currentGroup(), TQString::tqfromLatin1( "Entry Template" ), mTemplateComicBook, TQString::tqfromLatin1( "Fancy" ) ); - addItem( itemTemplateComicBook, TQString::tqfromLatin1( "templateComicBook" ) ); + itemTemplateComicBook = new KConfigSkeleton::ItemString( currentGroup(), TQString::fromLatin1( "Entry Template" ), mTemplateComicBook, TQString::fromLatin1( "Fancy" ) ); + addItem( itemTemplateComicBook, TQString::fromLatin1( "templateComicBook" ) ); KConfigSkeleton::ItemFont *itemFontComicBook; - itemFontComicBook = new KConfigSkeleton::ItemFont( currentGroup(), TQString::tqfromLatin1( "Template Font" ), mFontComicBook, KGlobalSettings::generalFont() ); - addItem( itemFontComicBook, TQString::tqfromLatin1( "fontComicBook" ) ); + itemFontComicBook = new KConfigSkeleton::ItemFont( currentGroup(), TQString::fromLatin1( "Template Font" ), mFontComicBook, KGlobalSettings::generalFont() ); + addItem( itemFontComicBook, TQString::fromLatin1( "fontComicBook" ) ); KConfigSkeleton::ItemColor *itemBaseColorComicBook; - itemBaseColorComicBook = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Base Color" ), mBaseColorComicBook, KGlobalSettings::baseColor() ); - addItem( itemBaseColorComicBook, TQString::tqfromLatin1( "baseColorComicBook" ) ); + itemBaseColorComicBook = new KConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Template Base Color" ), mBaseColorComicBook, KGlobalSettings::baseColor() ); + addItem( itemBaseColorComicBook, TQString::fromLatin1( "baseColorComicBook" ) ); KConfigSkeleton::ItemColor *itemTextColorComicBook; - itemTextColorComicBook = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Text Color" ), mTextColorComicBook, KGlobalSettings::textColor() ); - addItem( itemTextColorComicBook, TQString::tqfromLatin1( "textColorComicBook" ) ); + itemTextColorComicBook = new KConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Template Text Color" ), mTextColorComicBook, KGlobalSettings::textColor() ); + addItem( itemTextColorComicBook, TQString::fromLatin1( "textColorComicBook" ) ); KConfigSkeleton::ItemColor *itemHighlightedBaseColorComicBook; - itemHighlightedBaseColorComicBook = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Highlight Color" ), mHighlightedBaseColorComicBook, KGlobalSettings::highlightColor() ); - addItem( itemHighlightedBaseColorComicBook, TQString::tqfromLatin1( "highlightedBaseColorComicBook" ) ); + itemHighlightedBaseColorComicBook = new KConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Template Highlight Color" ), mHighlightedBaseColorComicBook, KGlobalSettings::highlightColor() ); + addItem( itemHighlightedBaseColorComicBook, TQString::fromLatin1( "highlightedBaseColorComicBook" ) ); KConfigSkeleton::ItemColor *itemHighlightedTextColorComicBook; - itemHighlightedTextColorComicBook = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Highlighted Text Color" ), mHighlightedTextColorComicBook, KGlobalSettings::highlightedTextColor() ); - addItem( itemHighlightedTextColorComicBook, TQString::tqfromLatin1( "highlightedTextColorComicBook" ) ); + itemHighlightedTextColorComicBook = new KConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Template Highlighted Text Color" ), mHighlightedTextColorComicBook, KGlobalSettings::highlightedTextColor() ); + addItem( itemHighlightedTextColorComicBook, TQString::fromLatin1( "highlightedTextColorComicBook" ) ); - setCurrentGroup( TQString::tqfromLatin1( "Options - wine" ) ); + setCurrentGroup( TQString::fromLatin1( "Options - wine" ) ); KConfigSkeleton::ItemString *itemTemplateWine; - itemTemplateWine = new KConfigSkeleton::ItemString( currentGroup(), TQString::tqfromLatin1( "Entry Template" ), mTemplateWine, TQString::tqfromLatin1( "Fancy" ) ); - addItem( itemTemplateWine, TQString::tqfromLatin1( "templateWine" ) ); + itemTemplateWine = new KConfigSkeleton::ItemString( currentGroup(), TQString::fromLatin1( "Entry Template" ), mTemplateWine, TQString::fromLatin1( "Fancy" ) ); + addItem( itemTemplateWine, TQString::fromLatin1( "templateWine" ) ); KConfigSkeleton::ItemFont *itemFontWine; - itemFontWine = new KConfigSkeleton::ItemFont( currentGroup(), TQString::tqfromLatin1( "Template Font" ), mFontWine, KGlobalSettings::generalFont() ); - addItem( itemFontWine, TQString::tqfromLatin1( "fontWine" ) ); + itemFontWine = new KConfigSkeleton::ItemFont( currentGroup(), TQString::fromLatin1( "Template Font" ), mFontWine, KGlobalSettings::generalFont() ); + addItem( itemFontWine, TQString::fromLatin1( "fontWine" ) ); KConfigSkeleton::ItemColor *itemBaseColorWine; - itemBaseColorWine = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Base Color" ), mBaseColorWine, KGlobalSettings::baseColor() ); - addItem( itemBaseColorWine, TQString::tqfromLatin1( "baseColorWine" ) ); + itemBaseColorWine = new KConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Template Base Color" ), mBaseColorWine, KGlobalSettings::baseColor() ); + addItem( itemBaseColorWine, TQString::fromLatin1( "baseColorWine" ) ); KConfigSkeleton::ItemColor *itemTextColorWine; - itemTextColorWine = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Text Color" ), mTextColorWine, KGlobalSettings::textColor() ); - addItem( itemTextColorWine, TQString::tqfromLatin1( "textColorWine" ) ); + itemTextColorWine = new KConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Template Text Color" ), mTextColorWine, KGlobalSettings::textColor() ); + addItem( itemTextColorWine, TQString::fromLatin1( "textColorWine" ) ); KConfigSkeleton::ItemColor *itemHighlightedBaseColorWine; - itemHighlightedBaseColorWine = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Highlight Color" ), mHighlightedBaseColorWine, KGlobalSettings::highlightColor() ); - addItem( itemHighlightedBaseColorWine, TQString::tqfromLatin1( "highlightedBaseColorWine" ) ); + itemHighlightedBaseColorWine = new KConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Template Highlight Color" ), mHighlightedBaseColorWine, KGlobalSettings::highlightColor() ); + addItem( itemHighlightedBaseColorWine, TQString::fromLatin1( "highlightedBaseColorWine" ) ); KConfigSkeleton::ItemColor *itemHighlightedTextColorWine; - itemHighlightedTextColorWine = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Highlighted Text Color" ), mHighlightedTextColorWine, KGlobalSettings::highlightedTextColor() ); - addItem( itemHighlightedTextColorWine, TQString::tqfromLatin1( "highlightedTextColorWine" ) ); + itemHighlightedTextColorWine = new KConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Template Highlighted Text Color" ), mHighlightedTextColorWine, KGlobalSettings::highlightedTextColor() ); + addItem( itemHighlightedTextColorWine, TQString::fromLatin1( "highlightedTextColorWine" ) ); - setCurrentGroup( TQString::tqfromLatin1( "Options - coin" ) ); + setCurrentGroup( TQString::fromLatin1( "Options - coin" ) ); KConfigSkeleton::ItemString *itemTemplateCoin; - itemTemplateCoin = new KConfigSkeleton::ItemString( currentGroup(), TQString::tqfromLatin1( "Entry Template" ), mTemplateCoin, TQString::tqfromLatin1( "Fancy" ) ); - addItem( itemTemplateCoin, TQString::tqfromLatin1( "templateCoin" ) ); + itemTemplateCoin = new KConfigSkeleton::ItemString( currentGroup(), TQString::fromLatin1( "Entry Template" ), mTemplateCoin, TQString::fromLatin1( "Fancy" ) ); + addItem( itemTemplateCoin, TQString::fromLatin1( "templateCoin" ) ); KConfigSkeleton::ItemFont *itemFontCoin; - itemFontCoin = new KConfigSkeleton::ItemFont( currentGroup(), TQString::tqfromLatin1( "Template Font" ), mFontCoin, KGlobalSettings::generalFont() ); - addItem( itemFontCoin, TQString::tqfromLatin1( "fontCoin" ) ); + itemFontCoin = new KConfigSkeleton::ItemFont( currentGroup(), TQString::fromLatin1( "Template Font" ), mFontCoin, KGlobalSettings::generalFont() ); + addItem( itemFontCoin, TQString::fromLatin1( "fontCoin" ) ); KConfigSkeleton::ItemColor *itemBaseColorCoin; - itemBaseColorCoin = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Base Color" ), mBaseColorCoin, KGlobalSettings::baseColor() ); - addItem( itemBaseColorCoin, TQString::tqfromLatin1( "baseColorCoin" ) ); + itemBaseColorCoin = new KConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Template Base Color" ), mBaseColorCoin, KGlobalSettings::baseColor() ); + addItem( itemBaseColorCoin, TQString::fromLatin1( "baseColorCoin" ) ); KConfigSkeleton::ItemColor *itemTextColorCoin; - itemTextColorCoin = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Text Color" ), mTextColorCoin, KGlobalSettings::textColor() ); - addItem( itemTextColorCoin, TQString::tqfromLatin1( "textColorCoin" ) ); + itemTextColorCoin = new KConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Template Text Color" ), mTextColorCoin, KGlobalSettings::textColor() ); + addItem( itemTextColorCoin, TQString::fromLatin1( "textColorCoin" ) ); KConfigSkeleton::ItemColor *itemHighlightedBaseColorCoin; - itemHighlightedBaseColorCoin = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Highlight Color" ), mHighlightedBaseColorCoin, KGlobalSettings::highlightColor() ); - addItem( itemHighlightedBaseColorCoin, TQString::tqfromLatin1( "highlightedBaseColorCoin" ) ); + itemHighlightedBaseColorCoin = new KConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Template Highlight Color" ), mHighlightedBaseColorCoin, KGlobalSettings::highlightColor() ); + addItem( itemHighlightedBaseColorCoin, TQString::fromLatin1( "highlightedBaseColorCoin" ) ); KConfigSkeleton::ItemColor *itemHighlightedTextColorCoin; - itemHighlightedTextColorCoin = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Highlighted Text Color" ), mHighlightedTextColorCoin, KGlobalSettings::highlightedTextColor() ); - addItem( itemHighlightedTextColorCoin, TQString::tqfromLatin1( "highlightedTextColorCoin" ) ); + itemHighlightedTextColorCoin = new KConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Template Highlighted Text Color" ), mHighlightedTextColorCoin, KGlobalSettings::highlightedTextColor() ); + addItem( itemHighlightedTextColorCoin, TQString::fromLatin1( "highlightedTextColorCoin" ) ); - setCurrentGroup( TQString::tqfromLatin1( "Options - stamp" ) ); + setCurrentGroup( TQString::fromLatin1( "Options - stamp" ) ); KConfigSkeleton::ItemString *itemTemplateStamp; - itemTemplateStamp = new KConfigSkeleton::ItemString( currentGroup(), TQString::tqfromLatin1( "Entry Template" ), mTemplateStamp, TQString::tqfromLatin1( "Fancy" ) ); - addItem( itemTemplateStamp, TQString::tqfromLatin1( "templateStamp" ) ); + itemTemplateStamp = new KConfigSkeleton::ItemString( currentGroup(), TQString::fromLatin1( "Entry Template" ), mTemplateStamp, TQString::fromLatin1( "Fancy" ) ); + addItem( itemTemplateStamp, TQString::fromLatin1( "templateStamp" ) ); KConfigSkeleton::ItemFont *itemFontStamp; - itemFontStamp = new KConfigSkeleton::ItemFont( currentGroup(), TQString::tqfromLatin1( "Template Font" ), mFontStamp, KGlobalSettings::generalFont() ); - addItem( itemFontStamp, TQString::tqfromLatin1( "fontStamp" ) ); + itemFontStamp = new KConfigSkeleton::ItemFont( currentGroup(), TQString::fromLatin1( "Template Font" ), mFontStamp, KGlobalSettings::generalFont() ); + addItem( itemFontStamp, TQString::fromLatin1( "fontStamp" ) ); KConfigSkeleton::ItemColor *itemBaseColorStamp; - itemBaseColorStamp = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Base Color" ), mBaseColorStamp, KGlobalSettings::baseColor() ); - addItem( itemBaseColorStamp, TQString::tqfromLatin1( "baseColorStamp" ) ); + itemBaseColorStamp = new KConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Template Base Color" ), mBaseColorStamp, KGlobalSettings::baseColor() ); + addItem( itemBaseColorStamp, TQString::fromLatin1( "baseColorStamp" ) ); KConfigSkeleton::ItemColor *itemTextColorStamp; - itemTextColorStamp = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Text Color" ), mTextColorStamp, KGlobalSettings::textColor() ); - addItem( itemTextColorStamp, TQString::tqfromLatin1( "textColorStamp" ) ); + itemTextColorStamp = new KConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Template Text Color" ), mTextColorStamp, KGlobalSettings::textColor() ); + addItem( itemTextColorStamp, TQString::fromLatin1( "textColorStamp" ) ); KConfigSkeleton::ItemColor *itemHighlightedBaseColorStamp; - itemHighlightedBaseColorStamp = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Highlight Color" ), mHighlightedBaseColorStamp, KGlobalSettings::highlightColor() ); - addItem( itemHighlightedBaseColorStamp, TQString::tqfromLatin1( "highlightedBaseColorStamp" ) ); + itemHighlightedBaseColorStamp = new KConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Template Highlight Color" ), mHighlightedBaseColorStamp, KGlobalSettings::highlightColor() ); + addItem( itemHighlightedBaseColorStamp, TQString::fromLatin1( "highlightedBaseColorStamp" ) ); KConfigSkeleton::ItemColor *itemHighlightedTextColorStamp; - itemHighlightedTextColorStamp = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Highlighted Text Color" ), mHighlightedTextColorStamp, KGlobalSettings::highlightedTextColor() ); - addItem( itemHighlightedTextColorStamp, TQString::tqfromLatin1( "highlightedTextColorStamp" ) ); + itemHighlightedTextColorStamp = new KConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Template Highlighted Text Color" ), mHighlightedTextColorStamp, KGlobalSettings::highlightedTextColor() ); + addItem( itemHighlightedTextColorStamp, TQString::fromLatin1( "highlightedTextColorStamp" ) ); - setCurrentGroup( TQString::tqfromLatin1( "Options - card" ) ); + setCurrentGroup( TQString::fromLatin1( "Options - card" ) ); KConfigSkeleton::ItemString *itemTemplateCard; - itemTemplateCard = new KConfigSkeleton::ItemString( currentGroup(), TQString::tqfromLatin1( "Entry Template" ), mTemplateCard, TQString::tqfromLatin1( "Fancy" ) ); - addItem( itemTemplateCard, TQString::tqfromLatin1( "templateCard" ) ); + itemTemplateCard = new KConfigSkeleton::ItemString( currentGroup(), TQString::fromLatin1( "Entry Template" ), mTemplateCard, TQString::fromLatin1( "Fancy" ) ); + addItem( itemTemplateCard, TQString::fromLatin1( "templateCard" ) ); KConfigSkeleton::ItemFont *itemFontCard; - itemFontCard = new KConfigSkeleton::ItemFont( currentGroup(), TQString::tqfromLatin1( "Template Font" ), mFontCard, KGlobalSettings::generalFont() ); - addItem( itemFontCard, TQString::tqfromLatin1( "fontCard" ) ); + itemFontCard = new KConfigSkeleton::ItemFont( currentGroup(), TQString::fromLatin1( "Template Font" ), mFontCard, KGlobalSettings::generalFont() ); + addItem( itemFontCard, TQString::fromLatin1( "fontCard" ) ); KConfigSkeleton::ItemColor *itemBaseColorCard; - itemBaseColorCard = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Base Color" ), mBaseColorCard, KGlobalSettings::baseColor() ); - addItem( itemBaseColorCard, TQString::tqfromLatin1( "baseColorCard" ) ); + itemBaseColorCard = new KConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Template Base Color" ), mBaseColorCard, KGlobalSettings::baseColor() ); + addItem( itemBaseColorCard, TQString::fromLatin1( "baseColorCard" ) ); KConfigSkeleton::ItemColor *itemTextColorCard; - itemTextColorCard = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Text Color" ), mTextColorCard, KGlobalSettings::textColor() ); - addItem( itemTextColorCard, TQString::tqfromLatin1( "textColorCard" ) ); + itemTextColorCard = new KConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Template Text Color" ), mTextColorCard, KGlobalSettings::textColor() ); + addItem( itemTextColorCard, TQString::fromLatin1( "textColorCard" ) ); KConfigSkeleton::ItemColor *itemHighlightedBaseColorCard; - itemHighlightedBaseColorCard = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Highlight Color" ), mHighlightedBaseColorCard, KGlobalSettings::highlightColor() ); - addItem( itemHighlightedBaseColorCard, TQString::tqfromLatin1( "highlightedBaseColorCard" ) ); + itemHighlightedBaseColorCard = new KConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Template Highlight Color" ), mHighlightedBaseColorCard, KGlobalSettings::highlightColor() ); + addItem( itemHighlightedBaseColorCard, TQString::fromLatin1( "highlightedBaseColorCard" ) ); KConfigSkeleton::ItemColor *itemHighlightedTextColorCard; - itemHighlightedTextColorCard = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Highlighted Text Color" ), mHighlightedTextColorCard, KGlobalSettings::highlightedTextColor() ); - addItem( itemHighlightedTextColorCard, TQString::tqfromLatin1( "highlightedTextColorCard" ) ); + itemHighlightedTextColorCard = new KConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Template Highlighted Text Color" ), mHighlightedTextColorCard, KGlobalSettings::highlightedTextColor() ); + addItem( itemHighlightedTextColorCard, TQString::fromLatin1( "highlightedTextColorCard" ) ); - setCurrentGroup( TQString::tqfromLatin1( "Options - game" ) ); + setCurrentGroup( TQString::fromLatin1( "Options - game" ) ); KConfigSkeleton::ItemString *itemTemplateGame; - itemTemplateGame = new KConfigSkeleton::ItemString( currentGroup(), TQString::tqfromLatin1( "Entry Template" ), mTemplateGame, TQString::tqfromLatin1( "Fancy" ) ); - addItem( itemTemplateGame, TQString::tqfromLatin1( "templateGame" ) ); + itemTemplateGame = new KConfigSkeleton::ItemString( currentGroup(), TQString::fromLatin1( "Entry Template" ), mTemplateGame, TQString::fromLatin1( "Fancy" ) ); + addItem( itemTemplateGame, TQString::fromLatin1( "templateGame" ) ); KConfigSkeleton::ItemFont *itemFontGame; - itemFontGame = new KConfigSkeleton::ItemFont( currentGroup(), TQString::tqfromLatin1( "Template Font" ), mFontGame, KGlobalSettings::generalFont() ); - addItem( itemFontGame, TQString::tqfromLatin1( "fontGame" ) ); + itemFontGame = new KConfigSkeleton::ItemFont( currentGroup(), TQString::fromLatin1( "Template Font" ), mFontGame, KGlobalSettings::generalFont() ); + addItem( itemFontGame, TQString::fromLatin1( "fontGame" ) ); KConfigSkeleton::ItemColor *itemBaseColorGame; - itemBaseColorGame = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Base Color" ), mBaseColorGame, KGlobalSettings::baseColor() ); - addItem( itemBaseColorGame, TQString::tqfromLatin1( "baseColorGame" ) ); + itemBaseColorGame = new KConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Template Base Color" ), mBaseColorGame, KGlobalSettings::baseColor() ); + addItem( itemBaseColorGame, TQString::fromLatin1( "baseColorGame" ) ); KConfigSkeleton::ItemColor *itemTextColorGame; - itemTextColorGame = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Text Color" ), mTextColorGame, KGlobalSettings::textColor() ); - addItem( itemTextColorGame, TQString::tqfromLatin1( "textColorGame" ) ); + itemTextColorGame = new KConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Template Text Color" ), mTextColorGame, KGlobalSettings::textColor() ); + addItem( itemTextColorGame, TQString::fromLatin1( "textColorGame" ) ); KConfigSkeleton::ItemColor *itemHighlightedBaseColorGame; - itemHighlightedBaseColorGame = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Highlight Color" ), mHighlightedBaseColorGame, KGlobalSettings::highlightColor() ); - addItem( itemHighlightedBaseColorGame, TQString::tqfromLatin1( "highlightedBaseColorGame" ) ); + itemHighlightedBaseColorGame = new KConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Template Highlight Color" ), mHighlightedBaseColorGame, KGlobalSettings::highlightColor() ); + addItem( itemHighlightedBaseColorGame, TQString::fromLatin1( "highlightedBaseColorGame" ) ); KConfigSkeleton::ItemColor *itemHighlightedTextColorGame; - itemHighlightedTextColorGame = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Highlighted Text Color" ), mHighlightedTextColorGame, KGlobalSettings::highlightedTextColor() ); - addItem( itemHighlightedTextColorGame, TQString::tqfromLatin1( "highlightedTextColorGame" ) ); + itemHighlightedTextColorGame = new KConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Template Highlighted Text Color" ), mHighlightedTextColorGame, KGlobalSettings::highlightedTextColor() ); + addItem( itemHighlightedTextColorGame, TQString::fromLatin1( "highlightedTextColorGame" ) ); - setCurrentGroup( TQString::tqfromLatin1( "Options - file" ) ); + setCurrentGroup( TQString::fromLatin1( "Options - file" ) ); KConfigSkeleton::ItemString *itemTemplateFile; - itemTemplateFile = new KConfigSkeleton::ItemString( currentGroup(), TQString::tqfromLatin1( "Entry Template" ), mTemplateFile, TQString::tqfromLatin1( "Fancy" ) ); - addItem( itemTemplateFile, TQString::tqfromLatin1( "templateFile" ) ); + itemTemplateFile = new KConfigSkeleton::ItemString( currentGroup(), TQString::fromLatin1( "Entry Template" ), mTemplateFile, TQString::fromLatin1( "Fancy" ) ); + addItem( itemTemplateFile, TQString::fromLatin1( "templateFile" ) ); KConfigSkeleton::ItemFont *itemFontFile; - itemFontFile = new KConfigSkeleton::ItemFont( currentGroup(), TQString::tqfromLatin1( "Template Font" ), mFontFile, KGlobalSettings::generalFont() ); - addItem( itemFontFile, TQString::tqfromLatin1( "fontFile" ) ); + itemFontFile = new KConfigSkeleton::ItemFont( currentGroup(), TQString::fromLatin1( "Template Font" ), mFontFile, KGlobalSettings::generalFont() ); + addItem( itemFontFile, TQString::fromLatin1( "fontFile" ) ); KConfigSkeleton::ItemColor *itemBaseColorFile; - itemBaseColorFile = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Base Color" ), mBaseColorFile, KGlobalSettings::baseColor() ); - addItem( itemBaseColorFile, TQString::tqfromLatin1( "baseColorFile" ) ); + itemBaseColorFile = new KConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Template Base Color" ), mBaseColorFile, KGlobalSettings::baseColor() ); + addItem( itemBaseColorFile, TQString::fromLatin1( "baseColorFile" ) ); KConfigSkeleton::ItemColor *itemTextColorFile; - itemTextColorFile = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Text Color" ), mTextColorFile, KGlobalSettings::textColor() ); - addItem( itemTextColorFile, TQString::tqfromLatin1( "textColorFile" ) ); + itemTextColorFile = new KConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Template Text Color" ), mTextColorFile, KGlobalSettings::textColor() ); + addItem( itemTextColorFile, TQString::fromLatin1( "textColorFile" ) ); KConfigSkeleton::ItemColor *itemHighlightedBaseColorFile; - itemHighlightedBaseColorFile = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Highlight Color" ), mHighlightedBaseColorFile, KGlobalSettings::highlightColor() ); - addItem( itemHighlightedBaseColorFile, TQString::tqfromLatin1( "highlightedBaseColorFile" ) ); + itemHighlightedBaseColorFile = new KConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Template Highlight Color" ), mHighlightedBaseColorFile, KGlobalSettings::highlightColor() ); + addItem( itemHighlightedBaseColorFile, TQString::fromLatin1( "highlightedBaseColorFile" ) ); KConfigSkeleton::ItemColor *itemHighlightedTextColorFile; - itemHighlightedTextColorFile = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Highlighted Text Color" ), mHighlightedTextColorFile, KGlobalSettings::highlightedTextColor() ); - addItem( itemHighlightedTextColorFile, TQString::tqfromLatin1( "highlightedTextColorFile" ) ); + itemHighlightedTextColorFile = new KConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Template Highlighted Text Color" ), mHighlightedTextColorFile, KGlobalSettings::highlightedTextColor() ); + addItem( itemHighlightedTextColorFile, TQString::fromLatin1( "highlightedTextColorFile" ) ); - setCurrentGroup( TQString::tqfromLatin1( "Options - boardgame" ) ); + setCurrentGroup( TQString::fromLatin1( "Options - boardgame" ) ); KConfigSkeleton::ItemString *itemTemplateBoardGame; - itemTemplateBoardGame = new KConfigSkeleton::ItemString( currentGroup(), TQString::tqfromLatin1( "Entry Template" ), mTemplateBoardGame, TQString::tqfromLatin1( "Fancy" ) ); - addItem( itemTemplateBoardGame, TQString::tqfromLatin1( "templateBoardGame" ) ); + itemTemplateBoardGame = new KConfigSkeleton::ItemString( currentGroup(), TQString::fromLatin1( "Entry Template" ), mTemplateBoardGame, TQString::fromLatin1( "Fancy" ) ); + addItem( itemTemplateBoardGame, TQString::fromLatin1( "templateBoardGame" ) ); KConfigSkeleton::ItemFont *itemFontBoardGame; - itemFontBoardGame = new KConfigSkeleton::ItemFont( currentGroup(), TQString::tqfromLatin1( "Template Font" ), mFontBoardGame, KGlobalSettings::generalFont() ); - addItem( itemFontBoardGame, TQString::tqfromLatin1( "fontBoardGame" ) ); + itemFontBoardGame = new KConfigSkeleton::ItemFont( currentGroup(), TQString::fromLatin1( "Template Font" ), mFontBoardGame, KGlobalSettings::generalFont() ); + addItem( itemFontBoardGame, TQString::fromLatin1( "fontBoardGame" ) ); KConfigSkeleton::ItemColor *itemBaseColorBoardGame; - itemBaseColorBoardGame = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Base Color" ), mBaseColorBoardGame, KGlobalSettings::baseColor() ); - addItem( itemBaseColorBoardGame, TQString::tqfromLatin1( "baseColorBoardGame" ) ); + itemBaseColorBoardGame = new KConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Template Base Color" ), mBaseColorBoardGame, KGlobalSettings::baseColor() ); + addItem( itemBaseColorBoardGame, TQString::fromLatin1( "baseColorBoardGame" ) ); KConfigSkeleton::ItemColor *itemTextColorBoardGame; - itemTextColorBoardGame = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Text Color" ), mTextColorBoardGame, KGlobalSettings::textColor() ); - addItem( itemTextColorBoardGame, TQString::tqfromLatin1( "textColorBoardGame" ) ); + itemTextColorBoardGame = new KConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Template Text Color" ), mTextColorBoardGame, KGlobalSettings::textColor() ); + addItem( itemTextColorBoardGame, TQString::fromLatin1( "textColorBoardGame" ) ); KConfigSkeleton::ItemColor *itemHighlightedBaseColorBoardGame; - itemHighlightedBaseColorBoardGame = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Highlight Color" ), mHighlightedBaseColorBoardGame, KGlobalSettings::highlightColor() ); - addItem( itemHighlightedBaseColorBoardGame, TQString::tqfromLatin1( "highlightedBaseColorBoardGame" ) ); + itemHighlightedBaseColorBoardGame = new KConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Template Highlight Color" ), mHighlightedBaseColorBoardGame, KGlobalSettings::highlightColor() ); + addItem( itemHighlightedBaseColorBoardGame, TQString::fromLatin1( "highlightedBaseColorBoardGame" ) ); KConfigSkeleton::ItemColor *itemHighlightedTextColorBoardGame; - itemHighlightedTextColorBoardGame = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Highlighted Text Color" ), mHighlightedTextColorBoardGame, KGlobalSettings::highlightedTextColor() ); - addItem( itemHighlightedTextColorBoardGame, TQString::tqfromLatin1( "highlightedTextColorBoardGame" ) ); + itemHighlightedTextColorBoardGame = new KConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Template Highlighted Text Color" ), mHighlightedTextColorBoardGame, KGlobalSettings::highlightedTextColor() ); + addItem( itemHighlightedTextColorBoardGame, TQString::fromLatin1( "highlightedTextColorBoardGame" ) ); - setCurrentGroup( TQString::tqfromLatin1( "Options - entry" ) ); + setCurrentGroup( TQString::fromLatin1( "Options - entry" ) ); KConfigSkeleton::ItemString *itemTemplateBase; - itemTemplateBase = new KConfigSkeleton::ItemString( currentGroup(), TQString::tqfromLatin1( "Entry Template" ), mTemplateBase, TQString::tqfromLatin1( "Fancy" ) ); - addItem( itemTemplateBase, TQString::tqfromLatin1( "templateBase" ) ); + itemTemplateBase = new KConfigSkeleton::ItemString( currentGroup(), TQString::fromLatin1( "Entry Template" ), mTemplateBase, TQString::fromLatin1( "Fancy" ) ); + addItem( itemTemplateBase, TQString::fromLatin1( "templateBase" ) ); KConfigSkeleton::ItemFont *itemFontBase; - itemFontBase = new KConfigSkeleton::ItemFont( currentGroup(), TQString::tqfromLatin1( "Template Font" ), mFontBase, KGlobalSettings::generalFont() ); - addItem( itemFontBase, TQString::tqfromLatin1( "fontBase" ) ); + itemFontBase = new KConfigSkeleton::ItemFont( currentGroup(), TQString::fromLatin1( "Template Font" ), mFontBase, KGlobalSettings::generalFont() ); + addItem( itemFontBase, TQString::fromLatin1( "fontBase" ) ); KConfigSkeleton::ItemColor *itemBaseColorBase; - itemBaseColorBase = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Base Color" ), mBaseColorBase, KGlobalSettings::baseColor() ); - addItem( itemBaseColorBase, TQString::tqfromLatin1( "baseColorBase" ) ); + itemBaseColorBase = new KConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Template Base Color" ), mBaseColorBase, KGlobalSettings::baseColor() ); + addItem( itemBaseColorBase, TQString::fromLatin1( "baseColorBase" ) ); KConfigSkeleton::ItemColor *itemTextColorBase; - itemTextColorBase = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Text Color" ), mTextColorBase, KGlobalSettings::textColor() ); - addItem( itemTextColorBase, TQString::tqfromLatin1( "textColorBase" ) ); + itemTextColorBase = new KConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Template Text Color" ), mTextColorBase, KGlobalSettings::textColor() ); + addItem( itemTextColorBase, TQString::fromLatin1( "textColorBase" ) ); KConfigSkeleton::ItemColor *itemHighlightedBaseColorBase; - itemHighlightedBaseColorBase = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Highlight Color" ), mHighlightedBaseColorBase, KGlobalSettings::highlightColor() ); - addItem( itemHighlightedBaseColorBase, TQString::tqfromLatin1( "highlightedBaseColorBase" ) ); + itemHighlightedBaseColorBase = new KConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Template Highlight Color" ), mHighlightedBaseColorBase, KGlobalSettings::highlightColor() ); + addItem( itemHighlightedBaseColorBase, TQString::fromLatin1( "highlightedBaseColorBase" ) ); KConfigSkeleton::ItemColor *itemHighlightedTextColorBase; - itemHighlightedTextColorBase = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Highlighted Text Color" ), mHighlightedTextColorBase, KGlobalSettings::highlightedTextColor() ); - addItem( itemHighlightedTextColorBase, TQString::tqfromLatin1( "highlightedTextColorBase" ) ); + itemHighlightedTextColorBase = new KConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Template Highlighted Text Color" ), mHighlightedTextColorBase, KGlobalSettings::highlightedTextColor() ); + addItem( itemHighlightedTextColorBase, TQString::fromLatin1( "highlightedTextColorBase" ) ); } Config::~Config() diff --git a/src/core/tellico_config_addons.cpp b/src/core/tellico_config_addons.cpp index e4e7260..49890ef 100644 --- a/src/core/tellico_config_addons.cpp +++ b/src/core/tellico_config_addons.cpp @@ -54,7 +54,7 @@ SET(name, BoardGame, value) namespace { - static const TQRegExp commaSplit = TQRegExp(TQString::tqfromLatin1("\\s*,\\s*")); + static const TQRegExp commaSplit = TQRegExp(TQString::fromLatin1("\\s*,\\s*")); } using Tellico::Config; diff --git a/src/detailedentryitem.cpp b/src/detailedentryitem.cpp index 51455a1..bd2c565 100644 --- a/src/detailedentryitem.cpp +++ b/src/detailedentryitem.cpp @@ -116,8 +116,8 @@ TQColor DetailedEntryItem::backgroundColor(int column_) { if(t > ENTRY_MAX_MINUTES_MESSAGE) { return EntryItem::backgroundColor(column_); } - return blendColors(lv->tqcolorGroup().highlight(), - lv->tqcolorGroup().base(), + return blendColors(lv->colorGroup().highlight(), + lv->colorGroup().base(), 80 + 20*t/ENTRY_MAX_MINUTES_MESSAGE /* percent */); // no more than 20% of highlight color } diff --git a/src/detailedlistview.cpp b/src/detailedlistview.cpp index 93b6894..716f5df 100644 --- a/src/detailedlistview.cpp +++ b/src/detailedlistview.cpp @@ -68,7 +68,7 @@ DetailedListView::DetailedListView(TQWidget* parent_, const char* name_/*=0*/) connect(m_headerMenu, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotHeaderMenuActivated(int))); - m_checkPix = UserIcon(TQString::tqfromLatin1("checkmark")); + m_checkPix = UserIcon(TQString::fromLatin1("checkmark")); } DetailedListView::~DetailedListView() { @@ -82,15 +82,15 @@ void DetailedListView::addCollection(Data::CollPtr coll_) { m_imageColumns.clear(); // myDebug() << "DetailedListView::addCollection()" << endl; - KConfigGroup config(kapp->config(), TQString::tqfromLatin1("Options - %1").tqarg(coll_->typeName())); + KConfigGroup config(kapp->config(), TQString::fromLatin1("Options - %1").arg(coll_->typeName())); TQString configN; if(coll_->type() == Data::Collection::Base) { KURL url = Kernel::self()->URL(); for(uint i = 0; i < Config::maxCustomURLSettings(); ++i) { - KURL u = config.readEntry(TQString::tqfromLatin1("URL_%1").tqarg(i)); + KURL u = config.readEntry(TQString::fromLatin1("URL_%1").arg(i)); if(u == url) { - configN = TQString::tqfromLatin1("_%1").tqarg(i); + configN = TQString::fromLatin1("_%1").arg(i); break; } } @@ -98,11 +98,11 @@ void DetailedListView::addCollection(Data::CollPtr coll_) { TQStringList colNames = config.readListEntry("ColumnNames" + configN); if(colNames.isEmpty()) { - colNames = TQString::tqfromLatin1("title"); + colNames = TQString::fromLatin1("title"); } // this block compensates for the chance that the user added a field and it wasn't - // written to the widths. Also compensates for 0.5.x to 0.6.x column tqlayout changes + // written to the widths. Also compensates for 0.5.x to 0.6.x column layout changes TQValueList<int> colWidths = config.readIntListEntry("ColumnWidths" + configN); if(colWidths.empty()) { colWidths.insert(colWidths.begin(), colNames.count(), -1); // automatic width @@ -747,16 +747,16 @@ void DetailedListView::slotUpdatePixmap() { } void DetailedListView::saveConfig(Tellico::Data::CollPtr coll_, int configIndex_) { - KConfigGroup config(kapp->config(), TQString::tqfromLatin1("Options - %1").tqarg(coll_->typeName())); + KConfigGroup config(kapp->config(), TQString::fromLatin1("Options - %1").arg(coll_->typeName())); // all of this is to have custom settings on a per file basis TQString configN; if(coll_->type() == Data::Collection::Base) { TQValueList<ConfigInfo> info; for(uint i = 0; i < Config::maxCustomURLSettings(); ++i) { - KURL u = config.readEntry(TQString::tqfromLatin1("URL_%1").tqarg(i)); + KURL u = config.readEntry(TQString::fromLatin1("URL_%1").arg(i)); if(!u.isEmpty() && static_cast<int>(i) != configIndex_) { - configN = TQString::tqfromLatin1("_%1").tqarg(i); + configN = TQString::fromLatin1("_%1").arg(i); ConfigInfo ci; ci.cols = config.readListEntry("ColumnNames" + configN); ci.widths = config.readIntListEntry("ColumnWidths" + configN); @@ -772,7 +772,7 @@ void DetailedListView::saveConfig(Tellico::Data::CollPtr coll_, int configIndex_ uint limit = TQMIN(info.count(), Config::maxCustomURLSettings()-1); for(uint i = 0; i < limit; ++i) { // starts at one since the current config will be written below - configN = TQString::tqfromLatin1("_%1").tqarg(i+1); + configN = TQString::fromLatin1("_%1").arg(i+1); config.writeEntry("ColumnNames" + configN, info[i].cols); config.writeEntry("ColumnWidths" + configN, info[i].widths); config.writeEntry("ColumnOrder" + configN, info[i].order); @@ -781,7 +781,7 @@ void DetailedListView::saveConfig(Tellico::Data::CollPtr coll_, int configIndex_ config.writeEntry("PrevSortColumn" + configN, info[i].prevSort); config.writeEntry("Prev2SortColumn" + configN, info[i].prev2Sort); } - configN = TQString::tqfromLatin1("_0"); + configN = TQString::fromLatin1("_0"); } TQValueList<int> widths, order; @@ -855,7 +855,7 @@ void DetailedListView::selectAllVisible() { slotSelectionChanged(); } -void DetailedListView::resetEntrytqStatus() { +void DetailedListView::resetEntryStatus() { for(TQListViewItemIterator it(this); it.current(); ++it) { static_cast<DetailedEntryItem*>(it.current())->setState(DetailedEntryItem::Normal); } diff --git a/src/detailedlistview.h b/src/detailedlistview.h index a5f718d..758936b 100644 --- a/src/detailedlistview.h +++ b/src/detailedlistview.h @@ -121,7 +121,7 @@ public: * @param height Height */ void setPixmapSize(int width, int height) { m_pixWidth = width; m_pixHeight = height; } - void resetEntrytqStatus(); + void resetEntryStatus(); virtual int compare(int col, const GUI::ListViewItem* item1, GUI::ListViewItem* item2, bool asc); diff --git a/src/document.cpp b/src/document.cpp index 178b9e8..bbe426f 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -398,7 +398,7 @@ void Document::unMergeCollection(CollPtr coll_, FieldVec origFields_, MergePair m_coll->removeEntries(entries); // second item in pair are the entries which got modified by the original merge command - const TQString track = TQString::tqfromLatin1("track"); + const TQString track = TQString::fromLatin1("track"); PairVector trackChanges = entryPair_.second; // need to go through them in reverse since one entry may have been modified multiple times // first item in the pair is the entry pointer @@ -464,14 +464,14 @@ void Document::checkOutEntry(Data::EntryPtr entry_) { return; } - const TQString loaned = TQString::tqfromLatin1("loaned"); + const TQString loaned = TQString::fromLatin1("loaned"); if(!m_coll->hasField(loaned)) { FieldPtr f = new Field(loaned, i18n("Loaned"), Field::Bool); f->setFlags(Field::AllowGrouped); f->setCategory(i18n("Personal")); m_coll->addField(f); } - entry_->setField(loaned, TQString::tqfromLatin1("true")); + entry_->setField(loaned, TQString::fromLatin1("true")); EntryVec vec; vec.append(entry_); m_coll->updateDicts(vec); @@ -482,7 +482,7 @@ void Document::checkInEntry(Data::EntryPtr entry_) { return; } - const TQString loaned = TQString::tqfromLatin1("loaned"); + const TQString loaned = TQString::fromLatin1("loaned"); if(!m_coll->hasField(loaned)) { return; } diff --git a/src/entry.cpp b/src/entry.cpp index 136fb49..801a9a4 100644 --- a/src/entry.cpp +++ b/src/entry.cpp @@ -48,16 +48,16 @@ bool Entry::operator==(const Entry& e1) { e1.m_coll && e1.m_coll->type() == Collection::File) { // don't forget case where both could have empty urls // but different values for other fields - TQString u = field(TQString::tqfromLatin1("url")); + TQString u = field(TQString::fromLatin1("url")); if(!u.isEmpty()) { // versions before 1.2.7 could have saved the url without the protocol - bool b = KURL::fromPathOrURL(u) == KURL::fromPathOrURL(e1.field(TQString::tqfromLatin1("url"))); + bool b = KURL::fromPathOrURL(u) == KURL::fromPathOrURL(e1.field(TQString::fromLatin1("url"))); if(b) { return true; } else { - Data::FieldPtr f = m_coll->fieldByName(TQString::tqfromLatin1("url")); - if(f && f->property(TQString::tqfromLatin1("relative")) == Latin1Literal("true")) { - return KURL(Document::self()->URL(), u) == KURL::fromPathOrURL(e1.field(TQString::tqfromLatin1("url"))); + Data::FieldPtr f = m_coll->fieldByName(TQString::fromLatin1("url")); + if(f && f->property(TQString::fromLatin1("relative")) == Latin1Literal("true")) { + return KURL(Document::self()->URL(), u) == KURL::fromPathOrURL(e1.field(TQString::fromLatin1("url"))); } } } @@ -125,17 +125,17 @@ void Entry::setCollection(CollPtr coll_) { // it would be better to do this in a real OOO way, but this should work const bool addEntryType = m_coll->type() == Collection::Book && coll_->type() == Collection::Bibtex && - !m_coll->hasField(TQString::tqfromLatin1("entry-type")); + !m_coll->hasField(TQString::fromLatin1("entry-type")); m_coll = coll_; m_id = -1; // set this after changing the m_coll pointer since setField() checks field validity if(addEntryType) { - setField(TQString::tqfromLatin1("entry-type"), TQString::tqfromLatin1("book")); + setField(TQString::fromLatin1("entry-type"), TQString::fromLatin1("book")); } } TQString Entry::title() const { - return formattedField(TQString::tqfromLatin1("title")); + return formattedField(TQString::fromLatin1("title")); } TQString Entry::field(Data::FieldPtr field_, bool formatted_/*=false*/) const { @@ -317,7 +317,7 @@ TQStringList Entry::groupNamesByFieldName(const TQString& fieldName_) const { // only use first column for group TQStringList::Iterator it = groups.begin(); while(it != groups.end()) { - (*it) = (*it).section(TQString::tqfromLatin1("::"), 0, 0); + (*it) = (*it).section(TQString::fromLatin1("::"), 0, 0); if((*it).isEmpty()) { it = groups.remove(it); // points to next in list } else { @@ -332,7 +332,7 @@ bool Entry::isOwned() { return (m_coll && m_id > -1 && m_coll->entryCount() > 0 && m_coll->entries().contains(this)); } -// a null string means tqinvalidate all +// a null string means invalidate all void Entry::invalidateFormattedFieldValue(const TQString& name_) { if(name_.isNull()) { m_formattedFields.clear(); @@ -423,7 +423,7 @@ int Entry::compareValues(EntryPtr e1, EntryPtr e2, FieldPtr f) { } } // try removing punctuation - TQRegExp notAlphaNum(TQString::tqfromLatin1("[^\\s\\w]")); + TQRegExp notAlphaNum(TQString::fromLatin1("[^\\s\\w]")); TQString s1a = s1; s1a.remove(notAlphaNum); TQString s2a = s2; s2a.remove(notAlphaNum); if(!s1a.isEmpty() && s1a == s2a) { @@ -437,7 +437,7 @@ int Entry::compareValues(EntryPtr e1, EntryPtr e2, FieldPtr f) { return 3; } // try removing everything between parentheses - TQRegExp rx(TQString::tqfromLatin1("\\s*\\(.*\\)\\s*")); + TQRegExp rx(TQString::fromLatin1("\\s*\\(.*\\)\\s*")); s1.remove(rx); s2.remove(rx); if(!s1.isEmpty() && s1 == s2) { diff --git a/src/entry.h b/src/entry.h index c4cbc8b..1c62593 100644 --- a/src/entry.h +++ b/src/entry.h @@ -211,7 +211,7 @@ public: * Removes the formatted value of the field from the map. This should be used when * the field's format flag has changed. * - * @param name The name of the field that changed. TQString() means tqinvalidate all fields. + * @param name The name of the field that changed. TQString() means invalidate all fields. */ void invalidateFormattedFieldValue(const TQString& name=TQString()); diff --git a/src/entryeditdialog.cpp b/src/entryeditdialog.cpp index 70b2288..8956163 100644 --- a/src/entryeditdialog.cpp +++ b/src/entryeditdialog.cpp @@ -30,7 +30,7 @@ #include <kpushbutton.h> #include <kaccel.h> -#include <tqlayout.h> +#include <layout.h> #include <tqstringlist.h> #include <tqpushbutton.h> #include <tqvaluevector.h> @@ -73,12 +73,12 @@ EntryEditDialog::EntryEditDialog(TQWidget* parent_, const char* name_) connect(this, TQT_SIGNAL(user3Clicked()), TQT_SLOT(slotGoPrevEntry())); KGuiItem prev; - prev.setIconName(TQString::tqfromLatin1(TQApplication::reverseLayout() ? "forward" : "back")); + prev.setIconName(TQString::fromLatin1(TQApplication::reverseLayout() ? "forward" : "back")); prev.setToolTip(i18n("Go to the previous entry in the collection")); prev.setWhatsThis(prev.toolTip()); KGuiItem next; - next.setIconName(TQString::tqfromLatin1(TQApplication::reverseLayout() ? "back" : "forward")); + next.setIconName(TQString::fromLatin1(TQApplication::reverseLayout() ? "back" : "forward")); next.setToolTip(i18n("Go to the next entry in the collection")); next.setWhatsThis(next.toolTip()); @@ -86,14 +86,14 @@ EntryEditDialog::EntryEditDialog(TQWidget* parent_, const char* name_) setButtonGuiItem(m_prevBtn, prev); KAccel* accel = new KAccel(this); - accel->insert(TQString::tqfromLatin1("Go Prev"), TQString(), prev.toolTip(), TQt::Key_PageUp, + accel->insert(TQString::fromLatin1("Go Prev"), TQString(), prev.toolTip(), TQt::Key_PageUp, Controller::self(), TQT_SLOT(slotGoPrevEntry())); - accel->insert(TQString::tqfromLatin1("Go Next"), TQString(), next.toolTip(), TQt::Key_PageDown, + accel->insert(TQString::fromLatin1("Go Next"), TQString(), next.toolTip(), TQt::Key_PageDown, Controller::self(), TQT_SLOT(slotGoNextEntry())); - setHelp(TQString::tqfromLatin1("entry-editor")); + setHelp(TQString::fromLatin1("entry-editor")); - resize(configDialogSize(TQString::tqfromLatin1("Edit Dialog Options"))); + resize(configDialogSize(TQString::fromLatin1("Edit Dialog Options"))); } void EntryEditDialog::slotClose() { @@ -153,7 +153,7 @@ void EntryEditDialog::setLayout(Data::CollPtr coll_) { continue; } - // if this tqlayout model is changed, be sure to check slotUpdateField() + // if this layout model is changed, be sure to check slotUpdateField() TQWidget* page = new TQWidget(m_tabs); // (parent, margin, spacing) TQVBoxLayout* boxLayout = new TQVBoxLayout(page, 0, 0); @@ -163,10 +163,10 @@ void EntryEditDialog::setLayout(Data::CollPtr coll_) { // (parent, nrows, ncols, margin, spacing) // spacing gets a bit weird, if there are absolutely no Choice fields, // then spacing should be 5, which is set later - TQGridLayout* tqlayout = new TQGridLayout(grid, 0, NCOLS, 8, 2); + TQGridLayout* layout = new TQGridLayout(grid, 0, NCOLS, 8, 2); // keramik styles make big widget, cut down the spacing a bit if(TQCString(tqstyle().name()).lower().find("keramik", 0, false) > -1) { - tqlayout->setSpacing(0); + layout->setSpacing(0); } boxLayout->addWidget(grid, 0); @@ -202,8 +202,8 @@ void EntryEditDialog::setLayout(Data::CollPtr coll_) { int r = count/NCOLS; int c = count%NCOLS; - tqlayout->addWidget(widget, r, c); - tqlayout->setRowStretch(r, 1); + layout->addWidget(widget, r, c); + layout->setRowStretch(r, 1); m_widgetDict.insert(TQString::number(m_currColl->id()) + field->name(), widget); @@ -213,7 +213,7 @@ void EntryEditDialog::setLayout(Data::CollPtr coll_) { } widget->updateGeometry(); if(!field->isSingleCategory()) { - maxHeight = TQMAX(maxHeight, widget->tqminimumSizeHint().height()); + maxHeight = TQMAX(maxHeight, widget->minimumSizeHint().height()); } ++count; } @@ -231,7 +231,7 @@ void EntryEditDialog::setLayout(Data::CollPtr coll_) { // update stretch factors for columns with a line edit for(int col = 0; col < NCOLS; ++col) { if(expands[col]) { - tqlayout->setColStretch(col, 1); + layout->setColStretch(col, 1); } } @@ -240,7 +240,7 @@ void EntryEditDialog::setLayout(Data::CollPtr coll_) { // Now, go through and set all the field widgets to the same height for(TQPtrListIterator<TQWidget> it(gridList); it.current(); ++it) { - TQGridLayout* l = static_cast<TQGridLayout*>(it.current()->tqlayout()); + TQGridLayout* l = static_cast<TQGridLayout*>(it.current()->layout()); if(noChoices) { l->setSpacing(5); } @@ -248,19 +248,19 @@ void EntryEditDialog::setLayout(Data::CollPtr coll_) { l->addRowSpacing(row, maxHeight); } // I don't want anything to be hidden, Keramik has a bug if I don't do this - it.current()->setMinimumHeight(it.current()->tqsizeHint().height()); + it.current()->setMinimumHeight(it.current()->sizeHint().height()); // the parent of the grid is the page that got added to the tabs - it.current()->parentWidget()->tqlayout()->tqinvalidate(); - it.current()->parentWidget()->setMinimumHeight(it.current()->parentWidget()->tqsizeHint().height()); + it.current()->parentWidget()->layout()->invalidate(); + it.current()->parentWidget()->setMinimumHeight(it.current()->parentWidget()->sizeHint().height()); } setUpdatesEnabled(true); // this doesn't seem to work -// tqsetSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::Minimum); +// setSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::Minimum); // so do this instead - tqlayout()->tqinvalidate(); // needed so the tqsizeHint() gets recalculated - m_tabs->setMinimumHeight(m_tabs->tqminimumSizeHint().height()); - m_tabs->setMinimumWidth(m_tabs->tqsizeHint().width()); + layout()->invalidate(); // needed so the sizeHint() gets recalculated + m_tabs->setMinimumHeight(m_tabs->minimumSizeHint().height()); + m_tabs->setMinimumWidth(m_tabs->sizeHint().width()); // update keyboard accels // only want to manage tabBar() @@ -313,7 +313,7 @@ void EntryEditDialog::slotHandleSave() { names += entry->title(); } TQString str(i18n("Do you really want to modify these entries?")); - TQString dontAsk = TQString::tqfromLatin1("SaveMultipleBooks"); // don't change 'books', invisible anyway + TQString dontAsk = TQString::fromLatin1("SaveMultipleBooks"); // don't change 'books', invisible anyway int ret = KMessageBox::questionYesNoList(this, str, names, i18n("Modify Multiple Entries"), KStdGuiItem::yes(), KStdGuiItem::no(), dontAsk); if(ret != KMessageBox::Yes) { @@ -345,7 +345,7 @@ void EntryEditDialog::slotHandleSave() { } entry->setField(fIt, temp); if(temp.isEmpty()) { - TQString prop = fIt->property(TQString::tqfromLatin1("required")).lower(); + TQString prop = fIt->property(TQString::fromLatin1("required")).lower(); if(prop == Latin1Literal("1") || prop == Latin1Literal("true")) { fieldsRequiringValues.append(fIt.data()); } @@ -361,7 +361,7 @@ void EntryEditDialog::slotHandleSave() { for(Data::FieldVecIt it = fieldsRequiringValues.begin(); it != fieldsRequiringValues.end(); ++it) { titles << it->title(); } - TQString dontAsk = TQString::tqfromLatin1("SaveWithoutRequired"); + TQString dontAsk = TQString::fromLatin1("SaveWithoutRequired"); int ret = KMessageBox::questionYesNoList(this, str, titles, i18n("Modify Entries"), KStdGuiItem::yes(), KStdGuiItem::no(), dontAsk); if(ret != KMessageBox::Yes) { @@ -379,7 +379,7 @@ void EntryEditDialog::slotHandleSave() { Kernel::self()->modifyEntries(oldEntries, m_currEntries); } if(!m_currEntries.isEmpty() && !m_currEntries[0]->title().isEmpty()) { - setCaption(i18n("Edit Entry") + TQString::tqfromLatin1(" - ") + m_currEntries[0]->title()); + setCaption(i18n("Edit Entry") + TQString::fromLatin1(" - ") + m_currEntries[0]->title()); } } @@ -509,7 +509,7 @@ void EntryEditDialog::setContents(Data::EntryPtr entry_) { m_currEntries.append(entry_); if(!entry_->title().isEmpty()) { - setCaption(i18n("Edit Entry") + TQString::tqfromLatin1(" - ") + entry_->title()); + setCaption(i18n("Edit Entry") + TQString::fromLatin1(" - ") + entry_->title()); } if(m_currColl != entry_->collection()) { @@ -566,8 +566,8 @@ void EntryEditDialog::removeField(Data::CollPtr, Data::FieldPtr field_) { delete w; // automatically deletes child widget } else { // much of this replicates code in setLayout() - TQGridLayout* tqlayout = static_cast<TQGridLayout*>(widget->parentWidget()->tqlayout()); - delete widget; // automatically removes from tqlayout + TQGridLayout* layout = static_cast<TQGridLayout*>(widget->parentWidget()->layout()); + delete widget; // automatically removes from layout TQValueVector<bool> expands(NCOLS, false); TQValueVector<int> maxWidth(NCOLS, 0); @@ -577,8 +577,8 @@ void EntryEditDialog::removeField(Data::CollPtr, Data::FieldPtr field_) { for(int count = 0; it != vec.end(); ++it) { GUI::FieldWidget* widget = m_widgetDict.find(TQString::number(m_currColl->id()) + it->name()); if(widget) { - tqlayout->remove(widget); - tqlayout->addWidget(widget, count/NCOLS, count%NCOLS); + layout->remove(widget); + layout->addWidget(widget, count/NCOLS, count%NCOLS); maxWidth[count%NCOLS] = TQMAX(maxWidth[count%NCOLS], widget->labelWidth()); if(widget->expands()) { @@ -602,7 +602,7 @@ void EntryEditDialog::removeField(Data::CollPtr, Data::FieldPtr field_) { // update stretch factors for columns with a line edit for(int col = 0; col < NCOLS; ++col) { if(expands[col]) { - tqlayout->setColStretch(col, 1); + layout->setColStretch(col, 1); } } } @@ -687,7 +687,7 @@ void EntryEditDialog::modifyField(Data::CollPtr coll_, Data::FieldPtr oldField_, m_currColl = coll_; } - // if the field type changed, go ahead and redo the whole tqlayout + // if the field type changed, go ahead and redo the whole layout // also if the category changed for a non-single field, since a new tab must be created if(oldField_->type() != newField_->type() || (oldField_->category() != newField_->category() && !newField_->isSingleCategory())) { diff --git a/src/entryeditdialog.h b/src/entryeditdialog.h index e645b81..20731f6 100644 --- a/src/entryeditdialog.h +++ b/src/entryeditdialog.h @@ -49,9 +49,9 @@ public: */ bool queryModified(); /** - * Deletes and resets the tqlayout of the tabs. + * Deletes and resets the layout of the tabs. * - * @param coll A pointer to the collection whose fields should be used for setting up the tqlayout + * @param coll A pointer to the collection whose fields should be used for setting up the layout */ void setLayout(Data::CollPtr coll); /** diff --git a/src/entrygroupitem.cpp b/src/entrygroupitem.cpp index c6a36ab..c94fa53 100644 --- a/src/entrygroupitem.cpp +++ b/src/entrygroupitem.cpp @@ -44,7 +44,7 @@ TQPixmap EntryGroupItem::ratingPixmap() { } TQPixmap newPix(m_pix.width() + 4 + stars.width(), TQMAX(m_pix.height(), stars.height())); - newPix.fill(isSelected() ? listView()->tqcolorGroup().highlight() : backgroundColor(0)); + newPix.fill(isSelected() ? listView()->colorGroup().highlight() : backgroundColor(0)); TQPainter p(&newPix); if(!m_pix.isNull()) { p.drawPixmap(0, 0, m_pix); @@ -74,7 +74,7 @@ void EntryGroupItem::paintCell(TQPainter* p_, const TQColorGroup& cg_, return; } - setText(column_, TQString::tqfromLatin1("\t\t")); + setText(column_, TQString::fromLatin1("\t\t")); GUI::CountedItem::setPixmap(column_, ratingPixmap()); GUI::CountedItem::paintCell(p_, cg_, column_, width_, align_); // GUI::CountedItem::setPixmap(column_, m_pix); @@ -109,14 +109,14 @@ TQString EntryGroupItem::key(int col_, bool) const { ++it) { tokens += (*it); if(!(*it).endsWith(TQChar('\''))) { - tokens += TQString::tqfromLatin1("\\s"); + tokens += TQString::fromLatin1("\\s"); } // if it's not the last item, add a pipe if((*it) != prefixes.last()) { tokens += TQChar('|'); } } - TQRegExp rx(TQString::tqfromLatin1("^(") + tokens + TQChar(')'), false); + TQRegExp rx(TQString::fromLatin1("^(") + tokens + TQChar(')'), false); // expensive if(rx.search(m_text) > -1) { m_key = m_text.mid(rx.matchedLength()); diff --git a/src/entryiconfactory.cpp b/src/entryiconfactory.cpp index 776b324..a01d982 100644 --- a/src/entryiconfactory.cpp +++ b/src/entryiconfactory.cpp @@ -34,7 +34,7 @@ TQPixmap* EntryIconFactory::createPixmap(const TQIconSet&, TQIconSet::Size, TQIc return new TQPixmap(entryPix); } - TQPixmap newPix = BarIcon(TQString::tqfromLatin1("mime_empty"), m_size); + TQPixmap newPix = BarIcon(TQString::fromLatin1("mime_empty"), m_size); TQImage newImg = newPix.convertToImage(); // TQImage blend; Not exactly sure what the coordinates mean, but this seems to work ok. KImageEffect::blendOnLower(m_size/4, m_size/4, entryPix.convertToImage(), newImg); diff --git a/src/entryiconview.cpp b/src/entryiconview.cpp index 105a0b4..a067a01 100644 --- a/src/entryiconview.cpp +++ b/src/entryiconview.cpp @@ -98,11 +98,11 @@ const TQPixmap& EntryIconView::defaultPixmap() { return *pix; } KIconLoader* loader = KGlobal::instance()->iconLoader(); - TQPixmap tmp = loader->loadIcon(TQString::tqfromLatin1("nocover_") + CollectionFactory::typeName(m_coll->type()), + TQPixmap tmp = loader->loadIcon(TQString::fromLatin1("nocover_") + CollectionFactory::typeName(m_coll->type()), KIcon::User, 0, KIcon::DefaultState, 0, true /*canReturnNull */); if(tmp.isNull()) { myLog() << "EntryIconView::defaultPixmap() - null nocover image, loading tellico.png" << endl; - tmp = UserIcon(TQString::tqfromLatin1("tellico")); + tmp = UserIcon(TQString::fromLatin1("tellico")); } if(TQMAX(tmp.width(), tmp.height()) > static_cast<int>(MIN_ENTRY_ICON_SIZE)) { tmp.convertFromImage(tmp.convertToImage().smoothScale(m_maxIconWidth, m_maxIconHeight, TQ_ScaleMin)); diff --git a/src/entryitem.h b/src/entryitem.h index 667f12e..74c95cd 100644 --- a/src/entryitem.h +++ b/src/entryitem.h @@ -34,7 +34,7 @@ namespace Tellico { class EntryItem : public GUI::ListViewItem { public: /** - * This constructor is for items which are direct tqchildren of a ListView object, + * This constructor is for items which are direct children of a ListView object, * which is just the @ref DetailedListView. * * @param parent A pointer to the parent diff --git a/src/entrymerger.cpp b/src/entrymerger.cpp index 073d32f..abe4998 100644 --- a/src/entrymerger.cpp +++ b/src/entrymerger.cpp @@ -47,9 +47,9 @@ EntryMerger::EntryMerger(Data::EntryVec entries_, TQObject* parent_) void EntryMerger::slotStartNext() { TQString statusMsg = i18n("Total merged/scanned entries: %1/%2") - .tqarg(m_entriesToRemove.count()) - .tqarg(m_origCount - m_entriesToCheck.count()); - StatusBar::self()->settqStatus(statusMsg); + .arg(m_entriesToRemove.count()) + .arg(m_origCount - m_entriesToCheck.count()); + StatusBar::self()->setStatus(statusMsg); ProgressManager::self()->setProgress(this, m_origCount - m_entriesToCheck.count()); Data::EntryPtr baseEntry = m_entriesToCheck.front(); @@ -85,7 +85,7 @@ void EntryMerger::slotCancel() { void EntryMerger::slotCleanup() { Kernel::self()->removeEntries(m_entriesToRemove); Controller::self()->slotUpdateSelection(0, m_entriesLeft); - StatusBar::self()->cleartqStatus(); + StatusBar::self()->clearStatus(); ProgressManager::self()->setDone(this); Kernel::self()->endCommandGroup(); deleteLater(); diff --git a/src/entryupdater.cpp b/src/entryupdater.cpp index 10e2297..bf7bfa2 100644 --- a/src/entryupdater.cpp +++ b/src/entryupdater.cpp @@ -78,7 +78,7 @@ void EntryUpdater::init() { m_origEntryCount = m_entriesToUpdate.count(); TQString label; if(m_entriesToUpdate.count() == 1) { - label = i18n("Updating %1...").tqarg(m_entriesToUpdate.front()->title()); + label = i18n("Updating %1...").arg(m_entriesToUpdate.front()->title()); } else { label = i18n("Updating entries..."); } @@ -96,7 +96,7 @@ void EntryUpdater::init() { } void EntryUpdater::slotStartNext() { - StatusBar::self()->settqStatus(i18n("Updating <b>%1</b>...").tqarg(m_entriesToUpdate.front()->title())); + StatusBar::self()->setStatus(i18n("Updating <b>%1</b>...").arg(m_entriesToUpdate.front()->title())); ProgressManager::self()->setProgress(this, m_fetchers.count() * (m_origEntryCount - m_entriesToUpdate.count()) + m_fetchIndex); Fetch::Fetcher::Ptr f = m_fetchers[m_fetchIndex]; @@ -213,11 +213,11 @@ Tellico::EntryUpdater::UpdateResult EntryUpdater::askUser(ResultList results) { TQHBox* hbox = new TQHBox(box); hbox->setSpacing(10); TQLabel* icon = new TQLabel(hbox); - icon->setPixmap(KGlobal::iconLoader()->loadIcon(TQString::tqfromLatin1("network"), KIcon::Panel, 64)); + icon->setPixmap(KGlobal::iconLoader()->loadIcon(TQString::fromLatin1("network"), KIcon::Panel, 64)); TQString s = i18n("<qt><b>%1</b> returned multiple results which could match <b>%2</b>, " "the entry currently in the collection. Please select the correct match.</qt>") - .tqarg(m_fetchers[m_fetchIndex]->source()) - .tqarg(m_entriesToUpdate.front()->field(TQString::tqfromLatin1("title"))); + .arg(m_fetchers[m_fetchIndex]->source()) + .arg(m_entriesToUpdate.front()->field(TQString::fromLatin1("title"))); GUI::RichTextLabel* l = new GUI::RichTextLabel(s, hbox); hbox->setStretchFactor(l, 100); @@ -264,7 +264,7 @@ void EntryUpdater::mergeCurrent(Data::EntryPtr entry_, bool overWrite_) { } void EntryUpdater::slotCleanup() { - StatusBar::self()->cleartqStatus(); + StatusBar::self()->clearStatus(); ProgressManager::self()->setDone(this); Kernel::self()->endCommandGroup(); deleteLater(); diff --git a/src/entryview.cpp b/src/entryview.cpp index 0539754..3499adc 100644 --- a/src/entryview.cpp +++ b/src/entryview.cpp @@ -46,7 +46,7 @@ EntryView::EntryView(TQWidget* parent_, const char* name_) : KHTMLPart(parent_, setJavaEnabled(false); setMetaRefreshEnabled(false); setPluginsEnabled(false); - clear(); // needed for initial tqlayout + clear(); // needed for initial layout view()->setAcceptDrops(true); DropHandler* drophandler = new DropHandler(this); @@ -76,7 +76,7 @@ void EntryView::clear() { write(m_textToShow); } end(); - view()->tqlayout(); // I need this because some of the margins and widths may get messed up + view()->layout(); // I need this because some of the margins and widths may get messed up } void EntryView::showEntry(Data::EntryPtr entry_) { @@ -121,7 +121,7 @@ void EntryView::showEntry(Data::EntryPtr entry_) { // myDebug() << dom.toString() << endl; #if 0 kdWarning() << "EntryView::showEntry() - turn me off!" << endl; - TQFile f1(TQString::tqfromLatin1("/tmp/test.xml")); + TQFile f1(TQString::fromLatin1("/tmp/test.xml")); if(f1.open(IO_WriteOnly)) { TQTextStream t(&f1); t << dom.toString(); @@ -146,7 +146,7 @@ void EntryView::showEntry(Data::EntryPtr entry_) { #if 0 kdWarning() << "EntryView::showEntry() - turn me off!" << endl; - TQFile f2(TQString::tqfromLatin1("/tmp/test.html")); + TQFile f2(TQString::fromLatin1("/tmp/test.html")); if(f2.open(IO_WriteOnly)) { TQTextStream t(&f2); t << html; @@ -158,7 +158,7 @@ void EntryView::showEntry(Data::EntryPtr entry_) { write(html); end(); // not need anymore? - view()->tqlayout(); // I need this because some of the margins and widths may get messed up + view()->layout(); // I need this because some of the margins and widths may get messed up } void EntryView::showText(const TQString& text_) { @@ -174,19 +174,19 @@ void EntryView::setXSLTFile(const TQString& file_) { if(file_.at(0) == '/') { m_xsltFile = file_; } else { - const TQString templateDir = TQString::tqfromLatin1("entry-templates/"); + const TQString templateDir = TQString::fromLatin1("entry-templates/"); m_xsltFile = locate("appdata", templateDir + file_); if(m_xsltFile.isEmpty()) { if(!file_.isEmpty()) { kdWarning() << "EntryView::setXSLTFile() - can't locate " << file_ << endl; } - m_xsltFile = locate("appdata", templateDir + TQString::tqfromLatin1("Fancy.xsl")); + m_xsltFile = locate("appdata", templateDir + TQString::fromLatin1("Fancy.xsl")); if(m_xsltFile.isEmpty()) { - TQString str = TQString::tqfromLatin1("<qt>"); + TQString str = TQString::fromLatin1("<qt>"); str += i18n("Tellico is unable to locate the default entry stylesheet."); str += TQChar(' '); str += i18n("Please check your installation."); - str += TQString::tqfromLatin1("</qt>"); + str += TQString::fromLatin1("</qt>"); KMessageBox::error(view(), str); clear(); return; @@ -244,7 +244,7 @@ void EntryView::setXSLTFile(const TQString& file_) { } // look for a file that gets installed to know the installation directory - TQString appdir = KGlobal::dirs()->findResourceDir("appdata", TQString::tqfromLatin1("pics/tellico.png")); + TQString appdir = KGlobal::dirs()->findResourceDir("appdata", TQString::fromLatin1("pics/tellico.png")); m_handler->addStringParam("datadir", TQFile::encodeName(appdir)); // if we don't have to reload the images, then just show the entry and we're done @@ -260,7 +260,7 @@ void EntryView::setXSLTFile(const TQString& file_) { void EntryView::slotRefresh() { setXSLTFile(m_xsltFile); showEntry(m_entry); - view()->tqrepaint(); + view()->repaint(); } // do some contortions in case the url is relative @@ -340,10 +340,10 @@ void EntryView::resetColors() { // this is a rather bad hack to get around the fact that the image cache is not reloaded when // the gradient files are changed on disk. Setting the URLArgs for write() calls doesn't seem to - // work. So force a reload with a temp file, then catch the completed signal and tqrepaint - TQString s = TQString::tqfromLatin1("<html><body><img src=\"%1\"><img src=\"%2\"></body></html>") - .tqarg(dir + TQString::tqfromLatin1("gradient_bg.png")) - .tqarg(dir + TQString::tqfromLatin1("gradient_header.png")); + // work. So force a reload with a temp file, then catch the completed signal and repaint + TQString s = TQString::fromLatin1("<html><body><img src=\"%1\"><img src=\"%2\"></body></html>") + .arg(dir + TQString::fromLatin1("gradient_bg.png")) + .arg(dir + TQString::fromLatin1("gradient_header.png")); delete m_tempFile; m_tempFile = new KTempFile; diff --git a/src/exportdialog.cpp b/src/exportdialog.cpp index bfa8da7..82e1947 100644 --- a/src/exportdialog.cpp +++ b/src/exportdialog.cpp @@ -35,12 +35,12 @@ #include <kglobal.h> #include <kconfig.h> -#include <tqlayout.h> +#include <layout.h> #include <tqcheckbox.h> #include <tqbuttongroup.h> #include <tqradiobutton.h> #include <tqwhatsthis.h> -#include <tqtextcodec.h> +#include <textcodec.h> using Tellico::ExportDialog; @@ -66,8 +66,8 @@ ExportDialog::ExportDialog(Export::Format format_, Data::CollPtr coll_, TQWidget m_encodeUTF8 = new TQRadioButton(i18n("Encode in Unicode (UTF-8)"), bg); m_encodeUTF8->setChecked(true); TQWhatsThis::add(m_encodeUTF8, i18n("Encode the exported file in Unicode (UTF-8).")); - TQString localStr = i18n("Encode in user locale (%1)").tqarg( - TQString::tqfromLatin1(TQTextCodec::codecForLocale()->name())); + TQString localStr = i18n("Encode in user locale (%1)").arg( + TQString::fromLatin1(TQTextCodec::codecForLocale()->name())); m_encodeLocale = new TQRadioButton(localStr, bg); TQWhatsThis::add(m_encodeLocale, i18n("Encode the exported file in the local encoding.")); diff --git a/src/fetch/amazonfetcher.cpp b/src/fetch/amazonfetcher.cpp index e5f50b8..9484581 100644 --- a/src/fetch/amazonfetcher.cpp +++ b/src/fetch/amazonfetcher.cpp @@ -37,12 +37,12 @@ #include <kaccelmanager.h> #include <tqdom.h> -#include <tqlayout.h> +#include <layout.h> #include <tqlabel.h> #include <tqwhatsthis.h> #include <tqcheckbox.h> #include <tqfile.h> -#include <tqtextcodec.h> +#include <textcodec.h> namespace { static const int AMAZON_RETURNS_PER_REQUEST = 10; @@ -84,8 +84,8 @@ const AmazonFetcher::SiteData& AmazonFetcher::siteData(int site_) { AmazonFetcher::AmazonFetcher(Site site_, TQObject* parent_, const char* name_) : Fetcher(parent_, name_), m_xsltHandler(0), m_site(site_), m_imageSize(MediumImage), - m_access(TQString::tqfromLatin1(AMAZON_ACCESS_KEY)), - m_assoc(TQString::tqfromLatin1(AMAZON_ASSOC_TOKEN)), m_addLinkField(true), m_limit(AMAZON_MAX_RETURNS_TOTAL), + m_access(TQString::fromLatin1(AMAZON_ACCESS_KEY)), + m_assoc(TQString::fromLatin1(AMAZON_ASSOC_TOKEN)), m_addLinkField(true), m_limit(AMAZON_MAX_RETURNS_TOTAL), m_countOffset(0), m_page(1), m_total(-1), m_numResults(0), m_job(0), m_started(false) { m_name = siteData(site_).title; } @@ -125,7 +125,7 @@ void AmazonFetcher::readConfigHook(const KConfigGroup& config_) { if(imageSize > -1) { m_imageSize = static_cast<ImageSize>(imageSize); } - m_fields = config_.readListEntry("Custom Fields", TQString::tqfromLatin1("keyword")); + m_fields = config_.readListEntry("Custom Fields", TQString::fromLatin1("keyword")); } void AmazonFetcher::search(FetchKey key_, const TQString& value_) { @@ -153,34 +153,34 @@ void AmazonFetcher::doSearch() { const SiteData& data = siteData(m_site); KURL u = data.url; - u.addQueryItem(TQString::tqfromLatin1("Service"), TQString::tqfromLatin1("AWSECommerceService")); - u.addQueryItem(TQString::tqfromLatin1("AssociateTag"), m_assoc); - u.addQueryItem(TQString::tqfromLatin1("AWSAccessKeyId"), m_access); - u.addQueryItem(TQString::tqfromLatin1("Operation"), TQString::tqfromLatin1("ItemSearch")); - u.addQueryItem(TQString::tqfromLatin1("ResponseGroup"), TQString::tqfromLatin1("Large")); - u.addQueryItem(TQString::tqfromLatin1("ItemPage"), TQString::number(m_page)); - u.addQueryItem(TQString::tqfromLatin1("Version"), TQString::tqfromLatin1("2007-10-29")); + u.addQueryItem(TQString::fromLatin1("Service"), TQString::fromLatin1("AWSECommerceService")); + u.addQueryItem(TQString::fromLatin1("AssociateTag"), m_assoc); + u.addQueryItem(TQString::fromLatin1("AWSAccessKeyId"), m_access); + u.addQueryItem(TQString::fromLatin1("Operation"), TQString::fromLatin1("ItemSearch")); + u.addQueryItem(TQString::fromLatin1("ResponseGroup"), TQString::fromLatin1("Large")); + u.addQueryItem(TQString::fromLatin1("ItemPage"), TQString::number(m_page)); + u.addQueryItem(TQString::fromLatin1("Version"), TQString::fromLatin1("2007-10-29")); const int type = Kernel::self()->collectionType(); switch(type) { case Data::Collection::Book: case Data::Collection::ComicBook: case Data::Collection::Bibtex: - u.addQueryItem(TQString::tqfromLatin1("SearchIndex"), TQString::tqfromLatin1("Books")); - u.addQueryItem(TQString::tqfromLatin1("SortIndex"), TQString::tqfromLatin1("relevancerank")); + u.addQueryItem(TQString::fromLatin1("SearchIndex"), TQString::fromLatin1("Books")); + u.addQueryItem(TQString::fromLatin1("SortIndex"), TQString::fromLatin1("relevancerank")); break; case Data::Collection::Album: - u.addQueryItem(TQString::tqfromLatin1("SearchIndex"), TQString::tqfromLatin1("Music")); + u.addQueryItem(TQString::fromLatin1("SearchIndex"), TQString::fromLatin1("Music")); break; case Data::Collection::Video: - u.addQueryItem(TQString::tqfromLatin1("SearchIndex"), TQString::tqfromLatin1("Video")); - u.addQueryItem(TQString::tqfromLatin1("SortIndex"), TQString::tqfromLatin1("relevancerank")); + u.addQueryItem(TQString::fromLatin1("SearchIndex"), TQString::fromLatin1("Video")); + u.addQueryItem(TQString::fromLatin1("SortIndex"), TQString::fromLatin1("relevancerank")); break; case Data::Collection::Game: - u.addQueryItem(TQString::tqfromLatin1("SearchIndex"), TQString::tqfromLatin1("VideoGames")); + u.addQueryItem(TQString::fromLatin1("SearchIndex"), TQString::fromLatin1("VideoGames")); break; case Data::Collection::Coin: @@ -189,7 +189,7 @@ void AmazonFetcher::doSearch() { case Data::Collection::Base: case Data::Collection::Card: default: - message(i18n("%1 does not allow searching for this collection type.").tqarg(source()), MessageHandler::Warning); + message(i18n("%1 does not allow searching for this collection type.").arg(source()), MessageHandler::Warning); stop(); return; } @@ -207,40 +207,40 @@ void AmazonFetcher::doSearch() { switch(m_key) { case Title: - u.addQueryItem(TQString::tqfromLatin1("Title"), value, mib); + u.addQueryItem(TQString::fromLatin1("Title"), value, mib); break; case Person: if(type == Data::Collection::Video) { - u.addQueryItem(TQString::tqfromLatin1("Actor"), value, mib); - u.addQueryItem(TQString::tqfromLatin1("Director"), value, mib); + u.addQueryItem(TQString::fromLatin1("Actor"), value, mib); + u.addQueryItem(TQString::fromLatin1("Director"), value, mib); } else if(type == Data::Collection::Album) { - u.addQueryItem(TQString::tqfromLatin1("Artist"), value, mib); + u.addQueryItem(TQString::fromLatin1("Artist"), value, mib); } else if(type == Data::Collection::Game) { - u.addQueryItem(TQString::tqfromLatin1("Manufacturer"), value, mib); + u.addQueryItem(TQString::fromLatin1("Manufacturer"), value, mib); } else { // books and bibtex - TQString s = TQString::tqfromLatin1("author:%1 or publisher:%2").tqarg(value, value); -// u.addQueryItem(TQString::tqfromLatin1("Author"), value, mib); -// u.addQueryItem(TQString::tqfromLatin1("Publisher"), value, mib); - u.addQueryItem(TQString::tqfromLatin1("Power"), s, mib); + TQString s = TQString::fromLatin1("author:%1 or publisher:%2").arg(value, value); +// u.addQueryItem(TQString::fromLatin1("Author"), value, mib); +// u.addQueryItem(TQString::fromLatin1("Publisher"), value, mib); + u.addQueryItem(TQString::fromLatin1("Power"), s, mib); } break; case ISBN: { - u.removeQueryItem(TQString::tqfromLatin1("Operation")); - u.addQueryItem(TQString::tqfromLatin1("Operation"), TQString::tqfromLatin1("ItemLookup")); + u.removeQueryItem(TQString::fromLatin1("Operation")); + u.addQueryItem(TQString::fromLatin1("Operation"), TQString::fromLatin1("ItemLookup")); TQString s = m_value; // not encValue!!! s.remove('-'); // ISBN only get digits or 'X', and multiple values are connected with "; " - TQStringList isbns = TQStringList::split(TQString::tqfromLatin1("; "), s); + TQStringList isbns = TQStringList::split(TQString::fromLatin1("; "), s); // Amazon isbn13 search is still very flaky, so if possible, we're going to convert // all of them to isbn10. If we run into a 979 isbn13, then we're forced to do an // isbn13 search bool isbn13 = false; for(TQStringList::Iterator it = isbns.begin(); it != isbns.end(); ) { - if(m_value.startsWith(TQString::tqfromLatin1("979"))) { + if(m_value.startsWith(TQString::fromLatin1("979"))) { if(m_site == JP) { // never works for JP kdWarning() << "AmazonFetcher:doSearch() - ISBN-13 searching not implemented for Japan" << endl; isbns.remove(it); // automatically skips to next @@ -260,40 +260,40 @@ void AmazonFetcher::doSearch() { } } // the default search is by ASIN, which prohibits SearchIndex - u.removeQueryItem(TQString::tqfromLatin1("SearchIndex")); + u.removeQueryItem(TQString::fromLatin1("SearchIndex")); } // limit to first 10 while(isbns.size() > 10) { isbns.pop_back(); } - u.addQueryItem(TQString::tqfromLatin1("ItemId"), isbns.join(TQString::tqfromLatin1(","))); + u.addQueryItem(TQString::fromLatin1("ItemId"), isbns.join(TQString::fromLatin1(","))); if(isbn13) { - u.addQueryItem(TQString::tqfromLatin1("IdType"), TQString::tqfromLatin1("EAN")); + u.addQueryItem(TQString::fromLatin1("IdType"), TQString::fromLatin1("EAN")); } } break; case UPC: { - u.removeQueryItem(TQString::tqfromLatin1("Operation")); - u.addQueryItem(TQString::tqfromLatin1("Operation"), TQString::tqfromLatin1("ItemLookup")); + u.removeQueryItem(TQString::fromLatin1("Operation")); + u.addQueryItem(TQString::fromLatin1("Operation"), TQString::fromLatin1("ItemLookup")); // US allows UPC, all others are EAN if(m_site == US) { - u.addQueryItem(TQString::tqfromLatin1("IdType"), TQString::tqfromLatin1("UPC")); + u.addQueryItem(TQString::fromLatin1("IdType"), TQString::fromLatin1("UPC")); } else { - u.addQueryItem(TQString::tqfromLatin1("IdType"), TQString::tqfromLatin1("EAN")); + u.addQueryItem(TQString::fromLatin1("IdType"), TQString::fromLatin1("EAN")); } TQString s = m_value; // not encValue!!! s.remove('-'); // limit to first 10 - s.replace(TQString::tqfromLatin1("; "), TQString::tqfromLatin1(",")); + s.replace(TQString::fromLatin1("; "), TQString::fromLatin1(",")); s = s.section(',', 0, 9); - u.addQueryItem(TQString::tqfromLatin1("ItemId"), s); + u.addQueryItem(TQString::fromLatin1("ItemId"), s); } break; case Keyword: - u.addQueryItem(TQString::tqfromLatin1("Keywords"), m_value, mib); + u.addQueryItem(TQString::fromLatin1("Keywords"), m_value, mib); break; case Raw: @@ -357,7 +357,7 @@ void AmazonFetcher::slotComplete(KIO::Job* job_) { #if 0 kdWarning() << "Remove debug from amazonfetcher.cpp" << endl; - TQFile f(TQString::tqfromLatin1("/tmp/test%1.xml").tqarg(m_page)); + TQFile f(TQString::fromLatin1("/tmp/test%1.xml").arg(m_page)); if(f.open(IO_WriteOnly)) { TQTextStream t(&f); t.setEncoding(TQTextStream::UnicodeUTF8); @@ -377,31 +377,31 @@ void AmazonFetcher::slotComplete(KIO::Job* job_) { // find TotalResults element // it's in the first level under the root element //ItemSearchResponse/Items/TotalResults - TQDomNode n = dom.documentElement().namedItem(TQString::tqfromLatin1("Items")) - .namedItem(TQString::tqfromLatin1("TotalResults")); + TQDomNode n = dom.documentElement().namedItem(TQString::fromLatin1("Items")) + .namedItem(TQString::fromLatin1("TotalResults")); TQDomElement e = n.toElement(); if(!e.isNull()) { m_total = e.text().toInt(); } - n = dom.documentElement().namedItem(TQString::tqfromLatin1("Items")) - .namedItem(TQString::tqfromLatin1("Request")) - .namedItem(TQString::tqfromLatin1("Errors")); + n = dom.documentElement().namedItem(TQString::fromLatin1("Items")) + .namedItem(TQString::fromLatin1("Request")) + .namedItem(TQString::fromLatin1("Errors")); e = n.toElement(); if(!e.isNull()) { - TQDomNodeList nodes = e.elementsByTagName(TQString::tqfromLatin1("Error")); + TQDomNodeList nodes = e.elementsByTagName(TQString::fromLatin1("Error")); for(uint i = 0; i < nodes.count(); ++i) { - e = nodes.item(i).toElement().namedItem(TQString::tqfromLatin1("Code")).toElement(); + e = nodes.item(i).toElement().namedItem(TQString::fromLatin1("Code")).toElement(); if(!e.isNull() && e.text() == Latin1Literal("AWS.ECommerceService.NoExactMatches")) { // no exact match, not a real error, so skip continue; } // for some reason, Amazon will return an error simply when a valid ISBN is not found // I really want to ignore that, so check the IsValid element in the Request element - TQDomNode isValidNode = n.parentNode().namedItem(TQString::tqfromLatin1("IsValid")); + TQDomNode isValidNode = n.parentNode().namedItem(TQString::fromLatin1("IsValid")); if(m_key == ISBN && isValidNode.toElement().text().lower() == Latin1Literal("true")) { continue; } - e = nodes.item(i).toElement().namedItem(TQString::tqfromLatin1("Message")).toElement(); + e = nodes.item(i).toElement().namedItem(TQString::fromLatin1("Message")).toElement(); if(!e.isNull()) { errors << e.text(); } @@ -417,7 +417,7 @@ void AmazonFetcher::slotComplete(KIO::Job* job_) { } } -// TQRegExp stripHTML(TQString::tqfromLatin1("<.*>"), true); +// TQRegExp stripHTML(TQString::fromLatin1("<.*>"), true); // stripHTML.setMinimal(true); // assume amazon is always utf-8 @@ -432,7 +432,7 @@ void AmazonFetcher::slotComplete(KIO::Job* job_) { if(!m_addLinkField) { // remove amazon field if it's not to be added - coll->removeField(TQString::tqfromLatin1("amazon")); + coll->removeField(TQString::fromLatin1("amazon")); } Data::EntryVec entries = coll->entries(); @@ -460,24 +460,24 @@ void AmazonFetcher::slotComplete(KIO::Job* job_) { // special case book author // amazon is really bad about not putting spaces after periods if(coll->type() == Data::Collection::Book) { - TQRegExp rx(TQString::tqfromLatin1("\\.([^\\s])")); - TQStringList values = entry->fields(TQString::tqfromLatin1("author"), false); + TQRegExp rx(TQString::fromLatin1("\\.([^\\s])")); + TQStringList values = entry->fields(TQString::fromLatin1("author"), false); for(TQStringList::Iterator it = values.begin(); it != values.end(); ++it) { - (*it).replace(rx, TQString::tqfromLatin1(". \\1")); + (*it).replace(rx, TQString::fromLatin1(". \\1")); } - entry->setField(TQString::tqfromLatin1("author"), values.join(TQString::tqfromLatin1("; "))); + entry->setField(TQString::fromLatin1("author"), values.join(TQString::fromLatin1("; "))); } // UK puts the year in the title for some reason if(m_site == UK && coll->type() == Data::Collection::Video) { - TQRegExp rx(TQString::tqfromLatin1("\\[(\\d{4})\\]")); + TQRegExp rx(TQString::fromLatin1("\\[(\\d{4})\\]")); TQString t = entry->title(); if(t.find(rx) > -1) { TQString y = rx.cap(1); t.remove(rx).simplifyWhiteSpace(); - entry->setField(TQString::tqfromLatin1("title"), t); - if(entry->field(TQString::tqfromLatin1("year")).isEmpty()) { - entry->setField(TQString::tqfromLatin1("year"), y); + entry->setField(TQString::fromLatin1("title"), t); + if(entry->field(TQString::fromLatin1("year")).isEmpty()) { + entry->setField(TQString::fromLatin1("year"), y); } } } @@ -487,37 +487,37 @@ void AmazonFetcher::slotComplete(KIO::Job* job_) { case Data::Collection::Book: case Data::Collection::ComicBook: case Data::Collection::Bibtex: - desc = entry->field(TQString::tqfromLatin1("author")) - + TQChar('/') + 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")); + desc = entry->field(TQString::fromLatin1("author")) + + TQChar('/') + entry->field(TQString::fromLatin1("publisher")); + if(!entry->field(TQString::fromLatin1("cr_year")).isEmpty()) { + desc += TQChar('/') + entry->field(TQString::fromLatin1("cr_year")); + } else if(!entry->field(TQString::fromLatin1("pub_year")).isEmpty()){ + desc += TQChar('/') + entry->field(TQString::fromLatin1("pub_year")); } break; case Data::Collection::Video: - desc = entry->field(TQString::tqfromLatin1("studio")) + desc = entry->field(TQString::fromLatin1("studio")) + TQChar('/') - + entry->field(TQString::tqfromLatin1("director")) + + entry->field(TQString::fromLatin1("director")) + TQChar('/') - + entry->field(TQString::tqfromLatin1("year")) + + entry->field(TQString::fromLatin1("year")) + TQChar('/') - + entry->field(TQString::tqfromLatin1("medium")); + + entry->field(TQString::fromLatin1("medium")); break; case Data::Collection::Album: - desc = entry->field(TQString::tqfromLatin1("artist")) + desc = entry->field(TQString::fromLatin1("artist")) + TQChar('/') - + entry->field(TQString::tqfromLatin1("label")) + + entry->field(TQString::fromLatin1("label")) + TQChar('/') - + entry->field(TQString::tqfromLatin1("year")); + + entry->field(TQString::fromLatin1("year")); break; case Data::Collection::Game: - desc = entry->field(TQString::tqfromLatin1("platform")) + desc = entry->field(TQString::fromLatin1("platform")) + TQChar('/') - + entry->field(TQString::tqfromLatin1("year")); + + entry->field(TQString::fromLatin1("year")); break; default: @@ -528,21 +528,21 @@ void AmazonFetcher::slotComplete(KIO::Job* job_) { // tentatively don't do this, looks like ECS 4 cleaned everything up /* if(coll->type() == Data::Collection::Video) { - TQString plot = entry->field(TQString::tqfromLatin1("plot")); + TQString plot = entry->field(TQString::fromLatin1("plot")); plot.remove(stripHTML); - entry->setField(TQString::tqfromLatin1("plot"), plot); + entry->setField(TQString::fromLatin1("plot"), plot); } else if(coll->type() == Data::Collection::Game) { - TQString desc = entry->field(TQString::tqfromLatin1("description")); + TQString desc = entry->field(TQString::fromLatin1("description")); desc.remove(stripHTML); - entry->setField(TQString::tqfromLatin1("description"), desc); + entry->setField(TQString::fromLatin1("description"), desc); } else { - TQString comments = entry->field(TQString::tqfromLatin1("comments")); + TQString comments = entry->field(TQString::fromLatin1("comments")); comments.remove(stripHTML); - entry->setField(TQString::tqfromLatin1("comments"), comments); + entry->setField(TQString::fromLatin1("comments"), comments); } */ // myDebug() << "AmazonFetcher::slotComplete() - " << entry->title() << endl; - SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(TQString::tqfromLatin1("isbn"))); + SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(TQString::fromLatin1("isbn"))); m_entries.insert(r->uid, Data::EntryPtr(entry)); emit signalResultFound(r); ++m_numResults; @@ -559,7 +559,7 @@ void AmazonFetcher::slotComplete(KIO::Job* job_) { const int currentTotal = TQMIN(m_total, m_limit); if(m_page * AMAZON_RETURNS_PER_REQUEST < currentTotal) { int foundCount = (m_page-1) * AMAZON_RETURNS_PER_REQUEST + coll->entryCount(); - message(i18n("Results from %1: %2/%3").tqarg(source()).tqarg(foundCount).tqarg(m_total), MessageHandler::tqStatus); + message(i18n("Results from %1: %2/%3").arg(source()).arg(foundCount).arg(m_total), MessageHandler::Status); ++m_page; m_countOffset = 0; doSearch(); @@ -595,7 +595,7 @@ Tellico::Data::EntryPtr AmazonFetcher::fetchEntry(uint uid_) { case Data::Collection::ComicBook: case Data::Collection::Bibtex: { - const TQString keywords = TQString::tqfromLatin1("keyword"); + const TQString keywords = TQString::fromLatin1("keyword"); TQStringList oldWords = entry->fields(keywords, false); StringSet words; for(TQStringList::Iterator it = oldWords.begin(); it != oldWords.end(); ++it) { @@ -607,26 +607,26 @@ Tellico::Data::EntryPtr AmazonFetcher::fetchEntry(uint uid_) { *it2 == Latin1Literal("Par prix") || // french stuff *it2 == Latin1Literal("Divers") || // french stuff (*it2).startsWith(TQChar('(')) || - (*it2).startsWith(TQString::tqfromLatin1("Authors"))) { + (*it2).startsWith(TQString::fromLatin1("Authors"))) { continue; } words.add(*it2); } } - entry->setField(keywords, words.toList().join(TQString::tqfromLatin1("; "))); + entry->setField(keywords, words.toList().join(TQString::fromLatin1("; "))); } - entry->setField(TQString::tqfromLatin1("comments"), Tellico::decodeHTML(entry->field(TQString::tqfromLatin1("comments")))); + entry->setField(TQString::fromLatin1("comments"), Tellico::decodeHTML(entry->field(TQString::fromLatin1("comments")))); break; case Data::Collection::Video: { - const TQString genres = TQString::tqfromLatin1("genre"); + const TQString genres = TQString::fromLatin1("genre"); TQStringList oldWords = entry->fields(genres, false); StringSet words; // only care about genres that have "Genres" in the amazon response // and take the first word after that for(TQStringList::Iterator it = oldWords.begin(); it != oldWords.end(); ++it) { - if((*it).find(TQString::tqfromLatin1("Genres")) == -1) { + if((*it).find(TQString::fromLatin1("Genres")) == -1) { continue; } @@ -643,27 +643,27 @@ Tellico::Data::EntryPtr AmazonFetcher::fetchEntry(uint uid_) { break; // we're done } } - entry->setField(genres, words.toList().join(TQString::tqfromLatin1("; "))); + entry->setField(genres, words.toList().join(TQString::fromLatin1("; "))); // language tracks get duplicated, too - TQStringList langs = entry->fields(TQString::tqfromLatin1("language"), false); + TQStringList langs = entry->fields(TQString::fromLatin1("language"), false); words.clear(); for(TQStringList::ConstIterator it = langs.begin(); it != langs.end(); ++it) { words.add(*it); } - entry->setField(TQString::tqfromLatin1("language"), words.toList().join(TQString::tqfromLatin1("; "))); + entry->setField(TQString::fromLatin1("language"), words.toList().join(TQString::fromLatin1("; "))); } - entry->setField(TQString::tqfromLatin1("plot"), Tellico::decodeHTML(entry->field(TQString::tqfromLatin1("plot")))); + entry->setField(TQString::fromLatin1("plot"), Tellico::decodeHTML(entry->field(TQString::fromLatin1("plot")))); break; case Data::Collection::Album: { - const TQString genres = TQString::tqfromLatin1("genre"); + const TQString genres = TQString::fromLatin1("genre"); TQStringList oldWords = entry->fields(genres, false); StringSet words; // only care about genres that have "Styles" in the amazon response // and take the first word after that for(TQStringList::Iterator it = oldWords.begin(); it != oldWords.end(); ++it) { - if((*it).find(TQString::tqfromLatin1("Styles")) == -1) { + if((*it).find(TQString::fromLatin1("Styles")) == -1) { continue; } @@ -682,13 +682,13 @@ Tellico::Data::EntryPtr AmazonFetcher::fetchEntry(uint uid_) { } } } - entry->setField(genres, words.toList().join(TQString::tqfromLatin1("; "))); + entry->setField(genres, words.toList().join(TQString::fromLatin1("; "))); } - entry->setField(TQString::tqfromLatin1("comments"), Tellico::decodeHTML(entry->field(TQString::tqfromLatin1("comments")))); + entry->setField(TQString::fromLatin1("comments"), Tellico::decodeHTML(entry->field(TQString::fromLatin1("comments")))); break; case Data::Collection::Game: - entry->setField(TQString::tqfromLatin1("description"), Tellico::decodeHTML(entry->field(TQString::tqfromLatin1("description")))); + entry->setField(TQString::fromLatin1("description"), Tellico::decodeHTML(entry->field(TQString::fromLatin1("description")))); break; } @@ -697,7 +697,7 @@ Tellico::Data::EntryPtr AmazonFetcher::fetchEntry(uint uid_) { // also sometimes table fields have rows but no values Data::FieldVec fields = entry->collection()->fields(); - TQRegExp blank(TQString::tqfromLatin1("[\\s:;]+")); // only white space, column separators and row separators + TQRegExp blank(TQString::fromLatin1("[\\s:;]+")); // only white space, column separators and row separators for(Data::FieldVec::Iterator fIt = fields.begin(); fIt != fields.end(); ++fIt) { if(fIt->type() != Data::Field::Table) { continue; @@ -710,13 +710,13 @@ Tellico::Data::EntryPtr AmazonFetcher::fetchEntry(uint uid_) { KURL imageURL; switch(m_imageSize) { case SmallImage: - imageURL = entry->field(TQString::tqfromLatin1("small-image")); + imageURL = entry->field(TQString::fromLatin1("small-image")); break; case MediumImage: - imageURL = entry->field(TQString::tqfromLatin1("medium-image")); + imageURL = entry->field(TQString::fromLatin1("medium-image")); break; case LargeImage: - imageURL = entry->field(TQString::tqfromLatin1("large-image")); + imageURL = entry->field(TQString::fromLatin1("large-image")); break; case NoImage: default: @@ -730,19 +730,19 @@ Tellico::Data::EntryPtr AmazonFetcher::fetchEntry(uint uid_) { message(i18n("The cover image could not be loaded."), MessageHandler::Warning); } else { // amazon serves up 1x1 gifs occasionally, but that's caught in the image constructor // all relevant collection types have cover fields - entry->setField(TQString::tqfromLatin1("cover"), id); + entry->setField(TQString::fromLatin1("cover"), id); } } // don't want to show image urls in the fetch dialog - entry->setField(TQString::tqfromLatin1("small-image"), TQString()); - entry->setField(TQString::tqfromLatin1("medium-image"), TQString()); - entry->setField(TQString::tqfromLatin1("large-image"), TQString()); + entry->setField(TQString::fromLatin1("small-image"), TQString()); + entry->setField(TQString::fromLatin1("medium-image"), TQString()); + entry->setField(TQString::fromLatin1("large-image"), TQString()); return entry; } void AmazonFetcher::initXSLTHandler() { - TQString xsltfile = locate("appdata", TQString::tqfromLatin1("amazon2tellico.xsl")); + TQString xsltfile = locate("appdata", TQString::fromLatin1("amazon2tellico.xsl")); if(xsltfile.isEmpty()) { kdWarning() << "AmazonFetcher::initXSLTHandler() - can not locate amazon2tellico.xsl." << endl; return; @@ -766,14 +766,14 @@ void AmazonFetcher::updateEntry(Data::EntryPtr entry_) { int type = entry_->collection()->type(); if(type == Data::Collection::Book || type == Data::Collection::ComicBook || type == Data::Collection::Bibtex) { - TQString isbn = entry_->field(TQString::tqfromLatin1("isbn")); + TQString isbn = entry_->field(TQString::fromLatin1("isbn")); if(!isbn.isEmpty()) { m_limit = 5; // no need for more search(Fetch::ISBN, isbn); return; } } else if(type == Data::Collection::Album) { - TQString a = entry_->field(TQString::tqfromLatin1("artist")); + TQString a = entry_->field(TQString::fromLatin1("artist")); if(!a.isEmpty()) { search(Fetch::Person, a); return; @@ -781,7 +781,7 @@ void AmazonFetcher::updateEntry(Data::EntryPtr entry_) { } // optimistically try searching for title and rely on Collection::sameEntry() to figure things out - TQString t = entry_->field(TQString::tqfromLatin1("title")); + TQString t = entry_->field(TQString::fromLatin1("title")); if(!t.isEmpty()) { search(Fetch::Title, t); return; @@ -794,9 +794,9 @@ void AmazonFetcher::updateEntry(Data::EntryPtr entry_) { void AmazonFetcher::parseTitle(Data::EntryPtr entry, int collType) { Q_UNUSED(collType); // assume that everything in brackets or parentheses is extra - TQRegExp rx(TQString::tqfromLatin1("[\\(\\[](.*)[\\)\\]]")); + TQRegExp rx(TQString::fromLatin1("[\\(\\[](.*)[\\)\\]]")); rx.setMinimal(true); - TQString title = entry->field(TQString::tqfromLatin1("title")); + TQString title = entry->field(TQString::fromLatin1("title")); int pos = rx.search(title); while(pos > -1) { if(parseTitleToken(entry, rx.cap(1))) { @@ -805,30 +805,30 @@ void AmazonFetcher::parseTitle(Data::EntryPtr entry, int collType) { } pos = rx.search(title, pos+1); } - entry->setField(TQString::tqfromLatin1("title"), title.stripWhiteSpace()); + entry->setField(TQString::fromLatin1("title"), title.stripWhiteSpace()); } bool AmazonFetcher::parseTitleToken(Data::EntryPtr entry, const TQString& token) { // if res = true, then the token gets removed from the title bool res = false; - if(token.find(TQString::tqfromLatin1("widescreen"), 0, false /* case-insensitive*/) > -1 || + if(token.find(TQString::fromLatin1("widescreen"), 0, false /* case-insensitive*/) > -1 || token.find(i18n("Widescreen"), 0, false) > -1) { - entry->setField(TQString::tqfromLatin1("widescreen"), TQString::tqfromLatin1("true")); + entry->setField(TQString::fromLatin1("widescreen"), TQString::fromLatin1("true")); // res = true; leave it in the title - } else if(token.find(TQString::tqfromLatin1("full screen"), 0, false) > -1) { + } else if(token.find(TQString::fromLatin1("full screen"), 0, false) > -1) { // skip, but go ahead and remove from title res = true; } - if(token.find(TQString::tqfromLatin1("blu-ray"), 0, false) > -1) { - entry->setField(TQString::tqfromLatin1("medium"), i18n("Blu-ray")); + if(token.find(TQString::fromLatin1("blu-ray"), 0, false) > -1) { + entry->setField(TQString::fromLatin1("medium"), i18n("Blu-ray")); res = true; - } else if(token.find(TQString::tqfromLatin1("hd dvd"), 0, false) > -1) { - entry->setField(TQString::tqfromLatin1("medium"), i18n("HD DVD")); + } else if(token.find(TQString::fromLatin1("hd dvd"), 0, false) > -1) { + entry->setField(TQString::fromLatin1("medium"), i18n("HD DVD")); res = true; } - if(token.find(TQString::tqfromLatin1("director's cut"), 0, false) > -1 || + if(token.find(TQString::fromLatin1("director's cut"), 0, false) > -1 || token.find(i18n("Director's Cut"), 0, false) > -1) { - entry->setField(TQString::tqfromLatin1("directors-cut"), TQString::tqfromLatin1("true")); + entry->setField(TQString::fromLatin1("directors-cut"), TQString::fromLatin1("true")); // res = true; leave it in the title } return res; @@ -896,7 +896,7 @@ AmazonFetcher::ConfigWidget::ConfigWidget(TQWidget* parent_, const AmazonFetcher m_assocEdit->setText(fetcher_->m_assoc); m_imageCombo->setCurrentData(fetcher_->m_imageSize); } else { // defaults - m_assocEdit->setText(TQString::tqfromLatin1(AMAZON_ASSOC_TOKEN)); + m_assocEdit->setText(TQString::fromLatin1(AMAZON_ASSOC_TOKEN)); m_imageCombo->setCurrentData(MediumImage); } @@ -930,7 +930,7 @@ void AmazonFetcher::ConfigWidget::slotSiteChanged() { //static Tellico::StringMap AmazonFetcher::customFields() { StringMap map; - map[TQString::tqfromLatin1("keyword")] = i18n("Keywords"); + map[TQString::fromLatin1("keyword")] = i18n("Keywords"); return map; } diff --git a/src/fetch/animenfofetcher.cpp b/src/fetch/animenfofetcher.cpp index 8a938a4..bd4460c 100644 --- a/src/fetch/animenfofetcher.cpp +++ b/src/fetch/animenfofetcher.cpp @@ -27,7 +27,7 @@ #include <kio/job.h> #include <tqregexp.h> -#include <tqlayout.h> +#include <layout.h> #include <tqlabel.h> #include <tqfile.h> @@ -44,7 +44,7 @@ AnimeNfoFetcher::AnimeNfoFetcher(TQObject* parent_, const char* name_ /*=0*/) } TQString AnimeNfoFetcher::defaultName() { - return TQString::tqfromLatin1("AnimeNfo.com"); + return TQString::fromLatin1("AnimeNfo.com"); } TQString AnimeNfoFetcher::source() const { @@ -64,22 +64,22 @@ void AnimeNfoFetcher::search(FetchKey key_, const TQString& value_) { m_matches.clear(); #ifdef ANIMENFO_TEST - KURL u = KURL::fromPathOrURL(TQString::tqfromLatin1("/home/robby/animenfo.html")); + KURL u = KURL::fromPathOrURL(TQString::fromLatin1("/home/robby/animenfo.html")); #else - KURL u(TQString::tqfromLatin1(ANIMENFO_BASE_URL)); - u.addQueryItem(TQString::tqfromLatin1("action"), TQString::tqfromLatin1("Go")); - u.addQueryItem(TQString::tqfromLatin1("option"), TQString::tqfromLatin1("keywords")); - u.addQueryItem(TQString::tqfromLatin1("queryin"), TQString::tqfromLatin1("anime_titles")); + KURL u(TQString::fromLatin1(ANIMENFO_BASE_URL)); + u.addQueryItem(TQString::fromLatin1("action"), TQString::fromLatin1("Go")); + u.addQueryItem(TQString::fromLatin1("option"), TQString::fromLatin1("keywords")); + u.addQueryItem(TQString::fromLatin1("queryin"), TQString::fromLatin1("anime_titles")); if(!canFetch(Kernel::self()->collectionType())) { - message(i18n("%1 does not allow searching for this collection type.").tqarg(source()), MessageHandler::Warning); + message(i18n("%1 does not allow searching for this collection type.").arg(source()), MessageHandler::Warning); stop(); return; } switch(key_) { case Keyword: - u.addQueryItem(TQString::tqfromLatin1("query"), value_); + u.addQueryItem(TQString::fromLatin1("query"), value_); break; default: @@ -135,11 +135,11 @@ void AnimeNfoFetcher::slotComplete(KIO::Job* job_) { TQString s = Tellico::decodeHTML(TQString(m_data)); - TQRegExp infoRx(TQString::tqfromLatin1("<td\\s+[^>]*class\\s*=\\s*[\"']anime_info[\"'][^>]*>(.*)</td>"), false); + TQRegExp infoRx(TQString::fromLatin1("<td\\s+[^>]*class\\s*=\\s*[\"']anime_info[\"'][^>]*>(.*)</td>"), false); infoRx.setMinimal(true); - TQRegExp anchorRx(TQString::tqfromLatin1("<a\\s+[^>]*href\\s*=\\s*[\"'](.*)[\"'][^>]*>(.*)</a>"), false); + TQRegExp anchorRx(TQString::fromLatin1("<a\\s+[^>]*href\\s*=\\s*[\"'](.*)[\"'][^>]*>(.*)</a>"), false); anchorRx.setMinimal(true); - TQRegExp yearRx(TQString::tqfromLatin1("\\d{4}"), false); + TQRegExp yearRx(TQString::fromLatin1("\\d{4}"), false); // search page comes in groups of threes int n = 0; @@ -151,9 +151,9 @@ void AnimeNfoFetcher::slotComplete(KIO::Job* job_) { emit signalResultFound(r); #ifdef ANIMENFO_TEST - KURL url = KURL::fromPathOrURL(TQString::tqfromLatin1("/home/robby/animetitle.html")); + KURL url = KURL::fromPathOrURL(TQString::fromLatin1("/home/robby/animetitle.html")); #else - KURL url(TQString::tqfromLatin1(ANIMENFO_BASE_URL), u); + KURL url(TQString::fromLatin1(ANIMENFO_BASE_URL), u); url.setQuery(TQString()); #endif m_matches.insert(r->uid, url); @@ -189,7 +189,7 @@ void AnimeNfoFetcher::slotComplete(KIO::Job* job_) { if(!u.isEmpty()) { SearchResult* r = new SearchResult(this, t, y, TQString()); emit signalResultFound(r); - KURL url(TQString::tqfromLatin1(ANIMENFO_BASE_URL), u); + KURL url(TQString::fromLatin1(ANIMENFO_BASE_URL), u); url.setQuery(TQString()); m_matches.insert(r->uid, url); } @@ -218,7 +218,7 @@ Tellico::Data::EntryPtr AnimeNfoFetcher::fetchEntry(uint uid_) { #if 0 kdWarning() << "Remove debug from animenfofetcher.cpp" << endl; - TQFile f(TQString::tqfromLatin1("/tmp/test.html")); + TQFile f(TQString::fromLatin1("/tmp/test.html")); if(f.open(IO_WriteOnly)) { TQTextStream t(&f); t.setEncoding(TQTextStream::UnicodeUTF8); @@ -239,13 +239,13 @@ Tellico::Data::EntryPtr AnimeNfoFetcher::fetchEntry(uint uid_) { Tellico::Data::EntryPtr AnimeNfoFetcher::parseEntry(const TQString& str_) { // myDebug() << "AnimeNfoFetcher::parseEntry()" << endl; // class might be anime_info_top - TQRegExp infoRx(TQString::tqfromLatin1("<td\\s+[^>]*class\\s*=\\s*[\"']anime_info[^>]*>(.*)</td>"), false); + TQRegExp infoRx(TQString::fromLatin1("<td\\s+[^>]*class\\s*=\\s*[\"']anime_info[^>]*>(.*)</td>"), false); infoRx.setMinimal(true); - TQRegExp tagRx(TQString::tqfromLatin1("<.*>")); + TQRegExp tagRx(TQString::fromLatin1("<.*>")); tagRx.setMinimal(true); - TQRegExp anchorRx(TQString::tqfromLatin1("<a\\s+[^>]*href\\s*=\\s*[\"'](.*)[\"'][^>]*>(.*)</a>"), false); + TQRegExp anchorRx(TQString::fromLatin1("<a\\s+[^>]*href\\s*=\\s*[\"'](.*)[\"'][^>]*>(.*)</a>"), false); anchorRx.setMinimal(true); - TQRegExp jsRx(TQString::tqfromLatin1("<script.*</script>"), false); + TQRegExp jsRx(TQString::fromLatin1("<script.*</script>"), false); jsRx.setMinimal(true); TQString s = str_; @@ -254,32 +254,32 @@ Tellico::Data::EntryPtr AnimeNfoFetcher::parseEntry(const TQString& str_) { Data::CollPtr coll = new Data::VideoCollection(true); // add new fields - Data::FieldPtr f = new Data::Field(TQString::tqfromLatin1("origtitle"), i18n("Original Title")); + Data::FieldPtr f = new Data::Field(TQString::fromLatin1("origtitle"), i18n("Original Title")); coll->addField(f); - f = new Data::Field(TQString::tqfromLatin1("alttitle"), i18n("Alternative Titles"), Data::Field::Table); + f = new Data::Field(TQString::fromLatin1("alttitle"), i18n("Alternative Titles"), Data::Field::Table); f->setFormatFlag(Data::Field::FormatTitle); coll->addField(f); - f = new Data::Field(TQString::tqfromLatin1("distributor"), i18n("Distributor")); + f = new Data::Field(TQString::fromLatin1("distributor"), i18n("Distributor")); f->setCategory(i18n("Other People")); f->setFlags(Data::Field::AllowCompletion | Data::Field::AllowMultiple | Data::Field::AllowGrouped); f->setFormatFlag(Data::Field::FormatPlain); coll->addField(f); - f = new Data::Field(TQString::tqfromLatin1("episodes"), i18n("Episodes"), Data::Field::Number); + f = new Data::Field(TQString::fromLatin1("episodes"), i18n("Episodes"), Data::Field::Number); f->setCategory(i18n("Features")); coll->addField(f); // map captions in HTML to field names TQMap<TQString, TQString> fieldMap; - fieldMap.insert(TQString::tqfromLatin1("Title"), TQString::tqfromLatin1("title")); - fieldMap.insert(TQString::tqfromLatin1("Japanese Title"), TQString::tqfromLatin1("origtitle")); - fieldMap.insert(TQString::tqfromLatin1("Total Episodes"), TQString::tqfromLatin1("episodes")); - fieldMap.insert(TQString::tqfromLatin1("Genres"), TQString::tqfromLatin1("genre")); - fieldMap.insert(TQString::tqfromLatin1("Year Published"), TQString::tqfromLatin1("year")); - fieldMap.insert(TQString::tqfromLatin1("Studio"), TQString::tqfromLatin1("studio")); - fieldMap.insert(TQString::tqfromLatin1("US Distribution"), TQString::tqfromLatin1("distributor")); + fieldMap.insert(TQString::fromLatin1("Title"), TQString::fromLatin1("title")); + fieldMap.insert(TQString::fromLatin1("Japanese Title"), TQString::fromLatin1("origtitle")); + fieldMap.insert(TQString::fromLatin1("Total Episodes"), TQString::fromLatin1("episodes")); + fieldMap.insert(TQString::fromLatin1("Genres"), TQString::fromLatin1("genre")); + fieldMap.insert(TQString::fromLatin1("Year Published"), TQString::fromLatin1("year")); + fieldMap.insert(TQString::fromLatin1("Studio"), TQString::fromLatin1("studio")); + fieldMap.insert(TQString::fromLatin1("US Distribution"), TQString::fromLatin1("distributor")); Data::EntryPtr entry = new Data::Entry(coll); @@ -292,8 +292,8 @@ Tellico::Data::EntryPtr AnimeNfoFetcher::parseEntry(const TQString& str_) { value = value.simplifyWhiteSpace(); if(value.length() > 2) { // might be "-" if(key == Latin1Literal("Genres")) { - entry->setField(fieldMap[key], TQStringList::split(TQRegExp(TQString::tqfromLatin1("\\s*,\\s*")), - value).join(TQString::tqfromLatin1("; "))); + entry->setField(fieldMap[key], TQStringList::split(TQRegExp(TQString::fromLatin1("\\s*,\\s*")), + value).join(TQString::fromLatin1("; "))); } else { entry->setField(fieldMap[key], value); } @@ -315,44 +315,44 @@ Tellico::Data::EntryPtr AnimeNfoFetcher::parseEntry(const TQString& str_) { } // image - TQRegExp imgRx(TQString::tqfromLatin1("<img\\s+[^>]*src\\s*=\\s*[\"']([^>]*)[\"']\\s+[^>]*alt\\s*=\\s*[\"']%1[\"']") - .tqarg(entry->field(TQString::tqfromLatin1("title"))), false); + TQRegExp imgRx(TQString::fromLatin1("<img\\s+[^>]*src\\s*=\\s*[\"']([^>]*)[\"']\\s+[^>]*alt\\s*=\\s*[\"']%1[\"']") + .arg(entry->field(TQString::fromLatin1("title"))), false); imgRx.setMinimal(true); int pos = imgRx.search(s); if(pos > -1) { - KURL imgURL(TQString::tqfromLatin1(ANIMENFO_BASE_URL), imgRx.cap(1)); + KURL imgURL(TQString::fromLatin1(ANIMENFO_BASE_URL), imgRx.cap(1)); TQString id = ImageFactory::addImage(imgURL, true); if(!id.isEmpty()) { - entry->setField(TQString::tqfromLatin1("cover"), id); + entry->setField(TQString::fromLatin1("cover"), id); } } // now look for alternative titles and plot - const TQString a = TQString::tqfromLatin1("Alternative titles"); + const TQString a = TQString::fromLatin1("Alternative titles"); pos = s.find(a, oldpos+1, false); if(pos > -1) { pos += a.length(); } int pos2 = -1; if(pos > -1) { - pos2 = s.find(TQString::tqfromLatin1("Description"), pos+1, true); + pos2 = s.find(TQString::fromLatin1("Description"), pos+1, true); if(pos2 > -1) { value = s.mid(pos, pos2-pos).remove(tagRx).simplifyWhiteSpace(); - entry->setField(TQString::tqfromLatin1("alttitle"), value); + entry->setField(TQString::fromLatin1("alttitle"), value); } } - TQRegExp descRx(TQString::tqfromLatin1("class\\s*=\\s*[\"']description[\"'][^>]*>(.*)<"), false); + TQRegExp descRx(TQString::fromLatin1("class\\s*=\\s*[\"']description[\"'][^>]*>(.*)<"), false); descRx.setMinimal(true); pos = descRx.search(s, TQMAX(pos, pos2)); if(pos > -1) { - entry->setField(TQString::tqfromLatin1("plot"), descRx.cap(1).simplifyWhiteSpace()); + entry->setField(TQString::fromLatin1("plot"), descRx.cap(1).simplifyWhiteSpace()); } return entry; } void AnimeNfoFetcher::updateEntry(Data::EntryPtr entry_) { - TQString t = entry_->field(TQString::tqfromLatin1("title")); + TQString t = entry_->field(TQString::fromLatin1("title")); if(!t.isEmpty()) { search(Fetch::Keyword, t); return; diff --git a/src/fetch/arxivfetcher.cpp b/src/fetch/arxivfetcher.cpp index 6586d94..4d76bd1 100644 --- a/src/fetch/arxivfetcher.cpp +++ b/src/fetch/arxivfetcher.cpp @@ -29,7 +29,7 @@ #include <tqdom.h> #include <tqlabel.h> -#include <tqlayout.h> +#include <layout.h> //#define ARXIV_TEST @@ -80,7 +80,7 @@ void ArxivFetcher::continueSearch() { void ArxivFetcher::doSearch() { if(!canFetch(Kernel::self()->collectionType())) { - message(i18n("%1 does not allow searching for this collection type.").tqarg(source()), MessageHandler::Warning); + message(i18n("%1 does not allow searching for this collection type.").arg(source()), MessageHandler::Warning); stop(); return; } @@ -140,7 +140,7 @@ void ArxivFetcher::slotComplete(KIO::Job* job_) { #if 0 kdWarning() << "Remove debug from arxivfetcher.cpp" << endl; - TQFile f(TQString::tqfromLatin1("/tmp/test.xml")); + TQFile f(TQString::fromLatin1("/tmp/test.xml")); if(f.open(IO_WriteOnly)) { TQTextStream t(&f); t.setEncoding(TQTextStream::UnicodeUTF8); @@ -164,8 +164,8 @@ void ArxivFetcher::slotComplete(KIO::Job* job_) { return; } // total is top level element, with attribute totalResultsAvailable - TQDomNodeList list = dom.elementsByTagNameNS(TQString::tqfromLatin1("http://a9.com/-/spec/opensearch/1.1/"), - TQString::tqfromLatin1("totalResults")); + TQDomNodeList list = dom.elementsByTagNameNS(TQString::fromLatin1("http://a9.com/-/spec/opensearch/1.1/"), + TQString::fromLatin1("totalResults")); if(list.count() > 0) { m_total = list.item(0).toElement().text().toInt(); } @@ -188,13 +188,13 @@ void ArxivFetcher::slotComplete(KIO::Job* job_) { // might get aborted break; } - TQString desc = entry->field(TQString::tqfromLatin1("author")) - + TQChar('/') + entry->field(TQString::tqfromLatin1("publisher")); - if(!entry->field(TQString::tqfromLatin1("year")).isEmpty()) { - desc += TQChar('/') + entry->field(TQString::tqfromLatin1("year")); + TQString desc = entry->field(TQString::fromLatin1("author")) + + TQChar('/') + entry->field(TQString::fromLatin1("publisher")); + if(!entry->field(TQString::fromLatin1("year")).isEmpty()) { + desc += TQChar('/') + entry->field(TQString::fromLatin1("year")); } - SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(TQString::tqfromLatin1("isbn"))); + SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(TQString::fromLatin1("isbn"))); m_entries.insert(r->uid, Data::EntryPtr(entry)); emit signalResultFound(r); } @@ -207,19 +207,19 @@ void ArxivFetcher::slotComplete(KIO::Job* job_) { Tellico::Data::EntryPtr ArxivFetcher::fetchEntry(uint uid_) { Data::EntryPtr entry = m_entries[uid_]; // if URL but no cover image, fetch it - if(!entry->field(TQString::tqfromLatin1("url")).isEmpty()) { + if(!entry->field(TQString::fromLatin1("url")).isEmpty()) { Data::CollPtr coll = entry->collection(); - Data::FieldPtr field = coll->fieldByName(TQString::tqfromLatin1("cover")); + Data::FieldPtr field = coll->fieldByName(TQString::fromLatin1("cover")); if(!field && !coll->imageFields().isEmpty()) { field = coll->imageFields().front(); } else if(!field) { - field = new Data::Field(TQString::tqfromLatin1("cover"), i18n("Front Cover"), Data::Field::Image); + field = new Data::Field(TQString::fromLatin1("cover"), i18n("Front Cover"), Data::Field::Image); coll->addField(field); } if(entry->field(field).isEmpty()) { - TQPixmap pix = NetAccess::filePreview(entry->field(TQString::tqfromLatin1("url"))); + TQPixmap pix = NetAccess::filePreview(entry->field(TQString::fromLatin1("url"))); if(!pix.isNull()) { - TQString id = ImageFactory::addImage(pix, TQString::tqfromLatin1("PNG")); + TQString id = ImageFactory::addImage(pix, TQString::fromLatin1("PNG")); if(!id.isEmpty()) { entry->setField(field, id); } @@ -230,7 +230,7 @@ Tellico::Data::EntryPtr ArxivFetcher::fetchEntry(uint uid_) { } void ArxivFetcher::initXSLTHandler() { - TQString xsltfile = locate("appdata", TQString::tqfromLatin1("arxiv2tellico.xsl")); + TQString xsltfile = locate("appdata", TQString::fromLatin1("arxiv2tellico.xsl")); if(xsltfile.isEmpty()) { kdWarning() << "ArxivFetcher::initXSLTHandler() - can not locate arxiv2tellico.xsl." << endl; return; @@ -250,33 +250,33 @@ void ArxivFetcher::initXSLTHandler() { } KURL ArxivFetcher::searchURL(FetchKey key_, const TQString& value_) const { - KURL u(TQString::tqfromLatin1(ARXIV_BASE_URL)); - u.addQueryItem(TQString::tqfromLatin1("start"), TQString::number(m_start)); - u.addQueryItem(TQString::tqfromLatin1("max_results"), TQString::number(ARXIV_RETURNS_PER_REQUEST)); + KURL u(TQString::fromLatin1(ARXIV_BASE_URL)); + u.addQueryItem(TQString::fromLatin1("start"), TQString::number(m_start)); + u.addQueryItem(TQString::fromLatin1("max_results"), TQString::number(ARXIV_RETURNS_PER_REQUEST)); // quotes should be used if spaces are present, just use all the time TQString quotedValue = '"' + value_ + '"'; switch(key_) { case Title: - u.addQueryItem(TQString::tqfromLatin1("search_query"), TQString::tqfromLatin1("ti:%1").tqarg(quotedValue)); + u.addQueryItem(TQString::fromLatin1("search_query"), TQString::fromLatin1("ti:%1").arg(quotedValue)); break; case Person: - u.addQueryItem(TQString::tqfromLatin1("search_query"), TQString::tqfromLatin1("au:%1").tqarg(quotedValue)); + u.addQueryItem(TQString::fromLatin1("search_query"), TQString::fromLatin1("au:%1").arg(quotedValue)); break; case Keyword: // keyword gets to use all the words without being quoted - u.addQueryItem(TQString::tqfromLatin1("search_query"), TQString::tqfromLatin1("all:%1").tqarg(value_)); + u.addQueryItem(TQString::fromLatin1("search_query"), TQString::fromLatin1("all:%1").arg(value_)); break; case ArxivID: { // remove prefix and/or version number TQString value = value_; - value.remove(TQRegExp(TQString::tqfromLatin1("^arxiv:"), false)); - value.remove(TQRegExp(TQString::tqfromLatin1("v\\d+$"))); - u.addQueryItem(TQString::tqfromLatin1("search_query"), TQString::tqfromLatin1("id:%1").tqarg(value)); + value.remove(TQRegExp(TQString::fromLatin1("^arxiv:"), false)); + value.remove(TQRegExp(TQString::fromLatin1("v\\d+$"))); + u.addQueryItem(TQString::fromLatin1("search_query"), TQString::fromLatin1("id:%1").arg(value)); } break; @@ -286,21 +286,21 @@ KURL ArxivFetcher::searchURL(FetchKey key_, const TQString& value_) const { } #ifdef ARXIV_TEST - u = KURL::fromPathOrURL(TQString::tqfromLatin1("/home/robby/arxiv.xml")); + u = KURL::fromPathOrURL(TQString::fromLatin1("/home/robby/arxiv.xml")); #endif myDebug() << "ArxivFetcher::search() - url: " << u.url() << endl; return u; } void ArxivFetcher::updateEntry(Data::EntryPtr entry_) { - TQString id = entry_->field(TQString::tqfromLatin1("arxiv")); + TQString id = entry_->field(TQString::fromLatin1("arxiv")); if(!id.isEmpty()) { search(Fetch::ArxivID, id); return; } // optimistically try searching for title and rely on Collection::sameEntry() to figure things out - TQString t = entry_->field(TQString::tqfromLatin1("title")); + TQString t = entry_->field(TQString::fromLatin1("title")); if(!t.isEmpty()) { search(Fetch::Title, t); return; @@ -314,7 +314,7 @@ void ArxivFetcher::updateEntrySynchronous(Data::EntryPtr entry) { if(!entry) { return; } - TQString arxiv = entry->field(TQString::tqfromLatin1("arxiv")); + TQString arxiv = entry->field(TQString::fromLatin1("arxiv")); if(arxiv.isEmpty()) { return; } @@ -340,8 +340,8 @@ void ArxivFetcher::updateEntrySynchronous(Data::EntryPtr entry) { myLog() << "ArxivFetcher::updateEntrySynchronous() - found Arxiv result, merging" << endl; Data::Collection::mergeEntry(entry, coll->entries().front(), false /*overwrite*/); // the arxiv id might have a version# - entry->setField(TQString::tqfromLatin1("arxiv"), - coll->entries().front()->field(TQString::tqfromLatin1("arxiv"))); + entry->setField(TQString::fromLatin1("arxiv"), + coll->entries().front()->field(TQString::fromLatin1("arxiv"))); } } diff --git a/src/fetch/bibsonomyfetcher.cpp b/src/fetch/bibsonomyfetcher.cpp index a6fd18a..9a4e130 100644 --- a/src/fetch/bibsonomyfetcher.cpp +++ b/src/fetch/bibsonomyfetcher.cpp @@ -25,7 +25,7 @@ #include <klocale.h> #include <tqlabel.h> -#include <tqlayout.h> +#include <layout.h> namespace { // always bibtex @@ -43,7 +43,7 @@ BibsonomyFetcher::~BibsonomyFetcher() { } TQString BibsonomyFetcher::defaultName() { - return TQString::tqfromLatin1("Bibsonomy"); + return TQString::fromLatin1("Bibsonomy"); } TQString BibsonomyFetcher::source() const { @@ -63,7 +63,7 @@ void BibsonomyFetcher::search(FetchKey key_, const TQString& value_) { m_started = true; if(!canFetch(Kernel::self()->collectionType())) { - message(i18n("%1 does not allow searching for this collection type.").tqarg(source()), MessageHandler::Warning); + message(i18n("%1 does not allow searching for this collection type.").arg(source()), MessageHandler::Warning); stop(); return; } @@ -136,13 +136,13 @@ void BibsonomyFetcher::slotComplete(KIO::Job* job_) { // might get aborted break; } - TQString desc = entry->field(TQString::tqfromLatin1("author")) - + TQChar('/') + entry->field(TQString::tqfromLatin1("publisher")); - if(!entry->field(TQString::tqfromLatin1("year")).isEmpty()) { - desc += TQChar('/') + entry->field(TQString::tqfromLatin1("year")); + TQString desc = entry->field(TQString::fromLatin1("author")) + + TQChar('/') + entry->field(TQString::fromLatin1("publisher")); + if(!entry->field(TQString::fromLatin1("year")).isEmpty()) { + desc += TQChar('/') + entry->field(TQString::fromLatin1("year")); } - SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(TQString::tqfromLatin1("isbn"))); + SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(TQString::fromLatin1("isbn"))); m_entries.insert(r->uid, Data::EntryPtr(entry)); emit signalResultFound(r); } @@ -155,16 +155,16 @@ Tellico::Data::EntryPtr BibsonomyFetcher::fetchEntry(uint uid_) { } KURL BibsonomyFetcher::searchURL(FetchKey key_, const TQString& value_) const { - KURL u(TQString::tqfromLatin1(BIBSONOMY_BASE_URL)); - u.setPath(TQString::tqfromLatin1("/bib/")); + KURL u(TQString::fromLatin1(BIBSONOMY_BASE_URL)); + u.setPath(TQString::fromLatin1("/bib/")); switch(key_) { case Person: - u.addPath(TQString::tqfromLatin1("author/%1").tqarg(value_)); + u.addPath(TQString::fromLatin1("author/%1").arg(value_)); break; case Keyword: - u.addPath(TQString::tqfromLatin1("search/%1").tqarg(value_)); + u.addPath(TQString::fromLatin1("search/%1").arg(value_)); break; default: @@ -172,13 +172,13 @@ KURL BibsonomyFetcher::searchURL(FetchKey key_, const TQString& value_) const { return KURL(); } - u.addQueryItem(TQString::tqfromLatin1("items"), TQString::number(BIBSONOMY_MAX_RESULTS)); + u.addQueryItem(TQString::fromLatin1("items"), TQString::number(BIBSONOMY_MAX_RESULTS)); myDebug() << "BibsonomyFetcher::search() - url: " << u.url() << endl; return u; } void BibsonomyFetcher::updateEntry(Data::EntryPtr entry_) { - TQString title = entry_->field(TQString::tqfromLatin1("title")); + TQString title = entry_->field(TQString::fromLatin1("title")); if(!title.isEmpty()) { search(Fetch::Keyword, title); return; diff --git a/src/fetch/citebasefetcher.cpp b/src/fetch/citebasefetcher.cpp index 744950e..610d539 100644 --- a/src/fetch/citebasefetcher.cpp +++ b/src/fetch/citebasefetcher.cpp @@ -25,7 +25,7 @@ #include <klocale.h> #include <tqlabel.h> -#include <tqlayout.h> +#include <layout.h> // #define CITEBASE_TEST @@ -44,7 +44,7 @@ CitebaseFetcher::~CitebaseFetcher() { } TQString CitebaseFetcher::defaultName() { - return TQString::tqfromLatin1("Citebase"); + return TQString::fromLatin1("Citebase"); } TQString CitebaseFetcher::source() const { @@ -64,7 +64,7 @@ void CitebaseFetcher::search(FetchKey key_, const TQString& value_) { m_started = true; if(!canFetch(Kernel::self()->collectionType())) { - message(i18n("%1 does not allow searching for this collection type.").tqarg(source()), MessageHandler::Warning); + message(i18n("%1 does not allow searching for this collection type.").arg(source()), MessageHandler::Warning); stop(); return; } @@ -124,7 +124,7 @@ void CitebaseFetcher::slotComplete(KIO::Job* job_) { #if 0 kdWarning() << "Remove debug from citebasefetcher.cpp" << endl; - TQFile f(TQString::tqfromLatin1("/tmp/test.bib")); + TQFile f(TQString::fromLatin1("/tmp/test.bib")); if(f.open(IO_WriteOnly)) { TQTextStream t(&f); t.setEncoding(TQTextStream::UnicodeUTF8); @@ -148,13 +148,13 @@ void CitebaseFetcher::slotComplete(KIO::Job* job_) { // might get aborted break; } - TQString desc = entry->field(TQString::tqfromLatin1("author")) - + TQChar('/') + entry->field(TQString::tqfromLatin1("publisher")); - if(!entry->field(TQString::tqfromLatin1("year")).isEmpty()) { - desc += TQChar('/') + entry->field(TQString::tqfromLatin1("year")); + TQString desc = entry->field(TQString::fromLatin1("author")) + + TQChar('/') + entry->field(TQString::fromLatin1("publisher")); + if(!entry->field(TQString::fromLatin1("year")).isEmpty()) { + desc += TQChar('/') + entry->field(TQString::fromLatin1("year")); } - SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(TQString::tqfromLatin1("isbn"))); + SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(TQString::fromLatin1("isbn"))); m_entries.insert(r->uid, Data::EntryPtr(entry)); emit signalResultFound(r); } @@ -167,16 +167,16 @@ Tellico::Data::EntryPtr CitebaseFetcher::fetchEntry(uint uid_) { } KURL CitebaseFetcher::searchURL(FetchKey key_, const TQString& value_) const { - KURL u(TQString::tqfromLatin1(CITEBASE_BASE_URL)); + KURL u(TQString::fromLatin1(CITEBASE_BASE_URL)); switch(key_) { case ArxivID: { // remove prefix and/or version number TQString value = value_; - value.remove(TQRegExp(TQString::tqfromLatin1("^arxiv:"), false)); - value.remove(TQRegExp(TQString::tqfromLatin1("v\\d+$"))); - u.addQueryItem(TQString::tqfromLatin1("rft_id"), TQString::tqfromLatin1("oai:arXiv.org:%1").tqarg(value)); + value.remove(TQRegExp(TQString::fromLatin1("^arxiv:"), false)); + value.remove(TQRegExp(TQString::fromLatin1("v\\d+$"))); + u.addQueryItem(TQString::fromLatin1("rft_id"), TQString::fromLatin1("oai:arXiv.org:%1").arg(value)); } break; @@ -186,14 +186,14 @@ KURL CitebaseFetcher::searchURL(FetchKey key_, const TQString& value_) const { } #ifdef CITEBASE_TEST - u = KURL::fromPathOrURL(TQString::tqfromLatin1("/home/robby/citebase.bib")); + u = KURL::fromPathOrURL(TQString::fromLatin1("/home/robby/citebase.bib")); #endif myDebug() << "CitebaseFetcher::search() - url: " << u.url() << endl; return u; } void CitebaseFetcher::updateEntry(Data::EntryPtr entry_) { - TQString arxiv = entry_->field(TQString::tqfromLatin1("arxiv")); + TQString arxiv = entry_->field(TQString::fromLatin1("arxiv")); if(!arxiv.isEmpty()) { search(Fetch::ArxivID, arxiv); return; @@ -207,7 +207,7 @@ void CitebaseFetcher::updateEntrySynchronous(Data::EntryPtr entry) { if(!entry) { return; } - TQString arxiv = entry->field(TQString::tqfromLatin1("arxiv")); + TQString arxiv = entry->field(TQString::fromLatin1("arxiv")); if(arxiv.isEmpty()) { return; } diff --git a/src/fetch/configwidget.cpp b/src/fetch/configwidget.cpp index f67c39a..24a1bc5 100644 --- a/src/fetch/configwidget.cpp +++ b/src/fetch/configwidget.cpp @@ -18,7 +18,7 @@ #include <kaccelmanager.h> #include <tqvgroupbox.h> -#include <tqlayout.h> +#include <layout.h> using Tellico::Fetch::ConfigWidget; @@ -38,7 +38,7 @@ void ConfigWidget::addFieldsWidget(const StringMap& customFields_, const TQStrin } TQVGroupBox* box = new TQVGroupBox(i18n("Available Fields"), this); - static_cast<TQBoxLayout*>(tqlayout())->addWidget(box); + static_cast<TQBoxLayout*>(layout())->addWidget(box); for(StringMap::ConstIterator it = customFields_.begin(); it != customFields_.end(); ++it) { TQCheckBox* cb = new TQCheckBox(it.data(), box); m_fields.insert(it.key(), cb); @@ -60,7 +60,7 @@ void ConfigWidget::saveFieldsConfig(KConfigGroup& config_) const { fields << it.currentKey(); } } - config_.writeEntry(TQString::tqfromLatin1("Custom Fields"), fields); + config_.writeEntry(TQString::fromLatin1("Custom Fields"), fields); } #include "configwidget.moc" diff --git a/src/fetch/crossreffetcher.cpp b/src/fetch/crossreffetcher.cpp index 2969e60..d888902 100644 --- a/src/fetch/crossreffetcher.cpp +++ b/src/fetch/crossreffetcher.cpp @@ -31,7 +31,7 @@ #include <tqlabel.h> #include <tqwhatsthis.h> -#include <tqlayout.h> +#include <layout.h> #include <tqfile.h> // #define CROSSREF_TEST @@ -54,7 +54,7 @@ CrossRefFetcher::~CrossRefFetcher() { } TQString CrossRefFetcher::defaultName() { - return TQString::tqfromLatin1("CrossRef"); + return TQString::fromLatin1("CrossRef"); } TQString CrossRefFetcher::source() const { @@ -82,13 +82,13 @@ void CrossRefFetcher::search(FetchKey key_, const TQString& value_) { m_started = true; if(m_user.isEmpty() || m_password.isEmpty()) { - message(i18n("%1 requires a username and password.").tqarg(source()), MessageHandler::Warning); + message(i18n("%1 requires a username and password.").arg(source()), MessageHandler::Warning); stop(); return; } if(!canFetch(Kernel::self()->collectionType())) { - message(i18n("%1 does not allow searching for this collection type.").tqarg(source()), MessageHandler::Warning); + message(i18n("%1 does not allow searching for this collection type.").arg(source()), MessageHandler::Warning); stop(); return; } @@ -148,7 +148,7 @@ void CrossRefFetcher::slotComplete(KIO::Job* job_) { #if 0 kdWarning() << "Remove debug from crossreffetcher.cpp" << endl; - TQFile f(TQString::tqfromLatin1("/tmp/test.xml")); + TQFile f(TQString::fromLatin1("/tmp/test.xml")); if(f.open(IO_WriteOnly)) { TQTextStream t(&f); t.setEncoding(TQTextStream::UnicodeUTF8); @@ -182,13 +182,13 @@ void CrossRefFetcher::slotComplete(KIO::Job* job_) { // might get aborted break; } - TQString desc = entry->field(TQString::tqfromLatin1("author")) - + TQChar('/') + entry->field(TQString::tqfromLatin1("publisher")); - if(!entry->field(TQString::tqfromLatin1("year")).isEmpty()) { - desc += TQChar('/') + entry->field(TQString::tqfromLatin1("year")); + TQString desc = entry->field(TQString::fromLatin1("author")) + + TQChar('/') + entry->field(TQString::fromLatin1("publisher")); + if(!entry->field(TQString::fromLatin1("year")).isEmpty()) { + desc += TQChar('/') + entry->field(TQString::fromLatin1("year")); } - SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(TQString::tqfromLatin1("isbn"))); + SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(TQString::fromLatin1("isbn"))); m_entries.insert(r->uid, Data::EntryPtr(entry)); emit signalResultFound(r); } @@ -199,19 +199,19 @@ void CrossRefFetcher::slotComplete(KIO::Job* job_) { Tellico::Data::EntryPtr CrossRefFetcher::fetchEntry(uint uid_) { Data::EntryPtr entry = m_entries[uid_]; // if URL but no cover image, fetch it - if(!entry->field(TQString::tqfromLatin1("url")).isEmpty()) { + if(!entry->field(TQString::fromLatin1("url")).isEmpty()) { Data::CollPtr coll = entry->collection(); - Data::FieldPtr field = coll->fieldByName(TQString::tqfromLatin1("cover")); + Data::FieldPtr field = coll->fieldByName(TQString::fromLatin1("cover")); if(!field && !coll->imageFields().isEmpty()) { field = coll->imageFields().front(); } else if(!field) { - field = new Data::Field(TQString::tqfromLatin1("cover"), i18n("Front Cover"), Data::Field::Image); + field = new Data::Field(TQString::fromLatin1("cover"), i18n("Front Cover"), Data::Field::Image); coll->addField(field); } if(entry->field(field).isEmpty()) { - TQPixmap pix = NetAccess::filePreview(entry->field(TQString::tqfromLatin1("url"))); + TQPixmap pix = NetAccess::filePreview(entry->field(TQString::fromLatin1("url"))); if(!pix.isNull()) { - TQString id = ImageFactory::addImage(pix, TQString::tqfromLatin1("PNG")); + TQString id = ImageFactory::addImage(pix, TQString::fromLatin1("PNG")); if(!id.isEmpty()) { entry->setField(field, id); } @@ -223,9 +223,9 @@ Tellico::Data::EntryPtr CrossRefFetcher::fetchEntry(uint uid_) { void CrossRefFetcher::initXSLTHandler() { #ifdef CROSSREF_USE_UNIXREF - TQString xsltfile = locate("appdata", TQString::tqfromLatin1("unixref2tellico.xsl")); + TQString xsltfile = locate("appdata", TQString::fromLatin1("unixref2tellico.xsl")); #else - TQString xsltfile = locate("appdata", TQString::tqfromLatin1("crossref2tellico.xsl")); + TQString xsltfile = locate("appdata", TQString::fromLatin1("crossref2tellico.xsl")); #endif if(xsltfile.isEmpty()) { kdWarning() << "CrossRefFetcher::initXSLTHandler() - can not locate xslt file." << endl; @@ -246,15 +246,15 @@ void CrossRefFetcher::initXSLTHandler() { } KURL CrossRefFetcher::searchURL(FetchKey key_, const TQString& value_) const { - KURL u(TQString::tqfromLatin1(CROSSREF_BASE_URL)); + KURL u(TQString::fromLatin1(CROSSREF_BASE_URL)); #ifdef CROSSREF_USE_UNIXREF - u.addQueryItem(TQString::tqfromLatin1("format"), TQString::tqfromLatin1("unixref")); + u.addQueryItem(TQString::fromLatin1("format"), TQString::fromLatin1("unixref")); #endif - u.addQueryItem(TQString::tqfromLatin1("req_dat"), TQString::tqfromLatin1("ourl_%1:%2").tqarg(m_user, m_password)); + u.addQueryItem(TQString::fromLatin1("req_dat"), TQString::fromLatin1("ourl_%1:%2").arg(m_user, m_password)); switch(key_) { case DOI: - u.addQueryItem(TQString::tqfromLatin1("rft_id"), TQString::tqfromLatin1("info:doi/%1").tqarg(value_)); + u.addQueryItem(TQString::fromLatin1("rft_id"), TQString::fromLatin1("info:doi/%1").arg(value_)); break; default: @@ -263,14 +263,14 @@ KURL CrossRefFetcher::searchURL(FetchKey key_, const TQString& value_) const { } #ifdef CROSSREF_TEST - u = KURL::fromPathOrURL(TQString::tqfromLatin1("/home/robby/crossref.xml")); + u = KURL::fromPathOrURL(TQString::fromLatin1("/home/robby/crossref.xml")); #endif myDebug() << "CrossRefFetcher::search() - url: " << u.url() << endl; return u; } void CrossRefFetcher::updateEntry(Data::EntryPtr entry_) { - TQString doi = entry_->field(TQString::tqfromLatin1("doi")); + TQString doi = entry_->field(TQString::fromLatin1("doi")); if(!doi.isEmpty()) { search(Fetch::DOI, doi); return; @@ -278,7 +278,7 @@ void CrossRefFetcher::updateEntry(Data::EntryPtr entry_) { #if 0 // optimistically try searching for title and rely on Collection::sameEntry() to figure things out - TQString t = entry_->field(TQString::tqfromLatin1("title")); + TQString t = entry_->field(TQString::fromLatin1("title")); if(!t.isEmpty()) { m_limit = 10; // raise limit so more possibility of match search(Fetch::Title, t); @@ -298,7 +298,7 @@ void CrossRefFetcher::updateEntrySynchronous(Data::EntryPtr entry) { myDebug() << "CrossRefFetcher::updateEntrySynchronous() - username and password is required" << endl; return; } - TQString doi = entry->field(TQString::tqfromLatin1("doi")); + TQString doi = entry->field(TQString::fromLatin1("doi")); if(doi.isEmpty()) { return; } @@ -347,7 +347,7 @@ CrossRefFetcher::ConfigWidget::ConfigWidget(TQWidget* parent_, const CrossRefFet ++row; l->addMultiCellWidget(al, row, row, 0, 1); // richtext gets weird with size - al->setMinimumWidth(al->tqsizeHint().width()); + al->setMinimumWidth(al->sizeHint().width()); TQLabel* label = new TQLabel(i18n("&Username: "), optionsWidget()); l->addWidget(label, ++row, 0); diff --git a/src/fetch/discogsfetcher.cpp b/src/fetch/discogsfetcher.cpp index 13341f6..c8c1de8 100644 --- a/src/fetch/discogsfetcher.cpp +++ b/src/fetch/discogsfetcher.cpp @@ -28,7 +28,7 @@ #include <kio/job.h> #include <tqlabel.h> -#include <tqlayout.h> +#include <layout.h> #include <tqfile.h> #include <tqwhatsthis.h> @@ -45,7 +45,7 @@ using Tellico::Fetch::DiscogsFetcher; DiscogsFetcher::DiscogsFetcher(TQObject* parent_, const char* name_) : Fetcher(parent_, name_), m_xsltHandler(0), m_limit(DISCOGS_MAX_RETURNS_TOTAL), m_job(0), m_started(false), - m_apiKey(TQString::tqfromLatin1(DISCOGS_API_KEY)) { + m_apiKey(TQString::fromLatin1(DISCOGS_API_KEY)) { } DiscogsFetcher::~DiscogsFetcher() { @@ -89,31 +89,31 @@ void DiscogsFetcher::continueSearch() { } void DiscogsFetcher::doSearch() { - KURL u(TQString::tqfromLatin1(DISCOGS_API_URL)); - u.addQueryItem(TQString::tqfromLatin1("f"), TQString::tqfromLatin1("xml")); - u.addQueryItem(TQString::tqfromLatin1("api_key"), m_apiKey); + KURL u(TQString::fromLatin1(DISCOGS_API_URL)); + u.addQueryItem(TQString::fromLatin1("f"), TQString::fromLatin1("xml")); + u.addQueryItem(TQString::fromLatin1("api_key"), m_apiKey); if(!canFetch(Kernel::self()->collectionType())) { - message(i18n("%1 does not allow searching for this collection type.").tqarg(source()), MessageHandler::Warning); + message(i18n("%1 does not allow searching for this collection type.").arg(source()), MessageHandler::Warning); stop(); return; } switch(m_key) { case Title: - u.setPath(TQString::tqfromLatin1("/search")); - u.addQueryItem(TQString::tqfromLatin1("q"), m_value); - u.addQueryItem(TQString::tqfromLatin1("type"), TQString::tqfromLatin1("release")); + u.setPath(TQString::fromLatin1("/search")); + u.addQueryItem(TQString::fromLatin1("q"), m_value); + u.addQueryItem(TQString::fromLatin1("type"), TQString::fromLatin1("release")); break; case Person: - u.setPath(TQString::tqfromLatin1("/artist/%1").tqarg(m_value)); + u.setPath(TQString::fromLatin1("/artist/%1").arg(m_value)); break; case Keyword: - u.setPath(TQString::tqfromLatin1("/search")); - u.addQueryItem(TQString::tqfromLatin1("q"), m_value); - u.addQueryItem(TQString::tqfromLatin1("type"), TQString::tqfromLatin1("all")); + u.setPath(TQString::fromLatin1("/search")); + u.addQueryItem(TQString::fromLatin1("q"), m_value); + u.addQueryItem(TQString::fromLatin1("type"), TQString::fromLatin1("all")); break; default: @@ -123,7 +123,7 @@ void DiscogsFetcher::doSearch() { } #ifdef DISCOGS_TEST - u = KURL(TQString::tqfromLatin1("/home/robby/discogs-results.xml")); + u = KURL(TQString::fromLatin1("/home/robby/discogs-results.xml")); #endif // myDebug() << "DiscogsFetcher::search() - url: " << u.url() << endl; @@ -168,7 +168,7 @@ void DiscogsFetcher::slotComplete(KIO::Job* job_) { #if 0 kdWarning() << "Remove debug from discogsfetcher.cpp" << endl; - TQFile f(TQString::tqfromLatin1("/tmp/test.xml")); + TQFile f(TQString::fromLatin1("/tmp/test.xml")); if(f.open(IO_WriteOnly)) { TQTextStream t(&f); t.setEncoding(TQTextStream::UnicodeUTF8); @@ -192,11 +192,11 @@ void DiscogsFetcher::slotComplete(KIO::Job* job_) { return; } // total is /resp/searchresults/@numResults - TQDomNode n = dom.documentElement().namedItem(TQString::tqfromLatin1("resp")) - .namedItem(TQString::tqfromLatin1("searchresults")); + TQDomNode n = dom.documentElement().namedItem(TQString::fromLatin1("resp")) + .namedItem(TQString::fromLatin1("searchresults")); TQDomElement e = n.toElement(); if(!e.isNull()) { - m_total = e.attribute(TQString::tqfromLatin1("numResults")).toInt(); + m_total = e.attribute(TQString::fromLatin1("numResults")).toInt(); myDebug() << "total = " << m_total; } } @@ -218,9 +218,9 @@ void DiscogsFetcher::slotComplete(KIO::Job* job_) { // might get aborted break; } - TQString desc = entry->field(TQString::tqfromLatin1("artist")) + TQString desc = entry->field(TQString::fromLatin1("artist")) + TQChar('/') - + entry->field(TQString::tqfromLatin1("label")); + + entry->field(TQString::fromLatin1("label")); SearchResult* r = new SearchResult(this, entry->title(), desc, TQString()); m_entries.insert(r->uid, Data::EntryPtr(entry)); @@ -241,24 +241,24 @@ Tellico::Data::EntryPtr DiscogsFetcher::fetchEntry(uint uid_) { } // one way we tell if this entry has been fully initialized is to // check for a cover image - if(!entry->field(TQString::tqfromLatin1("cover")).isEmpty()) { + if(!entry->field(TQString::fromLatin1("cover")).isEmpty()) { myLog() << "DiscogsFetcher::fetchEntry() - already downloaded " << entry->title() << endl; return entry; } - TQString release = entry->field(TQString::tqfromLatin1("discogs-id")); + TQString release = entry->field(TQString::fromLatin1("discogs-id")); if(release.isEmpty()) { myDebug() << "DiscogsFetcher::fetchEntry() - no discogs release found" << endl; return entry; } #ifdef DISCOGS_TEST - KURL u(TQString::tqfromLatin1("/home/robby/discogs-release.xml")); + KURL u(TQString::fromLatin1("/home/robby/discogs-release.xml")); #else - KURL u(TQString::tqfromLatin1(DISCOGS_API_URL)); - u.setPath(TQString::tqfromLatin1("/release/%1").tqarg(release)); - u.addQueryItem(TQString::tqfromLatin1("f"), TQString::tqfromLatin1("xml")); - u.addQueryItem(TQString::tqfromLatin1("api_key"), m_apiKey); + KURL u(TQString::fromLatin1(DISCOGS_API_URL)); + u.setPath(TQString::fromLatin1("/release/%1").arg(release)); + u.addQueryItem(TQString::fromLatin1("f"), TQString::fromLatin1("xml")); + u.addQueryItem(TQString::fromLatin1("api_key"), m_apiKey); #endif // myDebug() << "DiscogsFetcher::fetchEntry() - url: " << u << endl; @@ -266,7 +266,7 @@ Tellico::Data::EntryPtr DiscogsFetcher::fetchEntry(uint uid_) { TQString output = FileHandler::readTextFile(u, true, true, true); #if 0 kdWarning() << "Remove output debug from discogsfetcher.cpp" << endl; - TQFile f(TQString::tqfromLatin1("/tmp/test.xml")); + TQFile f(TQString::fromLatin1("/tmp/test.xml")); if(f.open(IO_WriteOnly)) { TQTextStream t(&f); t.setEncoding(TQTextStream::UnicodeUTF8); @@ -295,7 +295,7 @@ Tellico::Data::EntryPtr DiscogsFetcher::fetchEntry(uint uid_) { } // don't want to include id - coll->removeField(TQString::tqfromLatin1("discogs-id")); + coll->removeField(TQString::fromLatin1("discogs-id")); entry = coll->entries().front(); m_entries.replace(uid_, entry); @@ -303,7 +303,7 @@ Tellico::Data::EntryPtr DiscogsFetcher::fetchEntry(uint uid_) { } void DiscogsFetcher::initXSLTHandler() { - TQString xsltfile = locate("appdata", TQString::tqfromLatin1("discogs2tellico.xsl")); + TQString xsltfile = locate("appdata", TQString::fromLatin1("discogs2tellico.xsl")); if(xsltfile.isEmpty()) { kdWarning() << "DiscogsFetcher::initXSLTHandler() - can not locate discogs2tellico.xsl." << endl; return; @@ -326,13 +326,13 @@ void DiscogsFetcher::updateEntry(Data::EntryPtr entry_) { // myDebug() << "DiscogsFetcher::updateEntry()" << endl; TQString value; - TQString title = entry_->field(TQString::tqfromLatin1("title")); + TQString title = entry_->field(TQString::fromLatin1("title")); if(!title.isEmpty()) { search(Title, value); return; } - TQString artist = entry_->field(TQString::tqfromLatin1("artist")); + TQString artist = entry_->field(TQString::fromLatin1("artist")); if(!artist.isEmpty()) { search(Person, artist); return; @@ -382,7 +382,7 @@ DiscogsFetcher::ConfigWidget::ConfigWidget(TQWidget* parent_, const DiscogsFetch m_apiKeyEdit->setText(fetcher_->m_apiKey); m_fetchImageCheck->setChecked(fetcher_->m_fetchImages); } else { - m_apiKeyEdit->setText(TQString::tqfromLatin1(DISCOGS_API_KEY)); + m_apiKeyEdit->setText(TQString::fromLatin1(DISCOGS_API_KEY)); m_fetchImageCheck->setChecked(true); } } @@ -404,9 +404,9 @@ TQString DiscogsFetcher::ConfigWidget::preferredName() const { Tellico::StringMap DiscogsFetcher::customFields() { StringMap map; - map[TQString::tqfromLatin1("producer")] = i18n("Producer"); - map[TQString::tqfromLatin1("nationality")] = i18n("Nationality"); - map[TQString::tqfromLatin1("discogs")] = i18n("Discogs Link"); + map[TQString::fromLatin1("producer")] = i18n("Producer"); + map[TQString::fromLatin1("nationality")] = i18n("Nationality"); + map[TQString::fromLatin1("discogs")] = i18n("Discogs Link"); return map; } diff --git a/src/fetch/entrezfetcher.cpp b/src/fetch/entrezfetcher.cpp index 6383735..077ec33 100644 --- a/src/fetch/entrezfetcher.cpp +++ b/src/fetch/entrezfetcher.cpp @@ -28,7 +28,7 @@ #include <tqdom.h> #include <tqlabel.h> -#include <tqlayout.h> +#include <layout.h> #include <tqfile.h> //#define ENTREZ_TEST @@ -65,7 +65,7 @@ bool EntrezFetcher::canFetch(int type) const { } void EntrezFetcher::readConfigHook(const KConfigGroup& config_) { - TQString s = config_.readEntry("Database", TQString::tqfromLatin1(ENTREZ_DEFAULT_DATABASE)); // default to pubmed + TQString s = config_.readEntry("Database", TQString::fromLatin1(ENTREZ_DEFAULT_DATABASE)); // default to pubmed if(!s.isEmpty()) { m_dbname = s; } @@ -84,36 +84,36 @@ void EntrezFetcher::search(FetchKey key_, const TQString& value_) { return; } if(m_dbname.isEmpty()) { - m_dbname = TQString::tqfromLatin1(ENTREZ_DEFAULT_DATABASE); + m_dbname = TQString::fromLatin1(ENTREZ_DEFAULT_DATABASE); } #ifdef ENTREZ_TEST - KURL u = KURL::fromPathOrURL(TQString::tqfromLatin1("/home/robby/esearch.xml")); + KURL u = KURL::fromPathOrURL(TQString::fromLatin1("/home/robby/esearch.xml")); #else - KURL u(TQString::tqfromLatin1(ENTREZ_BASE_URL)); - u.addPath(TQString::tqfromLatin1(ENTREZ_SEARCH_CGI)); - u.addQueryItem(TQString::tqfromLatin1("tool"), TQString::tqfromLatin1("Tellico")); - u.addQueryItem(TQString::tqfromLatin1("retmode"), TQString::tqfromLatin1("xml")); - u.addQueryItem(TQString::tqfromLatin1("usehistory"), TQString::tqfromLatin1("y")); - u.addQueryItem(TQString::tqfromLatin1("retmax"), TQString::tqfromLatin1("1")); // we're just getting the count - u.addQueryItem(TQString::tqfromLatin1("db"), m_dbname); - u.addQueryItem(TQString::tqfromLatin1("term"), value_); + KURL u(TQString::fromLatin1(ENTREZ_BASE_URL)); + u.addPath(TQString::fromLatin1(ENTREZ_SEARCH_CGI)); + u.addQueryItem(TQString::fromLatin1("tool"), TQString::fromLatin1("Tellico")); + u.addQueryItem(TQString::fromLatin1("retmode"), TQString::fromLatin1("xml")); + u.addQueryItem(TQString::fromLatin1("usehistory"), TQString::fromLatin1("y")); + u.addQueryItem(TQString::fromLatin1("retmax"), TQString::fromLatin1("1")); // we're just getting the count + u.addQueryItem(TQString::fromLatin1("db"), m_dbname); + u.addQueryItem(TQString::fromLatin1("term"), value_); switch(key_) { case Title: - u.addQueryItem(TQString::tqfromLatin1("field"), TQString::tqfromLatin1("titl")); + u.addQueryItem(TQString::fromLatin1("field"), TQString::fromLatin1("titl")); break; case Person: - u.addQueryItem(TQString::tqfromLatin1("field"), TQString::tqfromLatin1("auth")); + u.addQueryItem(TQString::fromLatin1("field"), TQString::fromLatin1("auth")); break; case Keyword: // for Tellico Keyword searches basically mean search for any field matching -// u.addQueryItem(TQString::tqfromLatin1("field"), TQString::tqfromLatin1("word")); +// u.addQueryItem(TQString::fromLatin1("field"), TQString::fromLatin1("word")); break; case PubmedID: - u.addQueryItem(TQString::tqfromLatin1("field"), TQString::tqfromLatin1("pmid")); + u.addQueryItem(TQString::fromLatin1("field"), TQString::fromLatin1("pmid")); break; case DOI: @@ -179,7 +179,7 @@ void EntrezFetcher::slotComplete(KIO::Job* job_) { #if 0 kdWarning() << "Remove debug from entrezfetcher.cpp: " << __LINE__ << endl; - TQFile f(TQString::tqfromLatin1("/tmp/test.xml")); + TQFile f(TQString::fromLatin1("/tmp/test.xml")); if(f.open(IO_WriteOnly)) { TQTextStream t(&f); t.setEncoding(TQTextStream::UnicodeUTF8); @@ -239,18 +239,18 @@ void EntrezFetcher::searchResults() { void EntrezFetcher::doSummary() { #ifdef ENTREZ_TEST - KURL u = KURL::fromPathOrURL(TQString::tqfromLatin1("/home/robby/esummary.xml")); + KURL u = KURL::fromPathOrURL(TQString::fromLatin1("/home/robby/esummary.xml")); #else - KURL u(TQString::tqfromLatin1(ENTREZ_BASE_URL)); - u.addPath(TQString::tqfromLatin1(ENTREZ_SUMMARY_CGI)); - u.addQueryItem(TQString::tqfromLatin1("tool"), TQString::tqfromLatin1("Tellico")); - u.addQueryItem(TQString::tqfromLatin1("retmode"), TQString::tqfromLatin1("xml")); - u.addQueryItem(TQString::tqfromLatin1("retstart"), TQString::number(m_start)); - u.addQueryItem(TQString::tqfromLatin1("retmax"), TQString::number(TQMIN(m_total-m_start-1, ENTREZ_MAX_RETURNS_TOTAL))); - u.addQueryItem(TQString::tqfromLatin1("usehistory"), TQString::tqfromLatin1("y")); - u.addQueryItem(TQString::tqfromLatin1("db"), m_dbname); - u.addQueryItem(TQString::tqfromLatin1("query_key"), m_queryKey); - u.addQueryItem(TQString::tqfromLatin1("WebEnv"), m_webEnv); + KURL u(TQString::fromLatin1(ENTREZ_BASE_URL)); + u.addPath(TQString::fromLatin1(ENTREZ_SUMMARY_CGI)); + u.addQueryItem(TQString::fromLatin1("tool"), TQString::fromLatin1("Tellico")); + u.addQueryItem(TQString::fromLatin1("retmode"), TQString::fromLatin1("xml")); + u.addQueryItem(TQString::fromLatin1("retstart"), TQString::number(m_start)); + u.addQueryItem(TQString::fromLatin1("retmax"), TQString::number(TQMIN(m_total-m_start-1, ENTREZ_MAX_RETURNS_TOTAL))); + u.addQueryItem(TQString::fromLatin1("usehistory"), TQString::fromLatin1("y")); + u.addQueryItem(TQString::fromLatin1("db"), m_dbname); + u.addQueryItem(TQString::fromLatin1("query_key"), m_queryKey); + u.addQueryItem(TQString::fromLatin1("WebEnv"), m_webEnv); #endif m_step = Summary; @@ -270,34 +270,34 @@ void EntrezFetcher::summaryResults() { return; } // top child is eSummaryResult - // all tqchildren are DocSum + // all children are DocSum for(TQDomNode n = dom.documentElement().firstChild(); !n.isNull(); n = n.nextSibling()) { TQDomElement e = n.toElement(); if(e.isNull() || e.tagName() != Latin1Literal("DocSum")) { continue; } - TQDomNodeList nodes = e.elementsByTagName(TQString::tqfromLatin1("Id")); + TQDomNodeList nodes = e.elementsByTagName(TQString::fromLatin1("Id")); if(nodes.count() == 0) { myDebug() << "EntrezFetcher::summaryResults() - no Id elements" << endl; continue; } int id = nodes.item(0).toElement().text().toInt(); TQString title, pubdate, authors; - nodes = e.elementsByTagName(TQString::tqfromLatin1("Item")); + nodes = e.elementsByTagName(TQString::fromLatin1("Item")); for(uint j = 0; j < nodes.count(); ++j) { - if(nodes.item(j).toElement().attribute(TQString::tqfromLatin1("Name")) == Latin1Literal("Title")) { + if(nodes.item(j).toElement().attribute(TQString::fromLatin1("Name")) == Latin1Literal("Title")) { title = nodes.item(j).toElement().text(); - } else if(nodes.item(j).toElement().attribute(TQString::tqfromLatin1("Name")) == Latin1Literal("PubDate")) { + } else if(nodes.item(j).toElement().attribute(TQString::fromLatin1("Name")) == Latin1Literal("PubDate")) { pubdate = nodes.item(j).toElement().text(); - } else if(nodes.item(j).toElement().attribute(TQString::tqfromLatin1("Name")) == Latin1Literal("AuthorList")) { + } else if(nodes.item(j).toElement().attribute(TQString::fromLatin1("Name")) == Latin1Literal("AuthorList")) { TQStringList list; for(TQDomNode aNode = nodes.item(j).firstChild(); !aNode.isNull(); aNode = aNode.nextSibling()) { - // lazy, assume all tqchildren Items are authors + // lazy, assume all children Items are authors if(aNode.nodeName() == Latin1Literal("Item")) { list << aNode.toElement().text(); } } - authors = list.join(TQString::tqfromLatin1("; ")); + authors = list.join(TQString::fromLatin1("; ")); } if(!title.isEmpty() && !pubdate.isEmpty() && !authors.isEmpty()) { break; // done now @@ -333,15 +333,15 @@ Tellico::Data::EntryPtr EntrezFetcher::fetchEntry(uint uid_) { int id = m_matches[uid_]; #ifdef ENTREZ_TEST - KURL u = KURL::fromPathOrURL(TQString::tqfromLatin1("/home/robby/pubmed.xml")); + KURL u = KURL::fromPathOrURL(TQString::fromLatin1("/home/robby/pubmed.xml")); #else - KURL u(TQString::tqfromLatin1(ENTREZ_BASE_URL)); - u.addPath(TQString::tqfromLatin1(ENTREZ_FETCH_CGI)); - u.addQueryItem(TQString::tqfromLatin1("tool"), TQString::tqfromLatin1("Tellico")); - u.addQueryItem(TQString::tqfromLatin1("retmode"), TQString::tqfromLatin1("xml")); - u.addQueryItem(TQString::tqfromLatin1("rettype"), TQString::tqfromLatin1("abstract")); - u.addQueryItem(TQString::tqfromLatin1("db"), m_dbname); - u.addQueryItem(TQString::tqfromLatin1("id"), TQString::number(id)); + KURL u(TQString::fromLatin1(ENTREZ_BASE_URL)); + u.addPath(TQString::fromLatin1(ENTREZ_FETCH_CGI)); + u.addQueryItem(TQString::fromLatin1("tool"), TQString::fromLatin1("Tellico")); + u.addQueryItem(TQString::fromLatin1("retmode"), TQString::fromLatin1("xml")); + u.addQueryItem(TQString::fromLatin1("rettype"), TQString::fromLatin1("abstract")); + u.addQueryItem(TQString::fromLatin1("db"), m_dbname); + u.addQueryItem(TQString::fromLatin1("id"), TQString::number(id)); #endif // now it's sychronous, and we know that it's utf8 TQString xmlOutput = FileHandler::readTextFile(u, false /*quiet*/, true /*utf8*/); @@ -351,7 +351,7 @@ Tellico::Data::EntryPtr EntrezFetcher::fetchEntry(uint uid_) { } #if 0 kdWarning() << "EntrezFetcher::fetchEntry() - turn me off!" << endl; - TQFile f1(TQString::tqfromLatin1("/tmp/test-entry.xml")); + TQFile f1(TQString::fromLatin1("/tmp/test-entry.xml")); if(f1.open(IO_WriteOnly)) { TQTextStream t(&f1); t.setEncoding(TQTextStream::UnicodeUTF8); @@ -376,33 +376,33 @@ Tellico::Data::EntryPtr EntrezFetcher::fetchEntry(uint uid_) { Data::EntryPtr e = coll->entries().front(); // try to get a link, but only if necessary - if(m_fields.contains(TQString::tqfromLatin1("url"))) { - KURL link(TQString::tqfromLatin1(ENTREZ_BASE_URL)); - link.addPath(TQString::tqfromLatin1(ENTREZ_LINK_CGI)); - link.addQueryItem(TQString::tqfromLatin1("tool"), TQString::tqfromLatin1("Tellico")); - link.addQueryItem(TQString::tqfromLatin1("cmd"), TQString::tqfromLatin1("llinks")); - link.addQueryItem(TQString::tqfromLatin1("db"), m_dbname); - link.addQueryItem(TQString::tqfromLatin1("dbfrom"), m_dbname); - link.addQueryItem(TQString::tqfromLatin1("id"), TQString::number(id)); + if(m_fields.contains(TQString::fromLatin1("url"))) { + KURL link(TQString::fromLatin1(ENTREZ_BASE_URL)); + link.addPath(TQString::fromLatin1(ENTREZ_LINK_CGI)); + link.addQueryItem(TQString::fromLatin1("tool"), TQString::fromLatin1("Tellico")); + link.addQueryItem(TQString::fromLatin1("cmd"), TQString::fromLatin1("llinks")); + link.addQueryItem(TQString::fromLatin1("db"), m_dbname); + link.addQueryItem(TQString::fromLatin1("dbfrom"), m_dbname); + link.addQueryItem(TQString::fromLatin1("id"), TQString::number(id)); TQDomDocument linkDom = FileHandler::readXMLFile(link, false /* namespace */, true /* quiet */); // need eLinkResult/LinkSet/IdUrlList/IdUrlSet/ObjUrl/Url - TQDomNode linkNode = linkDom.namedItem(TQString::tqfromLatin1("eLinkResult")) - .namedItem(TQString::tqfromLatin1("LinkSet")) - .namedItem(TQString::tqfromLatin1("IdUrlList")) - .namedItem(TQString::tqfromLatin1("IdUrlSet")) - .namedItem(TQString::tqfromLatin1("ObjUrl")) - .namedItem(TQString::tqfromLatin1("Url")); + TQDomNode linkNode = linkDom.namedItem(TQString::fromLatin1("eLinkResult")) + .namedItem(TQString::fromLatin1("LinkSet")) + .namedItem(TQString::fromLatin1("IdUrlList")) + .namedItem(TQString::fromLatin1("IdUrlSet")) + .namedItem(TQString::fromLatin1("ObjUrl")) + .namedItem(TQString::fromLatin1("Url")); if(!linkNode.isNull()) { TQString u = linkNode.toElement().text(); // myDebug() << u << endl; if(!u.isEmpty()) { - if(!coll->hasField(TQString::tqfromLatin1("url"))) { - Data::FieldPtr field = new Data::Field(TQString::tqfromLatin1("url"), i18n("URL"), Data::Field::URL); + if(!coll->hasField(TQString::fromLatin1("url"))) { + Data::FieldPtr field = new Data::Field(TQString::fromLatin1("url"), i18n("URL"), Data::Field::URL); field->setCategory(i18n("Miscellaneous")); coll->addField(field); } - e->setField(TQString::tqfromLatin1("url"), u); + e->setField(TQString::fromLatin1("url"), u); } } } @@ -419,7 +419,7 @@ Tellico::Data::EntryPtr EntrezFetcher::fetchEntry(uint uid_) { } void EntrezFetcher::initXSLTHandler() { - TQString xsltfile = locate("appdata", TQString::tqfromLatin1("pubmed2tellico.xsl")); + TQString xsltfile = locate("appdata", TQString::fromLatin1("pubmed2tellico.xsl")); if(xsltfile.isEmpty()) { kdWarning() << "EntrezFetcher::initXSLTHandler() - can not locate pubmed2tellico.xsl." << endl; return; @@ -441,19 +441,19 @@ void EntrezFetcher::initXSLTHandler() { void EntrezFetcher::updateEntry(Data::EntryPtr entry_) { // myDebug() << "EntrezFetcher::updateEntry()" << endl; - TQString s = entry_->field(TQString::tqfromLatin1("pmid")); + TQString s = entry_->field(TQString::fromLatin1("pmid")); if(!s.isEmpty()) { search(PubmedID, s); return; } - s = entry_->field(TQString::tqfromLatin1("doi")); + s = entry_->field(TQString::fromLatin1("doi")); if(!s.isEmpty()) { search(DOI, s); return; } - s = entry_->field(TQString::tqfromLatin1("title")); + s = entry_->field(TQString::fromLatin1("title")); if(!s.isEmpty()) { search(Title, s); return; @@ -489,9 +489,9 @@ TQString EntrezFetcher::ConfigWidget::preferredName() const { //static Tellico::StringMap EntrezFetcher::customFields() { StringMap map; - map[TQString::tqfromLatin1("institution")] = i18n("Institution"); - map[TQString::tqfromLatin1("abstract")] = i18n("Abstract"); - map[TQString::tqfromLatin1("url")] = i18n("URL"); + map[TQString::fromLatin1("institution")] = i18n("Institution"); + map[TQString::fromLatin1("abstract")] = i18n("Abstract"); + map[TQString::fromLatin1("url")] = i18n("URL"); return map; } diff --git a/src/fetch/execexternalfetcher.cpp b/src/fetch/execexternalfetcher.cpp index 630abc9..3e40059 100644 --- a/src/fetch/execexternalfetcher.cpp +++ b/src/fetch/execexternalfetcher.cpp @@ -31,7 +31,7 @@ #include <kurlrequester.h> #include <kaccelmanager.h> -#include <tqlayout.h> +#include <layout.h> #include <tqlabel.h> #include <tqwhatsthis.h> #include <tqregexp.h> @@ -42,10 +42,10 @@ using Tellico::Fetch::ExecExternalFetcher; TQStringList ExecExternalFetcher::parseArguments(const TQString& str_) { // matching escaped quotes is too hard... :( -// TQRegExp quotes(TQString::tqfromLatin1("[^\\\\](['\"])(.*[^\\\\])\\1")); - TQRegExp quotes(TQString::tqfromLatin1("(['\"])(.*)\\1")); +// TQRegExp quotes(TQString::fromLatin1("[^\\\\](['\"])(.*[^\\\\])\\1")); + TQRegExp quotes(TQString::fromLatin1("(['\"])(.*)\\1")); quotes.setMinimal(true); - TQRegExp spaces(TQString::tqfromLatin1("\\s+")); + TQRegExp spaces(TQString::fromLatin1("\\s+")); spaces.setMinimal(true); TQStringList args; @@ -139,14 +139,14 @@ void ExecExternalFetcher::search(FetchKey key_, const TQString& value_) { value.remove('-'); // remove hyphens from isbn values // shouldn't hurt and might keep from confusing stupid search sources } - TQRegExp rx1(TQString::tqfromLatin1("['\"].*\\1")); + TQRegExp rx1(TQString::fromLatin1("['\"].*\\1")); if(!rx1.exactMatch(value)) { value.prepend('"').append('"'); } TQString args = m_args[key_]; - TQRegExp rx2(TQString::tqfromLatin1("['\"]%1\\1")); - args.replace(rx2, TQString::tqfromLatin1("%1")); - startSearch(parseArguments(args.tqarg(value))); // replace %1 with search value + TQRegExp rx2(TQString::fromLatin1("['\"]%1\\1")); + args.replace(rx2, TQString::fromLatin1("%1")); + startSearch(parseArguments(args.arg(value))); // replace %1 with search value } void ExecExternalFetcher::startSearch(const TQStringList& args_) { @@ -196,7 +196,7 @@ void ExecExternalFetcher::slotData(KProcess*, char* buffer_, int len_) { void ExecExternalFetcher::slotError(KProcess*, char* buffer_, int len_) { GUI::CursorSaver cs(TQt::arrowCursor); TQString msg = TQString::fromLocal8Bit(buffer_, len_); - msg.prepend(source() + TQString::tqfromLatin1(": ")); + msg.prepend(source() + TQString::fromLatin1(": ")); if(msg.endsWith(TQChar('\n'))) { msg.truncate(msg.length()-1); } @@ -235,7 +235,7 @@ void ExecExternalFetcher::slotProcessExited(KProcess*) { Data::CollPtr coll = imp->collection(); if(!coll) { if(!imp->statusMessage().isEmpty()) { - message(imp->statusMessage(), MessageHandler::tqStatus); + message(imp->statusMessage(), MessageHandler::Status); } myDebug() << "ExecExternalFetcher::slotProcessExited() - "<< source() << ": no collection pointer" << endl; delete imp; @@ -256,56 +256,56 @@ void ExecExternalFetcher::slotProcessExited(KProcess*) { switch(coll->type()) { case Data::Collection::Book: case Data::Collection::Bibtex: - desc = entry->field(TQString::tqfromLatin1("author")) + desc = entry->field(TQString::fromLatin1("author")) + TQChar('/') - + 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")); + + entry->field(TQString::fromLatin1("publisher")); + if(!entry->field(TQString::fromLatin1("cr_year")).isEmpty()) { + desc += TQChar('/') + entry->field(TQString::fromLatin1("cr_year")); + } else if(!entry->field(TQString::fromLatin1("pub_year")).isEmpty()){ + desc += TQChar('/') + entry->field(TQString::fromLatin1("pub_year")); } break; case Data::Collection::Video: - desc = entry->field(TQString::tqfromLatin1("studio")) + desc = entry->field(TQString::fromLatin1("studio")) + TQChar('/') - + entry->field(TQString::tqfromLatin1("director")) + + entry->field(TQString::fromLatin1("director")) + TQChar('/') - + entry->field(TQString::tqfromLatin1("year")) + + entry->field(TQString::fromLatin1("year")) + TQChar('/') - + entry->field(TQString::tqfromLatin1("medium")); + + entry->field(TQString::fromLatin1("medium")); break; case Data::Collection::Album: - desc = entry->field(TQString::tqfromLatin1("artist")) + desc = entry->field(TQString::fromLatin1("artist")) + TQChar('/') - + entry->field(TQString::tqfromLatin1("label")) + + entry->field(TQString::fromLatin1("label")) + TQChar('/') - + entry->field(TQString::tqfromLatin1("year")); + + entry->field(TQString::fromLatin1("year")); break; case Data::Collection::Game: - desc = entry->field(TQString::tqfromLatin1("platform")); + desc = entry->field(TQString::fromLatin1("platform")); break; case Data::Collection::ComicBook: - desc = entry->field(TQString::tqfromLatin1("publisher")) + desc = entry->field(TQString::fromLatin1("publisher")) + TQChar('/') - + entry->field(TQString::tqfromLatin1("pub_year")); + + entry->field(TQString::fromLatin1("pub_year")); break; case Data::Collection::BoardGame: - desc = entry->field(TQString::tqfromLatin1("designer")) + desc = entry->field(TQString::fromLatin1("designer")) + TQChar('/') - + entry->field(TQString::tqfromLatin1("publisher")) + + entry->field(TQString::fromLatin1("publisher")) + TQChar('/') - + entry->field(TQString::tqfromLatin1("year")); + + entry->field(TQString::fromLatin1("year")); break; default: break; } - SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(TQString::tqfromLatin1("isbn"))); + SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(TQString::fromLatin1("isbn"))); m_entries.insert(r->uid, entry); emit signalResultFound(r); } @@ -398,8 +398,8 @@ ExecExternalFetcher::ConfigWidget::ConfigWidget(TQWidget* parent_, const ExecExt gridLayout->addWidget(cb, ++row, 0); m_cbDict.insert(key, cb); GUI::LineEdit* le = new GUI::LineEdit(grid); - le->setHint(TQString::tqfromLatin1("%1")); // for example - le->completionObject()->addItem(TQString::tqfromLatin1("%1")); + le->setHint(TQString::fromLatin1("%1")); // for example + le->completionObject()->addItem(TQString::fromLatin1("%1")); gridLayout->addWidget(le, row, 1); m_leDict.insert(key, le); if(fetcher_ && fetcher_->m_args.contains(key)) { @@ -417,9 +417,9 @@ ExecExternalFetcher::ConfigWidget::ConfigWidget(TQWidget* parent_, const ExecExt m_cbUpdate = new TQCheckBox(i18n("Update"), grid); gridLayout->addWidget(m_cbUpdate, ++row, 0); m_leUpdate = new GUI::LineEdit(grid); - m_leUpdate->setHint(TQString::tqfromLatin1("%{title}")); // for example - m_leUpdate->completionObject()->addItem(TQString::tqfromLatin1("%{title}")); - m_leUpdate->completionObject()->addItem(TQString::tqfromLatin1("%{isbn}")); + m_leUpdate->setHint(TQString::fromLatin1("%{title}")); // for example + m_leUpdate->completionObject()->addItem(TQString::fromLatin1("%{title}")); + m_leUpdate->completionObject()->addItem(TQString::fromLatin1("%{isbn}")); gridLayout->addWidget(m_leUpdate, row, 1); /* TRANSLATORS: Do not translate %{author}. */ w2 = i18n("<p>Enter the arguments which should be used to search for available updates to an entry.</p><p>" diff --git a/src/fetch/fetcher.h b/src/fetch/fetcher.h index d2fc301..0474299 100644 --- a/src/fetch/fetcher.h +++ b/src/fetch/fetcher.h @@ -117,7 +117,7 @@ public: virtual ConfigWidget* configWidget(TQWidget* parent) const = 0; signals: -// void signaltqStatus(const TQString& status); +// void signalStatus(const TQString& status); void signalResultFound(Tellico::Fetch::SearchResult* result); void signalDone(Tellico::Fetch::Fetcher::Ptr); diff --git a/src/fetch/fetchmanager.cpp b/src/fetch/fetchmanager.cpp index fb83e9f..4a64052 100644 --- a/src/fetch/fetchmanager.cpp +++ b/src/fetch/fetchmanager.cpp @@ -94,11 +94,11 @@ void Manager::loadFetchers() { m_configMap.clear(); KConfig* config = KGlobal::config(); - if(config->hasGroup(TQString::tqfromLatin1("Data Sources"))) { - KConfigGroup configGroup(config, TQString::tqfromLatin1("Data Sources")); + if(config->hasGroup(TQString::fromLatin1("Data Sources"))) { + KConfigGroup configGroup(config, TQString::fromLatin1("Data Sources")); int nSources = configGroup.readNumEntry("Sources Count", 0); for(int i = 0; i < nSources; ++i) { - TQString group = TQString::tqfromLatin1("Data Source %1").tqarg(i); + TQString group = TQString::fromLatin1("Data Source %1").arg(i); Fetcher::Ptr f = createFetcher(config, group); if(f) { m_configMap.insert(f, group); @@ -359,7 +359,7 @@ Tellico::Fetch::FetcherVec Manager::defaultFetchers() { vec.append(new GoogleScholarFetcher(this)); vec.append(new DiscogsFetcher(this)); // only add IBS if user includes italian - if(KGlobal::locale()->languagesTwoAlpha().contains(TQString::tqfromLatin1("it"))) { + if(KGlobal::locale()->languagesTwoAlpha().contains(TQString::fromLatin1("it"))) { vec.append(new IBSFetcher(this)); } return vec; @@ -374,7 +374,7 @@ Tellico::Fetch::FetcherVec Manager::createUpdateFetchers(int collType_) { KConfigGroup config(KGlobal::config(), "Data Sources"); int nSources = config.readNumEntry("Sources Count", 0); for(int i = 0; i < nSources; ++i) { - TQString group = TQString::tqfromLatin1("Data Source %1").tqarg(i); + TQString group = TQString::fromLatin1("Data Source %1").arg(i); // needs the KConfig* Fetcher::Ptr f = createFetcher(KGlobal::config(), group); if(f && f->canFetch(collType_) && f->canUpdate()) { @@ -409,8 +409,8 @@ Tellico::Fetch::Fetcher::Ptr Manager::createUpdateFetcher(int collType_, const T return fetcher; } -void Manager::updatetqStatus(const TQString& message_) { - emit signaltqStatus(message_); +void Manager::updateStatus(const TQString& message_) { + emit signalStatus(message_); } Tellico::Fetch::TypePairList Manager::typeList() { @@ -440,7 +440,7 @@ Tellico::Fetch::TypePairList Manager::typeList() { list.append(TypePair(DiscogsFetcher::defaultName(), Discogs)); // now find all the scripts distributed with tellico - TQStringList files = KGlobal::dirs()->findAllResources("appdata", TQString::tqfromLatin1("data-sources/*.spec"), + TQStringList files = KGlobal::dirs()->findAllResources("appdata", TQString::fromLatin1("data-sources/*.spec"), false, true); for(TQStringList::Iterator it = files.begin(); it != files.end(); ++it) { KConfig spec(*it, false, false); @@ -587,7 +587,7 @@ TQPixmap Manager::fetcherIcon(Fetch::Fetcher::CPtr fetcher_, int group_, int siz if(fetcher_->type() == Fetch::Z3950) { const Fetch::Z3950Fetcher* f = static_cast<const Fetch::Z3950Fetcher*>(fetcher_.data()); KURL u; - u.setProtocol(TQString::tqfromLatin1("http")); + u.setProtocol(TQString::fromLatin1("http")); u.setHost(f->host()); TQString icon = favIcon(u); if(u.isValid() && !icon.isEmpty()) { @@ -599,16 +599,16 @@ TQPixmap Manager::fetcherIcon(Fetch::Fetcher::CPtr fetcher_, int group_, int siz const Fetch::ExecExternalFetcher* f = static_cast<const Fetch::ExecExternalFetcher*>(fetcher_.data()); const TQString p = f->execPath(); KURL u; - if(p.find(TQString::tqfromLatin1("allocine")) > -1) { - u = TQString::tqfromLatin1("http://www.allocine.fr"); - } else if(p.find(TQString::tqfromLatin1("ministerio_de_cultura")) > -1) { - u = TQString::tqfromLatin1("http://www.mcu.es"); - } else if(p.find(TQString::tqfromLatin1("dark_horse_comics")) > -1) { - u = TQString::tqfromLatin1("http://www.darkhorse.com"); - } else if(p.find(TQString::tqfromLatin1("boardgamegeek")) > -1) { - u = TQString::tqfromLatin1("http://www.boardgamegeek.com"); - } else if(f->source().find(TQString::tqfromLatin1("amarok"), 0, false /*case-sensitive*/) > -1) { - return LOAD_ICON(TQString::tqfromLatin1("amarok"), group_, size_); + if(p.find(TQString::fromLatin1("allocine")) > -1) { + u = TQString::fromLatin1("http://www.allocine.fr"); + } else if(p.find(TQString::fromLatin1("ministerio_de_cultura")) > -1) { + u = TQString::fromLatin1("http://www.mcu.es"); + } else if(p.find(TQString::fromLatin1("dark_horse_comics")) > -1) { + u = TQString::fromLatin1("http://www.darkhorse.com"); + } else if(p.find(TQString::fromLatin1("boardgamegeek")) > -1) { + u = TQString::fromLatin1("http://www.boardgamegeek.com"); + } else if(f->source().find(TQString::fromLatin1("amarok"), 0, false /*case-sensitive*/) > -1) { + return LOAD_ICON(TQString::fromLatin1("amarok"), group_, size_); } if(!u.isEmpty() && u.isValid()) { TQString icon = favIcon(u); @@ -628,13 +628,13 @@ TQPixmap Manager::fetcherIcon(Fetch::Type type_, int group_, int size_) { case IMDB: name = favIcon("http://imdb.com"); break; case Z3950: - name = TQString::tqfromLatin1("network"); break; // rather arbitrary + name = TQString::fromLatin1("network"); break; // rather arbitrary case SRU: - name = TQString::tqfromLatin1("network_local"); break; // just to be different than z3950 + name = TQString::fromLatin1("network_local"); break; // just to be different than z3950 case Entrez: name = favIcon("http://www.ncbi.nlm.nih.gov"); break; case ExecExternal: - name = TQString::tqfromLatin1("exec"); break; + name = TQString::fromLatin1("exec"); break; case Yahoo: name = favIcon("http://yahoo.com"); break; case AnimeNfo: @@ -644,7 +644,7 @@ TQPixmap Manager::fetcherIcon(Fetch::Type type_, int group_, int size_) { case ISBNdb: name = favIcon("http://isbndb.com"); break; case GCstarPlugin: - name = TQString::tqfromLatin1("gcstar"); break; + name = TQString::fromLatin1("gcstar"); break; case CrossRef: name = favIcon("http://crossref.org"); break; case Arxiv: diff --git a/src/fetch/fetchmanager.h b/src/fetch/fetchmanager.h index 8bb7f23..8d86616 100644 --- a/src/fetch/fetchmanager.h +++ b/src/fetch/fetchmanager.h @@ -74,7 +74,7 @@ public: static TQPixmap fetcherIcon(Fetch::Fetcher::CPtr ptr, int iconGroup=3 /*Small*/, int size=0 /* default*/); signals: - void signaltqStatus(const TQString& status); + void signalStatus(const TQString& status); void signalResultFound(Tellico::Fetch::SearchResult* result); void signalDone(); @@ -88,7 +88,7 @@ private: Manager(); Fetcher::Ptr createFetcher(KConfig* config, const TQString& configGroup); FetcherVec defaultFetchers(); - void updatetqStatus(const TQString& message); + void updateStatus(const TQString& message); static TQString favIcon(const KURL& url); static bool bundledScriptHasExecPath(const TQString& specFile, KConfig* config); diff --git a/src/fetch/gcstarpluginfetcher.cpp b/src/fetch/gcstarpluginfetcher.cpp index ccb963d..a1f6140 100644 --- a/src/fetch/gcstarpluginfetcher.cpp +++ b/src/fetch/gcstarpluginfetcher.cpp @@ -32,7 +32,7 @@ #include <kaccelmanager.h> #include <tqdir.h> -#include <tqlayout.h> +#include <layout.h> #include <tqlabel.h> #include <tqwhatsthis.h> @@ -45,23 +45,23 @@ GCstarPluginFetcher::PluginParse GCstarPluginFetcher::pluginParse = NotYet; GCstarPluginFetcher::PluginList GCstarPluginFetcher::plugins(int collType_) { if(!pluginMap.contains(collType_)) { GUI::CursorSaver cs; - TQString gcstar = KStandardDirs::findExe(TQString::tqfromLatin1("gcstar")); + TQString gcstar = KStandardDirs::findExe(TQString::fromLatin1("gcstar")); if(pluginParse == NotYet) { KProcIO proc; - proc << gcstar << TQString::tqfromLatin1("--version"); + proc << gcstar << TQString::fromLatin1("--version"); // wait 5 seconds at most, just a sanity thing, never want to block completely if(proc.start(KProcess::Block) && proc.wait(5)) { TQString output; proc.readln(output); if(!output.isEmpty()) { // always going to be x.y[.z] ? - TQRegExp versionRx(TQString::tqfromLatin1("(\\d+)\\.(\\d+)(?:\\.(\\d+))?")); + TQRegExp versionRx(TQString::fromLatin1("(\\d+)\\.(\\d+)(?:\\.(\\d+))?")); if(versionRx.search(output) > -1) { int x = versionRx.cap(1).toInt(); int y = versionRx.cap(2).toInt(); int z = versionRx.cap(3).toInt(); // ok to be empty - myDebug() << TQString::tqfromLatin1("GCstarPluginFetcher() - found %1.%2.%3").tqarg(x).tqarg(y).tqarg(z) << endl; + myDebug() << TQString::fromLatin1("GCstarPluginFetcher() - found %1.%2.%3").arg(x).arg(y).arg(z) << endl; // --list-plugins argument was added for 1.3 release pluginParse = (x >= 1 && y >=3) ? New : Old; } @@ -94,9 +94,9 @@ void GCstarPluginFetcher::readPluginsNew(int collType_, const TQString& gcstar_) KProcIO proc; proc << gcstar_ - << TQString::tqfromLatin1("-x") - << TQString::tqfromLatin1("--list-plugins") - << TQString::tqfromLatin1("--collection") << gcstarCollection; + << TQString::fromLatin1("-x") + << TQString::fromLatin1("--list-plugins") + << TQString::fromLatin1("--collection") << gcstarCollection; if(!proc.start(KProcess::Block)) { myWarning() << "GCstarPluginFetcher::readPluginsNew() - can't start" << endl; @@ -117,10 +117,10 @@ void GCstarPluginFetcher::readPluginsNew(int collType_, const TQString& gcstar_) // authors have \t at beginning line = line.stripWhiteSpace(); if(!hasName) { - info.insert(TQString::tqfromLatin1("name"), line); + info.insert(TQString::fromLatin1("name"), line); hasName = true; } else { - info.insert(TQString::tqfromLatin1("author"), line); + info.insert(TQString::fromLatin1("author"), line); } // myDebug() << line << endl; } @@ -130,10 +130,10 @@ void GCstarPluginFetcher::readPluginsNew(int collType_, const TQString& gcstar_) } void GCstarPluginFetcher::readPluginsOld(int collType_, const TQString& gcstar_) { - TQDir dir(gcstar_, TQString::tqfromLatin1("GC*.pm")); - dir.cd(TQString::tqfromLatin1("../../lib/gcstar/GCPlugins/")); + TQDir dir(gcstar_, TQString::fromLatin1("GC*.pm")); + dir.cd(TQString::fromLatin1("../../lib/gcstar/GCPlugins/")); - TQRegExp rx(TQString::tqfromLatin1("get(Name|Author|Lang)\\s*\\{\\s*return\\s+['\"](.+)['\"]")); + TQRegExp rx(TQString::fromLatin1("get(Name|Author|Lang)\\s*\\{\\s*return\\s+['\"](.+)['\"]")); rx.setMinimal(true); PluginList plugins; @@ -156,7 +156,7 @@ void GCstarPluginFetcher::readPluginsOld(int collType_, const TQString& gcstar_) info.insert(rx.cap(1).lower(), rx.cap(2)); } // only add if it has a name - if(info.contains(TQString::tqfromLatin1("name"))) { + if(info.contains(TQString::fromLatin1("name"))) { plugins << info; } } @@ -166,13 +166,13 @@ void GCstarPluginFetcher::readPluginsOld(int collType_, const TQString& gcstar_) TQString GCstarPluginFetcher::gcstarType(int collType_) { switch(collType_) { - case Data::Collection::Book: return TQString::tqfromLatin1("GCbooks"); - case Data::Collection::Video: return TQString::tqfromLatin1("GCfilms"); - case Data::Collection::Game: return TQString::tqfromLatin1("GCgames"); - case Data::Collection::Album: return TQString::tqfromLatin1("GCmusics"); - case Data::Collection::Coin: return TQString::tqfromLatin1("GCcoins"); - case Data::Collection::Wine: return TQString::tqfromLatin1("GCwines"); - case Data::Collection::BoardGame: return TQString::tqfromLatin1("GCboardgames"); + case Data::Collection::Book: return TQString::fromLatin1("GCbooks"); + case Data::Collection::Video: return TQString::fromLatin1("GCfilms"); + case Data::Collection::Game: return TQString::fromLatin1("GCgames"); + case Data::Collection::Album: return TQString::fromLatin1("GCmusics"); + case Data::Collection::Coin: return TQString::fromLatin1("GCcoins"); + case Data::Collection::Wine: return TQString::fromLatin1("GCwines"); + case Data::Collection::BoardGame: return TQString::fromLatin1("GCboardgames"); default: break; } return TQString(); @@ -213,7 +213,7 @@ void GCstarPluginFetcher::search(FetchKey key_, const TQString& value_) { return; } - TQString gcstar = KStandardDirs::findExe(TQString::tqfromLatin1("gcstar")); + TQString gcstar = KStandardDirs::findExe(TQString::fromLatin1("gcstar")); if(gcstar.isEmpty()) { myWarning() << "GCstarPluginFetcher::search() - gcstar not found!" << endl; stop(); @@ -233,11 +233,11 @@ void GCstarPluginFetcher::search(FetchKey key_, const TQString& value_) { connect(m_process, TQT_SIGNAL(receivedStderr(KProcess*, char*, int)), TQT_SLOT(slotError(KProcess*, char*, int))); connect(m_process, TQT_SIGNAL(processExited(KProcess*)), TQT_SLOT(slotProcessExited(KProcess*))); TQStringList args; - args << gcstar << TQString::tqfromLatin1("-x") - << TQString::tqfromLatin1("--collection") << gcstarCollection - << TQString::tqfromLatin1("--export") << TQString::tqfromLatin1("Tellico") - << TQString::tqfromLatin1("--website") << m_plugin - << TQString::tqfromLatin1("--download") << KProcess::quote(value_); + args << gcstar << TQString::fromLatin1("-x") + << TQString::fromLatin1("--collection") << gcstarCollection + << TQString::fromLatin1("--export") << TQString::fromLatin1("Tellico") + << TQString::fromLatin1("--website") << m_plugin + << TQString::fromLatin1("--download") << KProcess::quote(value_); myLog() << "GCstarPluginFetcher::search() - " << args.join(TQChar(' ')) << endl; *m_process << args; if(!m_process->start(KProcess::NotifyOnExit, KProcess::AllOutput)) { @@ -268,7 +268,7 @@ void GCstarPluginFetcher::slotData(KProcess*, char* buffer_, int len_) { void GCstarPluginFetcher::slotError(KProcess*, char* buffer_, int len_) { TQString msg = TQString::fromLocal8Bit(buffer_, len_); - msg.prepend(source() + TQString::tqfromLatin1(": ")); + msg.prepend(source() + TQString::fromLatin1(": ")); myDebug() << "GCstarPluginFetcher::slotError() - " << msg << endl; m_errors << msg; } @@ -298,7 +298,7 @@ void GCstarPluginFetcher::slotProcessExited(KProcess*) { Data::CollPtr coll = imp.collection(); if(!coll) { if(!imp.statusMessage().isEmpty()) { - message(imp.statusMessage(), MessageHandler::tqStatus); + message(imp.statusMessage(), MessageHandler::Status); } myDebug() << "GCstarPluginFetcher::slotProcessExited() - "<< source() << ": no collection pointer" << endl; stop(); @@ -311,56 +311,56 @@ void GCstarPluginFetcher::slotProcessExited(KProcess*) { switch(coll->type()) { case Data::Collection::Book: case Data::Collection::Bibtex: - desc = entry->field(TQString::tqfromLatin1("author")) + desc = entry->field(TQString::fromLatin1("author")) + TQChar('/') - + 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")); + + entry->field(TQString::fromLatin1("publisher")); + if(!entry->field(TQString::fromLatin1("cr_year")).isEmpty()) { + desc += TQChar('/') + entry->field(TQString::fromLatin1("cr_year")); + } else if(!entry->field(TQString::fromLatin1("pub_year")).isEmpty()){ + desc += TQChar('/') + entry->field(TQString::fromLatin1("pub_year")); } break; case Data::Collection::Video: - desc = entry->field(TQString::tqfromLatin1("studio")) + desc = entry->field(TQString::fromLatin1("studio")) + TQChar('/') - + entry->field(TQString::tqfromLatin1("director")) + + entry->field(TQString::fromLatin1("director")) + TQChar('/') - + entry->field(TQString::tqfromLatin1("year")) + + entry->field(TQString::fromLatin1("year")) + TQChar('/') - + entry->field(TQString::tqfromLatin1("medium")); + + entry->field(TQString::fromLatin1("medium")); break; case Data::Collection::Album: - desc = entry->field(TQString::tqfromLatin1("artist")) + desc = entry->field(TQString::fromLatin1("artist")) + TQChar('/') - + entry->field(TQString::tqfromLatin1("label")) + + entry->field(TQString::fromLatin1("label")) + TQChar('/') - + entry->field(TQString::tqfromLatin1("year")); + + entry->field(TQString::fromLatin1("year")); break; case Data::Collection::Game: - desc = entry->field(TQString::tqfromLatin1("platform")); + desc = entry->field(TQString::fromLatin1("platform")); break; case Data::Collection::ComicBook: - desc = entry->field(TQString::tqfromLatin1("publisher")) + desc = entry->field(TQString::fromLatin1("publisher")) + TQChar('/') - + entry->field(TQString::tqfromLatin1("pub_year")); + + entry->field(TQString::fromLatin1("pub_year")); break; case Data::Collection::BoardGame: - desc = entry->field(TQString::tqfromLatin1("designer")) + desc = entry->field(TQString::fromLatin1("designer")) + TQChar('/') - + entry->field(TQString::tqfromLatin1("publisher")) + + entry->field(TQString::fromLatin1("publisher")) + TQChar('/') - + entry->field(TQString::tqfromLatin1("year")); + + entry->field(TQString::fromLatin1("year")); break; default: break; } - SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(TQString::tqfromLatin1("isbn"))); + SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(TQString::fromLatin1("isbn"))); m_entries.insert(r->uid, entry); emit signalResultFound(r); } @@ -373,7 +373,7 @@ Tellico::Data::EntryPtr GCstarPluginFetcher::fetchEntry(uint uid_) { void GCstarPluginFetcher::updateEntry(Data::EntryPtr entry_) { // ry searching for title and rely on Collection::sameEntry() to figure things out - TQString t = entry_->field(TQString::tqfromLatin1("title")); + TQString t = entry_->field(TQString::fromLatin1("title")); if(!t.isEmpty()) { search(Fetch::Title, t); return; @@ -449,7 +449,7 @@ void GCstarPluginFetcher::ConfigWidget::saveConfig(KConfigGroup& config_) { } TQString GCstarPluginFetcher::ConfigWidget::preferredName() const { - return TQString::tqfromLatin1("GCstar - ") + m_pluginCombo->currentText(); + return TQString::fromLatin1("GCstar - ") + m_pluginCombo->currentText(); } void GCstarPluginFetcher::ConfigWidget::slotTypeChanged() { @@ -458,7 +458,7 @@ void GCstarPluginFetcher::ConfigWidget::slotTypeChanged() { TQStringList pluginNames; GCstarPluginFetcher::PluginList list = GCstarPluginFetcher::plugins(collType); for(GCstarPluginFetcher::PluginList::ConstIterator it = list.begin(); it != list.end(); ++it) { - pluginNames << (*it)[TQString::tqfromLatin1("name")].toString(); + pluginNames << (*it)[TQString::fromLatin1("name")].toString(); m_pluginCombo->insertItem(pluginNames.last(), *it); } slotPluginChanged(); @@ -467,8 +467,8 @@ void GCstarPluginFetcher::ConfigWidget::slotTypeChanged() { void GCstarPluginFetcher::ConfigWidget::slotPluginChanged() { PluginInfo info = m_pluginCombo->currentData().toMap(); - m_authorLabel->setText(info[TQString::tqfromLatin1("author")].toString()); -// m_langLabel->setText(info[TQString::tqfromLatin1("lang")].toString()); + m_authorLabel->setText(info[TQString::fromLatin1("author")].toString()); +// m_langLabel->setText(info[TQString::fromLatin1("lang")].toString()); emit signalName(preferredName()); } diff --git a/src/fetch/googlescholarfetcher.cpp b/src/fetch/googlescholarfetcher.cpp index e93c7cd..bb5e372 100644 --- a/src/fetch/googlescholarfetcher.cpp +++ b/src/fetch/googlescholarfetcher.cpp @@ -25,7 +25,7 @@ #include <kio/job.h> #include <tqlabel.h> -#include <tqlayout.h> +#include <layout.h> namespace { static const int GOOGLE_MAX_RETURNS_TOTAL = 20; @@ -38,7 +38,7 @@ GoogleScholarFetcher::GoogleScholarFetcher(TQObject* parent_, const char* name_) : Fetcher(parent_, name_), m_limit(GOOGLE_MAX_RETURNS_TOTAL), m_start(0), m_job(0), m_started(false), m_cookieIsSet(false) { - m_bibtexRx = TQRegExp(TQString::tqfromLatin1("<a\\s.*href\\s*=\\s*\"([^>]*scholar\\.bib[^>]*)\"")); + m_bibtexRx = TQRegExp(TQString::fromLatin1("<a\\s.*href\\s*=\\s*\"([^>]*scholar\\.bib[^>]*)\"")); m_bibtexRx.setMinimal(true); } @@ -47,7 +47,7 @@ GoogleScholarFetcher::~GoogleScholarFetcher() { TQString GoogleScholarFetcher::defaultName() { // no i18n - return TQString::tqfromLatin1("Google Scholar"); + return TQString::fromLatin1("Google Scholar"); } TQString GoogleScholarFetcher::source() const { @@ -65,7 +65,7 @@ void GoogleScholarFetcher::readConfigHook(const KConfigGroup& config_) { void GoogleScholarFetcher::search(FetchKey key_, const TQString& value_) { if(!m_cookieIsSet) { // have to set preferences to have bibtex output - FileHandler::readTextFile(TQString::tqfromLatin1("http://scholar.google.com/scholar_setprefs?num=100&scis=yes&scisf=4&submit=Save+Preferences"), true); + FileHandler::readTextFile(TQString::fromLatin1("http://scholar.google.com/scholar_setprefs?num=100&scis=yes&scisf=4&submit=Save+Preferences"), true); m_cookieIsSet = true; } m_key = key_; @@ -85,25 +85,25 @@ void GoogleScholarFetcher::doSearch() { // myDebug() << "GoogleScholarFetcher::search() - value = " << value_ << endl; if(!canFetch(Kernel::self()->collectionType())) { - message(i18n("%1 does not allow searching for this collection type.").tqarg(source()), MessageHandler::Warning); + message(i18n("%1 does not allow searching for this collection type.").arg(source()), MessageHandler::Warning); stop(); return; } - KURL u(TQString::tqfromLatin1(SCHOLAR_BASE_URL)); - u.addQueryItem(TQString::tqfromLatin1("start"), TQString::number(m_start)); + KURL u(TQString::fromLatin1(SCHOLAR_BASE_URL)); + u.addQueryItem(TQString::fromLatin1("start"), TQString::number(m_start)); switch(m_key) { case Title: - u.addQueryItem(TQString::tqfromLatin1("q"), TQString::tqfromLatin1("allintitle:%1").tqarg(m_value)); + u.addQueryItem(TQString::fromLatin1("q"), TQString::fromLatin1("allintitle:%1").arg(m_value)); break; case Keyword: - u.addQueryItem(TQString::tqfromLatin1("q"), m_value); + u.addQueryItem(TQString::fromLatin1("q"), m_value); break; case Person: - u.addQueryItem(TQString::tqfromLatin1("q"), TQString::tqfromLatin1("author:%1").tqarg(m_value)); + u.addQueryItem(TQString::fromLatin1("q"), TQString::fromLatin1("author:%1").arg(m_value)); break; default: @@ -159,7 +159,7 @@ void GoogleScholarFetcher::slotComplete(KIO::Job* job_) { TQString bibtex; int count = 0; for(int pos = text.find(m_bibtexRx); count < m_limit && pos > -1; pos = text.find(m_bibtexRx, pos+m_bibtexRx.matchedLength()), ++count) { - KURL bibtexUrl(TQString::tqfromLatin1(SCHOLAR_BASE_URL), m_bibtexRx.cap(1)); + KURL bibtexUrl(TQString::fromLatin1(SCHOLAR_BASE_URL), m_bibtexRx.cap(1)); // myDebug() << bibtexUrl << endl; bibtex += FileHandler::readTextFile(bibtexUrl, true); } @@ -179,13 +179,13 @@ void GoogleScholarFetcher::slotComplete(KIO::Job* job_) { // might get aborted break; } - TQString desc = entry->field(TQString::tqfromLatin1("author")) - + TQChar('/') + entry->field(TQString::tqfromLatin1("publisher")); - if(!entry->field(TQString::tqfromLatin1("year")).isEmpty()) { - desc += TQChar('/') + entry->field(TQString::tqfromLatin1("year")); + TQString desc = entry->field(TQString::fromLatin1("author")) + + TQChar('/') + entry->field(TQString::fromLatin1("publisher")); + if(!entry->field(TQString::fromLatin1("year")).isEmpty()) { + desc += TQChar('/') + entry->field(TQString::fromLatin1("year")); } - SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(TQString::tqfromLatin1("isbn"))); + SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(TQString::fromLatin1("isbn"))); m_entries.insert(r->uid, Data::EntryPtr(entry)); emit signalResultFound(r); } @@ -205,7 +205,7 @@ void GoogleScholarFetcher::updateEntry(Data::EntryPtr entry_) { // limit to top 5 results m_limit = 5; - TQString title = entry_->field(TQString::tqfromLatin1("title")); + TQString title = entry_->field(TQString::fromLatin1("title")); if(!title.isEmpty()) { search(Title, title); return; diff --git a/src/fetch/ibsfetcher.cpp b/src/fetch/ibsfetcher.cpp index 4c86ef3..0872056 100644 --- a/src/fetch/ibsfetcher.cpp +++ b/src/fetch/ibsfetcher.cpp @@ -27,7 +27,7 @@ #include <kio/job.h> #include <tqregexp.h> -#include <tqlayout.h> +#include <layout.h> #include <tqlabel.h> #include <tqfile.h> @@ -64,25 +64,25 @@ void IBSFetcher::search(FetchKey key_, const TQString& value_) { m_matches.clear(); #ifdef IBS_TEST - KURL u = KURL::fromPathOrURL(TQString::tqfromLatin1("/home/robby/ibs.html")); + KURL u = KURL::fromPathOrURL(TQString::fromLatin1("/home/robby/ibs.html")); #else - KURL u(TQString::tqfromLatin1(IBS_BASE_URL)); + KURL u(TQString::fromLatin1(IBS_BASE_URL)); if(!canFetch(Kernel::self()->collectionType())) { - message(i18n("%1 does not allow searching for this collection type.").tqarg(source()), MessageHandler::Warning); + message(i18n("%1 does not allow searching for this collection type.").arg(source()), MessageHandler::Warning); stop(); return; } switch(key_) { case Title: - u.addQueryItem(TQString::tqfromLatin1("Type"), TQString::tqfromLatin1("keyword")); - u.addQueryItem(TQString::tqfromLatin1("T"), value_); + u.addQueryItem(TQString::fromLatin1("Type"), TQString::fromLatin1("keyword")); + u.addQueryItem(TQString::fromLatin1("T"), value_); break; case Person: - u.addQueryItem(TQString::tqfromLatin1("Type"), TQString::tqfromLatin1("keyword")); - u.addQueryItem(TQString::tqfromLatin1("A"), value_); + u.addQueryItem(TQString::fromLatin1("Type"), TQString::fromLatin1("keyword")); + u.addQueryItem(TQString::fromLatin1("A"), value_); break; case ISBN: @@ -91,14 +91,14 @@ void IBSFetcher::search(FetchKey key_, const TQString& value_) { s.remove('-'); // limit to first isbn s = s.section(';', 0, 0); - u.setFileName(TQString::tqfromLatin1("serdsp.asp")); - u.addQueryItem(TQString::tqfromLatin1("isbn"), s); + u.setFileName(TQString::fromLatin1("serdsp.asp")); + u.addQueryItem(TQString::fromLatin1("isbn"), s); } break; case Keyword: - u.addQueryItem(TQString::tqfromLatin1("Type"), TQString::tqfromLatin1("keyword")); - u.addQueryItem(TQString::tqfromLatin1("S"), value_); + u.addQueryItem(TQString::fromLatin1("Type"), TQString::fromLatin1("keyword")); + u.addQueryItem(TQString::fromLatin1("S"), value_); break; default: @@ -156,12 +156,12 @@ void IBSFetcher::slotComplete(KIO::Job* job_) { TQString s = Tellico::decodeHTML(TQString(m_data)); // really specific regexp - TQString pat = TQString::tqfromLatin1("http://www.internetbookshop.it/code/"); - TQRegExp anchorRx(TQString::tqfromLatin1("<a\\s+[^>]*href\\s*=\\s*[\"'](") + + TQString pat = TQString::fromLatin1("http://www.internetbookshop.it/code/"); + TQRegExp anchorRx(TQString::fromLatin1("<a\\s+[^>]*href\\s*=\\s*[\"'](") + TQRegExp::escape(pat) + - TQString::tqfromLatin1("[^\"]*)\"[^>]*><b>([^<]+)<"), false); + TQString::fromLatin1("[^\"]*)\"[^>]*><b>([^<]+)<"), false); anchorRx.setMinimal(true); - TQRegExp tagRx(TQString::tqfromLatin1("<.*>")); + TQRegExp tagRx(TQString::fromLatin1("<.*>")); tagRx.setMinimal(true); TQString u, t, d; @@ -172,10 +172,10 @@ void IBSFetcher::slotComplete(KIO::Job* job_) { emit signalResultFound(r); #ifdef IBS_TEST - KURL url = KURL::fromPathOrURL(TQString::tqfromLatin1("/home/robby/ibs2.html")); + KURL url = KURL::fromPathOrURL(TQString::fromLatin1("/home/robby/ibs2.html")); #else // the url probable contains & so be careful - KURL url = u.replace(TQString::tqfromLatin1("&"), TQChar('&')); + KURL url = u.replace(TQString::fromLatin1("&"), TQChar('&')); #endif m_matches.insert(r->uid, url); @@ -185,9 +185,9 @@ void IBSFetcher::slotComplete(KIO::Job* job_) { } u = anchorRx.cap(1); t = anchorRx.cap(2); - pos2 = s.find(TQString::tqfromLatin1("<br>"), pos, false); + pos2 = s.find(TQString::fromLatin1("<br>"), pos, false); if(pos2 > -1) { - int pos3 = s.find(TQString::tqfromLatin1("<br>"), pos2+1, false); + int pos3 = s.find(TQString::fromLatin1("<br>"), pos2+1, false); if(pos3 > -1) { d = s.mid(pos2, pos3-pos2).remove(tagRx).simplifyWhiteSpace(); } @@ -197,7 +197,7 @@ void IBSFetcher::slotComplete(KIO::Job* job_) { if(!u.isEmpty()) { SearchResult* r = new SearchResult(this, t, d, TQString()); emit signalResultFound(r); - m_matches.insert(r->uid, u.replace(TQString::tqfromLatin1("&"), TQChar('&'))); + m_matches.insert(r->uid, u.replace(TQString::fromLatin1("&"), TQChar('&'))); } #endif @@ -221,15 +221,15 @@ void IBSFetcher::slotCompleteISBN(KIO::Job* job_) { } TQString str = Tellico::decodeHTML(TQString(m_data)); - if(str.find(TQString::tqfromLatin1("Libro non presente"), 0, false /* cas-sensitive */) > -1) { + if(str.find(TQString::fromLatin1("Libro non presente"), 0, false /* cas-sensitive */) > -1) { stop(); return; } Data::EntryPtr entry = parseEntry(str); if(entry) { - TQString desc = entry->field(TQString::tqfromLatin1("author")) - + '/' + entry->field(TQString::tqfromLatin1("publisher")); - SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(TQString::tqfromLatin1("isbn"))); + TQString desc = entry->field(TQString::fromLatin1("author")) + + '/' + entry->field(TQString::fromLatin1("publisher")); + SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(TQString::fromLatin1("isbn"))); emit signalResultFound(r); m_matches.insert(r->uid, static_cast<KIO::TransferJob*>(job_)->url().url()); } @@ -259,7 +259,7 @@ Tellico::Data::EntryPtr IBSFetcher::fetchEntry(uint uid_) { // myDebug() << url.url() << endl; #if 0 kdWarning() << "Remove debug from ibsfetcher.cpp" << endl; - TQFile f(TQString::tqfromLatin1("/tmp/test.html")); + TQFile f(TQString::fromLatin1("/tmp/test.html")); if(f.open(IO_WriteOnly)) { TQTextStream t(&f); t.setEncoding(TQTextStream::UnicodeUTF8); @@ -280,9 +280,9 @@ Tellico::Data::EntryPtr IBSFetcher::fetchEntry(uint uid_) { Tellico::Data::EntryPtr IBSFetcher::parseEntry(const TQString& str_) { // myDebug() << "IBSFetcher::parseEntry()" << endl; // class might be anime_info_top - TQString pat = TQString::tqfromLatin1("%1(?:<[^>]+>)+([^<>\\s][^<>]+)"); + TQString pat = TQString::fromLatin1("%1(?:<[^>]+>)+([^<>\\s][^<>]+)"); - TQRegExp isbnRx(TQString::tqfromLatin1("isbn=([\\dxX]{13})"), false); + TQRegExp isbnRx(TQString::fromLatin1("isbn=([\\dxX]{13})"), false); TQString isbn; int pos = isbnRx.search(str_); if(pos > -1) { @@ -293,25 +293,25 @@ Tellico::Data::EntryPtr IBSFetcher::parseEntry(const TQString& str_) { // map captions in HTML to field names TQMap<TQString, TQString> fieldMap; - fieldMap.insert(TQString::tqfromLatin1("Titolo"), TQString::tqfromLatin1("title")); - fieldMap.insert(TQString::tqfromLatin1("Autore"), TQString::tqfromLatin1("author")); - fieldMap.insert(TQString::tqfromLatin1("Anno"), TQString::tqfromLatin1("pub_year")); - fieldMap.insert(TQString::tqfromLatin1("Categoria"), TQString::tqfromLatin1("genre")); - fieldMap.insert(TQString::tqfromLatin1("Rilegatura"), TQString::tqfromLatin1("binding")); - fieldMap.insert(TQString::tqfromLatin1("Editore"), TQString::tqfromLatin1("publisher")); - fieldMap.insert(TQString::tqfromLatin1("Dati"), TQString::tqfromLatin1("edition")); - - TQRegExp pagesRx(TQString::tqfromLatin1("(\\d+) p\\.(\\s*,\\s*)?")); + fieldMap.insert(TQString::fromLatin1("Titolo"), TQString::fromLatin1("title")); + fieldMap.insert(TQString::fromLatin1("Autore"), TQString::fromLatin1("author")); + fieldMap.insert(TQString::fromLatin1("Anno"), TQString::fromLatin1("pub_year")); + fieldMap.insert(TQString::fromLatin1("Categoria"), TQString::fromLatin1("genre")); + fieldMap.insert(TQString::fromLatin1("Rilegatura"), TQString::fromLatin1("binding")); + fieldMap.insert(TQString::fromLatin1("Editore"), TQString::fromLatin1("publisher")); + fieldMap.insert(TQString::fromLatin1("Dati"), TQString::fromLatin1("edition")); + + TQRegExp pagesRx(TQString::fromLatin1("(\\d+) p\\.(\\s*,\\s*)?")); Data::EntryPtr entry = new Data::Entry(coll); for(TQMap<TQString, TQString>::Iterator it = fieldMap.begin(); it != fieldMap.end(); ++it) { - TQRegExp infoRx(pat.tqarg(it.key())); + TQRegExp infoRx(pat.arg(it.key())); pos = infoRx.search(str_); if(pos > -1) { if(it.data() == Latin1Literal("edition")) { int pos2 = pagesRx.search(infoRx.cap(1)); if(pos2 > -1) { - entry->setField(TQString::tqfromLatin1("pages"), pagesRx.cap(1)); + entry->setField(TQString::fromLatin1("pages"), pagesRx.cap(1)); entry->setField(it.data(), infoRx.cap(1).remove(pagesRx)); } else { entry->setField(it.data(), infoRx.cap(1)); @@ -324,44 +324,44 @@ Tellico::Data::EntryPtr IBSFetcher::parseEntry(const TQString& str_) { // image if(!isbn.isEmpty()) { - entry->setField(TQString::tqfromLatin1("isbn"), isbn); + entry->setField(TQString::fromLatin1("isbn"), isbn); #if 1 - TQString imgURL = TQString::tqfromLatin1("http://giotto.ibs.it/cop/copt13.asp?f=%1").tqarg(isbn); + TQString imgURL = TQString::fromLatin1("http://giotto.ibs.it/cop/copt13.asp?f=%1").arg(isbn); myLog() << "IBSFetcher() - cover = " << imgURL << endl; - TQString id = ImageFactory::addImage(imgURL, true, TQString::tqfromLatin1("http://internetbookshop.it")); + TQString id = ImageFactory::addImage(imgURL, true, TQString::fromLatin1("http://internetbookshop.it")); if(!id.isEmpty()) { - entry->setField(TQString::tqfromLatin1("cover"), id); + entry->setField(TQString::fromLatin1("cover"), id); } #else - TQRegExp imgRx(TQString::tqfromLatin1("<img\\s+[^>]*\\s*src\\s*=\\s*\"(http://[^/]*\\.ibs\\.it/[^\"]+e=%1)").tqarg(isbn)); + TQRegExp imgRx(TQString::fromLatin1("<img\\s+[^>]*\\s*src\\s*=\\s*\"(http://[^/]*\\.ibs\\.it/[^\"]+e=%1)").arg(isbn)); imgRx.setMinimal(true); pos = imgRx.search(str_); if(pos > -1) { myLog() << "IBSFetcher() - cover = " << imgRx.cap(1) << endl; - TQString id = ImageFactory::addImage(imgRx.cap(1), true, TQString::tqfromLatin1("http://internetbookshop.it")); + TQString id = ImageFactory::addImage(imgRx.cap(1), true, TQString::fromLatin1("http://internetbookshop.it")); if(!id.isEmpty()) { - entry->setField(TQString::tqfromLatin1("cover"), id); + entry->setField(TQString::fromLatin1("cover"), id); } } #endif } // now look for description - TQRegExp descRx(TQString::tqfromLatin1("Descrizione(?:<[^>]+>)+([^<>\\s].+)</span>"), false); + TQRegExp descRx(TQString::fromLatin1("Descrizione(?:<[^>]+>)+([^<>\\s].+)</span>"), false); descRx.setMinimal(true); pos = descRx.search(str_); if(pos == -1) { - descRx.setPattern(TQString::tqfromLatin1("In sintesi(?:<[^>]+>)+([^<>\\s].+)</span>")); + descRx.setPattern(TQString::fromLatin1("In sintesi(?:<[^>]+>)+([^<>\\s].+)</span>")); pos = descRx.search(str_); } if(pos > -1) { - Data::FieldPtr f = new Data::Field(TQString::tqfromLatin1("plot"), i18n("Plot Summary"), Data::Field::Para); + Data::FieldPtr f = new Data::Field(TQString::fromLatin1("plot"), i18n("Plot Summary"), Data::Field::Para); coll->addField(f); entry->setField(f, descRx.cap(1).simplifyWhiteSpace()); } // IBS switches the surname and family name of the author - TQStringList names = entry->fields(TQString::tqfromLatin1("author"), false); + TQStringList names = entry->fields(TQString::fromLatin1("author"), false); if(!names.isEmpty() && !names[0].isEmpty()) { for(TQStringList::Iterator it = names.begin(); it != names.end(); ++it) { if((*it).find(',') > -1) { @@ -376,18 +376,18 @@ Tellico::Data::EntryPtr IBSFetcher::parseEntry(const TQString& str_) { words.pop_front(); *it = words.join(TQChar(' ')); } - entry->setField(TQString::tqfromLatin1("author"), names.join(TQString::tqfromLatin1("; "))); + entry->setField(TQString::fromLatin1("author"), names.join(TQString::fromLatin1("; "))); } return entry; } void IBSFetcher::updateEntry(Data::EntryPtr entry_) { - TQString isbn = entry_->field(TQString::tqfromLatin1("isbn")); + TQString isbn = entry_->field(TQString::fromLatin1("isbn")); if(!isbn.isEmpty()) { search(Fetch::ISBN, isbn); return; } - TQString t = entry_->field(TQString::tqfromLatin1("title")); + TQString t = entry_->field(TQString::fromLatin1("title")); if(!t.isEmpty()) { search(Fetch::Title, t); return; diff --git a/src/fetch/imdbfetcher.cpp b/src/fetch/imdbfetcher.cpp index 682ae1f..2ddbc10 100644 --- a/src/fetch/imdbfetcher.cpp +++ b/src/fetch/imdbfetcher.cpp @@ -36,7 +36,7 @@ #include <tqlabel.h> #include <tqlistbox.h> #include <tqwhatsthis.h> -#include <tqlayout.h> +#include <layout.h> #include <tqcheckbox.h> #include <tqvgroupbox.h> @@ -45,7 +45,7 @@ namespace { static const char* IMDB_SERVER = "akas.imdb.com"; static const uint IMDB_MAX_RESULTS = 20; - static const TQString sep = TQString::tqfromLatin1("; "); + static const TQString sep = TQString::fromLatin1("; "); } using Tellico::Fetch::IMDBFetcher; @@ -58,24 +58,24 @@ TQRegExp* IMDBFetcher::s_titleRx = 0; // static void IMDBFetcher::initRegExps() { - s_tagRx = new TQRegExp(TQString::tqfromLatin1("<.*>")); + s_tagRx = new TQRegExp(TQString::fromLatin1("<.*>")); s_tagRx->setMinimal(true); - s_anchorRx = new TQRegExp(TQString::tqfromLatin1("<a\\s+[^>]*href\\s*=\\s*\"([^\"]*)\"[^<]*>([^<]*)</a>"), false); + s_anchorRx = new TQRegExp(TQString::fromLatin1("<a\\s+[^>]*href\\s*=\\s*\"([^\"]*)\"[^<]*>([^<]*)</a>"), false); s_anchorRx->setMinimal(true); - s_anchorTitleRx = new TQRegExp(TQString::tqfromLatin1("<a\\s+[^>]*href\\s*=\\s*\"([^\"]*/title/[^\"]*)\"[^<]*>([^<]*)</a>"), false); + s_anchorTitleRx = new TQRegExp(TQString::fromLatin1("<a\\s+[^>]*href\\s*=\\s*\"([^\"]*/title/[^\"]*)\"[^<]*>([^<]*)</a>"), false); s_anchorTitleRx->setMinimal(true); - s_anchorNameRx = new TQRegExp(TQString::tqfromLatin1("<a\\s+[^>]*href\\s*=\\s*\"([^\"]*/name/[^\"]*)\"[^<]*>([^<]*)</a>"), false); + s_anchorNameRx = new TQRegExp(TQString::fromLatin1("<a\\s+[^>]*href\\s*=\\s*\"([^\"]*/name/[^\"]*)\"[^<]*>([^<]*)</a>"), false); s_anchorNameRx->setMinimal(true); - s_titleRx = new TQRegExp(TQString::tqfromLatin1("<title>(.*)</title>"), false); + s_titleRx = new TQRegExp(TQString::fromLatin1("<title>(.*)</title>"), false); s_titleRx->setMinimal(true); } IMDBFetcher::IMDBFetcher(TQObject* parent_, const char* name_) : Fetcher(parent_, name_), - m_job(0), m_started(false), m_fetchImages(true), m_host(TQString::tqfromLatin1(IMDB_SERVER)), + m_job(0), m_started(false), m_fetchImages(true), m_host(TQString::fromLatin1(IMDB_SERVER)), m_limit(IMDB_MAX_RESULTS), m_countOffset(0) { if(!s_tagRx) { initRegExps(); @@ -130,25 +130,25 @@ void IMDBFetcher::search(FetchKey key_, const TQString& value_) { #ifdef IMDB_TEST if(m_key == Title) { - m_url = KURL::fromPathOrURL(TQString::tqfromLatin1("/home/robby/imdb-title.html")); + m_url = KURL::fromPathOrURL(TQString::fromLatin1("/home/robby/imdb-title.html")); m_redirected = false; } else { - m_url = KURL::fromPathOrURL(TQString::tqfromLatin1("/home/robby/imdb-name.html")); + m_url = KURL::fromPathOrURL(TQString::fromLatin1("/home/robby/imdb-name.html")); m_redirected = true; } #else m_url = KURL(); - m_url.setProtocol(TQString::tqfromLatin1("http")); - m_url.setHost(m_host.isEmpty() ? TQString::tqfromLatin1(IMDB_SERVER) : m_host); - m_url.setPath(TQString::tqfromLatin1("/find")); + m_url.setProtocol(TQString::fromLatin1("http")); + m_url.setHost(m_host.isEmpty() ? TQString::fromLatin1(IMDB_SERVER) : m_host); + m_url.setPath(TQString::fromLatin1("/find")); switch(key_) { case Title: - m_url.addQueryItem(TQString::tqfromLatin1("s"), TQString::tqfromLatin1("tt")); + m_url.addQueryItem(TQString::fromLatin1("s"), TQString::fromLatin1("tt")); break; case Person: - m_url.addQueryItem(TQString::tqfromLatin1("s"), TQString::tqfromLatin1("nm")); + m_url.addQueryItem(TQString::fromLatin1("s"), TQString::fromLatin1("nm")); break; default: @@ -159,7 +159,7 @@ void IMDBFetcher::search(FetchKey key_, const TQString& value_) { // as far as I can tell, the url encoding should always be iso-8859-1 // not utf-8 - m_url.addQueryItem(TQString::tqfromLatin1("q"), value_, 4 /* iso-8859-1 */); + m_url.addQueryItem(TQString::fromLatin1("q"), value_, 4 /* iso-8859-1 */); // myDebug() << "IMDBFetcher::search() url = " << m_url << endl; #endif @@ -282,9 +282,9 @@ void IMDBFetcher::parseMultipleTitleResults() { // IMDb can return three title lists, popular, exact, and partial // the popular titles are in the first table, after the "Popular Results" text - int pos_popular = output.find(TQString::tqfromLatin1("Popular Titles"), 0, false); - int pos_exact = output.find(TQString::tqfromLatin1("Exact Matches"), TQMAX(pos_popular, 0), false); - int pos_partial = output.find(TQString::tqfromLatin1("Partial Matches"), TQMAX(pos_exact, 0), false); + int pos_popular = output.find(TQString::fromLatin1("Popular Titles"), 0, false); + int pos_exact = output.find(TQString::fromLatin1("Exact Matches"), TQMAX(pos_popular, 0), false); + int pos_partial = output.find(TQString::fromLatin1("Partial Matches"), TQMAX(pos_exact, 0), false); int end_popular = pos_exact; // keep track of where to end if(end_popular == -1) { end_popular = pos_partial == -1 ? output.length() : pos_partial; @@ -336,7 +336,7 @@ void IMDBFetcher::parseTitleBlock(const TQString& str_) { } // myDebug() << "IMDBFetcher::parseTitleBlock() - " << m_currentTitleBlock << endl; - TQRegExp akaRx(TQString::tqfromLatin1("aka (.*)(</li>|<br)"), false); + TQRegExp akaRx(TQString::fromLatin1("aka (.*)(</li>|<br)"), false); akaRx.setMinimal(true); m_hasMoreResults = false; @@ -364,7 +364,7 @@ void IMDBFetcher::parseTitleBlock(const TQString& str_) { TQString text = str_.mid(start, end-start); pPos = text.find('('); if(pPos > -1) { - int pNewLine = text.find(TQString::tqfromLatin1("<br")); + int pNewLine = text.find(TQString::fromLatin1("<br")); if(pNewLine == -1 || pPos < pNewLine) { int pPos2 = text.find(')', pPos); desc = text.mid(pPos+1, pPos2-pPos-1); @@ -382,7 +382,7 @@ void IMDBFetcher::parseTitleBlock(const TQString& str_) { // limit to 50 chars desc += TQChar(' ') + akaRx.cap(1).stripWhiteSpace().remove(*s_tagRx); if(desc.length() > 50) { - desc = desc.left(50) + TQString::tqfromLatin1("..."); + desc = desc.left(50) + TQString::fromLatin1("..."); } } @@ -425,7 +425,7 @@ void IMDBFetcher::parseSingleNameResult() { return; } - TQRegExp tvRegExp(TQString::tqfromLatin1("TV\\sEpisode"), false); + TQRegExp tvRegExp(TQString::fromLatin1("TV\\sEpisode"), false); int len = 0; int count = 0; @@ -441,7 +441,7 @@ void IMDBFetcher::parseSingleNameResult() { desc = cap2.mid(pPos); } else { // look until the next <a - int aPos = output.find(TQString::tqfromLatin1("<a"), pos+len, false); + int aPos = output.find(TQString::fromLatin1("<a"), pos+len, false); if(aPos == -1) { aPos = output.length(); } @@ -451,7 +451,7 @@ void IMDBFetcher::parseSingleNameResult() { } pPos = tmp.find('('); if(pPos > -1) { - int pNewLine = tmp.find(TQString::tqfromLatin1("<br")); + int pNewLine = tmp.find(TQString::fromLatin1("<br")); if(pNewLine == -1 || pPos < pNewLine) { int pEnd = tmp.find(')', pPos+1); desc = tmp.mid(pPos+1, pEnd-pPos-1).remove(*s_tagRx); @@ -501,17 +501,17 @@ void IMDBFetcher::parseMultipleNameResults() { // the exact results are in the first table after the "exact results" text TQString output = Tellico::decodeHTML(TQString(m_data)); - int pos = output.find(TQString::tqfromLatin1("Popular Results"), 0, false); + int pos = output.find(TQString::fromLatin1("Popular Results"), 0, false); if(pos == -1) { - pos = output.find(TQString::tqfromLatin1("Exact Matches"), 0, false); + pos = output.find(TQString::fromLatin1("Exact Matches"), 0, false); } // find beginning of partial matches - int end = output.find(TQString::tqfromLatin1("Other Results"), TQMAX(pos, 0), false); + int end = output.find(TQString::fromLatin1("Other Results"), TQMAX(pos, 0), false); if(end == -1) { - end = output.find(TQString::tqfromLatin1("Partial Matches"), TQMAX(pos, 0), false); + end = output.find(TQString::fromLatin1("Partial Matches"), TQMAX(pos, 0), false); if(end == -1) { - end = output.find(TQString::tqfromLatin1("Approx Matches"), TQMAX(pos, 0), false); + end = output.find(TQString::fromLatin1("Approx Matches"), TQMAX(pos, 0), false); if(end == -1) { end = output.length(); } @@ -538,7 +538,7 @@ void IMDBFetcher::parseMultipleNameResults() { } nameMap.insert(s, nameMap[s] + 1); // check for duplicate names - s += TQString::tqfromLatin1("(%1) ").tqarg(nameMap[s]); + s += TQString::fromLatin1("(%1) ").arg(nameMap[s]); } else { nameMap.insert(s, 1); } @@ -561,7 +561,7 @@ void IMDBFetcher::parseMultipleNameResults() { } nameMap.insert(s, nameMap[s] + 1); // check for duplicate names - s += TQString::tqfromLatin1(" (%1)").tqarg(nameMap[s]); + s += TQString::fromLatin1(" (%1)").arg(nameMap[s]); } else { nameMap.insert(s, 1); } @@ -641,7 +641,7 @@ Tellico::Data::EntryPtr IMDBFetcher::fetchEntry(uint uid_) { } else { // now it's sychronous #ifdef IMDB_TEST - KURL u = KURL::fromPathOrURL(TQString::tqfromLatin1("/home/robby/imdb-title-result.html")); + KURL u = KURL::fromPathOrURL(TQString::fromLatin1("/home/robby/imdb-title-result.html")); results = Tellico::decodeHTML(FileHandler::readTextFile(u)); #else // be quiet about failure @@ -675,8 +675,8 @@ Tellico::Data::EntryPtr IMDBFetcher::parseEntry(const TQString& str_) { doAlsoKnownAs(str_, entry); doPlot(str_, entry, m_url); doLists(str_, entry); - doPerson(str_, entry, TQString::tqfromLatin1("Director"), TQString::tqfromLatin1("director")); - doPerson(str_, entry, TQString::tqfromLatin1("Writer"), TQString::tqfromLatin1("writer")); + doPerson(str_, entry, TQString::fromLatin1("Director"), TQString::fromLatin1("director")); + doPerson(str_, entry, TQString::fromLatin1("Writer"), TQString::fromLatin1("writer")); doRating(str_, entry); doCast(str_, entry, m_url); if(m_fetchImages) { @@ -684,7 +684,7 @@ Tellico::Data::EntryPtr IMDBFetcher::parseEntry(const TQString& str_) { doCover(str_, entry, m_url); } - const TQString imdb = TQString::tqfromLatin1("imdb"); + const TQString imdb = TQString::fromLatin1("imdb"); if(!coll->hasField(imdb) && m_fields.findIndex(imdb) > -1) { Data::FieldPtr field = new Data::Field(imdb, i18n("IMDB Link"), Data::Field::URL); field->setCategory(i18n("General")); @@ -707,7 +707,7 @@ void IMDBFetcher::doTitle(const TQString& str_, Data::EntryPtr entry_) { if(title.startsWith(TQChar('"')) && title.endsWith(TQChar('"'))) { title = title.mid(1, title.length()-2); } - entry_->setField(TQString::tqfromLatin1("title"), title); + entry_->setField(TQString::fromLatin1("title"), title); // remove parenthesis uint pPos2 = pPos+1; while(pPos2 < cap1.length() && cap1[pPos2].isDigit()) { @@ -715,62 +715,62 @@ void IMDBFetcher::doTitle(const TQString& str_, Data::EntryPtr entry_) { } TQString year = cap1.mid(pPos+1, pPos2-pPos-1); if(!year.isEmpty()) { - entry_->setField(TQString::tqfromLatin1("year"), year); + entry_->setField(TQString::fromLatin1("year"), year); } } } void IMDBFetcher::doRunningTime(const TQString& str_, Data::EntryPtr entry_) { // running time - TQRegExp runtimeRx(TQString::tqfromLatin1("runtime:.*(\\d+)\\s+min"), false); + TQRegExp runtimeRx(TQString::fromLatin1("runtime:.*(\\d+)\\s+min"), false); runtimeRx.setMinimal(true); if(runtimeRx.search(str_) > -1) { // myDebug() << "running-time = " << runtimeRx.cap(1) << endl; - entry_->setField(TQString::tqfromLatin1("running-time"), runtimeRx.cap(1)); + entry_->setField(TQString::fromLatin1("running-time"), runtimeRx.cap(1)); } } void IMDBFetcher::doAspectRatio(const TQString& str_, Data::EntryPtr entry_) { - TQRegExp rx(TQString::tqfromLatin1("aspect ratio:.*([\\d\\.]+\\s*:\\s*[\\d\\.]+)"), false); + TQRegExp rx(TQString::fromLatin1("aspect ratio:.*([\\d\\.]+\\s*:\\s*[\\d\\.]+)"), false); rx.setMinimal(true); if(rx.search(str_) > -1) { // myDebug() << "aspect ratio = " << rx.cap(1) << endl; - entry_->setField(TQString::tqfromLatin1("aspect-ratio"), rx.cap(1).stripWhiteSpace()); + entry_->setField(TQString::fromLatin1("aspect-ratio"), rx.cap(1).stripWhiteSpace()); } } void IMDBFetcher::doAlsoKnownAs(const TQString& str_, Data::EntryPtr entry_) { - if(m_fields.findIndex(TQString::tqfromLatin1("alttitle")) == -1) { + if(m_fields.findIndex(TQString::fromLatin1("alttitle")) == -1) { return; } // match until next b tag -// TQRegExp akaRx(TQString::tqfromLatin1("also known as(.*)<b(?:\\s.*)?>")); - TQRegExp akaRx(TQString::tqfromLatin1("also known as(.*)<(b[>\\s/]|div)"), false); +// TQRegExp akaRx(TQString::fromLatin1("also known as(.*)<b(?:\\s.*)?>")); + TQRegExp akaRx(TQString::fromLatin1("also known as(.*)<(b[>\\s/]|div)"), false); akaRx.setMinimal(true); if(akaRx.search(str_) > -1 && !akaRx.cap(1).isEmpty()) { - Data::FieldPtr f = entry_->collection()->fieldByName(TQString::tqfromLatin1("alttitle")); + Data::FieldPtr f = entry_->collection()->fieldByName(TQString::fromLatin1("alttitle")); if(!f) { - f = new Data::Field(TQString::tqfromLatin1("alttitle"), i18n("Alternative Titles"), Data::Field::Table); + f = new Data::Field(TQString::fromLatin1("alttitle"), i18n("Alternative Titles"), Data::Field::Table); f->setFormatFlag(Data::Field::FormatTitle); entry_->collection()->addField(f); } // split by <br>, remembering it could become valid xhtml! - TQRegExp brRx(TQString::tqfromLatin1("<br[\\s/]*>"), false); + TQRegExp brRx(TQString::fromLatin1("<br[\\s/]*>"), false); brRx.setMinimal(true); TQStringList list = TQStringList::split(brRx, akaRx.cap(1)); // lang could be included with [fr] -// const TQRegExp parRx(TQString::tqfromLatin1("\\(.+\\)")); - const TQRegExp brackRx(TQString::tqfromLatin1("\\[\\w+\\]")); +// const TQRegExp parRx(TQString::fromLatin1("\\(.+\\)")); + const TQRegExp brackRx(TQString::fromLatin1("\\[\\w+\\]")); TQStringList values; for(TQStringList::Iterator it = list.begin(); it != list.end(); ++it) { TQString s = *it; // sometimes, the word "more" gets linked to the releaseinfo page, check that - if(s.find(TQString::tqfromLatin1("releaseinfo")) > -1) { + if(s.find(TQString::fromLatin1("releaseinfo")) > -1) { continue; } s.remove(*s_tagRx); @@ -786,7 +786,7 @@ void IMDBFetcher::doAlsoKnownAs(const TQString& str_, Data::EntryPtr entry_) { } } if(!values.isEmpty()) { - entry_->setField(TQString::tqfromLatin1("alttitle"), values.join(sep)); + entry_->setField(TQString::fromLatin1("alttitle"), values.join(sep)); } } } @@ -799,36 +799,36 @@ void IMDBFetcher::doPlot(const TQString& str_, Data::EntryPtr entry_, const KURL TQString thisPlot; // match until next opening tag - TQRegExp plotRx(TQString::tqfromLatin1("plot (?:outline|summary):(.*)<[^/].*</"), false); + TQRegExp plotRx(TQString::fromLatin1("plot (?:outline|summary):(.*)<[^/].*</"), false); plotRx.setMinimal(true); - TQRegExp plotURLRx(TQString::tqfromLatin1("<a\\s+.*href\\s*=\\s*\".*/title/.*/plotsummary\""), false); + TQRegExp plotURLRx(TQString::fromLatin1("<a\\s+.*href\\s*=\\s*\".*/title/.*/plotsummary\""), false); plotURLRx.setMinimal(true); if(plotRx.search(str_) > -1) { thisPlot = plotRx.cap(1); thisPlot.remove(*s_tagRx); // remove HTML tags - entry_->setField(TQString::tqfromLatin1("plot"), thisPlot); + entry_->setField(TQString::fromLatin1("plot"), thisPlot); // if thisPlot ends with (more) or contains // a url that ends with plotsummary, then we'll grab it, otherwise not - if(plotRx.cap(0).endsWith(TQString::tqfromLatin1("(more)</")) || plotURLRx.search(plotRx.cap(0)) > -1) { + if(plotRx.cap(0).endsWith(TQString::fromLatin1("(more)</")) || plotURLRx.search(plotRx.cap(0)) > -1) { useUserSummary = true; } } if(useUserSummary) { - TQRegExp idRx(TQString::tqfromLatin1("title/(tt\\d+)")); + TQRegExp idRx(TQString::fromLatin1("title/(tt\\d+)")); idRx.search(baseURL_.path()); KURL plotURL = baseURL_; - plotURL.setPath(TQString::tqfromLatin1("/title/") + idRx.cap(1) + TQString::tqfromLatin1("/plotsummary")); + plotURL.setPath(TQString::fromLatin1("/title/") + idRx.cap(1) + TQString::fromLatin1("/plotsummary")); // be quiet about failure TQString plotPage = FileHandler::readTextFile(plotURL, true); if(!plotPage.isEmpty()) { - TQRegExp plotRx(TQString::tqfromLatin1("<p\\s+class\\s*=\\s*\"plotpar\">(.*)</p")); + TQRegExp plotRx(TQString::fromLatin1("<p\\s+class\\s*=\\s*\"plotpar\">(.*)</p")); plotRx.setMinimal(true); if(plotRx.search(plotPage) > -1) { TQString userPlot = plotRx.cap(1); userPlot.remove(*s_tagRx); // remove HTML tags - entry_->setField(TQString::tqfromLatin1("plot"), Tellico::decodeHTML(userPlot)); + entry_->setField(TQString::fromLatin1("plot"), Tellico::decodeHTML(userPlot)); } } } @@ -836,11 +836,11 @@ void IMDBFetcher::doPlot(const TQString& str_, Data::EntryPtr entry_, const KURL void IMDBFetcher::doPerson(const TQString& str_, Data::EntryPtr entry_, const TQString& imdbHeader_, const TQString& fieldName_) { - TQRegExp br2Rx(TQString::tqfromLatin1("<br[\\s/]*>\\s*<br[\\s/]*>"), false); + TQRegExp br2Rx(TQString::fromLatin1("<br[\\s/]*>\\s*<br[\\s/]*>"), false); br2Rx.setMinimal(true); - TQRegExp divRx(TQString::tqfromLatin1("<[/]*div"), false); + TQRegExp divRx(TQString::fromLatin1("<[/]*div"), false); divRx.setMinimal(true); - TQString name = TQString::tqfromLatin1("/name/"); + TQString name = TQString::fromLatin1("/name/"); StringSet people; for(int pos = str_.find(imdbHeader_); pos > 0; pos = str_.find(imdbHeader_, pos)) { @@ -866,13 +866,13 @@ void IMDBFetcher::doCast(const TQString& str_, Data::EntryPtr entry_, const KURL // that's usually a lot of people // but since it can be in billing order, the main actors might not // be in the short list - TQRegExp idRx(TQString::tqfromLatin1("title/(tt\\d+)")); + TQRegExp idRx(TQString::fromLatin1("title/(tt\\d+)")); idRx.search(baseURL_.path()); #ifdef IMDB_TEST - KURL castURL = KURL::fromPathOrURL(TQString::tqfromLatin1("/home/robby/imdb-title-fullcredits.html")); + KURL castURL = KURL::fromPathOrURL(TQString::fromLatin1("/home/robby/imdb-title-fullcredits.html")); #else KURL castURL = baseURL_; - castURL.setPath(TQString::tqfromLatin1("/title/") + idRx.cap(1) + TQString::tqfromLatin1("/fullcredits")); + castURL.setPath(TQString::fromLatin1("/title/") + idRx.cap(1) + TQString::fromLatin1("/fullcredits")); #endif // be quiet about failure and be sure to translate entities TQString castPage = Tellico::decodeHTML(FileHandler::readTextFile(castURL, true)); @@ -883,28 +883,28 @@ void IMDBFetcher::doCast(const TQString& str_, Data::EntryPtr entry_, const KURL if(castText.isEmpty()) { // fall back to short list castText = str_; - pos = castText.find(TQString::tqfromLatin1("cast overview"), 0, false); + pos = castText.find(TQString::fromLatin1("cast overview"), 0, false); if(pos == -1) { - pos = castText.find(TQString::tqfromLatin1("credited cast"), 0, false); + pos = castText.find(TQString::fromLatin1("credited cast"), 0, false); } } else { // first look for anchor - TQRegExp castAnchorRx(TQString::tqfromLatin1("<a\\s+name\\s*=\\s*\"cast\""), false); + TQRegExp castAnchorRx(TQString::fromLatin1("<a\\s+name\\s*=\\s*\"cast\""), false); pos = castText.find(castAnchorRx); if(pos < 0) { - TQRegExp tableClassRx(TQString::tqfromLatin1("<table\\s+class\\s*=\\s*\"cast\""), false); + TQRegExp tableClassRx(TQString::fromLatin1("<table\\s+class\\s*=\\s*\"cast\""), false); pos = castText.find(tableClassRx); if(pos < 0) { // fragile, the word "cast" appears in the title, but need to find // the one right above the actual cast table // for TV shows, there's a link on the sidebar for "episodes case" // so need to not match that one - pos = castText.find(TQString::tqfromLatin1("cast</"), 0, false); + pos = castText.find(TQString::fromLatin1("cast</"), 0, false); if(pos > 9) { // back up 9 places - if(castText.mid(pos-9, 9).startsWith(TQString::tqfromLatin1("episodes"))) { + if(castText.mid(pos-9, 9).startsWith(TQString::fromLatin1("episodes"))) { // find next cast list - pos = castText.find(TQString::tqfromLatin1("cast</"), pos+6, false); + pos = castText.find(TQString::fromLatin1("cast</"), pos+6, false); } } } @@ -915,13 +915,13 @@ void IMDBFetcher::doCast(const TQString& str_, Data::EntryPtr entry_, const KURL return; } - const TQString name = TQString::tqfromLatin1("/name/"); - TQRegExp tdRx(TQString::tqfromLatin1("<td[^>]*>(.*)</td>"), false); + const TQString name = TQString::fromLatin1("/name/"); + TQRegExp tdRx(TQString::fromLatin1("<td[^>]*>(.*)</td>"), false); tdRx.setMinimal(true); TQStringList cast; // loop until closing table tag - const int endPos = castText.find(TQString::tqfromLatin1("</table"), pos, false); + const int endPos = castText.find(TQString::fromLatin1("</table"), pos, false); pos = s_anchorRx->search(castText, pos+1); while(pos > -1 && pos < endPos && static_cast<int>(cast.count()) < m_numCast) { if(s_anchorRx->cap(1).find(name) > -1) { @@ -930,7 +930,7 @@ void IMDBFetcher::doCast(const TQString& str_, Data::EntryPtr entry_, const KURL const int pos2 = tdRx.search(castText, pos); if(pos2 > -1 && tdRx.search(castText, pos2+1) > -1) { cast += s_anchorRx->cap(2).stripWhiteSpace() - + TQString::tqfromLatin1("::") + tdRx.cap(1).simplifyWhiteSpace().remove(*s_tagRx); + + TQString::fromLatin1("::") + tdRx.cap(1).simplifyWhiteSpace().remove(*s_tagRx); } else { cast += s_anchorRx->cap(2).stripWhiteSpace(); } @@ -939,46 +939,46 @@ void IMDBFetcher::doCast(const TQString& str_, Data::EntryPtr entry_, const KURL } if(!cast.isEmpty()) { - entry_->setField(TQString::tqfromLatin1("cast"), cast.join(sep)); + entry_->setField(TQString::fromLatin1("cast"), cast.join(sep)); } } void IMDBFetcher::doRating(const TQString& str_, Data::EntryPtr entry_) { - if(m_fields.findIndex(TQString::tqfromLatin1("imdb-rating")) == -1) { + if(m_fields.findIndex(TQString::fromLatin1("imdb-rating")) == -1) { return; } // don't add a colon, since there's a <br> at the end // some of the imdb images use /10.gif in their path, so check for space or bracket - TQRegExp rx(TQString::tqfromLatin1("[>\\s](\\d+.?\\d*)/10[<//s]"), false); + TQRegExp rx(TQString::fromLatin1("[>\\s](\\d+.?\\d*)/10[<//s]"), false); rx.setMinimal(true); if(rx.search(str_) > -1 && !rx.cap(1).isEmpty()) { - Data::FieldPtr f = entry_->collection()->fieldByName(TQString::tqfromLatin1("imdb-rating")); + Data::FieldPtr f = entry_->collection()->fieldByName(TQString::fromLatin1("imdb-rating")); if(!f) { - f = new Data::Field(TQString::tqfromLatin1("imdb-rating"), i18n("IMDB Rating"), Data::Field::Rating); + f = new Data::Field(TQString::fromLatin1("imdb-rating"), i18n("IMDB Rating"), Data::Field::Rating); f->setCategory(i18n("General")); - f->setProperty(TQString::tqfromLatin1("maximum"), TQString::tqfromLatin1("10")); + f->setProperty(TQString::fromLatin1("maximum"), TQString::fromLatin1("10")); entry_->collection()->addField(f); } bool ok; float value = rx.cap(1).toFloat(&ok); if(ok) { - entry_->setField(TQString::tqfromLatin1("imdb-rating"), TQString::number(value)); + entry_->setField(TQString::fromLatin1("imdb-rating"), TQString::number(value)); } } } void IMDBFetcher::doCover(const TQString& str_, Data::EntryPtr entry_, const KURL& baseURL_) { // cover is the img with the "cover" alt text - TQRegExp imgRx(TQString::tqfromLatin1("<img\\s+[^>]*src\\s*=\\s*\"([^\"]*)\"[^>]*>"), false); + TQRegExp imgRx(TQString::fromLatin1("<img\\s+[^>]*src\\s*=\\s*\"([^\"]*)\"[^>]*>"), false); imgRx.setMinimal(true); - TQRegExp posterRx(TQString::tqfromLatin1("<a\\s+[^>]*name\\s*=\\s*\"poster\"[^>]*>(.*)</a>"), false); + TQRegExp posterRx(TQString::fromLatin1("<a\\s+[^>]*name\\s*=\\s*\"poster\"[^>]*>(.*)</a>"), false); posterRx.setMinimal(true); - const TQString cover = TQString::tqfromLatin1("cover"); + const TQString cover = TQString::fromLatin1("cover"); int pos = posterRx.search(str_); while(pos > -1) { @@ -1011,14 +1011,14 @@ void IMDBFetcher::doCover(const TQString& str_, Data::EntryPtr entry_, const KUR // end up reparsing whole string, but it's not really that slow // loook at every anchor tag in the string void IMDBFetcher::doLists(const TQString& str_, Data::EntryPtr entry_) { - const TQString genre = TQString::tqfromLatin1("/Genres/"); - const TQString country = TQString::tqfromLatin1("/Countries/"); - const TQString lang = TQString::tqfromLatin1("/Languages/"); - const TQString colorInfo = TQString::tqfromLatin1("color-info"); - const TQString cert = TQString::tqfromLatin1("certificates="); - const TQString soundMix = TQString::tqfromLatin1("sound-mix="); - const TQString year = TQString::tqfromLatin1("/Years/"); - const TQString company = TQString::tqfromLatin1("/company/"); + const TQString genre = TQString::fromLatin1("/Genres/"); + const TQString country = TQString::fromLatin1("/Countries/"); + const TQString lang = TQString::fromLatin1("/Languages/"); + const TQString colorInfo = TQString::fromLatin1("color-info"); + const TQString cert = TQString::fromLatin1("certificates="); + const TQString soundMix = TQString::fromLatin1("sound-mix="); + const TQString year = TQString::fromLatin1("/Years/"); + const TQString company = TQString::fromLatin1("/company/"); // IIMdb also has links with the word "sections" in them, remove that // for genres and nationalities @@ -1027,19 +1027,19 @@ void IMDBFetcher::doLists(const TQString& str_, Data::EntryPtr entry_) { for(int pos = s_anchorRx->search(str_); pos > -1; pos = s_anchorRx->search(str_, pos+1)) { const TQString cap1 = s_anchorRx->cap(1); if(cap1.find(genre) > -1) { - if(s_anchorRx->cap(2).find(TQString::tqfromLatin1(" section"), 0, false) == -1) { + if(s_anchorRx->cap(2).find(TQString::fromLatin1(" section"), 0, false) == -1) { genres += s_anchorRx->cap(2).stripWhiteSpace(); } } else if(cap1.find(country) > -1) { - if(s_anchorRx->cap(2).find(TQString::tqfromLatin1(" section"), 0, false) == -1) { + if(s_anchorRx->cap(2).find(TQString::fromLatin1(" section"), 0, false) == -1) { countries += s_anchorRx->cap(2).stripWhiteSpace(); } } else if(cap1.find(lang) > -1) { langs += s_anchorRx->cap(2).stripWhiteSpace(); } else if(cap1.find(colorInfo) > -1) { // change "black and white" to "black & white" - entry_->setField(TQString::tqfromLatin1("color"), - s_anchorRx->cap(2).replace(TQString::tqfromLatin1("and"), TQChar('&')).stripWhiteSpace()); + entry_->setField(TQString::fromLatin1("color"), + s_anchorRx->cap(2).replace(TQString::fromLatin1("and"), TQChar('&')).stripWhiteSpace()); } else if(cap1.find(cert) > -1) { certs += s_anchorRx->cap(2).stripWhiteSpace(); } else if(cap1.find(soundMix) > -1) { @@ -1047,34 +1047,34 @@ void IMDBFetcher::doLists(const TQString& str_, Data::EntryPtr entry_) { } else if(cap1.find(company) > -1) { studios += s_anchorRx->cap(2).stripWhiteSpace(); // if year field wasn't set before, do it now - } else if(entry_->field(TQString::tqfromLatin1("year")).isEmpty() && cap1.find(year) > -1) { - entry_->setField(TQString::tqfromLatin1("year"), s_anchorRx->cap(2).stripWhiteSpace()); + } else if(entry_->field(TQString::fromLatin1("year")).isEmpty() && cap1.find(year) > -1) { + entry_->setField(TQString::fromLatin1("year"), s_anchorRx->cap(2).stripWhiteSpace()); } } - entry_->setField(TQString::tqfromLatin1("genre"), genres.join(sep)); - entry_->setField(TQString::tqfromLatin1("nationality"), countries.join(sep)); - entry_->setField(TQString::tqfromLatin1("language"), langs.join(sep)); - entry_->setField(TQString::tqfromLatin1("audio-track"), tracks.join(sep)); - entry_->setField(TQString::tqfromLatin1("studio"), studios.join(sep)); + entry_->setField(TQString::fromLatin1("genre"), genres.join(sep)); + entry_->setField(TQString::fromLatin1("nationality"), countries.join(sep)); + entry_->setField(TQString::fromLatin1("language"), langs.join(sep)); + entry_->setField(TQString::fromLatin1("audio-track"), tracks.join(sep)); + entry_->setField(TQString::fromLatin1("studio"), studios.join(sep)); if(!certs.isEmpty()) { // first try to set default certification - const TQStringList& certsAllowed = entry_->collection()->fieldByName(TQString::tqfromLatin1("certification"))->allowed(); + const TQStringList& certsAllowed = entry_->collection()->fieldByName(TQString::fromLatin1("certification"))->allowed(); for(TQStringList::ConstIterator it = certs.begin(); it != certs.end(); ++it) { TQString country = (*it).section(':', 0, 0); TQString cert = (*it).section(':', 1, 1); if(cert == Latin1Literal("Unrated")) { cert = TQChar('U'); } - cert += TQString::tqfromLatin1(" (") + country + ')'; + cert += TQString::fromLatin1(" (") + country + ')'; if(certsAllowed.findIndex(cert) > -1) { - entry_->setField(TQString::tqfromLatin1("certification"), cert); + entry_->setField(TQString::fromLatin1("certification"), cert); break; } } // now add new field for all certifications - const TQString allc = TQString::tqfromLatin1("allcertification"); + const TQString allc = TQString::fromLatin1("allcertification"); if(m_fields.findIndex(allc) > -1) { Data::FieldPtr f = entry_->collection()->fieldByName(allc); if(!f) { @@ -1082,7 +1082,7 @@ void IMDBFetcher::doLists(const TQString& str_, Data::EntryPtr entry_) { f->setFlags(Data::Field::AllowGrouped); entry_->collection()->addField(f); } - entry_->setField(TQString::tqfromLatin1("allcertification"), certs.join(sep)); + entry_->setField(TQString::fromLatin1("allcertification"), certs.join(sep)); } } } @@ -1091,8 +1091,8 @@ void IMDBFetcher::updateEntry(Data::EntryPtr entry_) { // myLog() << "IMDBFetcher::updateEntry() - " << entry_->title() << endl; // only take first 5 m_limit = 5; - TQString t = entry_->field(TQString::tqfromLatin1("title")); - KURL link = entry_->field(TQString::tqfromLatin1("imdb")); + TQString t = entry_->field(TQString::fromLatin1("title")); + KURL link = entry_->field(TQString::fromLatin1("imdb")); if(!link.isEmpty() && link.isValid()) { // check if we want a different host if(link.host() != m_host) { @@ -1173,7 +1173,7 @@ IMDBFetcher::ConfigWidget::ConfigWidget(TQWidget* parent_, const IMDBFetcher* fe m_numCast->setValue(fetcher_->m_numCast); m_fetchImageCheck->setChecked(fetcher_->m_fetchImages); } else { //defaults - m_hostEdit->setText(TQString::tqfromLatin1(IMDB_SERVER)); + m_hostEdit->setText(TQString::fromLatin1(IMDB_SERVER)); m_numCast->setValue(10); m_fetchImageCheck->setChecked(true); } @@ -1198,10 +1198,10 @@ TQString IMDBFetcher::ConfigWidget::preferredName() const { //static Tellico::StringMap IMDBFetcher::customFields() { StringMap map; - map[TQString::tqfromLatin1("imdb")] = i18n("IMDB Link"); - map[TQString::tqfromLatin1("imdb-rating")] = i18n("IMDB Rating"); - map[TQString::tqfromLatin1("alttitle")] = i18n("Alternative Titles"); - map[TQString::tqfromLatin1("allcertification")] = i18n("Certifications"); + map[TQString::fromLatin1("imdb")] = i18n("IMDB Link"); + map[TQString::fromLatin1("imdb-rating")] = i18n("IMDB Rating"); + map[TQString::fromLatin1("alttitle")] = i18n("Alternative Titles"); + map[TQString::fromLatin1("allcertification")] = i18n("Certifications"); return map; } diff --git a/src/fetch/isbndbfetcher.cpp b/src/fetch/isbndbfetcher.cpp index 3c6c093..ce3ed08 100644 --- a/src/fetch/isbndbfetcher.cpp +++ b/src/fetch/isbndbfetcher.cpp @@ -27,7 +27,7 @@ #include <tqdom.h> #include <tqlabel.h> -#include <tqlayout.h> +#include <layout.h> #include <tqfile.h> namespace { @@ -76,7 +76,7 @@ void ISBNdbFetcher::search(FetchKey key_, const TQString& value_) { m_countOffset = 0; if(!canFetch(Kernel::self()->collectionType())) { - message(i18n("%1 does not allow searching for this collection type.").tqarg(source()), MessageHandler::Warning); + message(i18n("%1 does not allow searching for this collection type.").arg(source()), MessageHandler::Warning); stop(); return; } @@ -94,35 +94,35 @@ void ISBNdbFetcher::doSearch() { // myDebug() << "ISBNdbFetcher::search() - value = " << value_ << endl; - KURL u(TQString::tqfromLatin1(ISBNDB_BASE_URL)); - u.addQueryItem(TQString::tqfromLatin1("access_key"), TQString::tqfromLatin1(ISBNDB_APP_ID)); - u.addQueryItem(TQString::tqfromLatin1("results"), TQString::tqfromLatin1("details,authors,subjects,texts")); - u.addQueryItem(TQString::tqfromLatin1("page_number"), TQString::number(m_page)); + KURL u(TQString::fromLatin1(ISBNDB_BASE_URL)); + u.addQueryItem(TQString::fromLatin1("access_key"), TQString::fromLatin1(ISBNDB_APP_ID)); + u.addQueryItem(TQString::fromLatin1("results"), TQString::fromLatin1("details,authors,subjects,texts")); + u.addQueryItem(TQString::fromLatin1("page_number"), TQString::number(m_page)); switch(m_key) { case Title: - u.addQueryItem(TQString::tqfromLatin1("index1"), TQString::tqfromLatin1("title")); - u.addQueryItem(TQString::tqfromLatin1("value1"), m_value); + u.addQueryItem(TQString::fromLatin1("index1"), TQString::fromLatin1("title")); + u.addQueryItem(TQString::fromLatin1("value1"), m_value); break; case Person: // yes, this also queries titles, too, it's a limitation of the isbndb api service - u.addQueryItem(TQString::tqfromLatin1("index1"), TQString::tqfromLatin1("combined")); - u.addQueryItem(TQString::tqfromLatin1("value1"), m_value); + u.addQueryItem(TQString::fromLatin1("index1"), TQString::fromLatin1("combined")); + u.addQueryItem(TQString::fromLatin1("value1"), m_value); break; case Keyword: - u.addQueryItem(TQString::tqfromLatin1("index1"), TQString::tqfromLatin1("full")); - u.addQueryItem(TQString::tqfromLatin1("value1"), m_value); + u.addQueryItem(TQString::fromLatin1("index1"), TQString::fromLatin1("full")); + u.addQueryItem(TQString::fromLatin1("value1"), m_value); break; case ISBN: - u.addQueryItem(TQString::tqfromLatin1("index1"), TQString::tqfromLatin1("isbn")); + u.addQueryItem(TQString::fromLatin1("index1"), TQString::fromLatin1("isbn")); { // only grab first value TQString v = m_value.section(TQChar(';'), 0); v.remove('-'); - u.addQueryItem(TQString::tqfromLatin1("value1"), v); + u.addQueryItem(TQString::fromLatin1("value1"), v); } break; @@ -178,7 +178,7 @@ void ISBNdbFetcher::slotComplete(KIO::Job* job_) { #if 0 kdWarning() << "Remove debug from isbndbfetcher.cpp" << endl; - TQFile f(TQString::tqfromLatin1("/tmp/test.xml")); + TQFile f(TQString::fromLatin1("/tmp/test.xml")); if(f.open(IO_WriteOnly)) { TQTextStream t(&f); t.setEncoding(TQTextStream::UnicodeUTF8); @@ -194,10 +194,10 @@ void ISBNdbFetcher::slotComplete(KIO::Job* job_) { } if(m_total == -1) { - TQDomNode n = dom.documentElement().namedItem(TQString::tqfromLatin1("BookList")); + TQDomNode n = dom.documentElement().namedItem(TQString::fromLatin1("BookList")); TQDomElement e = n.toElement(); if(!e.isNull()) { - m_total = e.attribute(TQString::tqfromLatin1("total_results"), TQString::number(-1)).toInt(); + m_total = e.attribute(TQString::fromLatin1("total_results"), TQString::number(-1)).toInt(); } } @@ -224,15 +224,15 @@ void ISBNdbFetcher::slotComplete(KIO::Job* job_) { // might get aborted break; } - TQString desc = entry->field(TQString::tqfromLatin1("author")) - + TQChar('/') + 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")); + TQString desc = entry->field(TQString::fromLatin1("author")) + + TQChar('/') + entry->field(TQString::fromLatin1("publisher")); + if(!entry->field(TQString::fromLatin1("cr_year")).isEmpty()) { + desc += TQChar('/') + entry->field(TQString::fromLatin1("cr_year")); + } else if(!entry->field(TQString::fromLatin1("pub_year")).isEmpty()){ + desc += TQChar('/') + entry->field(TQString::fromLatin1("pub_year")); } - SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(TQString::tqfromLatin1("isbn"))); + SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(TQString::fromLatin1("isbn"))); m_entries.insert(r->uid, Data::EntryPtr(entry)); emit signalResultFound(r); ++m_numResults; @@ -244,7 +244,7 @@ void ISBNdbFetcher::slotComplete(KIO::Job* job_) { const int currentTotal = TQMIN(m_total, m_limit); if(m_page * ISBNDB_RETURNS_PER_REQUEST < currentTotal) { int foundCount = (m_page-1) * ISBNDB_RETURNS_PER_REQUEST + coll->entryCount(); - message(i18n("Results from %1: %2/%3").tqarg(source()).tqarg(foundCount).tqarg(m_total), MessageHandler::tqStatus); + message(i18n("Results from %1: %2/%3").arg(source()).arg(foundCount).arg(m_total), MessageHandler::Status); ++m_page; m_countOffset = 0; doSearch(); @@ -265,32 +265,32 @@ Tellico::Data::EntryPtr ISBNdbFetcher::fetchEntry(uint uid_) { } // if the publisher id is set, then we need to grab the real publisher name - const TQString id = entry->field(TQString::tqfromLatin1("pub_id")); + const TQString id = entry->field(TQString::fromLatin1("pub_id")); if(!id.isEmpty()) { - KURL u(TQString::tqfromLatin1(ISBNDB_BASE_URL)); - u.setFileName(TQString::tqfromLatin1("publishers.xml")); - u.addQueryItem(TQString::tqfromLatin1("access_key"), TQString::tqfromLatin1(ISBNDB_APP_ID)); - u.addQueryItem(TQString::tqfromLatin1("index1"), TQString::tqfromLatin1("publisher_id")); - u.addQueryItem(TQString::tqfromLatin1("value1"), id); + KURL u(TQString::fromLatin1(ISBNDB_BASE_URL)); + u.setFileName(TQString::fromLatin1("publishers.xml")); + u.addQueryItem(TQString::fromLatin1("access_key"), TQString::fromLatin1(ISBNDB_APP_ID)); + u.addQueryItem(TQString::fromLatin1("index1"), TQString::fromLatin1("publisher_id")); + u.addQueryItem(TQString::fromLatin1("value1"), id); TQDomDocument dom = FileHandler::readXMLFile(u, true); if(!dom.isNull()) { - TQString pub = dom.documentElement().namedItem(TQString::tqfromLatin1("PublisherList")) - .namedItem(TQString::tqfromLatin1("PublisherData")) - .namedItem(TQString::tqfromLatin1("Name")) + TQString pub = dom.documentElement().namedItem(TQString::fromLatin1("PublisherList")) + .namedItem(TQString::fromLatin1("PublisherData")) + .namedItem(TQString::fromLatin1("Name")) .toElement().text(); if(!pub.isEmpty()) { - entry->setField(TQString::tqfromLatin1("publisher"), pub); + entry->setField(TQString::fromLatin1("publisher"), pub); } } - entry->setField(TQString::tqfromLatin1("pub_id"), TQString()); + entry->setField(TQString::fromLatin1("pub_id"), TQString()); } return entry; } void ISBNdbFetcher::initXSLTHandler() { - TQString xsltfile = locate("appdata", TQString::tqfromLatin1("isbndb2tellico.xsl")); + TQString xsltfile = locate("appdata", TQString::fromLatin1("isbndb2tellico.xsl")); if(xsltfile.isEmpty()) { kdWarning() << "ISBNdbFetcher::initXSLTHandler() - can not locate isbndb2tellico.xsl." << endl; return; @@ -314,14 +314,14 @@ void ISBNdbFetcher::updateEntry(Data::EntryPtr entry_) { // limit to top 5 results m_limit = 5; - TQString isbn = entry_->field(TQString::tqfromLatin1("isbn")); + TQString isbn = entry_->field(TQString::fromLatin1("isbn")); if(!isbn.isEmpty()) { search(Fetch::ISBN, isbn); return; } // optimistically try searching for title and rely on Collection::sameEntry() to figure things out - TQString t = entry_->field(TQString::tqfromLatin1("title")); + TQString t = entry_->field(TQString::fromLatin1("title")); if(!t.isEmpty()) { m_limit = 10; // raise limit so more possibility of match search(Fetch::Title, t); diff --git a/src/fetch/messagehandler.cpp b/src/fetch/messagehandler.cpp index 5510480..287d689 100644 --- a/src/fetch/messagehandler.cpp +++ b/src/fetch/messagehandler.cpp @@ -21,7 +21,7 @@ using Tellico::Fetch::ManagerMessage; // all messages go to manager void ManagerMessage::send(const TQString& message_, Type type_) { - Fetch::Manager::self()->updatetqStatus(message_); + Fetch::Manager::self()->updateStatus(message_); // plus errors get a message box if(type_ == Error) { KMessageBox::sorry(Kernel::self()->widget(), message_); diff --git a/src/fetch/messagehandler.h b/src/fetch/messagehandler.h index 804d574..7cf525a 100644 --- a/src/fetch/messagehandler.h +++ b/src/fetch/messagehandler.h @@ -25,7 +25,7 @@ namespace Tellico { */ class MessageHandler { public: - enum Type { tqStatus, Warning, Error, ListError }; + enum Type { Status, Warning, Error, ListError }; MessageHandler() {} virtual ~MessageHandler() {} diff --git a/src/fetch/scripts/dark_horse_comics.py b/src/fetch/scripts/dark_horse_comics.py index 513127c..4f3b651 100644 --- a/src/fetch/scripts/dark_horse_comics.py +++ b/src/fetch/scripts/dark_horse_comics.py @@ -86,7 +86,7 @@ class BasicTellicoDOM: entryNode.setAttribute('id', str(self.__currentId)) titleNode = self.__doc.createElement('title') - titleNode.appendChild(self.__doc.createTextNode(tqunicode(d['title'], 'latin-1').encode('utf-8'))) + titleNode.appendChild(self.__doc.createTextNode(unicode(d['title'], 'latin-1').encode('utf-8'))) yearNode = self.__doc.createElement('pub_year') yearNode.appendChild(self.__doc.createTextNode(d['pub_year'])) @@ -101,25 +101,25 @@ class BasicTellicoDOM: writersNode = self.__doc.createElement('writers') for g in d['writer']: writerNode = self.__doc.createElement('writer') - writerNode.appendChild(self.__doc.createTextNode(tqunicode(g, 'latin-1').encode('utf-8'))) + writerNode.appendChild(self.__doc.createTextNode(unicode(g, 'latin-1').encode('utf-8'))) writersNode.appendChild(writerNode) genresNode = self.__doc.createElement('genres') for g in d['genre']: genreNode = self.__doc.createElement('genre') - genreNode.appendChild(self.__doc.createTextNode(tqunicode(g, 'latin-1').encode('utf-8'))) + genreNode.appendChild(self.__doc.createTextNode(unicode(g, 'latin-1').encode('utf-8'))) genresNode.appendChild(genreNode) commentsNode = self.__doc.createElement('comments') #for g in d['comments']: - # commentsNode.appendChild(self.__doc.createTextNode(tqunicode("%s\n\n" % g, 'latin-1').encode('utf-8'))) + # commentsNode.appendChild(self.__doc.createTextNode(unicode("%s\n\n" % g, 'latin-1').encode('utf-8'))) commentsData = string.join(d['comments'], '\n\n') - commentsNode.appendChild(self.__doc.createTextNode(tqunicode(commentsData, 'latin-1').encode('utf-8'))) + commentsNode.appendChild(self.__doc.createTextNode(unicode(commentsData, 'latin-1').encode('utf-8'))) artistsNode = self.__doc.createElement('artists') for k, v in d['artist'].iteritems(): artistNode = self.__doc.createElement('artist') - artistNode.appendChild(self.__doc.createTextNode(tqunicode(v, 'latin-1').encode('utf-8'))) + artistNode.appendChild(self.__doc.createTextNode(unicode(v, 'latin-1').encode('utf-8'))) artistsNode.appendChild(artistNode) pagesNode = self.__doc.createElement('pages') @@ -132,7 +132,7 @@ class BasicTellicoDOM: imageNode = self.__doc.createElement('image') imageNode.setAttribute('format', 'JPEG') imageNode.setAttribute('id', d['image'][0]) - imageNode.appendChild(self.__doc.createTextNode(tqunicode(d['image'][1], 'latin-1').encode('utf-8'))) + imageNode.appendChild(self.__doc.createTextNode(unicode(d['image'][1], 'latin-1').encode('utf-8'))) coverNode = self.__doc.createElement('cover') coverNode.appendChild(self.__doc.createTextNode(d['image'][0])) diff --git a/src/fetch/scripts/fr.allocine.py b/src/fetch/scripts/fr.allocine.py index 6412ecf..97a2247 100755 --- a/src/fetch/scripts/fr.allocine.py +++ b/src/fetch/scripts/fr.allocine.py @@ -90,23 +90,23 @@ class BasicTellicoDOM: entryNode.setAttribute('id', str(self.__currentId)) titleNode = self.__doc.createElement('title') - titleNode.appendChild(self.__doc.createTextNode(tqunicode(d['title'], 'latin-1').encode('utf-8'))) + titleNode.appendChild(self.__doc.createTextNode(unicode(d['title'], 'latin-1').encode('utf-8'))) otitleNode = self.__doc.createElement('titre-original') - otitleNode.appendChild(self.__doc.createTextNode(tqunicode(d['otitle'], 'latin-1').encode('utf-8'))) + otitleNode.appendChild(self.__doc.createTextNode(unicode(d['otitle'], 'latin-1').encode('utf-8'))) yearNode = self.__doc.createElement('year') - yearNode.appendChild(self.__doc.createTextNode(tqunicode(d['year'], 'latin-1').encode('utf-8'))) + yearNode.appendChild(self.__doc.createTextNode(unicode(d['year'], 'latin-1').encode('utf-8'))) genresNode = self.__doc.createElement('genres') for g in d['genres']: genreNode = self.__doc.createElement('genre') - genreNode.appendChild(self.__doc.createTextNode(tqunicode(g, 'latin-1').encode('utf-8'))) + genreNode.appendChild(self.__doc.createTextNode(unicode(g, 'latin-1').encode('utf-8'))) genresNode.appendChild(genreNode) natsNode = self.__doc.createElement('nationalitys') natNode = self.__doc.createElement('nat') - natNode.appendChild(self.__doc.createTextNode(tqunicode(d['nat'], 'latin-1').encode('utf-8'))) + natNode.appendChild(self.__doc.createTextNode(unicode(d['nat'], 'latin-1').encode('utf-8'))) natsNode.appendChild(natNode) castsNode = self.__doc.createElement('casts') @@ -114,7 +114,7 @@ class BasicTellicoDOM: castNode = self.__doc.createElement('cast') col1Node = self.__doc.createElement('column') col2Node = self.__doc.createElement('column') - col1Node.appendChild(self.__doc.createTextNode(tqunicode(g, 'latin-1').encode('utf-8'))) + col1Node.appendChild(self.__doc.createTextNode(unicode(g, 'latin-1').encode('utf-8'))) castNode.appendChild(col1Node) castNode.appendChild(col2Node) castsNode.appendChild(castNode) @@ -122,17 +122,17 @@ class BasicTellicoDOM: dirsNode = self.__doc.createElement('directors') for g in d['dirs']: dirNode = self.__doc.createElement('director') - dirNode.appendChild(self.__doc.createTextNode(tqunicode(g, 'latin-1').encode('utf-8'))) + dirNode.appendChild(self.__doc.createTextNode(unicode(g, 'latin-1').encode('utf-8'))) dirsNode.appendChild(dirNode) timeNode = self.__doc.createElement('running-time') - timeNode.appendChild(self.__doc.createTextNode(tqunicode(d['time'], 'latin-1').encode('utf-8'))) + timeNode.appendChild(self.__doc.createTextNode(unicode(d['time'], 'latin-1').encode('utf-8'))) - allocineNode = self.__doc.createElement(tqunicode('allociné-link', 'latin-1').encode('utf-8')) - allocineNode.appendChild(self.__doc.createTextNode(tqunicode(d['allocine'], 'latin-1').encode('utf-8'))) + allocineNode = self.__doc.createElement(unicode('allociné-link', 'latin-1').encode('utf-8')) + allocineNode.appendChild(self.__doc.createTextNode(unicode(d['allocine'], 'latin-1').encode('utf-8'))) plotNode = self.__doc.createElement('plot') - plotNode.appendChild(self.__doc.createTextNode(tqunicode(d['plot'], 'latin-1').encode('utf-8'))) + plotNode.appendChild(self.__doc.createTextNode(unicode(d['plot'], 'latin-1').encode('utf-8'))) if d['image']: imageNode = self.__doc.createElement('image') @@ -140,7 +140,7 @@ class BasicTellicoDOM: imageNode.setAttribute('id', d['image'][0]) imageNode.setAttribute('width', '120') imageNode.setAttribute('height', '160') - imageNode.appendChild(self.__doc.createTextNode(tqunicode(d['image'][1], 'latin-1').encode('utf-8'))) + imageNode.appendChild(self.__doc.createTextNode(unicode(d['image'][1], 'latin-1').encode('utf-8'))) coverNode = self.__doc.createElement('cover') coverNode.appendChild(self.__doc.createTextNode(d['image'][0])) diff --git a/src/fetch/scripts/ministerio_de_cultura.py b/src/fetch/scripts/ministerio_de_cultura.py index 7f949ba..8a768f9 100644 --- a/src/fetch/scripts/ministerio_de_cultura.py +++ b/src/fetch/scripts/ministerio_de_cultura.py @@ -155,9 +155,9 @@ class BasicTellicoDOM: # Convert all strings to UTF-8 for i in d.keys(): if type(d[i]) == types.ListType: - d[i] = [tqunicode(d[i][j], 'latin-1').encode('utf-8') for j in range(len(d[i]))] + d[i] = [unicode(d[i][j], 'latin-1').encode('utf-8') for j in range(len(d[i]))] elif type(d[i]) == types.StringType: - d[i] = tqunicode(d[i], 'latin-1').encode('utf-8') + d[i] = unicode(d[i], 'latin-1').encode('utf-8') entryNode = self.__doc.createElement('entry') entryNode.setAttribute('id', str(self.__currentId)) diff --git a/src/fetch/srufetcher.cpp b/src/fetch/srufetcher.cpp index 99529c3..3410c0c 100644 --- a/src/fetch/srufetcher.cpp +++ b/src/fetch/srufetcher.cpp @@ -36,7 +36,7 @@ #include <knuminput.h> #include <tqlabel.h> -#include <tqlayout.h> +#include <layout.h> #include <tqwhatsthis.h> //#define SRU_DEBUG @@ -95,7 +95,7 @@ void SRUFetcher::readConfigHook(const KConfigGroup& config_) { if(!m_path.startsWith(TQChar('/'))) { m_path.prepend('/'); } - m_format = config_.readEntry("Format", TQString::tqfromLatin1("mods")); + m_format = config_.readEntry("Format", TQString::fromLatin1("mods")); m_fields = config_.readListEntry("Custom Fields"); } @@ -109,35 +109,35 @@ void SRUFetcher::search(FetchKey key_, const TQString& value_) { m_started = true; #ifdef SRU_DEBUG - KURL u = KURL::fromPathOrURL(TQString::tqfromLatin1("/home/robby/sru.xml")); + KURL u = KURL::fromPathOrURL(TQString::fromLatin1("/home/robby/sru.xml")); #else KURL u; - u.setProtocol(TQString::tqfromLatin1("http")); + u.setProtocol(TQString::fromLatin1("http")); u.setHost(m_host); u.setPort(m_port); u.setPath(m_path); - u.addQueryItem(TQString::tqfromLatin1("operation"), TQString::tqfromLatin1("searchRetrieve")); - u.addQueryItem(TQString::tqfromLatin1("version"), TQString::tqfromLatin1("1.1")); - u.addQueryItem(TQString::tqfromLatin1("maximumRecords"), TQString::number(SRU_MAX_RECORDS)); - u.addQueryItem(TQString::tqfromLatin1("recordSchema"), m_format); + u.addQueryItem(TQString::fromLatin1("operation"), TQString::fromLatin1("searchRetrieve")); + u.addQueryItem(TQString::fromLatin1("version"), TQString::fromLatin1("1.1")); + u.addQueryItem(TQString::fromLatin1("maximumRecords"), TQString::number(SRU_MAX_RECORDS)); + u.addQueryItem(TQString::fromLatin1("recordSchema"), m_format); const int type = Kernel::self()->collectionType(); TQString str = TQChar('"') + value_ + TQChar('"'); switch(key_) { case Title: - u.addQueryItem(TQString::tqfromLatin1("query"), TQString::tqfromLatin1("dc.title=") + str); + u.addQueryItem(TQString::fromLatin1("query"), TQString::fromLatin1("dc.title=") + str); break; case Person: { TQString s; if(type == Data::Collection::Book || type == Data::Collection::Bibtex) { - s = TQString::tqfromLatin1("author=") + str + TQString::tqfromLatin1(" or dc.author=") + str; + s = TQString::fromLatin1("author=") + str + TQString::fromLatin1(" or dc.author=") + str; } else { - s = TQString::tqfromLatin1("dc.creator=") + str + TQString::tqfromLatin1(" or dc.editor=") + str; + s = TQString::fromLatin1("dc.creator=") + str + TQString::fromLatin1(" or dc.editor=") + str; } - u.addQueryItem(TQString::tqfromLatin1("query"), s); + u.addQueryItem(TQString::fromLatin1("query"), s); } break; @@ -146,7 +146,7 @@ void SRUFetcher::search(FetchKey key_, const TQString& value_) { str.remove('-'); // limit to first isbn str = str.section(';', 0, 0); - u.addQueryItem(TQString::tqfromLatin1("query"), TQString::tqfromLatin1("bath.isbn=") + str); + u.addQueryItem(TQString::fromLatin1("query"), TQString::fromLatin1("bath.isbn=") + str); break; case LCCN: @@ -156,15 +156,15 @@ void SRUFetcher::search(FetchKey key_, const TQString& value_) { str = str.section(';', 0, 0); // also try formalized lccn TQString lccn = LCCNValidator::formalize(str); - u.addQueryItem(TQString::tqfromLatin1("query"), - TQString::tqfromLatin1("bath.lccn=") + str + - TQString::tqfromLatin1(" or bath.lccn=") + lccn + u.addQueryItem(TQString::fromLatin1("query"), + TQString::fromLatin1("bath.lccn=") + str + + TQString::fromLatin1(" or bath.lccn=") + lccn ); } break; case Keyword: - u.addQueryItem(TQString::tqfromLatin1("query"), str); + u.addQueryItem(TQString::fromLatin1("query"), str); break; case Raw: @@ -233,11 +233,11 @@ void SRUFetcher::slotComplete(KIO::Job* job_) { Import::XMLImporter xmlImporter(result); TQDomDocument dom = xmlImporter.domDocument(); - TQDomNodeList diagList = dom.elementsByTagNameNS(diag, TQString::tqfromLatin1("diagnostic")); + TQDomNodeList diagList = dom.elementsByTagNameNS(diag, TQString::fromLatin1("diagnostic")); for(uint i = 0; i < diagList.count(); ++i) { TQDomElement elem = diagList.item(i).toElement(); - TQDomNodeList nodeList1 = elem.elementsByTagNameNS(diag, TQString::tqfromLatin1("message")); - TQDomNodeList nodeList2 = elem.elementsByTagNameNS(diag, TQString::tqfromLatin1("details")); + TQDomNodeList nodeList1 = elem.elementsByTagNameNS(diag, TQString::fromLatin1("message")); + TQDomNodeList nodeList2 = elem.elementsByTagNameNS(diag, TQString::fromLatin1("details")); for(uint j = 0; j < nodeList1.count(); ++j) { TQString d = nodeList1.item(j).toElement().text(); if(!d.isEmpty()) { @@ -275,7 +275,7 @@ void SRUFetcher::slotComplete(KIO::Job* job_) { } if(coll && !msg.isEmpty()) { - message(msg, coll->entryCount() == 0 ? MessageHandler::Warning : MessageHandler::tqStatus); + message(msg, coll->entryCount() == 0 ? MessageHandler::Warning : MessageHandler::Status); } if(!coll) { @@ -299,36 +299,36 @@ void SRUFetcher::slotComplete(KIO::Job* job_) { TQString desc; switch(coll->type()) { case Data::Collection::Book: - desc = entry->field(TQString::tqfromLatin1("author")) + desc = entry->field(TQString::fromLatin1("author")) + TQChar('/') - + 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")); + + entry->field(TQString::fromLatin1("publisher")); + if(!entry->field(TQString::fromLatin1("cr_year")).isEmpty()) { + desc += TQChar('/') + entry->field(TQString::fromLatin1("cr_year")); + } else if(!entry->field(TQString::fromLatin1("pub_year")).isEmpty()){ + desc += TQChar('/') + entry->field(TQString::fromLatin1("pub_year")); } break; case Data::Collection::Video: - desc = entry->field(TQString::tqfromLatin1("studio")) + desc = entry->field(TQString::fromLatin1("studio")) + TQChar('/') - + entry->field(TQString::tqfromLatin1("director")) + + entry->field(TQString::fromLatin1("director")) + TQChar('/') - + entry->field(TQString::tqfromLatin1("year")); + + entry->field(TQString::fromLatin1("year")); break; case Data::Collection::Album: - desc = entry->field(TQString::tqfromLatin1("artist")) + desc = entry->field(TQString::fromLatin1("artist")) + TQChar('/') - + entry->field(TQString::tqfromLatin1("label")) + + entry->field(TQString::fromLatin1("label")) + TQChar('/') - + entry->field(TQString::tqfromLatin1("year")); + + entry->field(TQString::fromLatin1("year")); break; default: break; } - SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(TQString::tqfromLatin1("isbn"))); + SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(TQString::fromLatin1("isbn"))); m_entries.insert(r->uid, entry); emit signalResultFound(r); } @@ -341,20 +341,20 @@ Tellico::Data::EntryPtr SRUFetcher::fetchEntry(uint uid_) { void SRUFetcher::updateEntry(Data::EntryPtr entry_) { // myDebug() << "SRUFetcher::updateEntry() - " << source() << ": " << entry_->title() << endl; - TQString isbn = entry_->field(TQString::tqfromLatin1("isbn")); + TQString isbn = entry_->field(TQString::fromLatin1("isbn")); if(!isbn.isEmpty()) { search(Fetch::ISBN, isbn); return; } - TQString lccn = entry_->field(TQString::tqfromLatin1("lccn")); + TQString lccn = entry_->field(TQString::fromLatin1("lccn")); if(!lccn.isEmpty()) { search(Fetch::LCCN, lccn); return; } // optimistically try searching for title and rely on Collection::sameEntry() to figure things out - TQString t = entry_->field(TQString::tqfromLatin1("title")); + TQString t = entry_->field(TQString::fromLatin1("title")); if(!t.isEmpty()) { search(Fetch::Title, t); return; @@ -369,7 +369,7 @@ bool SRUFetcher::initMARCXMLHandler() { return true; } - TQString xsltfile = locate("appdata", TQString::tqfromLatin1("MARC21slim2MODS3.xsl")); + TQString xsltfile = locate("appdata", TQString::fromLatin1("MARC21slim2MODS3.xsl")); if(xsltfile.isEmpty()) { kdWarning() << "SRUFetcher::initHandlers() - can not locate MARC21slim2MODS3.xsl." << endl; return false; @@ -393,7 +393,7 @@ bool SRUFetcher::initMODSHandler() { return true; } - TQString xsltfile = locate("appdata", TQString::tqfromLatin1("mods2tellico.xsl")); + TQString xsltfile = locate("appdata", TQString::fromLatin1("mods2tellico.xsl")); if(xsltfile.isEmpty()) { kdWarning() << "SRUFetcher::initHandlers() - can not locate mods2tellico.xsl." << endl; return false; @@ -413,15 +413,15 @@ bool SRUFetcher::initMODSHandler() { } Tellico::Fetch::Fetcher::Ptr SRUFetcher::libraryOfCongress(TQObject* parent_) { - return new SRUFetcher(i18n("Library of Congress (US)"), TQString::tqfromLatin1("z3950.loc.gov"), 7090, - TQString::tqfromLatin1("voyager"), parent_); + return new SRUFetcher(i18n("Library of Congress (US)"), TQString::fromLatin1("z3950.loc.gov"), 7090, + TQString::fromLatin1("voyager"), parent_); } // static Tellico::StringMap SRUFetcher::customFields() { StringMap map; - map[TQString::tqfromLatin1("address")] = i18n("Address"); - map[TQString::tqfromLatin1("abstract")] = i18n("Abstract"); + map[TQString::fromLatin1("address")] = i18n("Address"); + map[TQString::fromLatin1("abstract")] = i18n("Abstract"); return map; } @@ -453,7 +453,7 @@ SRUConfigWidget::SRUConfigWidget(TQWidget* parent_, const SRUFetcher* fetcher_ / m_portSpinBox = new KIntSpinBox(0, 999999, 1, SRU_DEFAULT_PORT, 10, optionsWidget()); 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.").tqarg(SRU_DEFAULT_PORT); + w = i18n("Enter the port number of the server. The default is %1.").arg(SRU_DEFAULT_PORT); TQWhatsThis::add(label, w); TQWhatsThis::add(m_portSpinBox, w); label->setBuddy(m_portSpinBox); @@ -471,9 +471,9 @@ SRUConfigWidget::SRUConfigWidget(TQWidget* parent_, const SRUFetcher* fetcher_ / label = new TQLabel(i18n("Format: "), optionsWidget()); l->addWidget(label, ++row, 0); m_formatCombo = new GUI::ComboBox(optionsWidget()); - m_formatCombo->insertItem(TQString::tqfromLatin1("MODS"), TQString::tqfromLatin1("mods")); - m_formatCombo->insertItem(TQString::tqfromLatin1("MARCXML"), TQString::tqfromLatin1("marcxml")); - m_formatCombo->insertItem(TQString::tqfromLatin1("Dublin Core"), TQString::tqfromLatin1("dc")); + m_formatCombo->insertItem(TQString::fromLatin1("MODS"), TQString::fromLatin1("mods")); + m_formatCombo->insertItem(TQString::fromLatin1("MARCXML"), TQString::fromLatin1("marcxml")); + m_formatCombo->insertItem(TQString::fromLatin1("Dublin Core"), TQString::fromLatin1("dc")); connect(m_formatCombo, TQT_SIGNAL(activated(int)), TQT_SLOT(slotSetModified())); l->addWidget(m_formatCombo, row, 1); w = i18n("Enter the result format used by the server."); diff --git a/src/fetch/yahoofetcher.cpp b/src/fetch/yahoofetcher.cpp index dcd1823..b3ddf77 100644 --- a/src/fetch/yahoofetcher.cpp +++ b/src/fetch/yahoofetcher.cpp @@ -29,7 +29,7 @@ #include <tqdom.h> #include <tqlabel.h> -#include <tqlayout.h> +#include <layout.h> #include <tqfile.h> namespace { @@ -83,32 +83,32 @@ void YahooFetcher::continueSearch() { void YahooFetcher::doSearch() { // myDebug() << "YahooFetcher::search() - value = " << value_ << endl; - KURL u(TQString::tqfromLatin1(YAHOO_BASE_URL)); - u.addQueryItem(TQString::tqfromLatin1("appid"), TQString::tqfromLatin1(YAHOO_APP_ID)); - u.addQueryItem(TQString::tqfromLatin1("type"), TQString::tqfromLatin1("all")); - u.addQueryItem(TQString::tqfromLatin1("output"), TQString::tqfromLatin1("xml")); - u.addQueryItem(TQString::tqfromLatin1("start"), TQString::number(m_start)); - u.addQueryItem(TQString::tqfromLatin1("results"), TQString::number(YAHOO_MAX_RETURNS_TOTAL)); + KURL u(TQString::fromLatin1(YAHOO_BASE_URL)); + u.addQueryItem(TQString::fromLatin1("appid"), TQString::fromLatin1(YAHOO_APP_ID)); + u.addQueryItem(TQString::fromLatin1("type"), TQString::fromLatin1("all")); + u.addQueryItem(TQString::fromLatin1("output"), TQString::fromLatin1("xml")); + u.addQueryItem(TQString::fromLatin1("start"), TQString::number(m_start)); + u.addQueryItem(TQString::fromLatin1("results"), TQString::number(YAHOO_MAX_RETURNS_TOTAL)); if(!canFetch(Kernel::self()->collectionType())) { - message(i18n("%1 does not allow searching for this collection type.").tqarg(source()), MessageHandler::Warning); + message(i18n("%1 does not allow searching for this collection type.").arg(source()), MessageHandler::Warning); stop(); return; } switch(m_key) { case Title: - u.addQueryItem(TQString::tqfromLatin1("album"), m_value); + u.addQueryItem(TQString::fromLatin1("album"), m_value); break; case Person: - u.addQueryItem(TQString::tqfromLatin1("artist"), m_value); + u.addQueryItem(TQString::fromLatin1("artist"), m_value); break; // raw is used for the entry updates case Raw: -// u.removeQueryItem(TQString::tqfromLatin1("type")); -// u.addQueryItem(TQString::tqfromLatin1("type"), TQString::tqfromLatin1("phrase")); +// u.removeQueryItem(TQString::fromLatin1("type")); +// u.addQueryItem(TQString::fromLatin1("type"), TQString::fromLatin1("phrase")); u.setQuery(u.query() + '&' + m_value); break; @@ -163,7 +163,7 @@ void YahooFetcher::slotComplete(KIO::Job* job_) { #if 0 kdWarning() << "Remove debug from yahoofetcher.cpp" << endl; - TQFile f(TQString::tqfromLatin1("/tmp/test.xml")); + TQFile f(TQString::fromLatin1("/tmp/test.xml")); if(f.open(IO_WriteOnly)) { TQTextStream t(&f); t.setEncoding(TQTextStream::UnicodeUTF8); @@ -189,7 +189,7 @@ void YahooFetcher::slotComplete(KIO::Job* job_) { // total is top level element, with attribute totalResultsAvailable TQDomElement e = dom.documentElement(); if(!e.isNull()) { - m_total = e.attribute(TQString::tqfromLatin1("totalResultsAvailable")).toInt(); + m_total = e.attribute(TQString::fromLatin1("totalResultsAvailable")).toInt(); } } @@ -210,13 +210,13 @@ void YahooFetcher::slotComplete(KIO::Job* job_) { // might get aborted break; } - TQString desc = entry->field(TQString::tqfromLatin1("artist")) + TQString desc = entry->field(TQString::fromLatin1("artist")) + TQChar('/') - + entry->field(TQString::tqfromLatin1("label")) + + entry->field(TQString::fromLatin1("label")) + TQChar('/') - + entry->field(TQString::tqfromLatin1("year")); + + entry->field(TQString::fromLatin1("year")); - SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(TQString::tqfromLatin1("isbn"))); + SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(TQString::fromLatin1("isbn"))); m_entries.insert(r->uid, Data::EntryPtr(entry)); emit signalResultFound(r); } @@ -232,30 +232,30 @@ Tellico::Data::EntryPtr YahooFetcher::fetchEntry(uint uid_) { return 0; } - KURL imageURL = entry->field(TQString::tqfromLatin1("image")); + KURL imageURL = entry->field(TQString::fromLatin1("image")); if(!imageURL.isEmpty()) { TQString id = ImageFactory::addImage(imageURL, true); if(id.isEmpty()) { - // rich text causes tqlayout issues -// emit signaltqStatus(i18n("<qt>The cover image for <i>%1</i> could not be loaded.</qt>").tqarg( -// entry->field(TQString::tqfromLatin1("title")))); + // rich text causes layout issues +// emit signalStatus(i18n("<qt>The cover image for <i>%1</i> could not be loaded.</qt>").arg( +// entry->field(TQString::fromLatin1("title")))); message(i18n("The cover image could not be loaded."), MessageHandler::Warning); } else { - entry->setField(TQString::tqfromLatin1("cover"), id); + entry->setField(TQString::fromLatin1("cover"), id); } } getTracks(entry); // don't want to show image urls in the fetch dialog - entry->setField(TQString::tqfromLatin1("image"), TQString()); + entry->setField(TQString::fromLatin1("image"), TQString()); // no need for album id now ? - entry->setField(TQString::tqfromLatin1("yahoo"), TQString()); + entry->setField(TQString::fromLatin1("yahoo"), TQString()); return entry; } void YahooFetcher::initXSLTHandler() { - TQString xsltfile = locate("appdata", TQString::tqfromLatin1("yahoo2tellico.xsl")); + TQString xsltfile = locate("appdata", TQString::fromLatin1("yahoo2tellico.xsl")); if(xsltfile.isEmpty()) { kdWarning() << "YahooFetcher::initXSLTHandler() - can not locate yahoo2tellico.xsl." << endl; return; @@ -276,20 +276,20 @@ void YahooFetcher::initXSLTHandler() { void YahooFetcher::getTracks(Data::EntryPtr entry_) { // get album id - if(!entry_ || entry_->field(TQString::tqfromLatin1("yahoo")).isEmpty()) { + if(!entry_ || entry_->field(TQString::fromLatin1("yahoo")).isEmpty()) { return; } - const TQString albumid = entry_->field(TQString::tqfromLatin1("yahoo")); + const TQString albumid = entry_->field(TQString::fromLatin1("yahoo")); - KURL u(TQString::tqfromLatin1(YAHOO_BASE_URL)); - u.setFileName(TQString::tqfromLatin1("songSearch")); - u.addQueryItem(TQString::tqfromLatin1("appid"), TQString::tqfromLatin1(YAHOO_APP_ID)); - u.addQueryItem(TQString::tqfromLatin1("type"), TQString::tqfromLatin1("all")); - u.addQueryItem(TQString::tqfromLatin1("output"), TQString::tqfromLatin1("xml")); + KURL u(TQString::fromLatin1(YAHOO_BASE_URL)); + u.setFileName(TQString::fromLatin1("songSearch")); + u.addQueryItem(TQString::fromLatin1("appid"), TQString::fromLatin1(YAHOO_APP_ID)); + u.addQueryItem(TQString::fromLatin1("type"), TQString::fromLatin1("all")); + u.addQueryItem(TQString::fromLatin1("output"), TQString::fromLatin1("xml")); // go ahesad and ask for all results, since there might well be more than 10 songs on the CD - u.addQueryItem(TQString::tqfromLatin1("results"), TQString::number(50)); - u.addQueryItem(TQString::tqfromLatin1("albumid"), albumid); + u.addQueryItem(TQString::fromLatin1("results"), TQString::number(50)); + u.addQueryItem(TQString::fromLatin1("albumid"), albumid); // myDebug() << "YahooFetcher::getTracks() - url: " << u.url() << endl; TQDomDocument dom = FileHandler::readXMLFile(u, false /*no namespace*/, true /*quiet*/); @@ -300,7 +300,7 @@ void YahooFetcher::getTracks(Data::EntryPtr entry_) { #if 0 kdWarning() << "Remove debug from yahoofetcher.cpp" << endl; - TQFile f(TQString::tqfromLatin1("/tmp/test.xml")); + TQFile f(TQString::fromLatin1("/tmp/test.xml")); if(f.open(IO_WriteOnly)) { TQTextStream t(&f); t.setEncoding(TQTextStream::UnicodeUTF8); @@ -309,7 +309,7 @@ void YahooFetcher::getTracks(Data::EntryPtr entry_) { f.close(); #endif - const TQString track = TQString::tqfromLatin1("track"); + const TQString track = TQString::fromLatin1("track"); TQDomNodeList nodes = dom.documentElement().childNodes(); for(uint i = 0; i < nodes.count(); ++i) { @@ -317,16 +317,16 @@ void YahooFetcher::getTracks(Data::EntryPtr entry_) { if(e.isNull()) { continue; } - TQString t = e.namedItem(TQString::tqfromLatin1("Title")).toElement().text(); - TQString n = e.namedItem(TQString::tqfromLatin1("Track")).toElement().text(); + TQString t = e.namedItem(TQString::fromLatin1("Title")).toElement().text(); + TQString n = e.namedItem(TQString::fromLatin1("Track")).toElement().text(); bool ok; int trackNum = Tellico::toUInt(n, &ok); // trackNum might be 0 if(t.isEmpty() || !ok || trackNum < 1) { continue; } - TQString a = e.namedItem(TQString::tqfromLatin1("Artist")).toElement().text(); - TQString l = e.namedItem(TQString::tqfromLatin1("Length")).toElement().text(); + TQString a = e.namedItem(TQString::fromLatin1("Artist")).toElement().text(); + TQString l = e.namedItem(TQString::fromLatin1("Length")).toElement().text(); int len = Tellico::toUInt(l, &ok); TQString value = t + "::" + a; @@ -346,14 +346,14 @@ TQString YahooFetcher::insertValue(const TQString& str_, const TQString& value_, bool write = true; if(!list[pos_-1].isNull()) { // for some reason, some songs are repeated from yahoo, with 0 length, don't overwrite that - if(value_.contains(TQString::tqfromLatin1("::")) < 2) { // means no length value + if(value_.contains(TQString::fromLatin1("::")) < 2) { // means no length value write = false; } } if(!value_.isEmpty() && write) { list[pos_-1] = value_; } - return list.join(TQString::tqfromLatin1("; ")); + return list.join(TQString::fromLatin1("; ")); } void YahooFetcher::updateEntry(Data::EntryPtr entry_) { @@ -362,16 +362,16 @@ void YahooFetcher::updateEntry(Data::EntryPtr entry_) { m_limit = 5; TQString value; - TQString title = entry_->field(TQString::tqfromLatin1("title")); + TQString title = entry_->field(TQString::fromLatin1("title")); if(!title.isEmpty()) { - value += TQString::tqfromLatin1("album=") + title; + value += TQString::fromLatin1("album=") + title; } - TQString artist = entry_->field(TQString::tqfromLatin1("artist")); + TQString artist = entry_->field(TQString::fromLatin1("artist")); if(!artist.isEmpty()) { if(!value.isEmpty()) { value += '&'; } - value += TQString::tqfromLatin1("artist=") + artist; + value += TQString::fromLatin1("artist=") + artist; } if(!value.isEmpty()) { search(Fetch::Raw, value); diff --git a/src/fetch/z3950connection.cpp b/src/fetch/z3950connection.cpp index 5bf77ac..7817762 100644 --- a/src/fetch/z3950connection.cpp +++ b/src/fetch/z3950connection.cpp @@ -149,7 +149,7 @@ void Z3950Connection::run() { // if syntax is mods, set esn to mods too TQCString type = "raw"; if(m_syntax == Latin1Literal("mods")) { - m_syntax = TQString::tqfromLatin1("xml"); + m_syntax = TQString::fromLatin1("xml"); ZOOM_resultset_option_set(resultSet, "elementSetName", "mods"); type = "xml"; } else { @@ -170,7 +170,7 @@ void Z3950Connection::run() { ZOOM_query_destroy(query); m_connected = false; - TQString s = i18n("Connection search error %1: %2").tqarg(errcode).tqarg(toString(errmsg)); + TQString s = i18n("Connection search error %1: %2").arg(errcode).arg(toString(errmsg)); if(!TQCString(addinfo).isEmpty()) { s += " (" + toString(addinfo) + ")"; } @@ -190,10 +190,10 @@ void Z3950Connection::run() { // want raw unless it's mods ZOOM_record_get(rec, type, &len); if(len > 0 && m_syntax.isEmpty()) { - newSyntax = TQString::tqfromLatin1(ZOOM_record_get(rec, "syntax", &len)).lower(); + newSyntax = TQString::fromLatin1(ZOOM_record_get(rec, "syntax", &len)).lower(); myLog() << "Z3950Connection::run() - syntax guess is " << newSyntax << endl; if(newSyntax == Latin1Literal("mods") || newSyntax == Latin1Literal("xml")) { - m_syntax = TQString::tqfromLatin1("xml"); + m_syntax = TQString::fromLatin1("xml"); ZOOM_resultset_option_set(resultSet, "elementSetName", "mods"); } else if(newSyntax == Latin1Literal("grs-1")) { // if it's defaulting to grs-1, go ahead and change it to try to get a marc @@ -208,7 +208,7 @@ void Z3950Connection::run() { newSyntax != Latin1Literal("unimarc") && newSyntax != Latin1Literal("grs-1")) { myLog() << "Z3950Connection::run() - changing z39.50 syntax to MODS" << endl; - newSyntax = TQString::tqfromLatin1("xml"); + newSyntax = TQString::fromLatin1("xml"); ZOOM_resultset_option_set(resultSet, "elementSetName", "mods"); ZOOM_resultset_option_set(resultSet, "preferredRecordSyntax", newSyntax.latin1()); rec = ZOOM_resultset_record(resultSet, 0); @@ -216,28 +216,28 @@ void Z3950Connection::run() { if(len == 0) { // change set name back ZOOM_resultset_option_set(resultSet, "elementSetName", m_esn.latin1()); - newSyntax = TQString::tqfromLatin1("usmarc"); // try usmarc + newSyntax = TQString::fromLatin1("usmarc"); // try usmarc myLog() << "Z3950Connection::run() - changing z39.50 syntax to USMARC" << endl; ZOOM_resultset_option_set(resultSet, "preferredRecordSyntax", newSyntax.latin1()); rec = ZOOM_resultset_record(resultSet, 0); ZOOM_record_get(rec, "raw", &len); } if(len == 0) { - newSyntax = TQString::tqfromLatin1("marc21"); // try marc21 + newSyntax = TQString::fromLatin1("marc21"); // try marc21 myLog() << "Z3950Connection::run() - changing z39.50 syntax to MARC21" << endl; ZOOM_resultset_option_set(resultSet, "preferredRecordSyntax", newSyntax.latin1()); rec = ZOOM_resultset_record(resultSet, 0); ZOOM_record_get(rec, "raw", &len); } if(len == 0) { - newSyntax = TQString::tqfromLatin1("unimarc"); // try unimarc + newSyntax = TQString::fromLatin1("unimarc"); // try unimarc myLog() << "Z3950Connection::run() - changing z39.50 syntax to UNIMARC" << endl; ZOOM_resultset_option_set(resultSet, "preferredRecordSyntax", newSyntax.latin1()); rec = ZOOM_resultset_record(resultSet, 0); ZOOM_record_get(rec, "raw", &len); } if(len == 0) { - newSyntax = TQString::tqfromLatin1("grs-1"); // try grs-1 + newSyntax = TQString::fromLatin1("grs-1"); // try grs-1 myLog() << "Z3950Connection::run() - changing z39.50 syntax to GRS-1" << endl; ZOOM_resultset_option_set(resultSet, "preferredRecordSyntax", newSyntax.latin1()); rec = ZOOM_resultset_record(resultSet, 0); @@ -256,10 +256,10 @@ void Z3950Connection::run() { // go back to fooling ourselves and calling it mods if(m_syntax == Latin1Literal("xml")) { - m_syntax = TQString::tqfromLatin1("mods"); + m_syntax = TQString::fromLatin1("mods"); } if(newSyntax == Latin1Literal("xml")) { - newSyntax = TQString::tqfromLatin1("mods"); + newSyntax = TQString::fromLatin1("mods"); } // save syntax change for next time if(m_syntax != newSyntax) { @@ -268,7 +268,7 @@ void Z3950Connection::run() { } if(m_sourceCharSet.isEmpty()) { - m_sourceCharSet = TQString::tqfromLatin1("marc-8"); + m_sourceCharSet = TQString::fromLatin1("marc-8"); } const size_t realLimit = TQMIN(numResults, m_limit); @@ -291,7 +291,7 @@ void Z3950Connection::run() { #if 0 kdWarning() << "Remove debug from z3950connection.cpp" << endl; { - TQFile f1(TQString::tqfromLatin1("/tmp/z3950.raw")); + TQFile f1(TQString::fromLatin1("/tmp/z3950.raw")); if(f1.open(IO_WriteOnly)) { TQDataStream t(&f1); t << ZOOM_record_get(rec, "raw", &len); @@ -342,7 +342,7 @@ bool Z3950Connection::makeConnection() { ZOOM_connection_destroy(d->conn); m_connected = false; - TQString s = i18n("Connection error %1: %2").tqarg(errcode).tqarg(toString(errmsg)); + TQString s = i18n("Connection error %1: %2").arg(errcode).arg(toString(errmsg)); if(!TQCString(addinfo).isEmpty()) { s += " (" + toString(addinfo) + ")"; } @@ -378,12 +378,12 @@ void Z3950Connection::checkPendingEvents() { inline TQCString Z3950Connection::toCString(const TQString& text_) { - return iconvRun(text_.utf8(), TQString::tqfromLatin1("utf-8"), m_sourceCharSet); + return iconvRun(text_.utf8(), TQString::fromLatin1("utf-8"), m_sourceCharSet); } inline TQString Z3950Connection::toString(const TQCString& text_) { - return TQString::fromUtf8(iconvRun(text_, m_sourceCharSet, TQString::tqfromLatin1("utf-8"))); + return TQString::fromUtf8(iconvRun(text_, m_sourceCharSet, TQString::fromLatin1("utf-8"))); } // static @@ -403,9 +403,9 @@ TQCString Z3950Connection::iconvRun(const TQCString& text_, const TQString& from TQString charSetLower = fromCharSet_.lower(); charSetLower.remove('-').remove(' '); if(charSetLower == Latin1Literal("iso5426")) { - return iconvRun(Iso5426Converter::toUtf8(text_).utf8(), TQString::tqfromLatin1("utf-8"), toCharSet_); + return iconvRun(Iso5426Converter::toUtf8(text_).utf8(), TQString::fromLatin1("utf-8"), toCharSet_); } else if(charSetLower == Latin1Literal("iso6937")) { - return iconvRun(Iso6937Converter::toUtf8(text_).utf8(), TQString::tqfromLatin1("utf-8"), toCharSet_); + return iconvRun(Iso6937Converter::toUtf8(text_).utf8(), TQString::fromLatin1("utf-8"), toCharSet_); } kdWarning() << "Z3950Connection::iconvRun() - conversion from " << fromCharSet_ << " to " << toCharSet_ << " is unsupported" << endl; @@ -453,9 +453,9 @@ TQString Z3950Connection::toXML(const TQCString& marc_, const TQString& charSet_ TQString charSetLower = charSet_.lower(); charSetLower.remove('-').remove(' '); if(charSetLower == Latin1Literal("iso5426")) { - return toXML(Iso5426Converter::toUtf8(marc_).utf8(), TQString::tqfromLatin1("utf-8")); + return toXML(Iso5426Converter::toUtf8(marc_).utf8(), TQString::fromLatin1("utf-8")); } else if(charSetLower == Latin1Literal("iso6937")) { - return toXML(Iso6937Converter::toUtf8(marc_).utf8(), TQString::tqfromLatin1("utf-8")); + return toXML(Iso6937Converter::toUtf8(marc_).utf8(), TQString::fromLatin1("utf-8")); } kdWarning() << "Z3950Connection::toXML() - conversion from " << charSet_ << " is unsupported" << endl; return TQString(); @@ -488,7 +488,7 @@ TQString Z3950Connection::toXML(const TQCString& marc_, const TQString& charSet_ return TQString(); } - TQString output = TQString::tqfromLatin1("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"); + TQString output = TQString::fromLatin1("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"); output += TQString::fromUtf8(TQCString(result, len+1), len+1); // myDebug() << TQCString(result) << endl; // myDebug() << "-------------------------------------------" << endl; diff --git a/src/fetch/z3950fetcher.cpp b/src/fetch/z3950fetcher.cpp index 2496b5b..f24b030 100644 --- a/src/fetch/z3950fetcher.cpp +++ b/src/fetch/z3950fetcher.cpp @@ -47,14 +47,14 @@ #include <kseparator.h> #include <tqfile.h> -#include <tqlayout.h> +#include <layout.h> #include <tqlabel.h> #include <tqwhatsthis.h> #include <tqdom.h> namespace { static const int Z3950_DEFAULT_PORT = 210; - static const TQString Z3950_DEFAULT_ESN = TQString::tqfromLatin1("F"); + static const TQString Z3950_DEFAULT_ESN = TQString::fromLatin1("F"); } using Tellico::Fetch::Z3950Fetcher; @@ -103,7 +103,7 @@ void Z3950Fetcher::readConfigHook(const KConfigGroup& config_) { m_password = config_.readEntry("Password"); } else { m_preset = preset; - TQString serverFile = locate("appdata", TQString::tqfromLatin1("z3950-servers.cfg")); + TQString serverFile = locate("appdata", TQString::fromLatin1("z3950-servers.cfg")); if(!serverFile.isEmpty()) { KConfig cfg(serverFile, true /* read-only */, false /* read KDE */); const TQStringList servers = cfg.groupList(); @@ -147,29 +147,29 @@ void Z3950Fetcher::search(FetchKey key_, const TQString& value_) { m_started = true; TQString svalue = m_value; - TQRegExp rx1(TQString::tqfromLatin1("['\"].*\\1")); + TQRegExp rx1(TQString::fromLatin1("['\"].*\\1")); if(!rx1.exactMatch(svalue)) { svalue.prepend('"').append('"'); } switch(key_) { case Title: - m_pqn = TQString::tqfromLatin1("@attr 1=4 ") + svalue; + m_pqn = TQString::fromLatin1("@attr 1=4 ") + svalue; break; case Person: -// m_pqn = TQString::tqfromLatin1("@or "); -// m_pqn += TQString::tqfromLatin1("@attr 1=1 \"") + m_value + '"'; - m_pqn = TQString::tqfromLatin1(" @attr 1=1003 ") + svalue; +// m_pqn = TQString::fromLatin1("@or "); +// m_pqn += TQString::fromLatin1("@attr 1=1 \"") + m_value + '"'; + m_pqn = TQString::fromLatin1(" @attr 1=1003 ") + svalue; break; case ISBN: { m_pqn.truncate(0); TQString s = m_value; s.remove('-'); - TQStringList isbnList = TQStringList::split(TQString::tqfromLatin1("; "), s); + TQStringList isbnList = TQStringList::split(TQString::fromLatin1("; "), s); // also going to search for isbn10 values for(TQStringList::Iterator it = isbnList.begin(); it != isbnList.end(); ++it) { - if((*it).startsWith(TQString::tqfromLatin1("978"))) { + if((*it).startsWith(TQString::fromLatin1("978"))) { TQString isbn10 = ISBNValidator::isbn10(*it); isbn10.remove('-'); isbnList.insert(it, isbn10); @@ -177,12 +177,12 @@ void Z3950Fetcher::search(FetchKey key_, const TQString& value_) { } const int count = isbnList.count(); if(count > 1) { - m_pqn = TQString::tqfromLatin1("@or "); + m_pqn = TQString::fromLatin1("@or "); } for(int i = 0; i < count; ++i) { - m_pqn += TQString::tqfromLatin1(" @attr 1=7 ") + isbnList[i]; + m_pqn += TQString::fromLatin1(" @attr 1=7 ") + isbnList[i]; if(i < count-2) { - m_pqn += TQString::tqfromLatin1(" @or"); + m_pqn += TQString::fromLatin1(" @or"); } } } @@ -192,19 +192,19 @@ void Z3950Fetcher::search(FetchKey key_, const TQString& value_) { m_pqn.truncate(0); TQString s = m_value; s.remove('-'); - TQStringList lccnList = TQStringList::split(TQString::tqfromLatin1("; "), s); + TQStringList lccnList = TQStringList::split(TQString::fromLatin1("; "), s); while(!lccnList.isEmpty()) { - m_pqn += TQString::tqfromLatin1(" @or @attr 1=9 ") + lccnList.front(); + m_pqn += TQString::fromLatin1(" @or @attr 1=9 ") + lccnList.front(); if(lccnList.count() > 1) { - m_pqn += TQString::tqfromLatin1(" @or"); + m_pqn += TQString::fromLatin1(" @or"); } - m_pqn += TQString::tqfromLatin1(" @attr 1=9 ") + LCCNValidator::formalize(lccnList.front()); + m_pqn += TQString::fromLatin1(" @attr 1=9 ") + LCCNValidator::formalize(lccnList.front()); lccnList.pop_front(); } } break; case Keyword: - m_pqn = TQString::tqfromLatin1("@attr 1=1016 ") + svalue; + m_pqn = TQString::fromLatin1("@attr 1=1016 ") + svalue; break; case Raw: m_pqn = m_value; @@ -214,7 +214,7 @@ void Z3950Fetcher::search(FetchKey key_, const TQString& value_) { stop(); return; } -// m_pqn = TQString::tqfromLatin1("@attr 1=7 0253333490"); +// m_pqn = TQString::fromLatin1("@attr 1=7 0253333490"); myLog() << "Z3950Fetcher::search() - PQN query = " << m_pqn << endl; if(m_conn) { @@ -256,7 +256,7 @@ bool Z3950Fetcher::initMARC21Handler() { return true; } - TQString xsltfile = locate("appdata", TQString::tqfromLatin1("MARC21slim2MODS3.xsl")); + TQString xsltfile = locate("appdata", TQString::fromLatin1("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; } - TQString xsltfile = locate("appdata", TQString::tqfromLatin1("UNIMARC2MODS3.xsl")); + TQString xsltfile = locate("appdata", TQString::fromLatin1("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; } - TQString xsltfile = locate("appdata", TQString::tqfromLatin1("mods2tellico.xsl")); + TQString xsltfile = locate("appdata", TQString::fromLatin1("mods2tellico.xsl")); if(xsltfile.isEmpty()) { kdWarning() << "Z3950Fetcher::initHandlers() - can not locate mods2tellico.xsl." << endl; return false; @@ -351,7 +351,7 @@ void Z3950Fetcher::handleResult(const TQString& result_) { #if 0 kdWarning() << "Remove debug from z3950fetcher.cpp" << endl; { - TQFile f1(TQString::tqfromLatin1("/tmp/marc.xml")); + TQFile f1(TQString::fromLatin1("/tmp/marc.xml")); if(f1.open(IO_WriteOnly)) { // if(f1.open(IO_WriteOnly | IO_Append)) { TQTextStream t(&f1); @@ -385,7 +385,7 @@ void Z3950Fetcher::handleResult(const TQString& result_) { #if 0 kdWarning() << "Remove debug from z3950fetcher.cpp" << endl; { - TQFile f2(TQString::tqfromLatin1("/tmp/mods.xml")); + TQFile f2(TQString::fromLatin1("/tmp/mods.xml")); // if(f2.open(IO_WriteOnly)) { if(f2.open(IO_WriteOnly | IO_Append)) { TQTextStream t(&f2); @@ -423,14 +423,14 @@ void Z3950Fetcher::handleResult(const TQString& result_) { Data::EntryVec entries = coll->entries(); for(Data::EntryVec::Iterator entry = entries.begin(); entry != entries.end(); ++entry) { - 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")); + TQString desc = entry->field(TQString::fromLatin1("author")) + '/' + + entry->field(TQString::fromLatin1("publisher")); + if(!entry->field(TQString::fromLatin1("cr_year")).isEmpty()) { + desc += TQChar('/') + entry->field(TQString::fromLatin1("cr_year")); + } else if(!entry->field(TQString::fromLatin1("pub_year")).isEmpty()){ + desc += TQChar('/') + entry->field(TQString::fromLatin1("pub_year")); } - SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(TQString::tqfromLatin1("isbn"))); + SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(TQString::fromLatin1("isbn"))); m_entries.insert(r->uid, entry); emit signalResultFound(r); } @@ -480,20 +480,20 @@ void Z3950Fetcher::customEvent(TQCustomEvent* event_) { void Z3950Fetcher::updateEntry(Data::EntryPtr entry_) { // myDebug() << "Z3950Fetcher::updateEntry() - " << source() << ": " << entry_->title() << endl; - TQString isbn = entry_->field(TQString::tqfromLatin1("isbn")); + TQString isbn = entry_->field(TQString::fromLatin1("isbn")); if(!isbn.isEmpty()) { search(Fetch::ISBN, isbn); return; } - TQString lccn = entry_->field(TQString::tqfromLatin1("lccn")); + TQString lccn = entry_->field(TQString::fromLatin1("lccn")); if(!lccn.isEmpty()) { search(Fetch::LCCN, lccn); return; } // optimistically try searching for title and rely on Collection::sameEntry() to figure things out - TQString t = entry_->field(TQString::tqfromLatin1("title")); + TQString t = entry_->field(TQString::fromLatin1("title")); if(!t.isEmpty()) { search(Fetch::Title, t); return; @@ -541,7 +541,7 @@ Z3950Fetcher::ConfigWidget::ConfigWidget(TQWidget* parent_, const Z3950Fetcher* m_portSpinBox = new KIntSpinBox(0, 999999, 1, Z3950_DEFAULT_PORT, 10, optionsWidget()); 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.").tqarg(Z3950_DEFAULT_PORT); + w = i18n("Enter the port number of the server. The default is %1.").arg(Z3950_DEFAULT_PORT); TQWhatsThis::add(label, w); TQWhatsThis::add(m_portSpinBox, w); label->setBuddy(m_portSpinBox); @@ -560,9 +560,9 @@ Z3950Fetcher::ConfigWidget::ConfigWidget(TQWidget* parent_, const Z3950Fetcher* l->addWidget(label, ++row, 0); m_charSetCombo = new KComboBox(true, optionsWidget()); 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")); + m_charSetCombo->insertItem(TQString::fromLatin1("marc8")); + m_charSetCombo->insertItem(TQString::fromLatin1("iso-8859-1")); + m_charSetCombo->insertItem(TQString::fromLatin1("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 " @@ -575,11 +575,11 @@ Z3950Fetcher::ConfigWidget::ConfigWidget(TQWidget* parent_, const Z3950Fetcher* l->addWidget(label, ++row, 0); m_syntaxCombo = new GUI::ComboBox(optionsWidget()); 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")); + m_syntaxCombo->insertItem(TQString::fromLatin1("MODS"), TQString::fromLatin1("mods")); + m_syntaxCombo->insertItem(TQString::fromLatin1("MARC21"), TQString::fromLatin1("marc21")); + m_syntaxCombo->insertItem(TQString::fromLatin1("UNIMARC"), TQString::fromLatin1("unimarc")); + m_syntaxCombo->insertItem(TQString::fromLatin1("USMARC"), TQString::fromLatin1("usmarc")); + m_syntaxCombo->insertItem(TQString::fromLatin1("GRS-1"), TQString::fromLatin1("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 " @@ -689,9 +689,9 @@ void Z3950Fetcher::ConfigWidget::saveConfig(KConfigGroup& config_) { // static Tellico::StringMap Z3950Fetcher::customFields() { StringMap map; - map[TQString::tqfromLatin1("address")] = i18n("Address"); - map[TQString::tqfromLatin1("abstract")] = i18n("Abstract"); - map[TQString::tqfromLatin1("illustrator")] = i18n("Illustrator"); + map[TQString::fromLatin1("address")] = i18n("Address"); + map[TQString::fromLatin1("abstract")] = i18n("Abstract"); + map[TQString::fromLatin1("illustrator")] = i18n("Illustrator"); return map; } @@ -727,7 +727,7 @@ void Z3950Fetcher::ConfigWidget::loadPresets(const TQString& current_) { KGlobal::locale()->splitLocale(lang, lang2A, dummy, dummy); } - TQString serverFile = locate("appdata", TQString::tqfromLatin1("z3950-servers.cfg")); + TQString serverFile = locate("appdata", TQString::fromLatin1("z3950-servers.cfg")); if(serverFile.isEmpty()) { kdWarning() << "Z3950Fetcher::loadPresets() - no z3950 servers file found" << endl; return; diff --git a/src/fetchdialog.cpp b/src/fetchdialog.cpp index 11a719d..77f04d5 100644 --- a/src/fetchdialog.cpp +++ b/src/fetchdialog.cpp @@ -41,7 +41,7 @@ #include <kaccelmanager.h> #include <ktextedit.h> -#include <tqlayout.h> +#include <layout.h> #include <tqhbox.h> #include <tqvgroupbox.h> #include <tqsplitter.h> @@ -112,19 +112,19 @@ FetchDialog::FetchDialog(TQWidget* parent_, const char* name_) m_searchButton = new KPushButton(box1); m_searchButton->setGuiItem(KGuiItem(i18n(FETCH_STRING_STOP), - SmallIconSet(TQString::tqfromLatin1("cancel")))); + SmallIconSet(TQString::fromLatin1("cancel")))); connect(m_searchButton, TQT_SIGNAL(clicked()), TQT_SLOT(slotSearchClicked())); TQWhatsThis::add(m_searchButton, i18n("Click to start or stop the search")); // the search button's text changes from search to stop // I don't want it resizing, so figure out the maximum size and set that m_searchButton->polish(); - int maxWidth = m_searchButton->tqsizeHint().width(); - int maxHeight = m_searchButton->tqsizeHint().height(); + int maxWidth = m_searchButton->sizeHint().width(); + int maxHeight = m_searchButton->sizeHint().height(); m_searchButton->setGuiItem(KGuiItem(i18n(FETCH_STRING_SEARCH), - SmallIconSet(TQString::tqfromLatin1("find")))); - maxWidth = TQMAX(maxWidth, m_searchButton->tqsizeHint().width()); - maxHeight = TQMAX(maxHeight, m_searchButton->tqsizeHint().height()); + SmallIconSet(TQString::fromLatin1("find")))); + maxWidth = TQMAX(maxWidth, m_searchButton->sizeHint().width()); + maxHeight = TQMAX(maxHeight, m_searchButton->sizeHint().height()); m_searchButton->setMinimumWidth(maxWidth); m_searchButton->setMinimumHeight(maxHeight); @@ -135,7 +135,7 @@ FetchDialog::FetchDialog(TQWidget* parent_, const char* name_) TQWhatsThis::add(m_multipleISBN, i18n("Check this box to search for multiple ISBN or UPC values.")); connect(m_multipleISBN, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotMultipleISBN(bool))); - m_editISBN = new KPushButton(KGuiItem(i18n("Edit List..."), TQString::tqfromLatin1("text_block")), box2); + m_editISBN = new KPushButton(KGuiItem(i18n("Edit List..."), TQString::fromLatin1("text_block")), box2); m_editISBN->setEnabled(false); TQWhatsThis::add(m_editISBN, i18n("Click to open a text edit box for entering or editing multiple ISBN values.")); connect(m_editISBN, TQT_SIGNAL(clicked()), TQT_SLOT(slotEditMultipleISBN())); @@ -181,7 +181,7 @@ FetchDialog::FetchDialog(TQWidget* parent_, const char* name_) // don't bother creating funky gradient images for compact view m_entryView->setUseGradientImages(false); // set the xslt file AFTER setting the gradient image option - m_entryView->setXSLTFile(TQString::tqfromLatin1("Compact.xsl")); + m_entryView->setXSLTFile(TQString::fromLatin1("Compact.xsl")); TQWhatsThis::add(m_entryView->view(), i18n("An entry may be shown here before adding it to the " "current collection by selecting it in the list above")); @@ -195,7 +195,7 @@ FetchDialog::FetchDialog(TQWidget* parent_, const char* name_) connect(m_addButton, TQT_SIGNAL(clicked()), TQT_SLOT(slotAddEntry())); TQWhatsThis::add(m_addButton, i18n("Add the selected entry to the current collection")); - m_moreButton = new KPushButton(KGuiItem(i18n("Get More Results"), SmallIconSet(TQString::tqfromLatin1("find"))), box3); + m_moreButton = new KPushButton(KGuiItem(i18n("Get More Results"), SmallIconSet(TQString::fromLatin1("find"))), box3); m_moreButton->setEnabled(false); connect(m_moreButton, TQT_SIGNAL(clicked()), TQT_SLOT(slotMoreClicked())); TQWhatsThis::add(m_moreButton, i18n("Fetch more results from the current data source")); @@ -223,9 +223,9 @@ FetchDialog::FetchDialog(TQWidget* parent_, const char* name_) connect(m_timer, TQT_SIGNAL(timeout()), TQT_SLOT(slotMoveProgress())); setMinimumWidth(TQMAX(minimumWidth(), FETCH_MIN_WIDTH)); - settqStatus(i18n("Ready.")); + setStatus(i18n("Ready.")); - resize(configDialogSize(TQString::tqfromLatin1("Fetch Dialog Options"))); + resize(configDialogSize(TQString::fromLatin1("Fetch Dialog Options"))); KConfigGroup config(kapp->config(), "Fetch Dialog Options"); TQValueList<int> splitList = config.readIntListEntry("Splitter Sizes"); @@ -235,8 +235,8 @@ FetchDialog::FetchDialog(TQWidget* parent_, const char* name_) connect(Fetch::Manager::self(), TQT_SIGNAL(signalResultFound(Tellico::Fetch::SearchResult*)), TQT_SLOT(slotResultFound(Tellico::Fetch::SearchResult*))); - connect(Fetch::Manager::self(), TQT_SIGNAL(signaltqStatus(const TQString&)), - TQT_SLOT(slottqStatus(const TQString&))); + connect(Fetch::Manager::self(), TQT_SIGNAL(signalStatus(const TQString&)), + TQT_SLOT(slotStatus(const TQString&))); connect(Fetch::Manager::self(), TQT_SIGNAL(signalDone()), TQT_SLOT(slotFetchDone())); @@ -285,7 +285,7 @@ FetchDialog::~FetchDialog() { // no additional entries to check images to keep though Data::Document::self()->removeImagesNotInCollection(entriesToCheck, Data::EntryVec()); - saveDialogSize(TQString::tqfromLatin1("Fetch Dialog Options")); + saveDialogSize(TQString::fromLatin1("Fetch Dialog Options")); KConfigGroup config(kapp->config(), "Fetch Dialog Options"); config.writeEntry("Splitter Sizes", static_cast<TQSplitter*>(m_listView->parentWidget())->sizes()); @@ -296,7 +296,7 @@ FetchDialog::~FetchDialog() { void FetchDialog::slotSearchClicked() { m_valueLineEdit->selectAll(); if(m_started) { - settqStatus(i18n("Cancelling the search...")); + setStatus(i18n("Cancelling the search...")); Fetch::Manager::self()->stop(); slotFetchDone(); } else { @@ -309,9 +309,9 @@ void FetchDialog::slotSearchClicked() { m_oldSearch = value; m_started = true; m_searchButton->setGuiItem(KGuiItem(i18n(FETCH_STRING_STOP), - SmallIconSet(TQString::tqfromLatin1("cancel")))); + SmallIconSet(TQString::fromLatin1("cancel")))); startProgress(); - settqStatus(i18n("Searching...")); + setStatus(i18n("Searching...")); kapp->processEvents(); Fetch::Manager::self()->startSearch(m_sourceCombo->currentText(), static_cast<Fetch::FetchKey>(m_keyCombo->currentData().toInt()), @@ -331,31 +331,31 @@ void FetchDialog::slotClearClicked() { m_moreButton->setEnabled(false); m_isbnList.clear(); m_statusMessages.clear(); - settqStatus(i18n("Ready.")); // because slotFetchDone() writes text + setStatus(i18n("Ready.")); // because slotFetchDone() writes text } -void FetchDialog::slottqStatus(const TQString& status_) { +void FetchDialog::slotStatus(const TQString& status_) { m_statusMessages.push_back(status_); // if the queue was empty, start the timer if(m_statusMessages.count() == 1) { // wait 2 seconds - TQTimer::singleShot(2000, this, TQT_SLOT(slotUpdatetqStatus())); + TQTimer::singleShot(2000, this, TQT_SLOT(slotUpdateStatus())); } } -void FetchDialog::slotUpdatetqStatus() { +void FetchDialog::slotUpdateStatus() { if(m_statusMessages.isEmpty()) { return; } - settqStatus(m_statusMessages.front()); + setStatus(m_statusMessages.front()); m_statusMessages.pop_front(); if(!m_statusMessages.isEmpty()) { // wait 2 seconds - TQTimer::singleShot(2000, this, TQT_SLOT(slotUpdatetqStatus())); + TQTimer::singleShot(2000, this, TQT_SLOT(slotUpdateStatus())); } } -void FetchDialog::settqStatus(const TQString& text_) { +void FetchDialog::setStatus(const TQString& text_) { m_statusBar->changeItem(TQChar(' ') + text_, FETCH_STATUS_ID); } @@ -363,13 +363,13 @@ void FetchDialog::slotFetchDone(bool checkISBN /* = true */) { // myDebug() << "FetchDialog::slotFetchDone()" << endl; m_started = false; m_searchButton->setGuiItem(KGuiItem(i18n(FETCH_STRING_SEARCH), - SmallIconSet(TQString::tqfromLatin1("find")))); + SmallIconSet(TQString::fromLatin1("find")))); stopProgress(); if(m_resultCount == 0) { - slottqStatus(i18n("The search returned no items.")); + slotStatus(i18n("The search returned no items.")); } else { /* TRANSLATORS: This is a plural form, you need to translate both lines (except "_n: ") */ - slottqStatus(i18n("The search returned 1 item.", + slotStatus(i18n("The search returned 1 item.", "The search returned %n items.", m_resultCount)); } @@ -385,7 +385,7 @@ void FetchDialog::slotFetchDone(bool checkISBN /* = true */) { if(m_collType & (Data::Collection::Book | Data::Collection::Bibtex) && m_multipleISBN->isChecked() && (key == Fetch::ISBN || key == Fetch::UPC)) { - TQStringList values = TQStringList::split(TQString::tqfromLatin1("; "), + TQStringList values = TQStringList::split(TQString::fromLatin1("; "), m_oldSearch.simplifyWhiteSpace()); for(TQStringList::Iterator it = values.begin(); it != values.end(); ++it) { *it = ISBNValidator::cleanValue(*it); @@ -393,7 +393,7 @@ void FetchDialog::slotFetchDone(bool checkISBN /* = true */) { for(TQListViewItemIterator it(m_listView); it.current(); ++it) { TQString i = ISBNValidator::cleanValue(static_cast<SearchResultItem*>(it.current())->m_result->isbn); values.remove(i); - if(i.length() > 10 && i.startsWith(TQString::tqfromLatin1("978"))) { + if(i.length() > 10 && i.startsWith(TQString::fromLatin1("978"))) { values.remove(ISBNValidator::cleanValue(ISBNValidator::isbn10(i))); } } @@ -407,7 +407,7 @@ void FetchDialog::slotFetchDone(bool checkISBN /* = true */) { TQVBoxLayout* lay = new TQVBoxLayout(box, KDialog::marginHint(), KDialog::spacingHint()*2); TQHBoxLayout* lay2 = new TQHBoxLayout(lay); TQLabel* lab = new TQLabel(box); - lab->setPixmap(KGlobal::iconLoader()->loadIcon(TQString::tqfromLatin1("messagebox_info"), + lab->setPixmap(KGlobal::iconLoader()->loadIcon(TQString::fromLatin1("messagebox_info"), KIcon::NoGroup, KIcon::SizeMedium)); lay2->addWidget(lab); @@ -442,7 +442,7 @@ void FetchDialog::slotAddEntry() { Fetch::SearchResult* r = item->m_result; Data::EntryPtr entry = m_entries[r->uid]; if(!entry) { - settqStatus(i18n("Fetching %1...").tqarg(r->title)); + setStatus(i18n("Fetching %1...").arg(r->title)); startProgress(); entry = r->fetchEntry(); if(!entry) { @@ -450,11 +450,11 @@ void FetchDialog::slotAddEntry() { } m_entries.insert(r->uid, entry); stopProgress(); - settqStatus(i18n("Ready.")); + setStatus(i18n("Ready.")); } // add a copy, intentionally allowing multiple copies to be added vec.append(new Data::Entry(*entry)); - item->setPixmap(0, UserIcon(TQString::tqfromLatin1("checkmark"))); + item->setPixmap(0, UserIcon(TQString::fromLatin1("checkmark"))); } if(!vec.isEmpty()) { Kernel::self()->addEntries(vec, true); @@ -469,9 +469,9 @@ void FetchDialog::slotMoreClicked() { m_started = true; m_searchButton->setGuiItem(KGuiItem(i18n(FETCH_STRING_STOP), - SmallIconSet(TQString::tqfromLatin1("cancel")))); + SmallIconSet(TQString::fromLatin1("cancel")))); startProgress(); - settqStatus(i18n("Searching...")); + setStatus(i18n("Searching...")); kapp->processEvents(); Fetch::Manager::self()->continueSearch(); } @@ -494,7 +494,7 @@ void FetchDialog::slotShowEntry() { SearchResultItem* item = static_cast<SearchResultItem*>(items.getFirst()); Fetch::SearchResult* r = item->m_result; - settqStatus(i18n("Fetching %1...").tqarg(r->title)); + setStatus(i18n("Fetching %1...").arg(r->title)); Data::EntryPtr entry = m_entries[r->uid]; if(!entry) { GUI::CursorSaver cs; @@ -505,7 +505,7 @@ void FetchDialog::slotShowEntry() { } stopProgress(); } - settqStatus(i18n("Ready.")); + setStatus(i18n("Ready.")); m_entryView->showEntry(entry); } @@ -603,7 +603,7 @@ void FetchDialog::slotEditMultipleISBN() { m_isbnTextEdit = new KTextEdit(box, "isbn text edit"); m_isbnTextEdit->setText(m_isbnList.join(TQChar('\n'))); TQWhatsThis::add(m_isbnTextEdit, s); - KPushButton* fromFileBtn = new KPushButton(SmallIconSet(TQString::tqfromLatin1("fileopen")), + KPushButton* fromFileBtn = new KPushButton(SmallIconSet(TQString::fromLatin1("fileopen")), i18n("&Load From File..."), box); TQWhatsThis::add(fromFileBtn, i18n("<qt>Load the list from a text file.</qt>")); connect(fromFileBtn, TQT_SIGNAL(clicked()), TQT_SLOT(slotLoadISBNList())); @@ -630,7 +630,7 @@ void FetchDialog::slotEditMultipleISBN() { while(m_isbnList.count() > 100) { m_isbnList.pop_back(); } - m_valueLineEdit->setText(m_isbnList.join(TQString::tqfromLatin1("; "))); + m_valueLineEdit->setText(m_isbnList.join(TQString::fromLatin1("; "))); } m_isbnTextEdit = 0; // gets auto-deleted } diff --git a/src/fetchdialog.h b/src/fetchdialog.h index 40f77c8..65e602a 100644 --- a/src/fetchdialog.h +++ b/src/fetchdialog.h @@ -76,8 +76,8 @@ private slots: void slotShowEntry(); void slotMoveProgress(); - void slottqStatus(const TQString& status); - void slotUpdatetqStatus(); + void slotStatus(const TQString& status); + void slotUpdateStatus(); void slotFetchDone(bool checkISBN = true); void slotResultFound(Tellico::Fetch::SearchResult* result); @@ -94,7 +94,7 @@ private slots: private: void startProgress(); void stopProgress(); - void settqStatus(const TQString& text); + void setStatus(const TQString& text); void adjustColumnWidth(); void customEvent( TQCustomEvent *e ); diff --git a/src/fetcherconfigdialog.cpp b/src/fetcherconfigdialog.cpp index 9d9b22a..45bf831 100644 --- a/src/fetcherconfigdialog.cpp +++ b/src/fetcherconfigdialog.cpp @@ -21,7 +21,7 @@ #include <kiconloader.h> #include <tqlabel.h> -#include <tqlayout.h> +#include <layout.h> #include <tqhgroupbox.h> #include <tqwidgetstack.h> #include <tqwhatsthis.h> @@ -58,7 +58,7 @@ FetcherConfigDialog::FetcherConfigDialog(const TQString& sourceName_, Fetch::Typ void FetcherConfigDialog::init(Fetch::Type type_) { setMinimumWidth(FETCHER_CONFIG_MIN_WIDTH); - setHelp(TQString::tqfromLatin1("data-sources-options")); + setHelp(TQString::fromLatin1("data-sources-options")); TQWidget* widget = new TQWidget(this); TQBoxLayout* topLayout = new TQHBoxLayout(widget, KDialog::spacingHint()); @@ -66,7 +66,7 @@ void FetcherConfigDialog::init(Fetch::Type type_) { TQBoxLayout* vlay1 = new TQVBoxLayout(topLayout, KDialog::spacingHint()); m_iconLabel = new TQLabel(widget); if(type_ == Fetch::Unknown) { - m_iconLabel->setPixmap(KGlobal::iconLoader()->loadIcon(TQString::tqfromLatin1("network"), KIcon::Panel, 64)); + m_iconLabel->setPixmap(KGlobal::iconLoader()->loadIcon(TQString::fromLatin1("network"), KIcon::Panel, 64)); } else { m_iconLabel->setPixmap(Fetch::Manager::self()->fetcherIcon(type_, KIcon::Panel, 64)); } diff --git a/src/field.cpp b/src/field.cpp index c260e9a..0e9b809 100644 --- a/src/field.cpp +++ b/src/field.cpp @@ -26,14 +26,14 @@ #include <tqdatetime.h> namespace { - static const TQRegExp comma_split = TQRegExp(TQString::tqfromLatin1("\\s*,\\s*")); + static const TQRegExp comma_split = TQRegExp(TQString::fromLatin1("\\s*,\\s*")); } using Tellico::Data::Field; //these get overwritten, but are here since they're static TQStringList Field::s_articlesApos; -TQRegExp Field::s_delimiter = TQRegExp(TQString::tqfromLatin1("\\s*;\\s*")); +TQRegExp Field::s_delimiter = TQRegExp(TQString::fromLatin1("\\s*;\\s*")); // this constructor is for anything but Choice type Field::Field(const TQString& name_, const TQString& title_, Type type_/*=Line*/) @@ -54,15 +54,15 @@ Field::Field(const TQString& name_, const TQString& title_, Type type_/*=Line*/) m_flags = AllowMultiple; if(m_type == Table2) { m_type = Table; - setProperty(TQString::tqfromLatin1("columns"), TQChar('2')); + setProperty(TQString::fromLatin1("columns"), TQChar('2')); } else { - setProperty(TQString::tqfromLatin1("columns"), TQChar('1')); + setProperty(TQString::fromLatin1("columns"), TQChar('1')); } } else if(m_type == Date) { // hidden from user m_formatFlag = FormatDate; } else if(m_type == Rating) { - setProperty(TQString::tqfromLatin1("minimum"), TQChar('1')); - setProperty(TQString::tqfromLatin1("maximum"), TQChar('5')); + setProperty(TQString::fromLatin1("minimum"), TQChar('1')); + setProperty(TQString::fromLatin1("maximum"), TQChar('5')); } m_id = getID(); } @@ -83,7 +83,7 @@ Field::Field(const Field& field_) m_allowed = field_.allowed(); } else if(m_type == Table2) { m_type = Table; - setProperty(TQString::tqfromLatin1("columns"), TQChar('2')); + setProperty(TQString::fromLatin1("columns"), TQChar('2')); } m_id = getID(); } @@ -101,7 +101,7 @@ Field& Field::operator=(const Field& field_) { m_allowed = field_.allowed(); } else if(m_type == Table2) { m_type = Table; - setProperty(TQString::tqfromLatin1("columns"), TQChar('2')); + setProperty(TQString::fromLatin1("columns"), TQChar('2')); } m_flags = field_.flags(); m_formatFlag = field_.formatFlag(); @@ -129,10 +129,10 @@ void Field::setType(Field::Type type_) { m_flags |= AllowMultiple; if(m_type == Table2) { m_type = Table; - setProperty(TQString::tqfromLatin1("columns"), TQChar('2')); + setProperty(TQString::fromLatin1("columns"), TQChar('2')); } - if(property(TQString::tqfromLatin1("columns")).isEmpty()) { - setProperty(TQString::tqfromLatin1("columns"), TQChar('1')); + if(property(TQString::fromLatin1("columns")).isEmpty()) { + setProperty(TQString::fromLatin1("columns"), TQChar('1')); } } if(isSingleCategory()) { @@ -167,12 +167,12 @@ void Field::setFormatFlag(FormatFlag flag_) { } const TQString& Field::defaultValue() const { - return property(TQString::tqfromLatin1("default")); + return property(TQString::fromLatin1("default")); } void Field::setDefaultValue(const TQString& value_) { if(m_type != Choice || m_allowed.findIndex(value_) > -1) { - setProperty(TQString::tqfromLatin1("default"), value_); + setProperty(TQString::fromLatin1("default"), value_); } } @@ -208,7 +208,7 @@ TQStringList Field::dependsOn() const { return list; } - TQRegExp rx(TQString::tqfromLatin1("%\\{(.+)\\}")); + TQRegExp rx(TQString::fromLatin1("%\\{(.+)\\}")); rx.setMinimal(true); // do NOT call recursively! for(int pos = m_desc.find(rx); pos > -1; pos = m_desc.find(rx, pos+3)) { @@ -246,7 +246,7 @@ TQString Field::format(const TQString& value_, FormatFlag flag_) { TQString Field::formatTitle(const TQString& title_) { TQString newTitle = title_; // special case for multi-column tables, assume user never has '::' in a value - const TQString colonColon = TQString::tqfromLatin1("::"); + const TQString colonColon = TQString::fromLatin1("::"); TQString tail; if(newTitle.find(colonColon) > -1) { tail = colonColon + newTitle.section(colonColon, 1); @@ -265,11 +265,11 @@ TQString Field::formatTitle(const TQString& title_) { // assume white space is already stripped // the articles are already in lower-case if(lower.startsWith(*it + TQChar(' '))) { - TQRegExp regexp(TQChar('^') + TQRegExp::escape(*it) + TQString::tqfromLatin1("\\s*"), false); + TQRegExp regexp(TQChar('^') + TQRegExp::escape(*it) + TQString::fromLatin1("\\s*"), false); // can't just use *it since it's in lower-case TQString article = newTitle.left((*it).length()); newTitle = newTitle.replace(regexp, TQString()) - .append(TQString::tqfromLatin1(", ")) + .append(TQString::fromLatin1(", ")) .append(article); break; } @@ -277,15 +277,15 @@ TQString Field::formatTitle(const TQString& title_) { } // also, arbitrarily impose rule that a space must follow every comma - newTitle.replace(comma_split, TQString::tqfromLatin1(", ")); + newTitle.replace(comma_split, TQString::fromLatin1(", ")); return newTitle + tail; } TQString Field::formatName(const TQString& name_, bool multiple_/*=true*/) { - static const TQRegExp spaceComma(TQString::tqfromLatin1("[\\s,]")); - static const TQString colonColon = TQString::tqfromLatin1("::"); + static const TQRegExp spaceComma(TQString::fromLatin1("[\\s,]")); + static const TQString colonColon = TQString::fromLatin1("::"); // the ending look-ahead is so that a space is not added at the end - static const TQRegExp periodSpace(TQString::tqfromLatin1("\\.\\s*(?=.)")); + static const TQRegExp periodSpace(TQString::fromLatin1("\\.\\s*(?=.)")); TQStringList entries; if(multiple_) { @@ -307,7 +307,7 @@ TQString Field::formatName(const TQString& name_, bool multiple_/*=true*/) { tail = colonColon + name.section(colonColon, 1); name = name.section(colonColon, 0, 0); } - name.replace(periodSpace, TQString::tqfromLatin1(". ")); + name.replace(periodSpace, TQString::fromLatin1(". ")); if(Config::autoCapitalization()) { name = capitalize(name); } @@ -320,7 +320,7 @@ TQString Field::formatName(const TQString& name_, bool multiple_/*=true*/) { if(!Config::autoFormat() || (name.find(',') > -1 && Config::nameSuffixList().grep(lastWord).isEmpty())) { // arbitrarily impose rule that no spaces before a comma and // a single space after every comma - name.replace(comma_split, TQString::tqfromLatin1(", ")); + name.replace(comma_split, TQString::fromLatin1(", ")); names << name + tail; continue; } @@ -354,7 +354,7 @@ TQString Field::formatName(const TQString& name_, bool multiple_/*=true*/) { } } - return names.join(TQString::tqfromLatin1("; ")); + return names.join(TQString::fromLatin1("; ")); } TQString Field::formatDate(const TQString& date_) { @@ -366,11 +366,11 @@ TQString Field::formatDate(const TQString& date_) { // for empty month or date, use 1 TQStringList s = TQStringList::split('-', date_, true); bool ok = true; - int y = s.count() > 0 ? s[0].toInt(&ok) : TQDate::tqcurrentDate().year(); + int y = s.count() > 0 ? s[0].toInt(&ok) : TQDate::currentDate().year(); if(ok) { empty = false; } else { - y = TQDate::tqcurrentDate().year(); + y = TQDate::currentDate().year(); } int m = s.count() > 1 ? s[1].toInt(&ok) : 1; if(ok) { @@ -392,13 +392,13 @@ TQString Field::formatDate(const TQString& date_) { TQString Field::capitalize(TQString str_) { // regexp to split words - static const TQRegExp rx(TQString::tqfromLatin1("[-\\s,.;]")); + static const TQRegExp rx(TQString::fromLatin1("[-\\s,.;]")); if(str_.isEmpty()) { return str_; } // first letter is always capitalized - str_.replace(0, 1, str_.tqat(0).upper()); + str_.replace(0, 1, str_.at(0).upper()); // special case for french words like l'espace @@ -418,7 +418,7 @@ TQString Field::capitalize(TQString str_) { for(TQStringList::ConstIterator it = s_articlesApos.begin(); it != s_articlesApos.end(); ++it) { if(word.lower().startsWith(*it)) { uint l = (*it).length(); - str_.replace(l, 1, str_.tqat(l).upper()); + str_.replace(l, 1, str_.at(l).upper()); break; } } @@ -435,7 +435,7 @@ TQString Field::capitalize(TQString str_) { for(TQStringList::ConstIterator it = s_articlesApos.begin(); it != s_articlesApos.end(); ++it) { if(word.lower().startsWith(*it)) { uint l = (*it).length(); - str_.replace(pos+l+1, 1, str_.tqat(pos+l+1).upper()); + str_.replace(pos+l+1, 1, str_.at(pos+l+1).upper()); aposMatch = true; break; } @@ -444,7 +444,7 @@ TQString Field::capitalize(TQString str_) { if(!aposMatch) { wordRx.setPattern(TQChar('^') + TQRegExp::escape(word) + TQChar('$')); if(notCap.grep(wordRx).isEmpty() && nextPos-pos > 1) { - str_.replace(pos+1, 1, str_.tqat(pos+1).upper()); + str_.replace(pos+1, 1, str_.at(pos+1).upper()); } } @@ -547,7 +547,7 @@ void Field::convertOldRating(Data::FieldPtr field_) { } if(field_->name() != Latin1Literal("rating") - && field_->property(TQString::tqfromLatin1("rating")) != Latin1Literal("true")) { + && field_->property(TQString::fromLatin1("rating")) != Latin1Literal("true")) { return; // nothing to do } @@ -568,9 +568,9 @@ void Field::convertOldRating(Data::FieldPtr field_) { min = 1; max = 5; } - field_->setProperty(TQString::tqfromLatin1("minimum"), TQString::number(min)); - field_->setProperty(TQString::tqfromLatin1("maximum"), TQString::number(max)); - field_->setProperty(TQString::tqfromLatin1("rating"), TQString()); + field_->setProperty(TQString::fromLatin1("minimum"), TQString::number(min)); + field_->setProperty(TQString::fromLatin1("maximum"), TQString::number(max)); + field_->setProperty(TQString::fromLatin1("rating"), TQString()); field_->setType(Rating); } @@ -586,9 +586,9 @@ void Field::stripArticles(TQString& value) { return; } for(TQStringList::ConstIterator it = articles.begin(); it != articles.end(); ++it) { - TQRegExp rx(TQString::tqfromLatin1("\\b") + *it + TQString::tqfromLatin1("\\b")); + TQRegExp rx(TQString::fromLatin1("\\b") + *it + TQString::fromLatin1("\\b")); value.remove(rx); } value = value.stripWhiteSpace(); - value.remove(TQRegExp(TQString::tqfromLatin1(",$"))); + value.remove(TQRegExp(TQString::fromLatin1(",$"))); } diff --git a/src/filehandler.cpp b/src/filehandler.cpp index 900257a..10c5405 100644 --- a/src/filehandler.cpp +++ b/src/filehandler.cpp @@ -65,7 +65,7 @@ FileHandler::FileRef::FileRef(const KURL& url_, bool quiet_, bool allowCompresse myDebug() << s << endl; } if(!quiet_) { - Kernel::self()->sorry(i18n(errorLoad).tqarg(url_.fileName())); + Kernel::self()->sorry(i18n(errorLoad).arg(url_.fileName())); } return; } @@ -107,7 +107,7 @@ bool FileHandler::FileRef::open(bool quiet_) { if(!quiet_) { KURL u; u.setPath(fileName()); - Kernel::self()->sorry(i18n(errorLoad).tqarg(u.fileName())); + Kernel::self()->sorry(i18n(errorLoad).arg(u.fileName())); } delete m_device; m_device = 0; @@ -151,12 +151,12 @@ TQDomDocument FileHandler::readXMLFile(const KURL& url_, bool processNamespace_, } if(!doc.setContent(f.file(), processNamespace_, &errorMsg, &errorLine, &errorColumn)) { if(!quiet_) { - TQString details = i18n("There is an XML parsing error in line %1, column %2.").tqarg(errorLine).tqarg(errorColumn); - details += TQString::tqfromLatin1("\n"); + TQString details = i18n("There is an XML parsing error in line %1, column %2.").arg(errorLine).arg(errorColumn); + details += TQString::fromLatin1("\n"); details += i18n("The error message from TQt is:"); - details += TQString::tqfromLatin1("\n\t") + errorMsg; + details += TQString::fromLatin1("\n\t") + errorMsg; GUI::CursorSaver cs(TQt::arrowCursor); - KMessageBox::detailedSorry(Kernel::self()->widget(), i18n(errorLoad).tqarg(url_.fileName()), details); + KMessageBox::detailedSorry(Kernel::self()->widget(), i18n(errorLoad).arg(url_.fileName()), details); } return TQDomDocument(); } @@ -184,11 +184,11 @@ Tellico::Data::Image* FileHandler::readImageFile(const KURL& url_, bool quiet_, tmpFile.setAutoDelete(true); KIO::Job* job = KIO::file_copy(url_, tmpURL, -1, true /* overwrite */); - job->addMetaData(TQString::tqfromLatin1("referrer"), referrer_.url()); + job->addMetaData(TQString::fromLatin1("referrer"), referrer_.url()); if(!KIO::NetAccess::synchronousRun(job, Kernel::self()->widget())) { if(!quiet_) { - Kernel::self()->sorry(i18n(errorLoad).tqarg(url_.fileName())); + Kernel::self()->sorry(i18n(errorLoad).arg(url_.fileName())); } return 0; } @@ -203,7 +203,7 @@ Tellico::Data::Image* FileHandler::readImageFile(const KURL& url_, bool quiet_) Data::Image* img = new Data::Image(f.fileName()); if(img->isNull() && !quiet_) { - TQString str = i18n("Tellico is unable to load the image - %1.").tqarg(url_.fileName()); + TQString str = i18n("Tellico is unable to load the image - %1.").arg(url_.fileName()); Kernel::self()->sorry(str); } return img; @@ -218,7 +218,7 @@ bool FileHandler::queryExists(const KURL& url_) { if(url_ != Kernel::self()->URL()) { GUI::CursorSaver cs(TQt::arrowCursor); TQString str = i18n("A file named \"%1\" already exists. " - "Are you sure you want to overwrite it?").tqarg(url_.fileName()); + "Are you sure you want to overwrite it?").arg(url_.fileName()); int want_continue = KMessageBox::warningContinueCancel(Kernel::self()->widget(), str, i18n("Overwrite File?"), i18n("Overwrite")); @@ -229,7 +229,7 @@ bool FileHandler::queryExists(const KURL& url_) { } KURL backup(url_); - backup.setPath(backup.path() + TQString::tqfromLatin1("~")); + backup.setPath(backup.path() + TQString::fromLatin1("~")); bool success = true; if(url_.isLocalFile()) { @@ -259,7 +259,7 @@ bool FileHandler::queryExists(const KURL& url_) { false /* resume */, Kernel::self()->widget()); } if(!success) { - Kernel::self()->sorry(i18n(errorWrite).tqarg(url_.fileName() + '~')); + Kernel::self()->sorry(i18n(errorWrite).arg(url_.fileName() + '~')); } return success; } @@ -288,7 +288,7 @@ bool FileHandler::writeTextURL(const KURL& url_, const TQString& text_, bool enc KSaveFile f(url_.path()); if(f.status() != 0) { if(!quiet_) { - Kernel::self()->sorry(i18n(errorWrite).tqarg(url_.fileName())); + Kernel::self()->sorry(i18n(errorWrite).arg(url_.fileName())); } return false; } @@ -307,7 +307,7 @@ bool FileHandler::writeTextURL(const KURL& url_, const TQString& text_, bool enc if(f.status() != 0) { tempfile.unlink(); if(!quiet_) { - Kernel::self()->sorry(i18n(errorWrite).tqarg(url_.fileName())); + Kernel::self()->sorry(i18n(errorWrite).arg(url_.fileName())); } return false; } @@ -318,7 +318,7 @@ bool FileHandler::writeTextURL(const KURL& url_, const TQString& text_, bool enc if(!uploaded) { tempfile.unlink(); if(!quiet_) { - Kernel::self()->sorry(i18n(errorUpload).tqarg(url_.fileName())); + Kernel::self()->sorry(i18n(errorUpload).arg(url_.fileName())); } success = false; } @@ -369,7 +369,7 @@ bool FileHandler::writeDataURL(const KURL& url_, const TQByteArray& data_, bool KSaveFile f(url_.path()); if(f.status() != 0) { if(!quiet_) { - Kernel::self()->sorry(i18n(errorWrite).tqarg(url_.fileName())); + Kernel::self()->sorry(i18n(errorWrite).arg(url_.fileName())); } return false; } @@ -387,7 +387,7 @@ bool FileHandler::writeDataURL(const KURL& url_, const TQByteArray& data_, bool KSaveFile f(tempfile.name()); if(f.status() != 0) { if(!quiet_) { - Kernel::self()->sorry(i18n(errorWrite).tqarg(url_.fileName())); + Kernel::self()->sorry(i18n(errorWrite).arg(url_.fileName())); } return false; } @@ -396,7 +396,7 @@ bool FileHandler::writeDataURL(const KURL& url_, const TQByteArray& data_, bool if(success) { success = KIO::NetAccess::upload(tempfile.name(), url_, Kernel::self()->widget()); if(!success && !quiet_) { - Kernel::self()->sorry(i18n(errorUpload).tqarg(url_.fileName())); + Kernel::self()->sorry(i18n(errorUpload).arg(url_.fileName())); } } tempfile.unlink(); diff --git a/src/filterdialog.cpp b/src/filterdialog.cpp index 0754a44..fdf36d5 100644 --- a/src/filterdialog.cpp +++ b/src/filterdialog.cpp @@ -11,7 +11,7 @@ * * ***************************************************************************/ -// The tqlayout borrows heavily from kmsearchpatternedit.cpp in kmail +// The layout borrows heavily from kmsearchpatternedit.cpp in kmail // which is authored by Marc Mutz <Marc@Mutz.com> under the GPL #include "filterdialog.h" @@ -29,7 +29,7 @@ #include <kregexpeditorinterface.h> #include <kiconloader.h> -#include <tqlayout.h> +#include <layout.h> #include <tqgroupbox.h> #include <tqradiobutton.h> #include <tqvbuttongroup.h> @@ -86,7 +86,7 @@ void FilterRuleWidget::initWidget() { m_ruleValue = new KLineEdit(this); connect(m_ruleValue, TQT_SIGNAL(textChanged(const TQString&)), TQT_SIGNAL(signalModified())); - if(!KTrader::self()->query(TQString::tqfromLatin1("KRegExpEditor/KRegExpEditor")).isEmpty()) { + if(!KTrader::self()->query(TQString::fromLatin1("KRegExpEditor/KRegExpEditor")).isEmpty()) { m_editRegExp = new KPushButton(i18n("Edit..."), this); connect(m_editRegExp, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotEditRegExp())); connect(m_ruleFunc, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotRuleFunctionChanged(int))); @@ -109,11 +109,11 @@ void FilterRuleWidget::initWidget() { void FilterRuleWidget::slotEditRegExp() { if(m_editRegExpDialog == 0) { - m_editRegExpDialog = KParts::ComponentFactory::createInstanceFromQuery<TQDialog>(TQString::tqfromLatin1("KRegExpEditor/KRegExpEditor"), + m_editRegExpDialog = KParts::ComponentFactory::createInstanceFromQuery<TQDialog>(TQString::fromLatin1("KRegExpEditor/KRegExpEditor"), TQString(), TQT_TQOBJECT(this)); } - KRegExpEditorInterface* iface = static_cast<KRegExpEditorInterface *>(m_editRegExpDialog->qt_cast(TQString::tqfromLatin1("KRegExpEditorInterface"))); + KRegExpEditorInterface* iface = static_cast<KRegExpEditorInterface *>(m_editRegExpDialog->qt_cast(TQString::fromLatin1("KRegExpEditorInterface"))); if(iface) { iface->setRegExp(m_ruleValue->text()); if(m_editRegExpDialog->exec() == TQDialog::Accepted) { @@ -316,7 +316,7 @@ void FilterDialog::init() { // only when creating a new filter can it be saved if(m_mode == CreateFilter) { - m_saveFilter = new KPushButton(SmallIconSet(TQString::tqfromLatin1("filter")), i18n("&Save Filter"), page); + m_saveFilter = new KPushButton(SmallIconSet(TQString::fromLatin1("filter")), i18n("&Save Filter"), page); blay->addWidget(m_saveFilter); m_saveFilter->setEnabled(false); connect(m_saveFilter, TQT_SIGNAL(clicked()), TQT_SLOT(slotSaveFilter())); @@ -326,7 +326,7 @@ void FilterDialog::init() { actionButton(Help)->setDefault(false); // Help automatically becomes default when OK is disabled actionButton(Cancel)->setDefault(true); // Help automatically becomes default when OK is disabled setMinimumWidth(TQMAX(minimumWidth(), FILTER_MIN_WIDTH)); - setHelp(TQString::tqfromLatin1("filter-dialog")); + setHelp(TQString::fromLatin1("filter-dialog")); } Tellico::FilterPtr FilterDialog::currentFilter() { @@ -391,7 +391,7 @@ void FilterDialog::slotClear() { void FilterDialog::slotShrink() { updateGeometry(); TQApplication::sendPostedEvents(); - resize(width(), tqsizeHint().height()); + resize(width(), sizeHint().height()); } void FilterDialog::slotFilterChanged() { diff --git a/src/filteritem.cpp b/src/filteritem.cpp index 655e889..9c57d3f 100644 --- a/src/filteritem.cpp +++ b/src/filteritem.cpp @@ -23,7 +23,7 @@ using Tellico::FilterItem; FilterItem::FilterItem(GUI::ListView* parent_, Filter::Ptr filter_) : GUI::CountedItem(parent_), m_filter(filter_) { setText(0, filter_->name()); - setPixmap(0, SmallIcon(TQString::tqfromLatin1("filter"))); + setPixmap(0, SmallIcon(TQString::fromLatin1("filter"))); } void FilterItem::updateFilter(Filter::Ptr filter_) { diff --git a/src/filterview.cpp b/src/filterview.cpp index ac96699..57061a2 100644 --- a/src/filterview.cpp +++ b/src/filterview.cpp @@ -64,9 +64,9 @@ void FilterView::contextMenuRequested(TQListViewItem* item_, const TQPoint& poin GUI::ListViewItem* item = static_cast<GUI::ListViewItem*>(item_); if(item->isFilterItem()) { KPopupMenu menu(this); - menu.insertItem(SmallIconSet(TQString::tqfromLatin1("filter")), + menu.insertItem(SmallIconSet(TQString::fromLatin1("filter")), i18n("Modify Filter"), this, TQT_SLOT(slotModifyFilter())); - menu.insertItem(SmallIconSet(TQString::tqfromLatin1("editdelete")), + menu.insertItem(SmallIconSet(TQString::fromLatin1("editdelete")), i18n("Delete Filter"), this, TQT_SLOT(slotDeleteFilter())); menu.exec(point_); } @@ -95,7 +95,7 @@ void FilterView::addCollection(Data::CollPtr coll_) { for(FilterVec::Iterator it = filters.begin(); it != filters.end(); ++it) { addFilter(it); } - Data::FieldPtr f = coll_->fieldByName(TQString::tqfromLatin1("title")); + Data::FieldPtr f = coll_->fieldByName(TQString::fromLatin1("title")); if(f) { setComparison(0, ListViewComparison::create(f)); } @@ -122,7 +122,7 @@ void FilterView::modifyEntry(Data::EntryPtr entry_) { for(TQListViewItem* item = firstChild(); item; item = item->nextSibling()) { bool hasEntry = false; TQListViewItem* entryItem = 0; - // iterate over all tqchildren and find item with matching entry pointers + // iterate over all children and find item with matching entry pointers for(TQListViewItem* i = item->firstChild(); i; i = i->nextSibling()) { if(static_cast<EntryItem*>(i)->entry() == entry_) { i->setText(0, entry_->title()); @@ -146,7 +146,7 @@ void FilterView::modifyEntry(Data::EntryPtr entry_) { void FilterView::removeEntries(Data::EntryVec entries_) { // the group modified signal gets handles separately, this is just for filters for(TQListViewItem* item = firstChild(); item; item = item->nextSibling()) { - // iterate over all tqchildren and delete items with matching entry pointers + // iterate over all children and delete items with matching entry pointers TQListViewItem* c1 = item->firstChild(); while(c1) { if(entries_.contains(static_cast<EntryItem*>(c1)->entry())) { @@ -257,7 +257,7 @@ void FilterView::resetComparisons() { if(!coll) { return; } - Data::FieldPtr f = coll->fieldByName(TQString::tqfromLatin1("title")); + Data::FieldPtr f = coll->fieldByName(TQString::fromLatin1("title")); if(f) { setComparison(0, ListViewComparison::create(f)); } diff --git a/src/groupiterator.cpp b/src/groupiterator.cpp index 209de52..ebfc5e7 100644 --- a/src/groupiterator.cpp +++ b/src/groupiterator.cpp @@ -17,7 +17,7 @@ using Tellico::GroupIterator; GroupIterator::GroupIterator(const TQListView* view_) { - // groups are the first tqchildren in the group view + // groups are the first children in the group view m_item = static_cast<GUI::ListViewItem*>(view_->firstChild()); } diff --git a/src/groupview.cpp b/src/groupview.cpp index a392eca..24e945c 100644 --- a/src/groupview.cpp +++ b/src/groupview.cpp @@ -57,8 +57,8 @@ GroupView::GroupView(TQWidget* parent_, const char* name_/*=0*/) connect(this, TQT_SIGNAL(collapsed(TQListViewItem*)), TQT_SLOT(slotCollapsed(TQListViewItem*))); - m_groupOpenPixmap = SmallIcon(TQString::tqfromLatin1("folder_open")); - m_groupClosedPixmap = SmallIcon(TQString::tqfromLatin1("folder")); + m_groupOpenPixmap = SmallIcon(TQString::fromLatin1("folder_open")); + m_groupClosedPixmap = SmallIcon(TQString::fromLatin1("folder")); } Tellico::EntryGroupItem* GroupView::addGroup(Data::EntryGroup* group_) { @@ -71,7 +71,7 @@ Tellico::EntryGroupItem* GroupView::addGroup(Data::EntryGroup* group_) { } EntryGroupItem* item = new EntryGroupItem(this, group_, type); if(group_->groupName() == i18n(Data::Collection::s_emptyGroupTitle)) { - item->setPixmap(0, SmallIcon(TQString::tqfromLatin1("folder_red"))); + item->setPixmap(0, SmallIcon(TQString::fromLatin1("folder_red"))); item->setSortWeight(10); } else { item->setPixmap(0, m_groupClosedPixmap); @@ -248,11 +248,11 @@ void GroupView::contextMenuRequested(TQListViewItem* item_, const TQPoint& point KPopupMenu menu(this); GUI::ListViewItem* item = static_cast<GUI::ListViewItem*>(item_); if(item->isEntryGroupItem()) { - menu.insertItem(SmallIconSet(TQString::tqfromLatin1("2downarrow")), + menu.insertItem(SmallIconSet(TQString::fromLatin1("2downarrow")), i18n("Expand All Groups"), this, TQT_SLOT(slotExpandAll())); - menu.insertItem(SmallIconSet(TQString::tqfromLatin1("2uparrow")), + menu.insertItem(SmallIconSet(TQString::fromLatin1("2uparrow")), i18n("Collapse All Groups"), this, TQT_SLOT(slotCollapseAll())); - menu.insertItem(SmallIconSet(TQString::tqfromLatin1("filter")), + menu.insertItem(SmallIconSet(TQString::fromLatin1("filter")), i18n("Filter by Group"), this, TQT_SLOT(slotFilterGroup())); } else if(item->isEntryItem()) { Controller::self()->plugEntryActions(&menu); @@ -264,7 +264,7 @@ void GroupView::slotCollapsed(TQListViewItem* item_) { // only change icon for group items if(static_cast<GUI::ListViewItem*>(item_)->isEntryGroupItem()) { if(item_->text(0) == i18n(Data::Collection::s_emptyGroupTitle)) { - item_->setPixmap(0, SmallIcon(TQString::tqfromLatin1("folder_red"))); + item_->setPixmap(0, SmallIcon(TQString::fromLatin1("folder_red"))); } else { item_->setPixmap(0, m_groupClosedPixmap); } @@ -281,7 +281,7 @@ void GroupView::slotExpanded(TQListViewItem* item_) { setUpdatesEnabled(false); if(item->text(0) == i18n(Data::Collection::s_emptyGroupTitle)) { - item->setPixmap(0, SmallIcon(TQString::tqfromLatin1("folder_red_open"))); + item->setPixmap(0, SmallIcon(TQString::fromLatin1("folder_red_open"))); } else { item->setPixmap(0, m_groupOpenPixmap); } @@ -316,11 +316,11 @@ void GroupView::addCollection(Data::CollPtr coll_) { // when the coll gets set for the first time, the pixmaps need to be updated if((m_coll->hasField(m_groupBy) && m_coll->fieldByName(m_groupBy)->formatFlag() == Data::Field::FormatName) || m_groupBy == Data::Collection::s_peopleGroupName) { - m_groupOpenPixmap = UserIcon(TQString::tqfromLatin1("person-open")); - m_groupClosedPixmap = UserIcon(TQString::tqfromLatin1("person")); + m_groupOpenPixmap = UserIcon(TQString::fromLatin1("person-open")); + m_groupClosedPixmap = UserIcon(TQString::fromLatin1("person")); } - Data::FieldPtr f = coll_->fieldByName(TQString::tqfromLatin1("title")); + Data::FieldPtr f = coll_->fieldByName(TQString::fromLatin1("title")); if(f) { setComparison(0, ListViewComparison::create(f)); } @@ -344,11 +344,11 @@ void GroupView::setGroupField(const TQString& groupField_) { } if((m_coll->hasField(groupField_) && m_coll->fieldByName(groupField_)->formatFlag() == Data::Field::FormatName) || groupField_ == Data::Collection::s_peopleGroupName) { - m_groupOpenPixmap = UserIcon(TQString::tqfromLatin1("person-open")); - m_groupClosedPixmap = UserIcon(TQString::tqfromLatin1("person")); + m_groupOpenPixmap = UserIcon(TQString::fromLatin1("person-open")); + m_groupClosedPixmap = UserIcon(TQString::fromLatin1("person")); } else { - m_groupOpenPixmap = SmallIcon(TQString::tqfromLatin1("folder_open")); - m_groupClosedPixmap = SmallIcon(TQString::tqfromLatin1("folder")); + m_groupOpenPixmap = SmallIcon(TQString::fromLatin1("folder_open")); + m_groupClosedPixmap = SmallIcon(TQString::fromLatin1("folder")); } updateHeader(); populateCollection(); @@ -463,7 +463,7 @@ void GroupView::updateHeader(Data::FieldPtr field_/*=0*/) { if(sortStyle() == ListView::SortByText) { setColumnText(0, t); } else { - setColumnText(0, i18n("%1 (Sort by Count)").tqarg(t)); + setColumnText(0, i18n("%1 (Sort by Count)").arg(t)); } } @@ -486,7 +486,7 @@ void GroupView::resetComparisons() { if(!m_coll) { return; } - Data::FieldPtr f = m_coll->fieldByName(TQString::tqfromLatin1("title")); + Data::FieldPtr f = m_coll->fieldByName(TQString::fromLatin1("title")); if(f) { setComparison(0, ListViewComparison::create(f)); } diff --git a/src/groupview.h b/src/groupview.h index 78a1909..a340241 100644 --- a/src/groupview.h +++ b/src/groupview.h @@ -73,7 +73,7 @@ public: */ void addCollection(Data::CollPtr coll); /** - * Removes a root collection item, and all of its tqchildren. + * Removes a root collection item, and all of its children. * * @param coll A pointer to the collection */ diff --git a/src/gui/boolfieldwidget.cpp b/src/gui/boolfieldwidget.cpp index a3a9649..cb8eff1 100644 --- a/src/gui/boolfieldwidget.cpp +++ b/src/gui/boolfieldwidget.cpp @@ -17,7 +17,7 @@ #include <tqlabel.h> #include <tqcheckbox.h> -#include <tqlayout.h> +#include <layout.h> using Tellico::GUI::BoolFieldWidget; @@ -31,7 +31,7 @@ BoolFieldWidget::BoolFieldWidget(Data::FieldPtr field_, TQWidget* parent_, const TQString BoolFieldWidget::text() const { if(m_checkBox->isChecked()) { - return TQString::tqfromLatin1("true"); + return TQString::fromLatin1("true"); } return TQString(); diff --git a/src/gui/choicefieldwidget.cpp b/src/gui/choicefieldwidget.cpp index 83e31f9..a8f0044 100644 --- a/src/gui/choicefieldwidget.cpp +++ b/src/gui/choicefieldwidget.cpp @@ -17,7 +17,7 @@ #include <kcombobox.h> #include <tqlabel.h> -#include <tqlayout.h> +#include <layout.h> using Tellico::GUI::ChoiceFieldWidget; diff --git a/src/gui/counteditem.cpp b/src/gui/counteditem.cpp index 1be5bcd..536d08e 100644 --- a/src/gui/counteditem.cpp +++ b/src/gui/counteditem.cpp @@ -73,7 +73,7 @@ void CountedItem::paintCell(TQPainter* p_, const TQColorGroup& cg_, } TQFontMetrics fm = p_->fontMetrics(); - TQString numText = TQString::tqfromLatin1(" (%1)").tqarg(count()); + TQString numText = TQString::fromLatin1(" (%1)").arg(count()); // don't call CountedListViewItem::width() because that includes the count already int w = ListViewItem::width(fm, listView(), column_); int countWidth = fm.width(numText); @@ -106,7 +106,7 @@ int CountedItem::width(const TQFontMetrics& fm_, const TQListView* lv_, int colu // show count is only for first column if(column_ == 0) { - TQString numText = TQString::tqfromLatin1(" (%1)").tqarg(count()); + TQString numText = TQString::fromLatin1(" (%1)").arg(count()); w += fm_.width(numText) + 2; // add a little pad } return w; diff --git a/src/gui/datewidget.cpp b/src/gui/datewidget.cpp index c43ca26..31de509 100644 --- a/src/gui/datewidget.cpp +++ b/src/gui/datewidget.cpp @@ -27,14 +27,14 @@ #include <kcalendarsystem.h> #include <tqvbox.h> -#include <tqlayout.h> +#include <layout.h> using Tellico::GUI::SpinBox; using Tellico::GUI::DateWidget; SpinBox::SpinBox(int min, int max, TQWidget *parent) : TQSpinBox(min, max, 1, parent) { - editor()->tqsetAlignment(AlignRight); + editor()->setAlignment(AlignRight); // I want to be able to omit the day // an empty string just removes the special value, so set white space setSpecialValueText(TQChar(' ')); @@ -71,7 +71,7 @@ DateWidget::DateWidget(TQWidget* parent_, const char* name_) : TQWidget(parent_, connect(m_yearSpin, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slotDateChanged())); m_dateButton = new KPushButton(this); - m_dateButton->setIconSet(SmallIconSet(TQString::tqfromLatin1("date"))); + m_dateButton->setIconSet(SmallIconSet(TQString::fromLatin1("date"))); connect(m_dateButton, TQT_SIGNAL(clicked()), TQT_SLOT(slotShowPicker())); l->addWidget(m_dateButton, 0); @@ -221,7 +221,7 @@ void DateWidget::clear() { m_daySpin->setValue(m_daySpin->minValue()); m_monthCombo->setCurrentItem(0); m_yearSpin->setValue(m_yearSpin->minValue()); - m_picker->setDate(TQDate::tqcurrentDate()); + m_picker->setDate(TQDate::currentDate()); m_daySpin->blockSignals(false); m_monthCombo->blockSignals(false); @@ -233,13 +233,13 @@ void DateWidget::slotShowPicker() { TQRect desk = KGlobalSettings::desktopGeometry(this); TQPoint popupPoint = mapToGlobal(TQPoint(0, 0)); - int dateFrameHeight = m_frame->tqsizeHint().height(); + int dateFrameHeight = m_frame->sizeHint().height(); if(popupPoint.y() + height() + dateFrameHeight > desk.bottom()) { popupPoint.setY(popupPoint.y() - dateFrameHeight); } else { popupPoint.setY(popupPoint.y() + height()); } - int dateFrameWidth = m_frame->tqsizeHint().width(); + int dateFrameWidth = m_frame->sizeHint().width(); if(popupPoint.x() + dateFrameWidth > desk.right()) { popupPoint.setX(desk.right() - dateFrameWidth); } diff --git a/src/gui/fieldwidget.cpp b/src/gui/fieldwidget.cpp index 3940fc4..653db95 100644 --- a/src/gui/fieldwidget.cpp +++ b/src/gui/fieldwidget.cpp @@ -28,7 +28,7 @@ #include <kurllabel.h> #include <klocale.h> -#include <tqlayout.h> +#include <layout.h> #include <tqwhatsthis.h> #include <tqregexp.h> #include <tqlabel.h> @@ -43,7 +43,7 @@ namespace { using Tellico::GUI::FieldWidget; -const TQRegExp FieldWidget::s_semiColon = TQRegExp(TQString::tqfromLatin1("\\s*;\\s*")); +const TQRegExp FieldWidget::s_semiColon = TQRegExp(TQString::fromLatin1("\\s*;\\s*")); FieldWidget* FieldWidget::create(Data::FieldPtr field_, TQWidget* parent_, const char* name_) { switch (field_->type()) { @@ -98,14 +98,14 @@ FieldWidget::FieldWidget(Data::FieldPtr field_, TQWidget* parent_, const char* n } Data::Field::Type type = field_->type(); - TQString s = i18n("Edit Label", "%1:").tqarg(field_->title()); + TQString s = i18n("Edit Label", "%1:").arg(field_->title()); if(type == Data::Field::URL) { // set URL to null for now m_label = new KURLLabel(TQString(), s, this); } else { m_label = new TQLabel(s, this); } - m_label->setFixedWidth(m_label->tqsizeHint().width()); + m_label->setFixedWidth(m_label->sizeHint().width()); l->addWidget(m_label); // expands indicates if the edit widget should expand to full width of widget @@ -120,7 +120,7 @@ FieldWidget::FieldWidget(Data::FieldPtr field_, TQWidget* parent_, const char* n m_editMultiple = new TQCheckBox(this); m_editMultiple->setChecked(true); - m_editMultiple->setFixedWidth(m_editMultiple->tqsizeHint().width()); // don't let it have any extra space + m_editMultiple->setFixedWidth(m_editMultiple->sizeHint().width()); // don't let it have any extra space connect(m_editMultiple, TQT_SIGNAL(toggled(bool)), TQT_SLOT(setEnabled(bool))); l->addWidget(m_editMultiple); @@ -147,7 +147,7 @@ void FieldWidget::setEnabled(bool enabled_) { } int FieldWidget::labelWidth() const { - return m_label->tqsizeHint().width(); + return m_label->sizeHint().width(); } void FieldWidget::setLabelWidth(int width_) { @@ -182,7 +182,7 @@ void FieldWidget::registerWidget() { setFocusProxy(w); } - TQHBoxLayout* l = static_cast<TQHBoxLayout*>(tqlayout()); + TQHBoxLayout* l = static_cast<TQHBoxLayout*>(layout()); l->insertWidget(FIELD_EDIT_WIDGET_INDEX, w, m_expands ? 1 : 0 /*stretch*/); if(!m_expands) { l->insertStretch(FIELD_EDIT_WIDGET_INDEX+1, 1 /*stretch*/); @@ -192,7 +192,7 @@ void FieldWidget::registerWidget() { void FieldWidget::updateField(Data::FieldPtr oldField_, Data::FieldPtr newField_) { m_field = newField_; - m_label->setText(i18n("Edit Label", "%1:").tqarg(newField_->title())); + m_label->setText(i18n("Edit Label", "%1:").arg(newField_->title())); updateGeometry(); TQWhatsThis::add(this, newField_->description()); updateFieldHook(oldField_, newField_); diff --git a/src/gui/imagefieldwidget.cpp b/src/gui/imagefieldwidget.cpp index 9acc732..77f67b9 100644 --- a/src/gui/imagefieldwidget.cpp +++ b/src/gui/imagefieldwidget.cpp @@ -22,7 +22,7 @@ ImageFieldWidget::ImageFieldWidget(Data::FieldPtr field_, TQWidget* parent_, con : FieldWidget(field_, parent_, name_) { m_widget = new ImageWidget(this); - m_widget->setLinkOnlyChecked(field_->property(TQString::tqfromLatin1("link")) == Latin1Literal("true")); + m_widget->setLinkOnlyChecked(field_->property(TQString::fromLatin1("link")) == Latin1Literal("true")); connect(m_widget, TQT_SIGNAL(signalModified()), TQT_SIGNAL(modified())); registerWidget(); diff --git a/src/gui/imagewidget.cpp b/src/gui/imagewidget.cpp index 69e0560..e4e3d57 100644 --- a/src/gui/imagewidget.cpp +++ b/src/gui/imagewidget.cpp @@ -25,7 +25,7 @@ #include <kmessagebox.h> #include <tqwmatrix.h> -#include <tqlayout.h> +#include <layout.h> #include <tqlabel.h> #include <tqcheckbox.h> #include <tqdragobject.h> @@ -44,9 +44,9 @@ ImageWidget::ImageWidget(TQWidget* parent_, const char* name_) : TQWidget(parent TQHBoxLayout* l = new TQHBoxLayout(this); l->setMargin(IMAGE_WIDGET_BUTTON_MARGIN); m_label = new TQLabel(this); - m_label->tqsetSizePolicy(TQSizePolicy(TQSizePolicy::Ignored, TQSizePolicy::Ignored)); + m_label->setSizePolicy(TQSizePolicy(TQSizePolicy::Ignored, TQSizePolicy::Ignored)); m_label->setFrameStyle(TQFrame::Panel | TQFrame::Sunken); - m_label->tqsetAlignment(TQt::AlignHCenter | TQt::AlignVCenter); + m_label->setAlignment(TQt::AlignHCenter | TQt::AlignVCenter); l->addWidget(m_label, 1); l->addSpacing(IMAGE_WIDGET_BUTTON_MARGIN); @@ -56,7 +56,7 @@ ImageWidget::ImageWidget(TQWidget* parent_, const char* name_) : TQWidget(parent KButtonBox* box = new KButtonBox(this,Qt::Vertical); box->addButton(i18n("Select Image..."), TQT_TQOBJECT(this), TQT_SLOT(slotGetImage())); box->addButton(i18n("Clear"), TQT_TQOBJECT(this), TQT_SLOT(slotClear())); - box->tqlayout(); + box->layout(); boxLayout->addWidget(box); boxLayout->addSpacing(8); @@ -179,7 +179,7 @@ void ImageWidget::mousePressEvent(TQMouseEvent* event_) { if(event_->button() == Qt::LeftButton) { // Store the position of the mouse press. // check if position is inside the label - if(m_label->tqgeometry().contains(event_->pos())) { + if(m_label->geometry().contains(event_->pos())) { m_dragStart = event_->pos(); } else { m_dragStart = TQPoint(); @@ -214,7 +214,7 @@ void ImageWidget::dropEvent(TQDropEvent* event_) { GUI::CursorSaver cs(TQt::busyCursor); if(TQImageDrag::decode(event_, image)) { // TQt reads PNG data by default - const TQString& id = ImageFactory::addImage(image, TQString::tqfromLatin1("PNG")); + const TQString& id = ImageFactory::addImage(image, TQString::fromLatin1("PNG")); if(!id.isEmpty() && id != m_imageID) { setImage(id); emit signalModified(); diff --git a/src/gui/kwidgetlister.cpp b/src/gui/kwidgetlister.cpp index 8574d28..896955c 100644 --- a/src/gui/kwidgetlister.cpp +++ b/src/gui/kwidgetlister.cpp @@ -36,7 +36,7 @@ #include <kpushbutton.h> #include <kiconloader.h> -#include <tqlayout.h> +#include <layout.h> #include <tqhbox.h> #include <assert.h> @@ -56,18 +56,18 @@ KWidgetLister::KWidgetLister( int minWidgets, int maxWidgets, TQWidget *parent, mLayout->addWidget( mButtonBox ); mBtnMore = new KPushButton( i18n("more widgets","More"), mButtonBox ); - mBtnMore->setIconSet(SmallIconSet(TQString::tqfromLatin1("down"))); + mBtnMore->setIconSet(SmallIconSet(TQString::fromLatin1("down"))); mButtonBox->setStretchFactor( mBtnMore, 0 ); mBtnFewer = new KPushButton( i18n("fewer widgets","Fewer"), mButtonBox ); - mBtnFewer->setIconSet(SmallIconSet(TQString::tqfromLatin1("up"))); + mBtnFewer->setIconSet(SmallIconSet(TQString::fromLatin1("up"))); mButtonBox->setStretchFactor( mBtnFewer, 0 ); TQWidget *spacer = new TQWidget( mButtonBox ); mButtonBox->setStretchFactor( spacer, 1 ); mBtnClear = new KPushButton( i18n("clear widgets","Clear"), mButtonBox ); - mBtnClear->setIconSet(SmallIconSet(TQString::tqfromLatin1("locationbar_erase"))); + mBtnClear->setIconSet(SmallIconSet(TQString::fromLatin1("locationbar_erase"))); mButtonBox->setStretchFactor( mBtnClear, 0 ); //---------- connect everything @@ -135,7 +135,7 @@ void KWidgetLister::addWidgetAtEnd(TQWidget *w) void KWidgetLister::removeLastWidget() { - // The tqlayout will take care that the + // The layout will take care that the // widget is removed from screen, too. mWidgetList.removeLast(); enableControls(); diff --git a/src/gui/kwidgetlister.h b/src/gui/kwidgetlister.h index 0124b65..262500c 100644 --- a/src/gui/kwidgetlister.h +++ b/src/gui/kwidgetlister.h @@ -71,19 +71,19 @@ protected slots: /** Called whenever the user clicks on the 'more' button. Reimplementations should call this method, because this implementation does all the dirty work with adding the widgets - to the tqlayout (through @ref addWidgetAtEnd) and enabling/disabling + to the layout (through @ref addWidgetAtEnd) and enabling/disabling the control buttons. */ virtual void slotMore(); /** Called whenever the user clicks on the 'fewer' button. Reimplementations should call this method, because this implementation does all the dirty work with removing the widgets - from the tqlayout (through @ref removelastWidget) and + from the layout (through @ref removelastWidget) and enabling/disabling the control buttons. */ virtual void slotFewer(); /** Called whenever the user clicks on the 'clear' button. Reimplementations should call this method, because this implementation does all the dirty work with removing all but - @ref mMinWidets widgets from the tqlayout and enabling/disabling + @ref mMinWidets widgets from the layout and enabling/disabling the control buttons. */ virtual void slotClear(); diff --git a/src/gui/lineedit.cpp b/src/gui/lineedit.cpp index cca7f7d..1936795 100644 --- a/src/gui/lineedit.cpp +++ b/src/gui/lineedit.cpp @@ -34,25 +34,25 @@ LineEdit::LineEdit(TQWidget* parent_, const char* name_) : KLineEdit(parent_, na void LineEdit::clear() { KLineEdit::clear(); m_drawHint = true; - tqrepaint(); + repaint(); } void LineEdit::setText(const TQString& text_) { m_drawHint = text_.isEmpty(); - tqrepaint(); + repaint(); KLineEdit::setText(text_); } void LineEdit::setHint(const TQString& hint_) { m_hint = hint_; m_drawHint = text().isEmpty(); - tqrepaint(); + repaint(); } void LineEdit::focusInEvent(TQFocusEvent* event_) { if(m_drawHint) { m_drawHint = false; - tqrepaint(); + repaint(); } KLineEdit::focusInEvent(event_); } @@ -60,7 +60,7 @@ void LineEdit::focusInEvent(TQFocusEvent* event_) { void LineEdit::focusOutEvent(TQFocusEvent* event_) { if(text().isEmpty()) { m_drawHint = true; - tqrepaint(); + repaint(); } KLineEdit::focusOutEvent(event_); } diff --git a/src/gui/linefieldwidget.cpp b/src/gui/linefieldwidget.cpp index cce1ade..3f3da1d 100644 --- a/src/gui/linefieldwidget.cpp +++ b/src/gui/linefieldwidget.cpp @@ -47,7 +47,7 @@ LineFieldWidget::LineFieldWidget(Data::FieldPtr field_, TQWidget* parent_, const TQString LineFieldWidget::text() const { TQString text = m_lineEdit->text(); if(field()->flags() & Data::Field::AllowMultiple) { - text.replace(s_semiColon, TQString::tqfromLatin1("; ")); + text.replace(s_semiColon, TQString::fromLatin1("; ")); } return text.stripWhiteSpace(); } diff --git a/src/gui/listview.cpp b/src/gui/listview.cpp index f5595ea..4b8c250 100644 --- a/src/gui/listview.cpp +++ b/src/gui/listview.cpp @@ -147,14 +147,14 @@ int ListView::compare(int col, const GUI::ListViewItem* item1, GUI::ListViewItem void ListView::setShadeSortColumn(bool shade_) { if(m_shadeSortColumn != shade_) { m_shadeSortColumn = shade_; - tqrepaint(); + repaint(); } } #endif void ListView::slotUpdateColors() { #if !KDE_IS_VERSION(3,3,90) - m_backColor2 = viewport()->tqcolorGroup().base(); + m_backColor2 = viewport()->colorGroup().base(); if(m_backColor2 == TQt::black) { m_backColor2 = TQColor(50, 50, 50); // dark gray } else { @@ -180,8 +180,8 @@ void ListView::slotUpdateColors() { } } #endif - Tellico::updateContrastColor(viewport()->tqcolorGroup()); - tqrepaint(); + Tellico::updateContrastColor(viewport()->colorGroup()); + repaint(); } void ListView::slotSelectionChanged() { @@ -196,7 +196,7 @@ void ListView::slotSelectionChanged() { m_isClear = false; Data::EntryVec entries; - // now just find all the tqchildren or grandtqchildren that are entry items + // now just find all the children or grandchildren that are entry items for(GUI::ListViewItemListIt it(m_selectedItems); it.current(); ++it) { Data::EntryVec more = it.current()->entries(); for(Data::EntryVecIt entry = more.begin(); entry != more.end(); ++entry) { @@ -214,8 +214,8 @@ void ListView::slotDoubleClicked(TQListViewItem* item_) { return; } - // if it has tqchildren, just open it - // but some items delay tqchildren creation + // if it has children, just open it + // but some items delay children creation if(static_cast<ListViewItem*>(item_)->realChildCount() > 0) { item_->setOpen(!item_->isOpen()); } @@ -234,8 +234,8 @@ void ListView::drawContentsOffset(TQPainter* p, int ox, int oy, int cx, int cy, /* ****************** ListViewItem ********************* */ ListViewItem::~ListViewItem() { - // I think there's a bug in qt where the tqchildren of this item are deleted after the item itself - // as a result, there is no listView() pointer for the tqchildren, that obvious causes + // I think there's a bug in qt where the children of this item are deleted after the item itself + // as a result, there is no listView() pointer for the children, that obvious causes // a problem with updating the selection. So we MUST call clear() here ourselves! clear(); // be sure to remove from selected list when it's deleted @@ -300,7 +300,7 @@ TQColor ListViewItem::backgroundColor(int column_) { if(view->columns() > 1 && view->shadeSortColumn() && column_ == view->sortColumn()) { return isAlternate() ? view->alternateBackground2() : view->background2(); } - return isAlternate() ? view->alternateBackground() : view->viewport()->tqcolorGroup().base(); + return isAlternate() ? view->alternateBackground() : view->viewport()->colorGroup().base(); #endif } diff --git a/src/gui/listview.h b/src/gui/listview.h index 3f1c485..d54eab6 100644 --- a/src/gui/listview.h +++ b/src/gui/listview.h @@ -161,8 +161,8 @@ public: * @param alternate The alternate row color can be forced */ virtual TQColor backgroundColor(int column); // not virtual in KListViewItem!!! - virtual void paintCell(TQPainter* painter, const TQColorGroup& tqcolorGroup, - int column, int width, int tqalignment); + virtual void paintCell(TQPainter* painter, const TQColorGroup& colorGroup, + int column, int width, int alignment); ListView* listView () const { return static_cast<ListView*>(KListViewItem::listView()); } diff --git a/src/gui/numberfieldwidget.cpp b/src/gui/numberfieldwidget.cpp index f2cdaa8..c016bc6 100644 --- a/src/gui/numberfieldwidget.cpp +++ b/src/gui/numberfieldwidget.cpp @@ -17,7 +17,7 @@ #include <klineedit.h> -#include <tqlayout.h> +#include <layout.h> #include <tqvalidator.h> using Tellico::GUI::NumberFieldWidget; @@ -41,7 +41,7 @@ void NumberFieldWidget::initLineEdit() { // regexp is any number of digits followed optionally by any number of // groups of a semi-colon followed optionally by a space, followed by digits - TQRegExp rx(TQString::tqfromLatin1("-?\\d*(; ?-?\\d*)*")); + TQRegExp rx(TQString::fromLatin1("-?\\d*(; ?-?\\d*)*")); m_lineEdit->setValidator(new TQRegExpValidator(rx, TQT_TQOBJECT(this))); } @@ -67,7 +67,7 @@ TQString NumberFieldWidget::text() const { TQString text = m_lineEdit->text(); if(field()->flags() & Data::Field::AllowMultiple) { - text.replace(s_semiColon, TQString::tqfromLatin1("; ")); + text.replace(s_semiColon, TQString::fromLatin1("; ")); } return text.simplifyWhiteSpace(); } @@ -116,19 +116,19 @@ void NumberFieldWidget::updateFieldHook(Data::FieldPtr, Data::FieldPtr newField_ TQString value = text(); if(wasLineEdit && !nowLineEdit) { - tqlayout()->remove(m_lineEdit); + layout()->remove(m_lineEdit); delete m_lineEdit; m_lineEdit = 0; initSpinBox(); } else if(!wasLineEdit && nowLineEdit) { - tqlayout()->remove(m_spinBox); + layout()->remove(m_spinBox); delete m_spinBox; m_spinBox = 0; initLineEdit(); } // should really be FIELD_EDIT_WIDGET_INDEX from fieldwidget.cpp - static_cast<TQBoxLayout*>(tqlayout())->insertWidget(2, widget(), 1 /*stretch*/); + static_cast<TQBoxLayout*>(layout())->insertWidget(2, widget(), 1 /*stretch*/); widget()->show(); setText(value); } diff --git a/src/gui/overlaywidget.cpp b/src/gui/overlaywidget.cpp index fd5c02b..7116ba2 100644 --- a/src/gui/overlaywidget.cpp +++ b/src/gui/overlaywidget.cpp @@ -13,7 +13,7 @@ #include "overlaywidget.h" -#include <tqlayout.h> +#include <layout.h> using Tellico::GUI::OverlayWidget; @@ -34,7 +34,7 @@ void OverlayWidget::setCorner(Corner corner_) { } void OverlayWidget::addWidget(TQWidget* widget_) { - tqlayout()->add(widget_); + layout()->add(widget_); adjustSize(); } @@ -70,9 +70,9 @@ void OverlayWidget::reposition() { } // Position in the toplevelwidget's coordinates - TQPoint pTopLevel = m_anchor->mapTo(tqtopLevelWidget(), p); + TQPoint pTopLevel = m_anchor->mapTo(topLevelWidget(), p); // Position in the widget's parentWidget coordinates - TQPoint pParent = parentWidget()->mapFrom(tqtopLevelWidget(), pTopLevel); + TQPoint pParent = parentWidget()->mapFrom(topLevelWidget(), pTopLevel); // keep it on the screen if(pParent.x() < 0) { pParent.rx() = 0; diff --git a/src/gui/parafieldwidget.cpp b/src/gui/parafieldwidget.cpp index 9aee35e..c03a28a 100644 --- a/src/gui/parafieldwidget.cpp +++ b/src/gui/parafieldwidget.cpp @@ -24,7 +24,7 @@ ParaFieldWidget::ParaFieldWidget(Data::FieldPtr field_, TQWidget* parent_, const m_textEdit = new KTextEdit(this); m_textEdit->setTextFormat(TQt::PlainText); - if(field_->property(TQString::tqfromLatin1("spellcheck")) != Latin1Literal("false")) { + if(field_->property(TQString::fromLatin1("spellcheck")) != Latin1Literal("false")) { m_textEdit->setCheckSpellingEnabled(true); } connect(m_textEdit, TQT_SIGNAL(textChanged()), TQT_SIGNAL(modified())); @@ -34,7 +34,7 @@ ParaFieldWidget::ParaFieldWidget(Data::FieldPtr field_, TQWidget* parent_, const TQString ParaFieldWidget::text() const { TQString text = m_textEdit->text(); - text.replace('\n', TQString::tqfromLatin1("<br/>")); + text.replace('\n', TQString::fromLatin1("<br/>")); return text; } @@ -42,7 +42,7 @@ void ParaFieldWidget::setText(const TQString& text_) { blockSignals(true); m_textEdit->blockSignals(true); - TQRegExp rx(TQString::tqfromLatin1("<br/?>"), false /*case-sensitive*/); + TQRegExp rx(TQString::fromLatin1("<br/?>"), false /*case-sensitive*/); TQString s = text_; s.replace(rx, TQChar('\n')); m_textEdit->setText(s); diff --git a/src/gui/ratingwidget.cpp b/src/gui/ratingwidget.cpp index ec5d717..a35c3fa 100644 --- a/src/gui/ratingwidget.cpp +++ b/src/gui/ratingwidget.cpp @@ -20,7 +20,7 @@ #include <kiconloader.h> #include <tqintdict.h> -#include <tqlayout.h> +#include <layout.h> namespace { static const int RATING_WIDGET_MAX_ICONS = 10; // same as in Field::ratingValues() @@ -43,7 +43,7 @@ const TQPixmap& RatingWidget::pixmap(const TQString& value_) { return *pixmaps[n]; } - TQString picName = TQString::tqfromLatin1("stars%1").tqarg(n); + TQString picName = TQString::fromLatin1("stars%1").arg(n); TQPixmap* pix = new TQPixmap(UserIcon(picName)); pixmaps.insert(n, pix); return *pix; @@ -51,8 +51,8 @@ const TQPixmap& RatingWidget::pixmap(const TQString& value_) { RatingWidget::RatingWidget(Data::FieldPtr field_, TQWidget* parent_, const char* name_/*=0*/) : TQHBox(parent_, name_), m_field(field_), m_currIndex(-1) { - m_pixOn = UserIcon(TQString::tqfromLatin1("star_on")); - m_pixOff = UserIcon(TQString::tqfromLatin1("star_off")); + m_pixOn = UserIcon(TQString::fromLatin1("star_on")); + m_pixOff = UserIcon(TQString::fromLatin1("star_off")); setSpacing(0); // find maximum width and height @@ -65,7 +65,7 @@ RatingWidget::RatingWidget(Data::FieldPtr field_, TQWidget* parent_, const char* } init(); - TQBoxLayout* l = dynamic_cast<TQBoxLayout*>(tqlayout()); + TQBoxLayout* l = dynamic_cast<TQBoxLayout*>(layout()); if(l) { l->addStretch(1); } @@ -86,8 +86,8 @@ void RatingWidget::init() { void RatingWidget::updateBounds() { bool ok; // not used; - m_min = Tellico::toUInt(m_field->property(TQString::tqfromLatin1("minimum")), &ok); - m_max = Tellico::toUInt(m_field->property(TQString::tqfromLatin1("maximum")), &ok); + m_min = Tellico::toUInt(m_field->property(TQString::fromLatin1("minimum")), &ok); + m_max = Tellico::toUInt(m_field->property(TQString::fromLatin1("maximum")), &ok); if(m_max > RATING_WIDGET_MAX_ICONS) { myDebug() << "RatingWidget::updateBounds() - max is too high: " << m_max << endl; m_max = RATING_WIDGET_MAX_ICONS; @@ -116,7 +116,7 @@ void RatingWidget::mousePressEvent(TQMouseEvent* event_) { } int idx; - TQWidget* child = tqchildAt(event_->pos()); + TQWidget* child = childAt(event_->pos()); if(child) { idx = m_widgets.findRef(static_cast<TQLabel*>(child)); // if the widget is clicked beyond the maximum value, clear it diff --git a/src/gui/richtextlabel.cpp b/src/gui/richtextlabel.cpp index 632f771..85a9dde 100644 --- a/src/gui/richtextlabel.cpp +++ b/src/gui/richtextlabel.cpp @@ -15,7 +15,7 @@ #include <kdebug.h> -#include <tqlayout.h> +#include <layout.h> using Tellico::GUI::RichTextLabel; @@ -27,8 +27,8 @@ RichTextLabel::RichTextLabel(const TQString& text, TQWidget* parent) : TQTextEdi init(); } -TQSize RichTextLabel::tqsizeHint() const { - return tqminimumSizeHint(); +TQSize RichTextLabel::sizeHint() const { + return minimumSizeHint(); } void RichTextLabel::init() { @@ -38,10 +38,10 @@ void RichTextLabel::init() { setFrameShape(TQFrame::NoFrame); viewport()->setMouseTracking(false); - setPaper(tqcolorGroup().background()); + setPaper(colorGroup().background()); - tqsetSizePolicy(TQSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Expanding)); - viewport()->tqsetSizePolicy(TQSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Expanding)); + setSizePolicy(TQSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Expanding)); + viewport()->setSizePolicy(TQSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Expanding)); } #include "richtextlabel.moc" diff --git a/src/gui/richtextlabel.h b/src/gui/richtextlabel.h index e8c4777..850f2d7 100644 --- a/src/gui/richtextlabel.h +++ b/src/gui/richtextlabel.h @@ -14,7 +14,7 @@ #ifndef TELLICO_GUI_RICHTEXTLABEL_H #define TELLICO_GUI_RICHTEXTLABEL_H -#include <tqtextedit.h> +#include <textedit.h> namespace Tellico { namespace GUI { @@ -30,7 +30,7 @@ public: RichTextLabel(TQWidget* parent); RichTextLabel(const TQString& text, TQWidget* parent); - virtual TQSize tqsizeHint() const; + virtual TQSize sizeHint() const; private: void init(); diff --git a/src/gui/stringmapdialog.cpp b/src/gui/stringmapdialog.cpp index fbd6f6a..62a12a3 100644 --- a/src/gui/stringmapdialog.cpp +++ b/src/gui/stringmapdialog.cpp @@ -19,7 +19,7 @@ #include <kbuttonbox.h> #include <kiconloader.h> -#include <tqlayout.h> +#include <layout.h> #include <tqheader.h> #include <tqhbox.h> #include <tqwhatsthis.h> @@ -55,9 +55,9 @@ StringMapDialog::StringMapDialog(const TQMap<TQString, TQString>& map_, TQWidget KButtonBox* bb = new KButtonBox(box); bb->addStretch(); TQPushButton* btn = bb->addButton(i18n("&Set"), TQT_TQOBJECT(this), TQT_SLOT(slotAdd())); - btn->setIconSet(BarIcon(TQString::tqfromLatin1("filenew"), KIcon::SizeSmall)); + btn->setIconSet(BarIcon(TQString::fromLatin1("filenew"), KIcon::SizeSmall)); btn = bb->addButton(i18n("&Delete"), TQT_TQOBJECT(this), TQT_SLOT(slotDelete())); - btn->setIconSet(BarIcon(TQString::tqfromLatin1("editdelete"), KIcon::SizeSmall)); + btn->setIconSet(BarIcon(TQString::fromLatin1("editdelete"), KIcon::SizeSmall)); l->addWidget(box); l->addStretch(1); diff --git a/src/gui/tablefieldwidget.cpp b/src/gui/tablefieldwidget.cpp index 449fbbb..81c9dba 100644 --- a/src/gui/tablefieldwidget.cpp +++ b/src/gui/tablefieldwidget.cpp @@ -34,7 +34,7 @@ TableFieldWidget::TableFieldWidget(Data::FieldPtr field_, TQWidget* parent_, con : FieldWidget(field_, parent_, name_), m_field(field_), m_row(-1), m_col(-1) { bool ok; - m_columns = Tellico::toUInt(field_->property(TQString::tqfromLatin1("columns")), &ok); + m_columns = Tellico::toUInt(field_->property(TQString::fromLatin1("columns")), &ok); if(!ok) { m_columns = 1; } else { @@ -77,17 +77,17 @@ TQString TableFieldWidget::text() const { for(int col = 0; col < m_table->numCols(); ++col) { str = m_table->text(row, col).simplifyWhiteSpace(); if(str.isEmpty()) { - cstack += TQString::tqfromLatin1("::"); + cstack += TQString::fromLatin1("::"); } else { - rowStr += cstack + str + TQString::tqfromLatin1("::"); + rowStr += cstack + str + TQString::fromLatin1("::"); cstack.truncate(0); } } if(rowStr.isEmpty()) { - rstack += TQString::tqfromLatin1("; "); + rstack += TQString::fromLatin1("; "); } else { rowStr.truncate(rowStr.length()-2); // remove last semi-colon and space - text += rstack + rowStr + TQString::tqfromLatin1("; "); + text += rstack + rowStr + TQString::fromLatin1("; "); rstack.truncate(0); } } @@ -123,7 +123,7 @@ void TableFieldWidget::setText(const TQString& text_) { int row; for(row = 0; row < static_cast<int>(list.count()); ++row) { for(int col = 0; col < m_table->numCols(); ++col) { - m_table->setText(row, col, list[row].section(TQString::tqfromLatin1("::"), col, col)); + m_table->setText(row, col, list[row].section(TQString::fromLatin1("::"), col, col)); } m_table->showRow(row); } @@ -182,7 +182,7 @@ void TableFieldWidget::slotRenameColumn() { name, &ok, this); if(ok && !newName.isEmpty()) { Data::FieldPtr newField = new Data::Field(*m_field); - newField->setProperty(TQString::tqfromLatin1("column%1").tqarg(m_col+1), newName); + newField->setProperty(TQString::fromLatin1("column%1").arg(m_col+1), newName); if(Kernel::self()->modifyField(newField)) { m_field = newField; labelColumns(m_field); @@ -201,9 +201,9 @@ bool TableFieldWidget::emptyRow(int row_) const { void TableFieldWidget::labelColumns(Data::FieldPtr field_) { for(int i = 0; i < m_columns; ++i) { - TQString s = field_->property(TQString::tqfromLatin1("column%1").tqarg(i+1)); + TQString s = field_->property(TQString::fromLatin1("column%1").arg(i+1)); if(s.isEmpty()) { - s = i18n("Column %1").tqarg(i+1); + s = i18n("Column %1").arg(i+1); } m_table->horizontalHeader()->setLabel(i, s); } @@ -211,7 +211,7 @@ void TableFieldWidget::labelColumns(Data::FieldPtr field_) { void TableFieldWidget::updateFieldHook(Data::FieldPtr, Data::FieldPtr newField_) { bool ok; - m_columns = Tellico::toUInt(newField_->property(TQString::tqfromLatin1("columns")), &ok); + m_columns = Tellico::toUInt(newField_->property(TQString::fromLatin1("columns")), &ok); if(!ok) { m_columns = 1; } else { @@ -238,7 +238,7 @@ bool TableFieldWidget::eventFilter(TQObject* obj_, TQEvent* ev_) { m_row = -1; m_col = col; KPopupMenu menu(this); - menu.insertItem(SmallIconSet(TQString::tqfromLatin1("edit")), i18n("Rename Column..."), + menu.insertItem(SmallIconSet(TQString::fromLatin1("edit")), i18n("Rename Column..."), this, TQT_SLOT(slotRenameColumn())); menu.exec(ev->globalPos()); return true; @@ -271,28 +271,28 @@ void TableFieldWidget::contextMenu(int row_, int col_, const TQPoint& p_) { int id; KPopupMenu menu(this); - menu.insertItem(SmallIconSet(TQString::tqfromLatin1("insrow")), i18n("Insert Row"), + menu.insertItem(SmallIconSet(TQString::fromLatin1("insrow")), i18n("Insert Row"), this, TQT_SLOT(slotInsertRow())); - menu.insertItem(SmallIconSet(TQString::tqfromLatin1("remrow")), i18n("Remove Row"), + menu.insertItem(SmallIconSet(TQString::fromLatin1("remrow")), i18n("Remove Row"), this, TQT_SLOT(slotRemoveRow())); - id = menu.insertItem(SmallIconSet(TQString::tqfromLatin1("1uparrow")), i18n("Move Row Up"), + id = menu.insertItem(SmallIconSet(TQString::fromLatin1("1uparrow")), i18n("Move Row Up"), this, TQT_SLOT(slotMoveRowUp())); if(m_row == 0) { menu.setItemEnabled(id, false); } - id = menu.insertItem(SmallIconSet(TQString::tqfromLatin1("1downarrow")), i18n("Move Row Down"), + id = menu.insertItem(SmallIconSet(TQString::fromLatin1("1downarrow")), i18n("Move Row Down"), this, TQT_SLOT(slotMoveRowDown())); if(m_row == m_table->numRows()-1) { menu.setItemEnabled(id, false); } menu.insertSeparator(); - id = menu.insertItem(SmallIconSet(TQString::tqfromLatin1("edit")), i18n("Rename Column..."), + id = menu.insertItem(SmallIconSet(TQString::fromLatin1("edit")), i18n("Rename Column..."), this, TQT_SLOT(slotRenameColumn())); if(m_col < 0 || m_col > m_columns-1) { menu.setItemEnabled(id, false); } menu.insertSeparator(); - menu.insertItem(SmallIconSet(TQString::tqfromLatin1("locationbar_erase")), i18n("Clear Table"), + menu.insertItem(SmallIconSet(TQString::fromLatin1("locationbar_erase")), i18n("Clear Table"), this, TQT_SLOT(clear())); menu.exec(p_); } diff --git a/src/gui/urlfieldwidget.cpp b/src/gui/urlfieldwidget.cpp index 0ecc37d..187f8bb 100644 --- a/src/gui/urlfieldwidget.cpp +++ b/src/gui/urlfieldwidget.cpp @@ -44,7 +44,7 @@ URLFieldWidget::URLFieldWidget(Data::FieldPtr field_, TQWidget* parent_, const c registerWidget(); // special case, remember if it's a relative url - m_isRelative = field_->property(TQString::tqfromLatin1("relative")) == Latin1Literal("true"); + m_isRelative = field_->property(TQString::fromLatin1("relative")) == Latin1Literal("true"); } URLFieldWidget::~URLFieldWidget() { @@ -80,7 +80,7 @@ void URLFieldWidget::clear() { } void URLFieldWidget::updateFieldHook(Data::FieldPtr, Data::FieldPtr newField_) { - m_isRelative = newField_->property(TQString::tqfromLatin1("relative")) == Latin1Literal("true"); + m_isRelative = newField_->property(TQString::fromLatin1("relative")) == Latin1Literal("true"); } void URLFieldWidget::slotOpenURL(const TQString& url_) { diff --git a/src/image.cpp b/src/image.cpp index 88c134f..8cb6fa4 100644 --- a/src/image.cpp +++ b/src/image.cpp @@ -103,7 +103,7 @@ TQByteArray Image::byteArray(const TQImage& img_, const TQCString& outputFormat_ } TQString Image::idClean(const TQString& id_) { - static const TQRegExp rx('[' + TQRegExp::escape(TQString::tqfromLatin1("/@<>#\"&%?={}|^~[]'`\\:+")) + ']'); + static const TQRegExp rx('[' + TQRegExp::escape(TQString::fromLatin1("/@<>#\"&%?={}|^~[]'`\\:+")) + ']'); TQString clean = id_; return clean.remove(rx); } @@ -116,7 +116,7 @@ void Image::calculateID() { // the id will eventually be used as a filename if(!isNull()) { KMD5 md5(byteArray()); - m_id = TQString::tqfromLatin1(md5.hexDigest()) + TQString::tqfromLatin1(".") + TQString::tqfromLatin1(m_format).lower(); + m_id = TQString::fromLatin1(md5.hexDigest()) + TQString::fromLatin1(".") + TQString::fromLatin1(m_format).lower(); m_id = idClean(m_id); } } diff --git a/src/imagefactory.cpp b/src/imagefactory.cpp index 12b116d..c63fc18 100644 --- a/src/imagefactory.cpp +++ b/src/imagefactory.cpp @@ -67,7 +67,7 @@ TQString ImageFactory::tempDir() { } TQString ImageFactory::dataDir() { - static const TQString dataDir = Tellico::saveLocation(TQString::tqfromLatin1("data/")); + static const TQString dataDir = Tellico::saveLocation(TQString::fromLatin1("data/")); return dataDir; } @@ -510,12 +510,12 @@ void ImageFactory::createStyleImages(const StyleOptions& opt_) { const TQColor& bgc1 = Tellico::blendColors(baseColor, highColor, 30); const TQColor& bgc2 = Tellico::blendColors(baseColor, highColor, 50); - const TQString bgname = TQString::tqfromLatin1("gradient_bg.png"); + const TQString bgname = TQString::fromLatin1("gradient_bg.png"); TQImage bgImage = KImageEffect::gradient(TQSize(400, 1), bgc1, baseColor, KImageEffect::PipeCrossGradient); bgImage = KImageEffect::rotate(bgImage, KImageEffect::Rotate90); - const TQString hdrname = TQString::tqfromLatin1("gradient_header.png"); + const TQString hdrname = TQString::fromLatin1("gradient_header.png"); TQImage hdrImage = KImageEffect::unbalancedGradient(TQSize(1, 10), highColor, bgc2, KImageEffect::VerticalGradient, 100, -100); @@ -523,12 +523,12 @@ void ImageFactory::createStyleImages(const StyleOptions& opt_) { // write the style images both to the tmp dir and the data dir // doesn't really hurt and lets the user switch back and forth ImageFactory::removeImage(bgname, true /*delete */); - ImageFactory::addImageImpl(Data::Image::byteArray(bgImage, "PNG"), TQString::tqfromLatin1("PNG"), bgname); + ImageFactory::addImageImpl(Data::Image::byteArray(bgImage, "PNG"), TQString::fromLatin1("PNG"), bgname); ImageFactory::writeCachedImage(bgname, DataDir, true /*force*/); ImageFactory::writeCachedImage(bgname, TempDir, true /*force*/); ImageFactory::removeImage(hdrname, true /*delete */); - ImageFactory::addImageImpl(Data::Image::byteArray(hdrImage, "PNG"), TQString::tqfromLatin1("PNG"), hdrname); + ImageFactory::addImageImpl(Data::Image::byteArray(hdrImage, "PNG"), TQString::fromLatin1("PNG"), hdrname); ImageFactory::writeCachedImage(hdrname, DataDir, true /*force*/); ImageFactory::writeCachedImage(hdrname, TempDir, true /*force*/); } else { @@ -601,8 +601,8 @@ void ImageFactory::setLocalDirectory(const KURL& url_) { } else { s_localDir = url_.directory(false); // could have already been set once - if(!url_.fileName().contains(TQString::tqfromLatin1("_files"))) { - s_localDir += url_.fileName().section('.', 0, 0) + TQString::tqfromLatin1("_files/"); + if(!url_.fileName().contains(TQString::fromLatin1("_files"))) { + s_localDir += url_.fileName().section('.', 0, 0) + TQString::fromLatin1("_files/"); } myLog() << "ImageFactory::setLocalDirectory() - local dir = " << s_localDir << endl; } diff --git a/src/importdialog.cpp b/src/importdialog.cpp index 86f6c27..192b710 100644 --- a/src/importdialog.cpp +++ b/src/importdialog.cpp @@ -38,7 +38,7 @@ #include <klocale.h> #include <kstandarddirs.h> -#include <tqlayout.h> +#include <layout.h> #include <tqbuttongroup.h> #include <tqradiobutton.h> #include <tqcheckbox.h> @@ -96,7 +96,7 @@ ImportDialog::ImportDialog(Import::Format format_, const KURL::List& urls_, TQWi setButtonOK(ok); // want to grab default button action, too - // since the importer might do something with widgets, don't just call it, do it after tqlayout is done + // since the importer might do something with widgets, don't just call it, do it after layout is done TQTimer::singleShot(0, this, TQT_SLOT(slotUpdateAction())); } @@ -160,7 +160,7 @@ Tellico::Import::Importer* ImportDialog::importer(Import::Format format_, const CHECK_SIZE; importer = new Import::XSLTImporter(firstURL); { - TQString xsltFile = locate("appdata", TQString::tqfromLatin1("mods2tellico.xsl")); + TQString xsltFile = locate("appdata", TQString::fromLatin1("mods2tellico.xsl")); if(!xsltFile.isEmpty()) { KURL u; u.setPath(xsltFile); @@ -318,18 +318,18 @@ Tellico::Import::FormatMap ImportDialog::formatMap() { // I decided they were likely to be the same in any language // transliteration is unlikely Import::FormatMap map; - map[Import::TellicoXML] = TQString::tqfromLatin1("Tellico"); - map[Import::Bibtex] = TQString::tqfromLatin1("Bibtex"); - map[Import::Bibtexml] = TQString::tqfromLatin1("Bibtexml"); -// map[Import::CSV] = TQString::tqfromLatin1("CSV"); - map[Import::MODS] = TQString::tqfromLatin1("MODS"); - map[Import::RIS] = TQString::tqfromLatin1("RIS"); - map[Import::GCfilms] = TQString::tqfromLatin1("GCstar"); - map[Import::AMC] = TQString::tqfromLatin1("AMC"); - map[Import::Griffith] = TQString::tqfromLatin1("Griffith"); - map[Import::PDF] = TQString::tqfromLatin1("PDF"); - map[Import::Referencer] = TQString::tqfromLatin1("Referencer"); - map[Import::Delicious ] = TQString::tqfromLatin1("Delicious Library"); + map[Import::TellicoXML] = TQString::fromLatin1("Tellico"); + map[Import::Bibtex] = TQString::fromLatin1("Bibtex"); + map[Import::Bibtexml] = TQString::fromLatin1("Bibtexml"); +// map[Import::CSV] = TQString::fromLatin1("CSV"); + map[Import::MODS] = TQString::fromLatin1("MODS"); + map[Import::RIS] = TQString::fromLatin1("RIS"); + map[Import::GCfilms] = TQString::fromLatin1("GCstar"); + map[Import::AMC] = TQString::fromLatin1("AMC"); + map[Import::Griffith] = TQString::fromLatin1("Griffith"); + map[Import::PDF] = TQString::fromLatin1("PDF"); + map[Import::Referencer] = TQString::fromLatin1("Referencer"); + map[Import::Delicious ] = TQString::fromLatin1("Delicious Library"); return map; } @@ -343,11 +343,11 @@ TQString ImportDialog::startDir(Import::Format format_) { if(format_ == Import::GCfilms) { TQDir dir = TQDir::home(); // able to cd if exists and readable - if(dir.cd(TQString::tqfromLatin1(".local/share/gcfilms/"))) { + if(dir.cd(TQString::fromLatin1(".local/share/gcfilms/"))) { return dir.absPath(); } } - return TQString::tqfromLatin1(":import"); + return TQString::fromLatin1(":import"); } void ImportDialog::slotOk() { diff --git a/src/isbnvalidator.cpp b/src/isbnvalidator.cpp index 6f33c67..4832cdd 100644 --- a/src/isbnvalidator.cpp +++ b/src/isbnvalidator.cpp @@ -18,7 +18,7 @@ using Tellico::ISBNValidator; //static TQString ISBNValidator::isbn10(TQString isbn13) { - if(!isbn13.startsWith(TQString::tqfromLatin1("978"))) { + if(!isbn13.startsWith(TQString::fromLatin1("978"))) { myDebug() << "ISBNValidator::isbn10() - can't convert, must start with 978: " << isbn13 << endl; return isbn13; } @@ -34,14 +34,14 @@ TQString ISBNValidator::isbn10(TQString isbn13) { TQString ISBNValidator::isbn13(TQString isbn10) { isbn10.remove('-'); - if(isbn10.startsWith(TQString::tqfromLatin1("978")) || - isbn10.startsWith(TQString::tqfromLatin1("979"))) { + if(isbn10.startsWith(TQString::fromLatin1("978")) || + isbn10.startsWith(TQString::fromLatin1("979"))) { return isbn10; } // remove checksum isbn10.truncate(isbn10.length()-1); // begins with 978 - isbn10.prepend(TQString::tqfromLatin1("978")); + isbn10.prepend(TQString::fromLatin1("978")); // add new checksum isbn10 += checkSum13(isbn10); staticFixup(isbn10); @@ -49,7 +49,7 @@ TQString ISBNValidator::isbn13(TQString isbn10) { } TQString ISBNValidator::cleanValue(TQString isbn) { - isbn.remove(TQRegExp(TQString::tqfromLatin1("[^xX0123456789]"))); + isbn.remove(TQRegExp(TQString::fromLatin1("[^xX0123456789]"))); return isbn; } @@ -58,8 +58,8 @@ ISBNValidator::ISBNValidator(TQObject* parent_, const char* name_/*=0*/) } TQValidator::State ISBNValidator::validate(TQString& input_, int& pos_) const { - if(input_.startsWith(TQString::tqfromLatin1("978")) || - input_.startsWith(TQString::tqfromLatin1("979"))) { + if(input_.startsWith(TQString::fromLatin1("978")) || + input_.startsWith(TQString::fromLatin1("979"))) { return validate13(input_, pos_); } else { return validate10(input_, pos_); @@ -71,9 +71,9 @@ void ISBNValidator::fixup(TQString& input_) const { } void ISBNValidator::staticFixup(TQString& input_) { - if((input_.startsWith(TQString::tqfromLatin1("978")) - || input_.startsWith(TQString::tqfromLatin1("979"))) - && input_.contains(TQRegExp(TQString::tqfromLatin1("\\d"))) > 10) { + if((input_.startsWith(TQString::fromLatin1("978")) + || input_.startsWith(TQString::fromLatin1("979"))) + && input_.contains(TQRegExp(TQString::fromLatin1("\\d"))) > 10) { return fixup13(input_); } return fixup10(input_); @@ -84,7 +84,7 @@ TQValidator::State ISBNValidator::validate10(TQString& input_, int& pos_) const // A perfect ISBN has 9 digits plus either an 'X' or another digit // A perfect ISBN may have 2 or 3 hyphens // The final digit or 'X' is the correct check sum - static const TQRegExp isbn(TQString::tqfromLatin1("(\\d-?){9,11}-[\\dX]")); + static const TQRegExp isbn(TQString::fromLatin1("(\\d-?){9,11}-[\\dX]")); uint len = input_.length(); /* // Don't do this since the hyphens may be in the wrong place, can't put that in a regexp @@ -113,7 +113,7 @@ TQValidator::State ISBNValidator::validate10(TQString& input_, int& pos_) const // fix the case where the user attempts to delete the checksum; the // solution is to delete the last digit as well - static const TQRegExp digit(TQString::tqfromLatin1("\\d")); + static const TQRegExp digit(TQString::fromLatin1("\\d")); if(atEnd && input_.contains(digit) == 9 && input_[len-1] == '-') { input_.truncate(len-2); pos_ -= 2; @@ -139,7 +139,7 @@ TQValidator::State ISBNValidator::validate13(TQString& input_, int& pos_) const // A perfect ISBN13 has 13 digits // A perfect ISBN13 may have 3 or 4 hyphens // The final digit is the correct check sum - static const TQRegExp isbn(TQString::tqfromLatin1("(\\d-?){13,17}")); + static const TQRegExp isbn(TQString::fromLatin1("(\\d-?){13,17}")); uint len = input_.length(); const uint countX = input_.contains('X', false); @@ -166,7 +166,7 @@ TQValidator::State ISBNValidator::validate13(TQString& input_, int& pos_) const // fix the case where the user attempts to delete the checksum; the // solution is to delete the last digit as well - static const TQRegExp digit(TQString::tqfromLatin1("\\d")); + static const TQRegExp digit(TQString::fromLatin1("\\d")); const uint countN = input_.contains(digit); if(atEnd && (countN == 12 || countN == 9) && input_[len-1] == '-') { input_.truncate(len-2); @@ -199,10 +199,10 @@ void ISBNValidator::fixup10(TQString& input_) { } //replace "x" with "X" - input_.replace('x', TQString::tqfromLatin1("X")); + input_.replace('x', TQString::fromLatin1("X")); // remove invalid chars - static const TQRegExp badChars(TQString::tqfromLatin1("[^\\d-X]")); + static const TQRegExp badChars(TQString::fromLatin1("[^\\d-X]")); input_.remove(badChars); // special case for EAN values that start with 978 or 979. That's the case @@ -214,8 +214,8 @@ void ISBNValidator::fixup10(TQString& input_) { // I consider the likelihood that someone wants to input an EAN to be higher than someone // using a Nigerian ISBN and not noticing that the checksum gets added automatically. if(input_.length() > 12 - && (input_.startsWith(TQString::tqfromLatin1("978")) - || input_.startsWith(TQString::tqfromLatin1("979")))) { + && (input_.startsWith(TQString::fromLatin1("978")) + || input_.startsWith(TQString::fromLatin1("979")))) { // Strip the first 4 characters (the invalid publisher) input_ = input_.right(input_.length() - 3); } @@ -251,8 +251,8 @@ void ISBNValidator::fixup10(TQString& input_) { // If we can find it, add the checksum // but only if not started with 978 or 979 if(input_.length() > 8 - && !input_.startsWith(TQString::tqfromLatin1("978")) - && !input_.startsWith(TQString::tqfromLatin1("979"))) { + && !input_.startsWith(TQString::fromLatin1("978")) + && !input_.startsWith(TQString::fromLatin1("979"))) { input_[9] = checkSum10(input_); } @@ -293,7 +293,7 @@ void ISBNValidator::fixup13(TQString& input_) { } // remove invalid chars - static const TQRegExp badChars(TQString::tqfromLatin1("[^\\d-]")); + static const TQRegExp badChars(TQString::fromLatin1("[^\\d-]")); input_.remove(badChars); // hyphen placement for some languages publishers is well-defined diff --git a/src/latin1literal.h b/src/latin1literal.h index 72bc880..1cebfe7 100644 --- a/src/latin1literal.h +++ b/src/latin1literal.h @@ -53,7 +53,7 @@ public: inline bool operator==(const TQString& s1, const Tellico::Latin1LiteralInternal& s2) { - const TQChar* uc = s1.tqunicode(); + const TQChar* uc = s1.unicode(); const char* c = s2.str; if(!c || !uc) { return (!c && !uc); @@ -65,7 +65,7 @@ bool operator==(const TQString& s1, const Tellico::Latin1LiteralInternal& s2) { } for(size_t i = 0; i < l; ++i, ++uc, ++c) { - if(uc->tqunicode() != static_cast<uchar>(*c)) { + if(uc->unicode() != static_cast<uchar>(*c)) { return false; } } diff --git a/src/lccnvalidator.cpp b/src/lccnvalidator.cpp index bde2427..cf0e850 100644 --- a/src/lccnvalidator.cpp +++ b/src/lccnvalidator.cpp @@ -17,7 +17,7 @@ using Tellico::LCCNValidator; LCCNValidator::LCCNValidator(TQObject* parent_) : TQRegExpValidator(parent_) { - TQRegExp rx(TQString::tqfromLatin1("[a-z ]{0,3}" + TQRegExp rx(TQString::fromLatin1("[a-z ]{0,3}" "(" "\\d{2}-?\\d{1,6}" "|" @@ -54,7 +54,7 @@ TQString LCCNValidator::formalize(const TQString& value_) { // or from any year after 2100. Reasonable, right? // so if the string starts with '20' we take the first 4 digits as the year // otherwise the first 2 - if(afterAlpha.startsWith(TQString::tqfromLatin1("20"))) { + if(afterAlpha.startsWith(TQString::fromLatin1("20"))) { year = afterAlpha.left(4); serial = afterAlpha.mid(4); } else { diff --git a/src/listviewcomparison.cpp b/src/listviewcomparison.cpp index e15b1d8..b78de94 100644 --- a/src/listviewcomparison.cpp +++ b/src/listviewcomparison.cpp @@ -51,7 +51,7 @@ Tellico::ListViewComparison* Tellico::ListViewComparison::create(Data::ConstFiel } else if(field_->formatFlag() == Data::Field::FormatTitle) { // Dependent could be title, so put this test after return new TitleComparison(field_); - } else if(field_->property(TQString::tqfromLatin1("lcc")) == Latin1Literal("true") || + } else if(field_->property(TQString::fromLatin1("lcc")) == Latin1Literal("true") || (field_->name() == Latin1Literal("lcc") && Data::Document::self()->collection() && (Data::Document::self()->collection()->type() == Data::Collection::Book || @@ -119,15 +119,15 @@ int Tellico::NumberComparison::compare(const TQString& str1_, const TQString& st // http://www.mcgees.org/2001/08/08/sort-by-library-of-congress-call-number-in-perl/ Tellico::LCCComparison::LCCComparison(Data::ConstFieldPtr field) : StringComparison(field), - m_regexp(TQString::tqfromLatin1("^([A-Z]+)(\\d+(?:\\.\\d+)?)\\.?([A-Z]*)(\\d*)\\.?([A-Z]*)(\\d*)(?: (\\d\\d\\d\\d))?")) { + m_regexp(TQString::fromLatin1("^([A-Z]+)(\\d+(?:\\.\\d+)?)\\.?([A-Z]*)(\\d*)\\.?([A-Z]*)(\\d*)(?: (\\d\\d\\d\\d))?")) { } int Tellico::LCCComparison::compare(const TQString& str1_, const TQString& str2_) { // myDebug() << "LCCComparison::compare() - " << str1_ << " to " << str2_ << endl; int pos1 = m_regexp.search(str1_); - const TQStringList cap1 = m_regexp.tqcapturedTexts(); + const TQStringList cap1 = m_regexp.capturedTexts(); int pos2 = m_regexp.search(str2_); - const TQStringList cap2 = m_regexp.tqcapturedTexts(); + const TQStringList cap2 = m_regexp.capturedTexts(); if(pos1 > -1 && pos2 > -1) { int res = compareLCC(cap1, cap2); // myLog() << "...result = " << res << endl; @@ -142,11 +142,11 @@ int Tellico::LCCComparison::compareLCC(const TQStringList& cap1, const TQStringL return (res = cap1[1].compare(cap2[1])) != 0 ? res : (res = compareFloat(cap1[2], cap2[2])) != 0 ? res : (res = cap1[3].compare(cap2[3])) != 0 ? res : - (res = compareFloat(TQString::tqfromLatin1("0.") + cap1[4], - TQString::tqfromLatin1("0.") + cap2[4])) != 0 ? res : + (res = compareFloat(TQString::fromLatin1("0.") + cap1[4], + TQString::fromLatin1("0.") + cap2[4])) != 0 ? res : (res = cap1[5].compare(cap2[5])) != 0 ? res : - (res = compareFloat(TQString::tqfromLatin1("0.") + cap1[6], - TQString::tqfromLatin1("0.") + cap2[6])) != 0 ? res : + (res = compareFloat(TQString::fromLatin1("0.") + cap1[6], + TQString::fromLatin1("0.") + cap2[6])) != 0 ? res : (res = compareFloat(cap1[7], cap2[7])) != 0 ? res : 0; } @@ -241,9 +241,9 @@ int Tellico::ISODateComparison::compare(const TQString& str1, const TQString& st // and accounting for "current year - 1 - 1" default scheme TQStringList dlist1 = TQStringList::split('-', str1, true); bool ok = true; - int y1 = dlist1.count() > 0 ? dlist1[0].toInt(&ok) : TQDate::tqcurrentDate().year(); + int y1 = dlist1.count() > 0 ? dlist1[0].toInt(&ok) : TQDate::currentDate().year(); if(!ok) { - y1 = TQDate::tqcurrentDate().year(); + y1 = TQDate::currentDate().year(); } int m1 = dlist1.count() > 1 ? dlist1[1].toInt(&ok) : 1; if(!ok) { @@ -256,9 +256,9 @@ int Tellico::ISODateComparison::compare(const TQString& str1, const TQString& st TQDate date1(y1, m1, d1); TQStringList dlist2 = TQStringList::split('-', str2, true); - int y2 = dlist2.count() > 0 ? dlist2[0].toInt(&ok) : TQDate::tqcurrentDate().year(); + int y2 = dlist2.count() > 0 ? dlist2[0].toInt(&ok) : TQDate::currentDate().year(); if(!ok) { - y2 = TQDate::tqcurrentDate().year(); + y2 = TQDate::currentDate().year(); } int m2 = dlist2.count() > 1 ? dlist2[1].toInt(&ok) : 1; if(!ok) { diff --git a/src/loandialog.cpp b/src/loandialog.cpp index ba7a16e..5a74a14 100644 --- a/src/loandialog.cpp +++ b/src/loandialog.cpp @@ -28,7 +28,7 @@ #include <kiconloader.h> #include <kabc/stdaddressbook.h> -#include <tqlayout.h> +#include <layout.h> #include <tqhbox.h> #include <tqlabel.h> #include <tqcheckbox.h> @@ -69,23 +69,23 @@ void LoanDialog::init() { TQHBox* hbox = new TQHBox(mainWidget); hbox->setSpacing(KDialog::spacingHint()); TQLabel* pixLabel = new TQLabel(hbox); - pixLabel->setPixmap(DesktopIcon(TQString::tqfromLatin1("tellico"), 64)); - pixLabel->tqsetAlignment(TQt::AlignAuto | TQt::AlignTop); + pixLabel->setPixmap(DesktopIcon(TQString::fromLatin1("tellico"), 64)); + pixLabel->setAlignment(TQt::AlignAuto | TQt::AlignTop); hbox->setStretchFactor(pixLabel, 0); - TQString entryString = TQString::tqfromLatin1("<qt><p>"); + TQString entryString = TQString::fromLatin1("<qt><p>"); if(m_mode == Add) { entryString += i18n("The following items are being checked out:"); - entryString += TQString::tqfromLatin1("</p><ol>"); + entryString += TQString::fromLatin1("</p><ol>"); for(Data::EntryVec::ConstIterator entry = m_entries.constBegin(); entry != m_entries.constEnd(); ++entry) { - entryString += TQString::tqfromLatin1("<li>") + entry->title() + TQString::tqfromLatin1("</li>"); + entryString += TQString::fromLatin1("<li>") + entry->title() + TQString::fromLatin1("</li>"); } } else { entryString += i18n("The following item is on-loan:"); - entryString += TQString::tqfromLatin1("</p><ol>"); - entryString += TQString::tqfromLatin1("<li>") + m_loan->entry()->title() + TQString::tqfromLatin1("</li>"); + entryString += TQString::fromLatin1("</p><ol>"); + entryString += TQString::fromLatin1("<li>") + m_loan->entry()->title() + TQString::fromLatin1("</li>"); } - entryString += TQString::tqfromLatin1("</ol></qt>"); + entryString += TQString::fromLatin1("</ol></qt>"); GUI::RichTextLabel* entryLabel = new GUI::RichTextLabel(entryString, hbox); hbox->setStretchFactor(entryLabel, 1); @@ -102,7 +102,7 @@ void LoanDialog::init() { connect(m_borrowerEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotBorrowerNameChanged(const TQString&))); actionButton(Ok)->setEnabled(false); // disable until a name is entered - KPushButton* pb = new KPushButton(SmallIconSet(TQString::tqfromLatin1("kaddressbook")), TQString(), hbox); + KPushButton* pb = new KPushButton(SmallIconSet(TQString::fromLatin1("kaddressbook")), TQString(), hbox); connect(pb, TQT_SIGNAL(clicked()), TQT_SLOT(slotGetBorrower())); TQString whats = i18n("Enter the name of the person borrowing the items from you. " "Clicking the button allows you to select from your address book."); @@ -117,7 +117,7 @@ void LoanDialog::init() { l = new TQLabel(i18n("&Loan date:"), mainWidget); topLayout->addWidget(l, 2, 0); m_loanDate = new GUI::DateWidget(mainWidget); - m_loanDate->setDate(TQDate::tqcurrentDate()); + m_loanDate->setDate(TQDate::currentDate()); l->setBuddy(m_loanDate); topLayout->addWidget(m_loanDate, 2, 1); whats = i18n("The check-out date is the date that you lent the items. By default, " @@ -158,7 +158,7 @@ void LoanDialog::init() { "to your active calendar, which can be viewed using KOrganizer. " "The box is only active if you set a due date.")); - resize(configDialogSize(TQString::tqfromLatin1("Loan Dialog Options"))); + resize(configDialogSize(TQString::fromLatin1("Loan Dialog Options"))); KABC::AddressBook* abook = KABC::StdAddressBook::self(true); connect(abook, TQT_SIGNAL(addressBookChanged(AddressBook*)), @@ -169,7 +169,7 @@ void LoanDialog::init() { } LoanDialog::~LoanDialog() { - saveDialogSize(TQString::tqfromLatin1("Loan Dialog Options")); + saveDialogSize(TQString::fromLatin1("Loan Dialog Options")); } void LoanDialog::slotBorrowerNameChanged(const TQString& str_) { diff --git a/src/loanview.cpp b/src/loanview.cpp index b2e4347..7f7d36d 100644 --- a/src/loanview.cpp +++ b/src/loanview.cpp @@ -70,9 +70,9 @@ void LoanView::contextMenuRequested(TQListViewItem* item_, const TQPoint& point_ GUI::ListViewItem* item = static_cast<GUI::ListViewItem*>(item_); if(item->isLoanItem()) { KPopupMenu menu(this); - menu.insertItem(SmallIconSet(TQString::tqfromLatin1("2downarrow")), + menu.insertItem(SmallIconSet(TQString::fromLatin1("2downarrow")), i18n("Check-in"), this, TQT_SLOT(slotCheckIn())); - menu.insertItem(SmallIconSet(TQString::tqfromLatin1("2downarrow")), + menu.insertItem(SmallIconSet(TQString::fromLatin1("2downarrow")), i18n("Modify Loan..."), this, TQT_SLOT(slotModifyLoan())); menu.exec(point_); } @@ -101,7 +101,7 @@ void LoanView::addCollection(Data::CollPtr coll_) { for(Data::BorrowerVec::Iterator it = borrowers.begin(); it != borrowers.end(); ++it) { addBorrower(it); } - Data::FieldPtr f = coll_->fieldByName(TQString::tqfromLatin1("title")); + Data::FieldPtr f = coll_->fieldByName(TQString::fromLatin1("title")); if(f) { setComparison(0, ListViewComparison::create(f)); } @@ -225,7 +225,7 @@ void LoanView::resetComparisons() { if(!coll) { return; } - Data::FieldPtr f = coll->fieldByName(TQString::tqfromLatin1("title")); + Data::FieldPtr f = coll->fieldByName(TQString::fromLatin1("title")); if(f) { setComparison(0, ListViewComparison::create(f)); } diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 377d9d2..6cd1df5 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -87,7 +87,7 @@ // the null string and bool are dummy arguments #define MIME_ICON(s) \ - KMimeType::mimeType(TQString::tqfromLatin1(s))->icon(TQString(), false) + KMimeType::mimeType(TQString::fromLatin1(s))->icon(TQString(), false) namespace { static const int MAIN_WINDOW_MIN_WIDTH = 600; @@ -126,7 +126,7 @@ MainWindow::MainWindow(TQWidget* parent_/*=0*/, const char* name_/*=0*/) : KMain // has to be after controller init Kernel::init(this); // the only time this is ever called! - setIcon(DesktopIcon(TQString::tqfromLatin1("tellico"))); + setIcon(DesktopIcon(TQString::fromLatin1("tellico"))); // initialize the status bar and progress bar initStatusBar(); @@ -187,14 +187,14 @@ void MainWindow::initActions() { KActionMenu* fileNewMenu = new KActionMenu(actionCollection(), "file_new_collection"); fileNewMenu->setText(i18n("New")); -// fileNewMenu->setIconSet(BarIconSet(TQString::tqfromLatin1("filenew"))); // doesn't work - fileNewMenu->setIconSet(BarIcon(TQString::tqfromLatin1("filenew"))); +// fileNewMenu->setIconSet(BarIconSet(TQString::fromLatin1("filenew"))); // doesn't work + fileNewMenu->setIconSet(BarIcon(TQString::fromLatin1("filenew"))); fileNewMenu->setToolTip(i18n("Create a new collection")); fileNewMenu->setDelayed(false); KAction* action = new KAction(actionCollection(), "new_book_collection"); action->setText(i18n("New &Book Collection")); - action->setIconSet(UserIconSet(TQString::tqfromLatin1("book"))); + action->setIconSet(UserIconSet(TQString::fromLatin1("book"))); action->setToolTip(i18n("Create a new book collection")); fileNewMenu->insert(action); connect(action, TQT_SIGNAL(activated()), collectionMapper, TQT_SLOT(map())); @@ -202,7 +202,7 @@ void MainWindow::initActions() { action = new KAction(actionCollection(), "new_bibtex_collection"); action->setText(i18n("New B&ibliography")); - action->setIconSet(UserIconSet(TQString::tqfromLatin1("bibtex"))); + action->setIconSet(UserIconSet(TQString::fromLatin1("bibtex"))); action->setToolTip(i18n("Create a new bibtex bibliography")); fileNewMenu->insert(action); connect(action, TQT_SIGNAL(activated()), collectionMapper, TQT_SLOT(map())); @@ -210,7 +210,7 @@ void MainWindow::initActions() { action = new KAction(actionCollection(), "new_comic_book_collection"); action->setText(i18n("New &Comic Book Collection")); - action->setIconSet(UserIconSet(TQString::tqfromLatin1("comic"))); + action->setIconSet(UserIconSet(TQString::fromLatin1("comic"))); action->setToolTip(i18n("Create a new comic book collection")); fileNewMenu->insert(action); connect(action, TQT_SIGNAL(activated()), collectionMapper, TQT_SLOT(map())); @@ -218,7 +218,7 @@ void MainWindow::initActions() { action = new KAction(actionCollection(), "new_video_collection"); action->setText(i18n("New &Video Collection")); - action->setIconSet(UserIconSet(TQString::tqfromLatin1("video"))); + action->setIconSet(UserIconSet(TQString::fromLatin1("video"))); action->setToolTip(i18n("Create a new video collection")); fileNewMenu->insert(action); connect(action, TQT_SIGNAL(activated()), collectionMapper, TQT_SLOT(map())); @@ -226,7 +226,7 @@ void MainWindow::initActions() { action = new KAction(actionCollection(), "new_music_collection"); action->setText(i18n("New &Music Collection")); - action->setIconSet(UserIconSet(TQString::tqfromLatin1("album"))); + action->setIconSet(UserIconSet(TQString::fromLatin1("album"))); action->setToolTip(i18n("Create a new music collection")); fileNewMenu->insert(action); connect(action, TQT_SIGNAL(activated()), collectionMapper, TQT_SLOT(map())); @@ -234,7 +234,7 @@ void MainWindow::initActions() { action = new KAction(actionCollection(), "new_coin_collection"); action->setText(i18n("New C&oin Collection")); - action->setIconSet(UserIconSet(TQString::tqfromLatin1("coin"))); + action->setIconSet(UserIconSet(TQString::fromLatin1("coin"))); action->setToolTip(i18n("Create a new coin collection")); fileNewMenu->insert(action); connect(action, TQT_SIGNAL(activated()), collectionMapper, TQT_SLOT(map())); @@ -242,7 +242,7 @@ void MainWindow::initActions() { action = new KAction(actionCollection(), "new_stamp_collection"); action->setText(i18n("New &Stamp Collection")); - action->setIconSet(UserIconSet(TQString::tqfromLatin1("stamp"))); + action->setIconSet(UserIconSet(TQString::fromLatin1("stamp"))); action->setToolTip(i18n("Create a new stamp collection")); fileNewMenu->insert(action); connect(action, TQT_SIGNAL(activated()), collectionMapper, TQT_SLOT(map())); @@ -250,7 +250,7 @@ void MainWindow::initActions() { action = new KAction(actionCollection(), "new_card_collection"); action->setText(i18n("New C&ard Collection")); - action->setIconSet(UserIconSet(TQString::tqfromLatin1("card"))); + action->setIconSet(UserIconSet(TQString::fromLatin1("card"))); action->setToolTip(i18n("Create a new trading card collection")); fileNewMenu->insert(action); connect(action, TQT_SIGNAL(activated()), collectionMapper, TQT_SLOT(map())); @@ -258,7 +258,7 @@ void MainWindow::initActions() { action = new KAction(actionCollection(), "new_wine_collection"); action->setText(i18n("New &Wine Collection")); - action->setIconSet(UserIconSet(TQString::tqfromLatin1("wine"))); + action->setIconSet(UserIconSet(TQString::fromLatin1("wine"))); action->setToolTip(i18n("Create a new wine collection")); fileNewMenu->insert(action); connect(action, TQT_SIGNAL(activated()), collectionMapper, TQT_SLOT(map())); @@ -266,7 +266,7 @@ void MainWindow::initActions() { action = new KAction(actionCollection(), "new_game_collection"); action->setText(i18n("New &Game Collection")); - action->setIconSet(UserIconSet(TQString::tqfromLatin1("game"))); + action->setIconSet(UserIconSet(TQString::fromLatin1("game"))); action->setToolTip(i18n("Create a new game collection")); fileNewMenu->insert(action); connect(action, TQT_SIGNAL(activated()), collectionMapper, TQT_SLOT(map())); @@ -274,7 +274,7 @@ void MainWindow::initActions() { collectionMapper->setMapping(action, Data::Collection::Game); action = new KAction(actionCollection(), "new_boardgame_collection"); action->setText(i18n("New Boa&rd Game Collection")); - action->setIconSet(UserIconSet(TQString::tqfromLatin1("boardgame"))); + action->setIconSet(UserIconSet(TQString::fromLatin1("boardgame"))); action->setToolTip(i18n("Create a new board game collection")); fileNewMenu->insert(action); connect(action, TQT_SIGNAL(activated()), collectionMapper, TQT_SLOT(map())); @@ -282,7 +282,7 @@ void MainWindow::initActions() { action = new KAction(actionCollection(), "new_file_catalog"); action->setText(i18n("New &File Catalog")); - action->setIconSet(UserIconSet(TQString::tqfromLatin1("file"))); + action->setIconSet(UserIconSet(TQString::fromLatin1("file"))); action->setToolTip(i18n("Create a new file catalog")); fileNewMenu->insert(action); connect(action, TQT_SIGNAL(activated()), collectionMapper, TQT_SLOT(map())); @@ -290,7 +290,7 @@ void MainWindow::initActions() { action = new KAction(actionCollection(), "new_custom_collection"); action->setText(i18n("New C&ustom Collection")); - action->setIconSet(UserIconSet(TQString::tqfromLatin1("filenew"))); + action->setIconSet(UserIconSet(TQString::fromLatin1("filenew"))); action->setToolTip(i18n("Create a new custom collection")); fileNewMenu->insert(action); connect(action, TQT_SIGNAL(activated()), collectionMapper, TQT_SLOT(map())); @@ -320,14 +320,14 @@ void MainWindow::initActions() { KActionMenu* importMenu = new KActionMenu(actionCollection(), "file_import"); importMenu->setText(i18n("&Import")); - importMenu->setIconSet(BarIconSet(TQString::tqfromLatin1("fileimport"))); + importMenu->setIconSet(BarIconSet(TQString::fromLatin1("fileimport"))); importMenu->setToolTip(i18n("Import collection data from other formats")); importMenu->setDelayed(false); action = new KAction(actionCollection(), "file_import_tellico"); action->setText(i18n("Import Tellico Data...")); action->setToolTip(i18n("Import another Tellico data file")); - action->setIcon(TQString::tqfromLatin1("tellico")); + action->setIcon(TQString::fromLatin1("tellico")); importMenu->insert(action); connect(action, TQT_SIGNAL(activated()), importMapper, TQT_SLOT(map())); importMapper->setMapping(action, Import::TellicoXML); @@ -351,7 +351,7 @@ void MainWindow::initActions() { action = new KAction(actionCollection(), "file_import_alexandria"); action->setText(i18n("Import Alexandria Data...")); action->setToolTip(i18n("Import data from the Alexandria book collection manager")); - action->setIcon(TQString::tqfromLatin1("alexandria")); + action->setIcon(TQString::fromLatin1("alexandria")); importMenu->insert(action); connect(action, TQT_SIGNAL(activated()), importMapper, TQT_SLOT(map())); importMapper->setMapping(action, Import::Alexandria); @@ -367,7 +367,7 @@ void MainWindow::initActions() { action = new KAction(actionCollection(), "file_import_referencer"); action->setText(i18n("Import Referencer Data...")); action->setToolTip(i18n("Import data from Referencer")); - action->setIcon(TQString::tqfromLatin1("referencer")); + action->setIcon(TQString::fromLatin1("referencer")); importMenu->insert(action); connect(action, TQT_SIGNAL(activated()), importMapper, TQT_SLOT(map())); importMapper->setMapping(action, Import::Referencer); @@ -429,7 +429,7 @@ void MainWindow::initActions() { action = new KAction(actionCollection(), "file_import_gcfilms"); action->setText(i18n("Import GCstar Data...")); action->setToolTip(i18n("Import a GCstar data file")); - action->setIcon(TQString::tqfromLatin1("gcstar")); + action->setIcon(TQString::fromLatin1("gcstar")); importMenu->insert(action); connect(action, TQT_SIGNAL(activated()), importMapper, TQT_SLOT(map())); importMapper->setMapping(action, Import::GCfilms); @@ -437,7 +437,7 @@ void MainWindow::initActions() { action = new KAction(actionCollection(), "file_import_griffith"); action->setText(i18n("Import Griffith Data...")); action->setToolTip(i18n("Import a Griffith database")); - action->setIcon(TQString::tqfromLatin1("griffith")); + action->setIcon(TQString::fromLatin1("griffith")); importMenu->insert(action); connect(action, TQT_SIGNAL(activated()), importMapper, TQT_SLOT(map())); importMapper->setMapping(action, Import::Griffith); @@ -474,14 +474,14 @@ void MainWindow::initActions() { KActionMenu* exportMenu = new KActionMenu(actionCollection(), "file_export"); exportMenu->setText(i18n("&Export")); - exportMenu->setIconSet(BarIconSet(TQString::tqfromLatin1("fileexport"))); + exportMenu->setIconSet(BarIconSet(TQString::fromLatin1("fileexport"))); exportMenu->setToolTip(i18n("Export the collection data to other formats")); exportMenu->setDelayed(false); action = new KAction(actionCollection(), "file_export_xml"); action->setText(i18n("Export to XML...")); action->setToolTip(i18n("Export to a Tellico XML file")); - action->setIcon(TQString::tqfromLatin1("tellico")); + action->setIcon(TQString::fromLatin1("tellico")); exportMenu->insert(action); connect(action, TQT_SIGNAL(activated()), exportMapper, TQT_SLOT(map())); exportMapper->setMapping(action, Export::TellicoXML); @@ -489,7 +489,7 @@ void MainWindow::initActions() { action = new KAction(actionCollection(), "file_export_zip"); action->setText(i18n("Export to Zip...")); action->setToolTip(i18n("Export to a Tellico Zip file")); - action->setIcon(TQString::tqfromLatin1("tellico")); + action->setIcon(TQString::fromLatin1("tellico")); exportMenu->insert(action); connect(action, TQT_SIGNAL(activated()), exportMapper, TQT_SLOT(map())); exportMapper->setMapping(action, Export::TellicoZip); @@ -521,7 +521,7 @@ void MainWindow::initActions() { action = new KAction(actionCollection(), "file_export_alexandria"); action->setText(i18n("Export to Alexandria...")); action->setToolTip(i18n("Export to an Alexandria library")); - action->setIcon(TQString::tqfromLatin1("alexandria")); + action->setIcon(TQString::fromLatin1("alexandria")); exportMenu->insert(action); connect(action, TQT_SIGNAL(activated()), exportMapper, TQT_SLOT(map())); exportMapper->setMapping(action, Export::Alexandria); @@ -553,7 +553,7 @@ void MainWindow::initActions() { action = new KAction(actionCollection(), "file_export_gcfilms"); action->setText(i18n("Export to GCfilms...")); action->setToolTip(i18n("Export to a GCfilms data file")); - action->setIcon(TQString::tqfromLatin1("gcstar")); + action->setIcon(TQString::fromLatin1("gcstar")); exportMenu->insert(action); connect(action, TQT_SIGNAL(activated()), exportMapper, TQT_SLOT(map())); exportMapper->setMapping(action, Export::GCfilms); @@ -585,12 +585,12 @@ void MainWindow::initActions() { action = KStdAction::deselect(TQT_TQOBJECT(this), TQT_SLOT(slotEditDeselect()), actionCollection()); action->setToolTip(i18n("Deselect all the entries in the collection")); - action = new KAction(i18n("Internet Search..."), TQString::tqfromLatin1("wizard"), CTRL + Key_M, + action = new KAction(i18n("Internet Search..."), TQString::fromLatin1("wizard"), CTRL + Key_M, TQT_TQOBJECT(this), TQT_SLOT(slotShowFetchDialog()), actionCollection(), "edit_search_internet"); action->setToolTip(i18n("Search the internet...")); - action = new KAction(i18n("Advanced &Filter..."), TQString::tqfromLatin1("filter"), CTRL + Key_J, + action = new KAction(i18n("Advanced &Filter..."), TQString::fromLatin1("filter"), CTRL + Key_J, TQT_TQOBJECT(this), TQT_SLOT(slotShowFilterDialog()), actionCollection(), "filter_dialog"); action->setToolTip(i18n("Filter the collection")); @@ -598,46 +598,46 @@ void MainWindow::initActions() { /************************************************* * Collection menu *************************************************/ - m_newEntry = new KAction(i18n("&New Entry..."), TQString::tqfromLatin1("filenew"), CTRL + Key_N, + m_newEntry = new KAction(i18n("&New Entry..."), TQString::fromLatin1("filenew"), CTRL + Key_N, TQT_TQOBJECT(this), TQT_SLOT(slotNewEntry()), actionCollection(), "coll_new_entry"); m_newEntry->setToolTip(i18n("Create a new entry")); - m_editEntry = new KAction(i18n("&Edit Entry..."), TQString::tqfromLatin1("edit"), CTRL + Key_E, + m_editEntry = new KAction(i18n("&Edit Entry..."), TQString::fromLatin1("edit"), CTRL + Key_E, TQT_TQOBJECT(this), TQT_SLOT(slotShowEntryEditor()), actionCollection(), "coll_edit_entry"); m_editEntry->setToolTip(i18n("Edit the selected entries")); - m_copyEntry = new KAction(i18n("D&uplicate Entry"), TQString::tqfromLatin1("editcopy"), CTRL + Key_Y, + m_copyEntry = new KAction(i18n("D&uplicate Entry"), TQString::fromLatin1("editcopy"), CTRL + Key_Y, Controller::self(), TQT_SLOT(slotCopySelectedEntries()), actionCollection(), "coll_copy_entry"); m_copyEntry->setToolTip(i18n("Copy the selected entries")); - m_deleteEntry = new KAction(i18n("&Delete Entry"), TQString::tqfromLatin1("editdelete"), CTRL + Key_D, + m_deleteEntry = new KAction(i18n("&Delete Entry"), TQString::fromLatin1("editdelete"), CTRL + Key_D, Controller::self(), TQT_SLOT(slotDeleteSelectedEntries()), actionCollection(), "coll_delete_entry"); m_deleteEntry->setToolTip(i18n("Delete the selected entries")); - m_mergeEntry = new KAction(i18n("&Merge Entries"), TQString::tqfromLatin1("editcopy"), CTRL + Key_G, + m_mergeEntry = new KAction(i18n("&Merge Entries"), TQString::fromLatin1("editcopy"), CTRL + Key_G, Controller::self(), TQT_SLOT(slotMergeSelectedEntries()), actionCollection(), "coll_merge_entry"); m_mergeEntry->setToolTip(i18n("Merge the selected entries")); m_mergeEntry->setEnabled(false); // gets enabled when more than 1 entry is selected - action = new KAction(i18n("&Generate Reports..."), TQString::tqfromLatin1("document"), 0, TQT_TQOBJECT(this), + action = new KAction(i18n("&Generate Reports..."), TQString::fromLatin1("document"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotShowReportDialog()), actionCollection(), "coll_reports"); action->setToolTip(i18n("Generate collection reports")); - m_checkOutEntry = new KAction(i18n("Check-&out..."), TQString::tqfromLatin1("2uparrow"), 0, + m_checkOutEntry = new KAction(i18n("Check-&out..."), TQString::fromLatin1("2uparrow"), 0, Controller::self(), TQT_SLOT(slotCheckOut()), actionCollection(), "coll_checkout"); m_checkOutEntry->setToolTip(i18n("Check-out the selected items")); - m_checkInEntry = new KAction(i18n("Check-&in"), TQString::tqfromLatin1("2downarrow"), 0, + m_checkInEntry = new KAction(i18n("Check-&in"), TQString::fromLatin1("2downarrow"), 0, Controller::self(), TQT_SLOT(slotCheckIn()), actionCollection(), "coll_checkin"); m_checkInEntry->setToolTip(i18n("Check-in the selected items")); - action = new KAction(i18n("&Rename Collection..."), TQString::tqfromLatin1("editclear"), CTRL + Key_R, + action = new KAction(i18n("&Rename Collection..."), TQString::fromLatin1("editclear"), CTRL + Key_R, TQT_TQOBJECT(this), TQT_SLOT(slotRenameCollection()), actionCollection(), "coll_rename_collection"); action->setToolTip(i18n("Rename the collection")); - action = new KAction(i18n("Collection &Fields..."), TQString::tqfromLatin1("edit"), CTRL + Key_U, + action = new KAction(i18n("Collection &Fields..."), TQString::fromLatin1("edit"), CTRL + Key_U, TQT_TQOBJECT(this), TQT_SLOT(slotShowCollectionFieldsDialog()), actionCollection(), "coll_fields"); action->setToolTip(i18n("Modify the collection fields")); @@ -645,8 +645,8 @@ void MainWindow::initActions() { TQT_TQOBJECT(this), TQT_SLOT(slotConvertToBibliography()), actionCollection(), "coll_convert_bibliography"); action->setToolTip(i18n("Convert a book collection to a bibliography")); - action->setIconSet(UserIconSet(TQString::tqfromLatin1("bibtex"))); - action = new KAction(i18n("String &Macros..."), TQString::tqfromLatin1("view_text"), 0, + action->setIconSet(UserIconSet(TQString::fromLatin1("bibtex"))); + action = new KAction(i18n("String &Macros..."), TQString::fromLatin1("view_text"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotShowStringMacroDialog()), actionCollection(), "coll_string_macros"); action->setToolTip(i18n("Edit the bibtex string macros")); @@ -658,21 +658,21 @@ void MainWindow::initActions() { action = new KAction(actionCollection(), "cite_clipboard"); action->setText(i18n("Copy Bibtex to Cli&pboard")); action->setToolTip(i18n("Copy bibtex citations to the clipboard")); - action->setIcon(TQString::tqfromLatin1("editpaste")); + action->setIcon(TQString::fromLatin1("editpaste")); connect(action, TQT_SIGNAL(activated()), citeMapper, TQT_SLOT(map())); citeMapper->setMapping(action, Cite::CiteClipboard); action = new KAction(actionCollection(), "cite_lyxpipe"); action->setText(i18n("Cite Entry in &LyX")); action->setToolTip(i18n("Cite the selected entries in LyX")); - action->setIcon(TQString::tqfromLatin1("lyx")); + action->setIcon(TQString::fromLatin1("lyx")); connect(action, TQT_SIGNAL(activated()), citeMapper, TQT_SLOT(map())); citeMapper->setMapping(action, Cite::CiteLyxpipe); action = new KAction(actionCollection(), "cite_openoffice"); action->setText(i18n("Ci&te Entry in OpenOffice.org")); action->setToolTip(i18n("Cite the selected entries in OpenOffice.org")); - action->setIcon(TQString::tqfromLatin1("ooo-writer")); + action->setIcon(TQString::fromLatin1("ooo-writer")); connect(action, TQT_SIGNAL(activated()), citeMapper, TQT_SLOT(map())); citeMapper->setMapping(action, Cite::CiteOpenOffice); @@ -681,7 +681,7 @@ void MainWindow::initActions() { Controller::self(), TQT_SLOT(slotUpdateSelectedEntries(const TQString&))); m_updateEntryMenu = new KActionMenu(i18n("&Update Entry"), actionCollection(), "coll_update_entry"); -// m_updateEntryMenu->setIconSet(BarIconSet(TQString::tqfromLatin1("fileexport"))); +// m_updateEntryMenu->setIconSet(BarIconSet(TQString::fromLatin1("fileexport"))); m_updateEntryMenu->setDelayed(false); m_updateAll = new KAction(actionCollection(), "update_entry_all"); @@ -689,7 +689,7 @@ void MainWindow::initActions() { m_updateAll->setToolTip(i18n("Update entry data from all available sources")); // m_updateEntryMenu->insert(action); connect(m_updateAll, TQT_SIGNAL(activated()), updateMapper, TQT_SLOT(map())); - updateMapper->setMapping(m_updateAll, TQString::tqfromLatin1("_all")); + updateMapper->setMapping(m_updateAll, TQString::fromLatin1("_all")); /************************************************* * Settings menu @@ -738,7 +738,7 @@ void MainWindow::initActions() { (void) new KAction(i18n("Filter"), CTRL + Key_F, TQT_TQOBJECT(this), TQT_SLOT(slotFilterLabelActivated()), actionCollection(), "quick_filter_accel"); - (void) new KAction(i18n("Clear Filter"), TQString::tqfromLatin1("locationbar_erase"), 0, + (void) new KAction(i18n("Clear Filter"), TQString::fromLatin1("locationbar_erase"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotClearFilter()), actionCollection(), "quick_filter_clear"); @@ -761,7 +761,7 @@ void MainWindow::initActions() { connect(actionCollection(), TQT_SIGNAL(actionStatusText(const TQString &)), TQT_SLOT(slotStatusMsg(const TQString &))); connect(actionCollection(), TQT_SIGNAL(clearStatusText()), - TQT_SLOT(slotCleartqStatus())); + TQT_SLOT(slotClearStatus())); #ifdef UIFILE kdWarning() << "MainWindow::initActions() - change createGUI() call!" << endl; @@ -801,7 +801,7 @@ void MainWindow::initView() { m_viewTabs->setTabBarHidden(true); m_groupView = new GroupView(m_viewTabs, "groupview"); Controller::self()->addObserver(m_groupView); - m_viewTabs->addTab(m_groupView, SmallIcon(TQString::tqfromLatin1("folder")), i18n("Groups")); + m_viewTabs->addTab(m_groupView, SmallIcon(TQString::fromLatin1("folder")), i18n("Groups")); TQWhatsThis::add(m_groupView, i18n("<qt>The <i>Group View</i> sorts the entries into groupings " "based on a selected field.</qt>")); @@ -856,16 +856,16 @@ void MainWindow::initFileOpen(bool nofile_) { slotEntryCount(); const int type = Kernel::self()->collectionType(); - TQString welcomeFile = locate("appdata", TQString::tqfromLatin1("welcome.html")); + TQString welcomeFile = locate("appdata", TQString::fromLatin1("welcome.html")); TQString text = FileHandler::readTextFile(welcomeFile); - text.replace(TQString::tqfromLatin1("$FGCOLOR$"), Config::templateTextColor(type).name()); - text.replace(TQString::tqfromLatin1("$BGCOLOR$"), Config::templateBaseColor(type).name()); - text.replace(TQString::tqfromLatin1("$COLOR1$"), Config::templateHighlightedTextColor(type).name()); - text.replace(TQString::tqfromLatin1("$COLOR2$"), Config::templateHighlightedBaseColor(type).name()); - text.replace(TQString::tqfromLatin1("$IMGDIR$"), TQFile::encodeName(ImageFactory::tempDir())); - text.replace(TQString::tqfromLatin1("$BANNER$"), + text.replace(TQString::fromLatin1("$FGCOLOR$"), Config::templateTextColor(type).name()); + text.replace(TQString::fromLatin1("$BGCOLOR$"), Config::templateBaseColor(type).name()); + text.replace(TQString::fromLatin1("$COLOR1$"), Config::templateHighlightedTextColor(type).name()); + text.replace(TQString::fromLatin1("$COLOR2$"), Config::templateHighlightedBaseColor(type).name()); + text.replace(TQString::fromLatin1("$IMGDIR$"), TQFile::encodeName(ImageFactory::tempDir())); + text.replace(TQString::fromLatin1("$BANNER$"), i18n("Welcome to the Tellico Collection Manager")); - text.replace(TQString::tqfromLatin1("$WELCOMETEXT$"), + text.replace(TQString::fromLatin1("$WELCOMETEXT$"), i18n("<h3>Tellico is a tool for managing collections of books, " "videos, music, and whatever else you want to catalog.</h3>" "<h3>New entries can be added to your collection by " @@ -883,13 +883,13 @@ void MainWindow::initFileOpen(bool nofile_) { void MainWindow::saveOptions() { // myDebug() << "MainWindow::saveOptions()" << endl; - saveMainWindowSettings(KGlobal::config(), TQString::tqfromLatin1("Main Window Options")); + saveMainWindowSettings(KGlobal::config(), TQString::fromLatin1("Main Window Options")); Config::setShowGroupWidget(m_toggleGroupWidget->isChecked()); Config::setShowEditWidget(m_toggleEntryEditor->isChecked()); Config::setShowEntryView(m_toggleEntryView->isChecked()); - m_fileOpenRecent->saveEntries(KGlobal::config(), TQString::tqfromLatin1("Recent Files")); + m_fileOpenRecent->saveEntries(KGlobal::config(), TQString::fromLatin1("Recent Files")); if(!isNewDocument()) { Config::setLastOpenFile(Data::Document::self()->URL().url()); } @@ -916,14 +916,14 @@ void MainWindow::saveOptions() { } // this is used in the EntryEditDialog constructor, too - m_editDialog->saveDialogSize(TQString::tqfromLatin1("Edit Dialog Options")); + m_editDialog->saveDialogSize(TQString::fromLatin1("Edit Dialog Options")); saveCollectionOptions(Data::Document::self()->collection()); Config::writeConfig(); } void MainWindow::readCollectionOptions(Data::CollPtr coll_) { - KConfigGroup group(KGlobal::config(), TQString::tqfromLatin1("Options - %1").tqarg(coll_->typeName())); + KConfigGroup group(KGlobal::config(), TQString::fromLatin1("Options - %1").arg(coll_->typeName())); TQString defaultGroup = coll_->defaultGroupField(); TQString entryGroup; @@ -932,9 +932,9 @@ void MainWindow::readCollectionOptions(Data::CollPtr coll_) { } else { KURL url = Kernel::self()->URL(); for(uint i = 0; i < Config::maxCustomURLSettings(); ++i) { - KURL u = group.readEntry(TQString::tqfromLatin1("URL_%1").tqarg(i)); + KURL u = group.readEntry(TQString::fromLatin1("URL_%1").arg(i)); if(url == u) { - entryGroup = group.readEntry(TQString::tqfromLatin1("Group By_%1").tqarg(i), defaultGroup); + entryGroup = group.readEntry(TQString::fromLatin1("Group By_%1").arg(i), defaultGroup); break; } } @@ -950,9 +950,9 @@ void MainWindow::readCollectionOptions(Data::CollPtr coll_) { TQString entryXSLTFile = Config::templateName(coll_->type()); if(entryXSLTFile.isEmpty()) { - entryXSLTFile = TQString::tqfromLatin1("Fancy"); // should never happen, but just in case + entryXSLTFile = TQString::fromLatin1("Fancy"); // should never happen, but just in case } - m_viewStack->entryView()->setXSLTFile(entryXSLTFile + TQString::tqfromLatin1(".xsl")); + m_viewStack->entryView()->setXSLTFile(entryXSLTFile + TQString::fromLatin1(".xsl")); // make sure the right combo element is selected slotUpdateCollectionToolBar(coll_); @@ -965,7 +965,7 @@ void MainWindow::saveCollectionOptions(Data::CollPtr coll_) { } int configIndex = -1; - KConfigGroup config(KGlobal::config(), TQString::tqfromLatin1("Options - %1").tqarg(coll_->typeName())); + KConfigGroup config(KGlobal::config(), TQString::fromLatin1("Options - %1").arg(coll_->typeName())); TQString groupName; if(m_entryGrouping->currentItem() > -1 && static_cast<int>(coll_->entryGroups().count()) > m_entryGrouping->currentItem()) { @@ -981,8 +981,8 @@ void MainWindow::saveCollectionOptions(Data::CollPtr coll_) { TQValueList<KURL> urls = TQValueList<KURL>() << url; TQStringList groupBys = TQStringList() << groupName; for(uint i = 0; i < Config::maxCustomURLSettings(); ++i) { - KURL u = config.readEntry(TQString::tqfromLatin1("URL_%1").tqarg(i)); - TQString g = config.readEntry(TQString::tqfromLatin1("Group By_%1").tqarg(i)); + KURL u = config.readEntry(TQString::fromLatin1("URL_%1").arg(i)); + TQString g = config.readEntry(TQString::fromLatin1("Group By_%1").arg(i)); if(!u.isEmpty() && url != u) { urls.append(u); groupBys.append(g); @@ -992,8 +992,8 @@ void MainWindow::saveCollectionOptions(Data::CollPtr coll_) { } uint limit = TQMIN(urls.count(), Config::maxCustomURLSettings()); for(uint i = 0; i < limit; ++i) { - config.writeEntry(TQString::tqfromLatin1("URL_%1").tqarg(i), urls[i].url()); - config.writeEntry(TQString::tqfromLatin1("Group By_%1").tqarg(i), groupBys[i]); + config.writeEntry(TQString::fromLatin1("URL_%1").arg(i), urls[i].url()); + config.writeEntry(TQString::fromLatin1("Group By_%1").arg(i), groupBys[i]); } } m_detailedView->saveConfig(coll_, configIndex); @@ -1002,7 +1002,7 @@ void MainWindow::saveCollectionOptions(Data::CollPtr coll_) { void MainWindow::readOptions() { // myDebug() << "MainWindow::readOptions()" << endl; - applyMainWindowSettings(KGlobal::config(), TQString::tqfromLatin1("Main Window Options")); + applyMainWindowSettings(KGlobal::config(), TQString::fromLatin1("Main Window Options")); TQValueList<int> splitList = Config::mainSplitterSizes(); if(!splitList.empty()) { @@ -1025,7 +1025,7 @@ void MainWindow::readOptions() { slotToggleEntryView(); // initialize the recent file list - m_fileOpenRecent->loadEntries(KGlobal::config(), TQString::tqfromLatin1("Recent Files")); + m_fileOpenRecent->loadEntries(KGlobal::config(), TQString::fromLatin1("Recent Files")); // sort by count if column = 1 int sortStyle = Config::groupViewSortColumn(); @@ -1061,8 +1061,8 @@ void MainWindow::saveProperties(KConfig* cfg_) { } void MainWindow::readProperties(KConfig* cfg_) { - TQString filename = cfg_->readEntry(TQString::tqfromLatin1("filename")); - bool modified = cfg_->readBoolEntry(TQString::tqfromLatin1("modified"), false); + TQString filename = cfg_->readEntry(TQString::fromLatin1("filename")); + bool modified = cfg_->readBoolEntry(TQString::fromLatin1("modified"), false); if(modified) { bool canRecover; TQString tempname = kapp->checkRecoverFile(filename, canRecover); @@ -1127,7 +1127,7 @@ void MainWindow::slotFileNew(int type_) { ImageFactory::clean(false); } - StatusBar::self()->cleartqStatus(); + StatusBar::self()->clearStatus(); } void MainWindow::slotFileOpen() { @@ -1135,18 +1135,18 @@ void MainWindow::slotFileOpen() { if(m_editDialog->queryModified() && Data::Document::self()->saveModified()) { TQString filter = i18n("*.tc *.bc|Tellico Files (*.tc)"); - filter += TQString::tqfromLatin1("\n"); + filter += TQString::fromLatin1("\n"); filter += i18n("*.xml|XML Files (*.xml)"); - filter += TQString::tqfromLatin1("\n"); + filter += TQString::fromLatin1("\n"); filter += i18n("*|All Files"); // keyword 'open' - KURL url = KFileDialog::getOpenURL(TQString::tqfromLatin1(":open"), filter, + KURL url = KFileDialog::getOpenURL(TQString::fromLatin1(":open"), filter, this, i18n("Open File")); if(!url.isEmpty() && url.isValid()) { slotFileOpen(url); } } - StatusBar::self()->cleartqStatus(); + StatusBar::self()->clearStatus(); } void MainWindow::slotFileOpen(const KURL& url_) { @@ -1164,7 +1164,7 @@ void MainWindow::slotFileOpen(const KURL& url_) { } } - StatusBar::self()->cleartqStatus(); + StatusBar::self()->clearStatus(); } void MainWindow::slotFileOpenRecent(const KURL& url_) { @@ -1183,7 +1183,7 @@ void MainWindow::slotFileOpenRecent(const KURL& url_) { m_fileOpenRecent->setCurrentItem(-1); } - StatusBar::self()->cleartqStatus(); + StatusBar::self()->clearStatus(); } void MainWindow::openFile(const TQString& file_) { @@ -1279,13 +1279,13 @@ bool MainWindow::fileSave() { m_newDocument = false; updateCaption(false); m_fileSave->setEnabled(false); - m_detailedView->resetEntrytqStatus(); + m_detailedView->resetEntryStatus(); } else { ret = false; } } - StatusBar::self()->cleartqStatus(); + StatusBar::self()->clearStatus(); return ret; } @@ -1305,13 +1305,13 @@ bool MainWindow::fileSaveAs() { filter += i18n("*|All Files"); // keyword 'open' - KFileDialog dlg(TQString::tqfromLatin1(":open"), filter, this, "filedialog", true); + KFileDialog dlg(TQString::fromLatin1(":open"), filter, this, "filedialog", true); dlg.setCaption(i18n("Save As")); dlg.setOperationMode(KFileDialog::Saving); int result = dlg.exec(); if(result == TQDialog::Rejected) { - StatusBar::self()->cleartqStatus(); + StatusBar::self()->clearStatus(); return false; } @@ -1325,13 +1325,13 @@ bool MainWindow::fileSaveAs() { updateCaption(false); m_newDocument = false; m_fileSave->setEnabled(false); - m_detailedView->resetEntrytqStatus(); + m_detailedView->resetEntryStatus(); } else { ret = false; } } - StatusBar::self()->cleartqStatus(); + StatusBar::self()->clearStatus(); return ret; } @@ -1348,9 +1348,9 @@ void MainWindow::slotFilePrint() { TQString str = i18n("The collection is currently being filtered to show a limited subset of " "the entries. Only the visible entries will be printed. Continue?"); int ret = KMessageBox::warningContinueCancel(this, str, TQString(), KStdGuiItem::print(), - TQString::tqfromLatin1("WarnPrintVisible")); + TQString::fromLatin1("WarnPrintVisible")); if(ret == KMessageBox::Cancel) { - StatusBar::self()->cleartqStatus(); + StatusBar::self()->clearStatus(); return; } } @@ -1360,7 +1360,7 @@ void MainWindow::slotFilePrint() { Export::HTMLExporter exporter(Data::Document::self()->collection()); // only print visible entries exporter.setEntries(m_detailedView->visibleEntries()); - exporter.setXSLTFile(TQString::tqfromLatin1("tellico-printing.xsl")); + exporter.setXSLTFile(TQString::fromLatin1("tellico-printing.xsl")); exporter.setPrintHeaders(printHeaders); exporter.setPrintGrouped(printGrouped); exporter.setGroupBy(Controller::self()->expandedGroupBy()); @@ -1379,7 +1379,7 @@ void MainWindow::slotFilePrint() { TQString html = exporter.text(); if(html.isEmpty()) { XSLTError(); - StatusBar::self()->cleartqStatus(); + StatusBar::self()->clearStatus(); return; } @@ -1389,7 +1389,7 @@ void MainWindow::slotFilePrint() { slotStatusMsg(i18n("Printing...")); doPrint(html); - StatusBar::self()->cleartqStatus(); + StatusBar::self()->clearStatus(); } void MainWindow::slotFileQuit() { @@ -1399,7 +1399,7 @@ void MainWindow::slotFileQuit() { //saveOptions(); close(); - StatusBar::self()->cleartqStatus(); + StatusBar::self()->clearStatus(); } void MainWindow::slotEditCut() { @@ -1418,13 +1418,13 @@ void MainWindow::activateEditSlot(const char* slot_) { // the edit widget is the only one that copies, cuts, and pastes TQWidget* w; if(m_editDialog->isVisible()) { - w = m_editDialog->tqfocusWidget(); + w = m_editDialog->focusWidget(); } else { - w = kapp->tqfocusWidget(); + w = kapp->focusWidget(); } if(w && w->isVisible()) { - TQMetaObject* meta = w->tqmetaObject(); + TQMetaObject* meta = w->metaObject(); int idx = meta->findSlot(slot_ + 1, true); if(idx > -1) { @@ -1442,7 +1442,7 @@ void MainWindow::slotEditDeselect() { } void MainWindow::slotConfigToolbar() { - saveMainWindowSettings(KGlobal::config(), TQString::tqfromLatin1("Main Window Options")); + saveMainWindowSettings(KGlobal::config(), TQString::fromLatin1("Main Window Options")); #ifdef UIFILE KEditToolbar dlg(actionCollection(), UIFILE); #else @@ -1453,7 +1453,7 @@ void MainWindow::slotConfigToolbar() { } void MainWindow::slotNewToolbarConfig() { - applyMainWindowSettings(KGlobal::config(), TQString::tqfromLatin1("Main Window Options")); + applyMainWindowSettings(KGlobal::config(), TQString::fromLatin1("Main Window Options")); #ifdef UIFILE createGUI(UIFILE, false); #else @@ -1512,16 +1512,16 @@ void MainWindow::slotHideConfigDialog() { } void MainWindow::slotShowTipOfDay(bool force_/*=true*/) { - TQString tipfile = locate("appdata", TQString::tqfromLatin1("tellico.tips")); + TQString tipfile = locate("appdata", TQString::fromLatin1("tellico.tips")); KTipDialog::showTip(this, tipfile, force_); } void MainWindow::slotStatusMsg(const TQString& text_) { - m_statusBar->settqStatus(text_); + m_statusBar->setStatus(text_); } -void MainWindow::slotCleartqStatus() { - StatusBar::self()->cleartqStatus(); +void MainWindow::slotClearStatus() { + StatusBar::self()->clearStatus(); } void MainWindow::slotEntryCount() { @@ -1531,20 +1531,20 @@ void MainWindow::slotEntryCount() { } int count = coll->entryCount(); - TQString text = i18n("Total entries: %1").tqarg(count); + TQString text = i18n("Total entries: %1").arg(count); int selectCount = Controller::self()->selectedEntries().count(); int filterCount = m_detailedView->visibleItems(); // if more than one book is selected, add the number of selected books if(filterCount < count && selectCount > 1) { text += TQChar(' '); - text += i18n("(%1 filtered; %2 selected)").tqarg(filterCount).tqarg(selectCount); + text += i18n("(%1 filtered; %2 selected)").arg(filterCount).arg(selectCount); } else if(filterCount < count) { text += TQChar(' '); - text += i18n("(%1 filtered)").tqarg(filterCount); + text += i18n("(%1 filtered)").arg(filterCount); } else if(selectCount > 1) { text += TQChar(' '); - text += i18n("(%1 selected)").tqarg(selectCount); + text += i18n("(%1 selected)").arg(selectCount); } m_statusBar->setCount(text); @@ -1591,14 +1591,14 @@ void MainWindow::slotHandleConfigChange() { nocaps != Config::noCapitalizationList() || suffixes != Config::nameSuffixList() || prefixes != Config::surnamePrefixList()) { - // tqinvalidate all groups + // invalidate all groups Data::Document::self()->collection()->invalidateGroups(); // refreshing the title causes the group view to refresh - Controller::self()->slotRefreshField(Data::Document::self()->collection()->fieldByName(TQString::tqfromLatin1("title"))); + Controller::self()->slotRefreshField(Data::Document::self()->collection()->fieldByName(TQString::fromLatin1("title"))); } TQString entryXSLTFile = Config::templateName(Kernel::self()->collectionType()); - m_viewStack->entryView()->setXSLTFile(entryXSLTFile + TQString::tqfromLatin1(".xsl")); + m_viewStack->entryView()->setXSLTFile(entryXSLTFile + TQString::fromLatin1(".xsl")); } void MainWindow::slotUpdateCollectionToolBar(Data::CollPtr coll_) { @@ -1624,7 +1624,7 @@ void MainWindow::slotUpdateCollectionToolBar(Data::CollPtr coll_) { for(TQStringList::ConstIterator groupIt = groups.begin(); groupIt != groups.end(); ++groupIt) { // special case for people "pseudo-group" if(*groupIt == Data::Collection::s_peopleGroupName) { - groupMap.insert(*groupIt, TQString::tqfromLatin1("<") + i18n("People") + TQString::tqfromLatin1(">")); + groupMap.insert(*groupIt, TQString::fromLatin1("<") + i18n("People") + TQString::fromLatin1(">")); } else { groupMap.insert(*groupIt, coll_->fieldTitleByName(*groupIt)); } @@ -1649,8 +1649,8 @@ void MainWindow::slotUpdateCollectionToolBar(Data::CollPtr coll_) { if(tb) { KComboBox* cb = tb->getCombo(m_entryGrouping->itemId(i)); if(cb) { - // qt caches the combobox size and never recalculates the tqsizeHint() - // the source code recommends calling setFont to tqinvalidate the tqsizeHint + // qt caches the combobox size and never recalculates the sizeHint() + // the source code recommends calling setFont to invalidate the sizeHint cb->setFont(cb->font()); cb->updateGeometry(); } @@ -1664,7 +1664,7 @@ void MainWindow::slotChangeGrouping() { TQString groupName = Kernel::self()->fieldNameByTitle(title); if(groupName.isEmpty()) { - if(title == TQString::tqfromLatin1("<") + i18n("People") + TQString::tqfromLatin1(">")) { + if(title == TQString::fromLatin1("<") + i18n("People") + TQString::fromLatin1(">")) { groupName = Data::Collection::s_peopleGroupName; } else { groupName = Data::Document::self()->collection()->defaultGroupField(); @@ -1703,7 +1703,7 @@ void MainWindow::doPrint(const TQString& html_) { w.write(html_); w.end(); -// the problem with doing my own tqlayout is that the text gets truncated, both at the +// the problem with doing my own layout is that the text gets truncated, both at the // top and at the bottom. Even adding the overlap parameter, there were problems. // KHTMLView takes care of that with a truncatedAt() parameter, but that's hidden in // the khtml::render_root class. So for now, just use the KHTMLView::print() method. @@ -1712,20 +1712,20 @@ void MainWindow::doPrint(const TQString& html_) { #else KPrinter* printer = new KPrinter(TQPrinter::PrinterResolution); - if(printer->setup(this, i18n("Print %1").tqarg(Data::Document::self()->URL().prettyURL()))) { + if(printer->setup(this, i18n("Print %1").arg(Data::Document::self()->URL().prettyURL()))) { printer->setFullPage(false); - printer->setCreator(TQString::tqfromLatin1("Tellico")); + printer->setCreator(TQString::fromLatin1("Tellico")); printer->setDocName(Data::Document::self()->URL().prettyURL()); TQPainter *p = new TQPainter; p->begin(printer); // mostly taken from KHTMLView::print() - TQString headerLeft = KGlobal::locale()->formatDate(TQDate::tqcurrentDate(), false); + TQString headerLeft = KGlobal::locale()->formatDate(TQDate::currentDate(), false); TQString headerRight = Data::Document::self()->URL().prettyURL(); TQString footerMid; - TQFont headerFont(TQString::tqfromLatin1("helvetica"), 8); + TQFont headerFont(TQString::fromLatin1("helvetica"), 8); p->setFont(headerFont); const int lspace = p->fontMetrics().lineSpacing(); const int headerHeight = (lspace * 3) / 2; @@ -1745,7 +1745,7 @@ void MainWindow::doPrint(const TQString& html_) { p->setPen(TQt::black); p->setFont(headerFont); - footerMid = i18n("Page %1").tqarg(page); + footerMid = i18n("Page %1").arg(page); p->drawText(0, 0, pageWidth, lspace, TQt::AlignLeft, headerLeft); p->drawText(0, 0, pageWidth, lspace, TQt::AlignRight, headerRight); @@ -1835,10 +1835,10 @@ void MainWindow::setFilter(const TQString& text_) { } // if the text contains any non-word characters, assume it's a regexp // but \W in qt is letter, number, or '_', I want to be a bit less strict - TQRegExp rx(TQString::tqfromLatin1("[^\\w\\s-']")); + TQRegExp rx(TQString::fromLatin1("[^\\w\\s-']")); if(text.find(rx) == -1) { // split by whitespace, and add rules for each word - TQStringList tokens = TQStringList::split(TQRegExp(TQString::tqfromLatin1("\\s")), text); + TQStringList tokens = TQStringList::split(TQRegExp(TQString::fromLatin1("\\s")), text); for(TQStringList::Iterator it = tokens.begin(); it != tokens.end(); ++it) { // an empty field string means check every field filter->append(new FilterRule(fieldName, *it, FilterRule::FuncContains)); @@ -1909,12 +1909,12 @@ void MainWindow::slotFileImport(int format_) { if(checkURL) { bool ok = !url.isEmpty() && url.isValid() && KIO::NetAccess::exists(url, true, this); if(!ok) { - StatusBar::self()->cleartqStatus(); + StatusBar::self()->clearStatus(); return; } } importFile(format, url); - StatusBar::self()->cleartqStatus(); + StatusBar::self()->clearStatus(); } void MainWindow::slotFileExport(int format_) { @@ -1924,7 +1924,7 @@ void MainWindow::slotFileExport(int format_) { ExportDialog dlg(format, Data::Document::self()->collection(), this, "exportdialog"); if(dlg.exec() == TQDialog::Rejected) { - StatusBar::self()->cleartqStatus(); + StatusBar::self()->clearStatus(); return; } @@ -1939,12 +1939,12 @@ void MainWindow::slotFileExport(int format_) { case Export::File: { - KFileDialog fileDlg(TQString::tqfromLatin1(":export"), dlg.fileFilter(), this, "filedialog", true); + KFileDialog fileDlg(TQString::fromLatin1(":export"), dlg.fileFilter(), this, "filedialog", true); fileDlg.setCaption(i18n("Export As")); fileDlg.setOperationMode(KFileDialog::Saving); if(fileDlg.exec() == TQDialog::Rejected) { - StatusBar::self()->cleartqStatus(); + StatusBar::self()->clearStatus(); return; } @@ -1957,7 +1957,7 @@ void MainWindow::slotFileExport(int format_) { break; } - StatusBar::self()->cleartqStatus(); + StatusBar::self()->clearStatus(); } void MainWindow::slotShowStringMacroDialog() { @@ -2032,9 +2032,9 @@ void MainWindow::slotConvertToBibliography() { } void MainWindow::slotCiteEntry(int action_) { - StatusBar::self()->settqStatus(i18n("Creating citations...")); + StatusBar::self()->setStatus(i18n("Creating citations...")); Cite::ActionManager::self()->cite(static_cast<Cite::CiteAction>(action_), Controller::self()->selectedEntries()); - StatusBar::self()->cleartqStatus(); + StatusBar::self()->clearStatus(); } void MainWindow::slotShowFetchDialog() { @@ -2064,7 +2064,7 @@ bool MainWindow::importFile(Import::Format format_, const KURL& url_, Import::Ac if(!url_.isEmpty() && url_.isValid() && KIO::NetAccess::exists(url_, true, this)) { coll = ImportDialog::importURL(format_, url_); } else { - Kernel::self()->sorry(i18n(errorLoad).tqarg(url_.fileName())); + Kernel::self()->sorry(i18n(errorLoad).arg(url_.fileName())); failed = true; } @@ -2091,7 +2091,7 @@ bool MainWindow::importFile(Import::Format format_, const KURL& url_, Import::Ac failed = !importCollection(coll, action_); } - StatusBar::self()->cleartqStatus(); + StatusBar::self()->clearStatus(); return !failed; // return true means success } @@ -2137,7 +2137,7 @@ void MainWindow::addFilterView() { m_filterView = new FilterView(m_viewTabs, "filterview"); Controller::self()->addObserver(m_filterView); - m_viewTabs->insertTab(m_filterView, SmallIcon(TQString::tqfromLatin1("filter")), i18n("Filters"), 1); + m_viewTabs->insertTab(m_filterView, SmallIcon(TQString::fromLatin1("filter")), i18n("Filters"), 1); TQWhatsThis::add(m_filterView, i18n("<qt>The <i>Filter View</i> shows the entries which meet certain " "filter rules.</qt>")); @@ -2154,7 +2154,7 @@ void MainWindow::addLoanView() { m_loanView = new LoanView(m_viewTabs, "loanview"); Controller::self()->addObserver(m_loanView); - m_viewTabs->insertTab(m_loanView, SmallIcon(TQString::tqfromLatin1("kaddressbook")), i18n("Loans"), 2); + m_viewTabs->insertTab(m_loanView, SmallIcon(TQString::fromLatin1("kaddressbook")), i18n("Loans"), 2); TQWhatsThis::add(m_loanView, i18n("<qt>The <i>Loan View</i> shows a list of all the people who " "have borrowed items from your collection.</qt>")); @@ -2171,7 +2171,7 @@ void MainWindow::updateCaption(bool modified_) { } if(!m_newDocument) { if(!caption.isEmpty()) { - caption += TQString::tqfromLatin1(" - "); + caption += TQString::fromLatin1(" - "); } KURL u = Data::Document::self()->URL(); if(u.isLocalFile()) { @@ -2247,17 +2247,17 @@ void MainWindow::updateCollectionActions() { return; } - stateChanged(TQString::tqfromLatin1("collection_reset")); + stateChanged(TQString::fromLatin1("collection_reset")); Data::Collection::Type type = Data::Document::self()->collection()->type(); switch(type) { case Data::Collection::Book: - stateChanged(TQString::tqfromLatin1("is_book")); + stateChanged(TQString::fromLatin1("is_book")); break; case Data::Collection::Bibtex: - stateChanged(TQString::tqfromLatin1("is_bibliography")); + stateChanged(TQString::fromLatin1("is_bibliography")); break; case Data::Collection::Video: - stateChanged(TQString::tqfromLatin1("is_video")); + stateChanged(TQString::fromLatin1("is_video")); break; default: break; @@ -2276,7 +2276,7 @@ void MainWindow::updateEntrySources() { return; } - unplugActionList(TQString::tqfromLatin1("update_entry_actions")); + unplugActionList(TQString::fromLatin1("update_entry_actions")); for(TQPtrListIterator<KAction> it(m_fetchActions); it.current(); ++it) { it.current()->unplugAll(); mapper->removeMappings(it.current()); @@ -2288,14 +2288,14 @@ void MainWindow::updateEntrySources() { for(Fetch::FetcherVec::Iterator it = vec.begin(); it != vec.end(); ++it) { KAction* action = new KAction(actionCollection()); action->setText(it->source()); - action->setToolTip(i18n("Update entry data from %1").tqarg(it->source())); + action->setToolTip(i18n("Update entry data from %1").arg(it->source())); action->setIconSet(Fetch::Manager::fetcherIcon(it.data())); connect(action, TQT_SIGNAL(activated()), mapper, TQT_SLOT(map())); mapper->setMapping(action, it->source()); m_fetchActions.append(action); } - plugActionList(TQString::tqfromLatin1("update_entry_actions"), m_fetchActions); + plugActionList(TQString::fromLatin1("update_entry_actions"), m_fetchActions); } void MainWindow::importFile(Import::Format format_, const KURL::List& urls_) { @@ -2308,7 +2308,7 @@ void MainWindow::importFile(Import::Format format_, const KURL::List& urls_) { KURL u = urls_.front(); TQString url = u.isLocalFile() ? u.path() : u.prettyURL(); Kernel::self()->sorry(i18n("Tellico can only import one file of this type at a time. " - "Only %1 will be imported.").tqarg(url)); + "Only %1 will be imported.").arg(url)); urls.clear(); urls = u; } diff --git a/src/mainwindow.h b/src/mainwindow.h index b08ddb2..660b206 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -221,7 +221,7 @@ public slots: * @param text The text that is displayed in the statusbar */ void slotStatusMsg(const TQString& text); - void slotCleartqStatus(); + void slotClearStatus(); /** * Shows the configuration window for the toolbars. */ @@ -299,7 +299,7 @@ public slots: private: /** * Saves the general options like all toolbar positions and status as well as the - * tqgeometry and the recent file list to the configuration file. + * geometry and the recent file list to the configuration file. */ void saveOptions(); /** diff --git a/src/newstuff/dialog.cpp b/src/newstuff/dialog.cpp index 646793a..8ee1569 100644 --- a/src/newstuff/dialog.cpp +++ b/src/newstuff/dialog.cpp @@ -31,8 +31,8 @@ #include <ktempfile.h> #include <tqlabel.h> -#include <tqtextedit.h> -#include <tqlayout.h> +#include <textedit.h> +#include <layout.h> #include <tqwhatsthis.h> #include <tqregexp.h> #include <tqvbox.h> @@ -62,13 +62,13 @@ class Dialog::Item : public GUI::ListViewItem { public: Item(GUI::ListView* parent) : GUI::ListViewItem(parent) {} - InstalltqStatus status() const { return m_status; } - void settqStatus(InstalltqStatus status) { + InstallStatus status() const { return m_status; } + void setStatus(InstallStatus status) { m_status = status; if(m_status == Current) { - setPixmap(0, SmallIcon(TQString::tqfromLatin1("ok"))); + setPixmap(0, SmallIcon(TQString::fromLatin1("ok"))); } else if(m_status == OldVersion) { - setPixmap(0, SmallIcon(TQString::tqfromLatin1("reload"))); + setPixmap(0, SmallIcon(TQString::fromLatin1("reload"))); } } @@ -87,7 +87,7 @@ public: } private: - InstalltqStatus m_status; + InstallStatus m_status; }; Dialog::Dialog(NewStuff::DataType type_, TQWidget* parent_) @@ -126,7 +126,7 @@ Dialog::Dialog(NewStuff::DataType type_, TQWidget* parent_) TQBoxLayout* boxLayout2 = new TQVBoxLayout(widget, 0, KDialog::spacingHint()); m_iconLabel = new TQLabel(widget); - m_iconLabel->tqsetAlignment(TQt::AlignTop | TQt::AlignLeft); + m_iconLabel->setAlignment(TQt::AlignTop | TQt::AlignLeft); m_iconLabel->setMargin(0); m_nameLabel = new TQLabel(widget); @@ -140,27 +140,27 @@ Dialog::Dialog(NewStuff::DataType type_, TQWidget* parent_) TQWhatsThis::add(m_infoLabel, i18n("The author of the selected item")); m_install = new KPushButton(i18n("Install"), widget); - m_install->setIconSet(SmallIconSet(TQString::tqfromLatin1("knewstuff"))); + m_install->setIconSet(SmallIconSet(TQString::fromLatin1("knewstuff"))); m_install->setEnabled(false); connect(m_install, TQT_SIGNAL(clicked()), TQT_SLOT(slotInstall())); // the button's text changes later // I don't want it resizing, so figure out the maximum size and set that m_install->polish(); - int maxWidth = m_install->tqsizeHint().width(); - int maxHeight = m_install->tqsizeHint().height(); - m_install->setGuiItem(KGuiItem(i18n("Update"), SmallIconSet(TQString::tqfromLatin1("knewstuff")))); - maxWidth = TQMAX(maxWidth, m_install->tqsizeHint().width()); - maxHeight = TQMAX(maxHeight, m_install->tqsizeHint().height()); + int maxWidth = m_install->sizeHint().width(); + int maxHeight = m_install->sizeHint().height(); + m_install->setGuiItem(KGuiItem(i18n("Update"), SmallIconSet(TQString::fromLatin1("knewstuff")))); + maxWidth = TQMAX(maxWidth, m_install->sizeHint().width()); + maxHeight = TQMAX(maxHeight, m_install->sizeHint().height()); m_install->setMinimumWidth(maxWidth); m_install->setMinimumHeight(maxHeight); TQPixmap pix; if(m_type == EntryTemplate) { - pix = DesktopIcon(TQString::tqfromLatin1("looknfeel"), KIcon::SizeLarge); + pix = DesktopIcon(TQString::fromLatin1("looknfeel"), KIcon::SizeLarge); TQWhatsThis::add(m_install, i18n("Download and install the selected template.")); } else { - pix = UserIcon(TQString::tqfromLatin1("script")); + pix = UserIcon(TQString::fromLatin1("script")); TQWhatsThis::add(m_install, i18n("Download and install the selected script. Some scripts " "may need to be configured after being installed.")); } @@ -188,7 +188,7 @@ Dialog::Dialog(NewStuff::DataType type_, TQWidget* parent_) m_descLabel = new TQTextEdit(widget); m_descLabel->setReadOnly(true); m_descLabel->setTextFormat(TQt::RichText); - m_descLabel->setPaper(tqcolorGroup().background()); + m_descLabel->setPaper(colorGroup().background()); m_descLabel->setMinimumHeight(5 * fontMetrics().height()); boxLayout2->addWidget(m_descLabel, 10); TQWhatsThis::add(m_descLabel, i18n("A description of the selected item is shown here.")); @@ -213,7 +213,7 @@ Dialog::Dialog(NewStuff::DataType type_, TQWidget* parent_) setMinimumWidth(TQMAX(minimumWidth(), NEW_STUFF_MIN_WIDTH)); setMinimumHeight(TQMAX(minimumHeight(), NEW_STUFF_MIN_HEIGHT)); - resize(configDialogSize(TQString::tqfromLatin1("NewStuff Dialog Options"))); + resize(configDialogSize(TQString::fromLatin1("NewStuff Dialog Options"))); KConfigGroup dialogConfig(KGlobal::config(), "NewStuff Dialog Options"); TQValueList<int> splitList = dialogConfig.readIntListEntry("Splitter Sizes"); @@ -221,7 +221,7 @@ Dialog::Dialog(NewStuff::DataType type_, TQWidget* parent_) m_split->setSizes(splitList); } - settqStatus(i18n("Downloading information...")); + setStatus(i18n("Downloading information...")); ProviderLoader* loader = new Tellico::NewStuff::ProviderLoader(this); connect(loader, TQT_SIGNAL(providersLoaded(TQPtrList<KNS::Provider>*)), TQT_SLOT(slotProviders(TQPtrList<KNS::Provider>*))); @@ -232,17 +232,17 @@ Dialog::Dialog(NewStuff::DataType type_, TQWidget* parent_) TQString prov = config.readEntry("ProvidersUrl"); if(prov.isEmpty()) { if(m_type == EntryTemplate) { - prov = TQString::tqfromLatin1("http://periapsis.org/tellico/newstuff/tellicotemplates-providers.php"); - TQString alt = TQString::tqfromLatin1("http://download.kde.org/khotnewstuff/tellicotemplates-providers.xml"); + prov = TQString::fromLatin1("http://periapsis.org/tellico/newstuff/tellicotemplates-providers.php"); + TQString alt = TQString::fromLatin1("http://download.kde.org/khotnewstuff/tellicotemplates-providers.xml"); loader->setAlternativeProvider(alt); } else { - prov = TQString::tqfromLatin1("http://periapsis.org/tellico/newstuff/tellicoscripts-providers.php"); + prov = TQString::fromLatin1("http://periapsis.org/tellico/newstuff/tellicoscripts-providers.php"); } } if(m_type == EntryTemplate) { - m_typeName = TQString::tqfromLatin1("tellico/entry-template"); + m_typeName = TQString::fromLatin1("tellico/entry-template"); } else { - m_typeName = TQString::tqfromLatin1("tellico/data-source"); + m_typeName = TQString::fromLatin1("tellico/data-source"); } loader->load(m_typeName, prov); @@ -253,7 +253,7 @@ Dialog::~Dialog() { delete m_cursorSaver; m_cursorSaver = 0; - saveDialogSize(TQString::tqfromLatin1("NewStuff Dialog Options")); + saveDialogSize(TQString::fromLatin1("NewStuff Dialog Options")); KConfigGroup config(KGlobal::config(), "NewStuff Dialog Options"); config.writeEntry("Splitter Sizes", m_split->sizes()); } @@ -261,7 +261,7 @@ Dialog::~Dialog() { void Dialog::slotProviderError() { if(m_listView->childCount() == 0) { myDebug() << "NewStuff::Dialog::slotCheckError() - no available items" << endl; - settqStatus(TQString()); + setStatus(TQString()); delete m_cursorSaver; m_cursorSaver = 0; @@ -294,7 +294,7 @@ void Dialog::slotResult(KIO::Job* job_) { myDebug() << "NewStuff::Dialog::slotResult() - can't load result: " << u.url() << endl; m_jobs.remove(job_); if(m_jobs.isEmpty()) { - settqStatus(i18n("Ready.")); + setStatus(i18n("Ready.")); delete m_cursorSaver; m_cursorSaver = 0; } @@ -321,7 +321,7 @@ void Dialog::slotResult(KIO::Job* job_) { } m_jobs.remove(job_); if(m_jobs.isEmpty()) { - settqStatus(i18n("Ready.")); + setStatus(i18n("Ready.")); delete m_cursorSaver; m_cursorSaver = 0; } @@ -338,7 +338,7 @@ void Dialog::addEntry(KNS::Entry* entry_) { item->setText(2, TQString::number(entry_->rating())); item->setText(3, TQString::number(entry_->downloads())); item->setText(4, KGlobal::locale()->formatDate(entry_->releaseDate(), true /*short format */)); - item->settqStatus(NewStuff::Manager::installtqStatus(entry_)); + item->setStatus(NewStuff::Manager::installStatus(entry_)); m_entryMap.insert(item, entry_); if(!m_listView->selectedItem()) { @@ -371,15 +371,15 @@ void Dialog::slotSelected(TQListViewItem* item_) { m_lastPreviewItem = item_; } TQPixmap pix = m_type == EntryTemplate - ? DesktopIcon(TQString::tqfromLatin1("looknfeel"), KIcon::SizeLarge) - : UserIcon(TQString::tqfromLatin1("script")); + ? DesktopIcon(TQString::fromLatin1("looknfeel"), KIcon::SizeLarge) + : UserIcon(TQString::fromLatin1("script")); m_iconLabel->setPixmap(pix); TQString license = entry->license(); if(!license.isEmpty()) { license.prepend('(').append(')'); } - TQString name = TQString::tqfromLatin1("%1 %2").tqarg(ENTRYNAME(entry)).tqarg(license); + TQString name = TQString::fromLatin1("%1 %2").arg(ENTRYNAME(entry)).arg(license); TQFont font = m_nameLabel->font(); font.setBold(true); font.setItalic(false); @@ -389,10 +389,10 @@ void Dialog::slotSelected(TQListViewItem* item_) { m_infoLabel->setText(entry->author()); TQString desc = entry->summary(m_lang); - desc.replace(TQRegExp(TQString::tqfromLatin1("\\n")), TQString::tqfromLatin1("<br>")); + desc.replace(TQRegExp(TQString::fromLatin1("\\n")), TQString::fromLatin1("<br>")); m_descLabel->setText(desc); - InstalltqStatus installed = static_cast<Item*>(item_)->status(); + InstallStatus installed = static_cast<Item*>(item_)->status(); m_install->setText(installed == OldVersion ? i18n("Update Stuff", "Update") : i18n("Install")); m_install->setEnabled(installed != Current); } @@ -410,7 +410,7 @@ void Dialog::slotInstall() { delete m_cursorSaver; m_cursorSaver = new GUI::CursorSaver(); - settqStatus(i18n("Installing item...")); + setStatus(i18n("Installing item...")); m_progress->show(); m_timer->start(100); connect(m_manager, TQT_SIGNAL(signalInstalled(KNS::Entry*)), TQT_SLOT(slotDoneInstall(KNS::Entry*))); @@ -423,15 +423,15 @@ void Dialog::slotDoneInstall(KNS::Entry* entry_) { TQMap<TQListViewItem*, KNS::Entry*>::Iterator it; for(it = m_entryMap.begin(); entry_ && it != m_entryMap.end(); ++it) { if(it.data() == entry_) { - InstalltqStatus installed = Manager::installtqStatus(entry_); - static_cast<Item*>(it.key())->settqStatus(installed); + InstallStatus installed = Manager::installStatus(entry_); + static_cast<Item*>(it.key())->setStatus(installed); m_install->setEnabled(installed != Current); break; } } delete m_cursorSaver; m_cursorSaver = 0; - settqStatus(i18n("Ready.")); + setStatus(i18n("Ready.")); m_timer->stop(); m_progress->hide(); } @@ -440,7 +440,7 @@ void Dialog::slotMoveProgress() { m_progress->setProgress(m_progress->progress()+5); } -void Dialog::settqStatus(const TQString& text_) { +void Dialog::setStatus(const TQString& text_) { m_statusBar->changeItem(TQChar(' ') + text_, PROGRESS_STATUS_ID); } diff --git a/src/newstuff/dialog.h b/src/newstuff/dialog.h index 2afb0f2..8154c54 100644 --- a/src/newstuff/dialog.h +++ b/src/newstuff/dialog.h @@ -69,7 +69,7 @@ private slots: private: class Item; - void settqStatus(const TQString& status); + void setStatus(const TQString& status); void addEntry(KNS::Entry* entry); Manager* const m_manager; diff --git a/src/newstuff/manager.cpp b/src/newstuff/manager.cpp index 3847df6..7011e9c 100644 --- a/src/newstuff/manager.cpp +++ b/src/newstuff/manager.cpp @@ -64,7 +64,7 @@ bool Manager::installTemplate(const KURL& url_, const TQString& entryName_) { KTar archive(ref->fileName()); if(archive.open(IO_ReadOnly)) { const KArchiveDirectory* archiveDir = archive.directory(); - archiveDir->copyTo(Tellico::saveLocation(TQString::tqfromLatin1("entry-templates/"))); + archiveDir->copyTo(Tellico::saveLocation(TQString::fromLatin1("entry-templates/"))); allFiles = archiveFiles(archiveDir); // remember files installed for template @@ -74,11 +74,11 @@ bool Manager::installTemplate(const KURL& url_, const TQString& entryName_) { if(name.isEmpty()) { name = url_.fileName(); } - if(!name.endsWith(TQString::tqfromLatin1(".xsl"))) { - name += TQString::tqfromLatin1(".xsl"); + if(!name.endsWith(TQString::fromLatin1(".xsl"))) { + name += TQString::fromLatin1(".xsl"); } KURL dest; - dest.setPath(Tellico::saveLocation(TQString::tqfromLatin1("entry-templates/")) + name); + dest.setPath(Tellico::saveLocation(TQString::fromLatin1("entry-templates/")) + name); success = true; if(TQFile::exists(dest.path())) { myDebug() << "Manager::installTemplate() - " << dest.path() << " exists!" << endl; @@ -115,7 +115,7 @@ bool Manager::removeTemplate(const TQString& name_) { } bool success = true; - TQString path = Tellico::saveLocation(TQString::tqfromLatin1("entry-templates/")); + TQString path = Tellico::saveLocation(TQString::fromLatin1("entry-templates/")); for(TQStringList::ConstIterator it = files.begin(); it != files.end(); ++it) { if((*it).endsWith(TQChar('/'))) { // ok to not delete all directories @@ -158,7 +158,7 @@ bool Manager::installScript(const KURL& url_) { TQFileInfo exeInfo(exeFile); DataSourceInfo* info = new DataSourceInfo(); - TQString copyTarget = Tellico::saveLocation(TQString::tqfromLatin1("data-sources/")); + TQString copyTarget = Tellico::saveLocation(TQString::fromLatin1("data-sources/")); TQString scriptFolder; // package could have a top-level directory or not @@ -229,7 +229,7 @@ bool Manager::removeScript(const TQString& name_) { TQStringList files = fileGroup.readListEntry(name_); bool success = true; - TQString path = Tellico::saveLocation(TQString::tqfromLatin1("data-sources/")); + TQString path = Tellico::saveLocation(TQString::fromLatin1("data-sources/")); for(TQStringList::ConstIterator it = files.begin(); it != files.end(); ++it) { if((*it).endsWith(TQChar('/'))) { // ok to not delete all directories @@ -252,7 +252,7 @@ bool Manager::removeScript(const TQString& name_) { return success; } -Tellico::NewStuff::InstalltqStatus Manager::installtqStatus(KNS::Entry* entry_) { +Tellico::NewStuff::InstallStatus Manager::installStatus(KNS::Entry* entry_) { KConfigGroup config(KGlobal::config(), "KNewStuffStatus"); TQString datestring = config.readEntry(entry_->name()); if(datestring.isEmpty()) { @@ -270,7 +270,7 @@ Tellico::NewStuff::InstalltqStatus Manager::installtqStatus(KNS::Entry* entry_) // also check that executable files exists KConfigGroup fileGroup(KGlobal::config(), "KNewStuffFiles"); TQStringList files = fileGroup.readListEntry(entry_->name()); - TQString path = Tellico::saveLocation(TQString::tqfromLatin1("data-sources/")); + TQString path = Tellico::saveLocation(TQString::fromLatin1("data-sources/")); for(TQStringList::ConstIterator it = files.begin(); it != files.end(); ++it) { if(!TQFile::exists(path + *it)) { return NotInstalled; @@ -303,7 +303,7 @@ TQString Manager::findXSL(const KArchiveDirectory* dir_) { const TQStringList entries = dir_->entries(); for(TQStringList::ConstIterator it = entries.begin(); it != entries.end(); ++it) { const TQString& entry = *it; - if(entry.endsWith(TQString::tqfromLatin1(".xsl"))) { + if(entry.endsWith(TQString::fromLatin1(".xsl"))) { return entry; } } @@ -414,12 +414,12 @@ bool Manager::checkCommonFile() { // look for a file that gets installed to know the installation directory // need to check timestamps TQString userDataDir = Tellico::saveLocation(TQString()); - TQString userCommonFile = userDataDir + '/' + TQString::tqfromLatin1("tellico-common.xsl"); + TQString userCommonFile = userDataDir + '/' + TQString::fromLatin1("tellico-common.xsl"); if(TQFile::exists(userCommonFile)) { // check timestamps // pics/tellico.png is not likely to be in a user directory - TQString installDir = KGlobal::dirs()->findResourceDir("appdata", TQString::tqfromLatin1("pics/tellico.png")); - TQString installCommonFile = installDir + '/' + TQString::tqfromLatin1("tellico-common.xsl"); + TQString installDir = KGlobal::dirs()->findResourceDir("appdata", TQString::fromLatin1("pics/tellico.png")); + TQString installCommonFile = installDir + '/' + TQString::fromLatin1("tellico-common.xsl"); #ifndef NDEBUG if(userCommonFile == installCommonFile) { kdWarning() << "Manager::checkCommonFile() - install location is same as user location" << endl; @@ -438,7 +438,7 @@ bool Manager::checkCommonFile() { } } KURL src, dest; - src.setPath(KGlobal::dirs()->findResource("appdata", TQString::tqfromLatin1("tellico-common.xsl"))); + src.setPath(KGlobal::dirs()->findResource("appdata", TQString::fromLatin1("tellico-common.xsl"))); dest.setPath(userCommonFile); return KIO::NetAccess::file_copy(src, dest); } diff --git a/src/newstuff/manager.h b/src/newstuff/manager.h index 8b33dd4..b8cc2dc 100644 --- a/src/newstuff/manager.h +++ b/src/newstuff/manager.h @@ -40,7 +40,7 @@ enum DataType { DataScript }; -enum InstalltqStatus { +enum InstallStatus { NotInstalled, OldVersion, Current @@ -71,7 +71,7 @@ public: bool installScript(const KURL& url); bool removeScript(const TQString& name); - static InstalltqStatus installtqStatus(KNS::Entry* entry); + static InstallStatus installStatus(KNS::Entry* entry); static bool checkCommonFile(); signals: diff --git a/src/newstuff/newscript.cpp b/src/newstuff/newscript.cpp index 3a47dd1..697f449 100644 --- a/src/newstuff/newscript.cpp +++ b/src/newstuff/newscript.cpp @@ -22,7 +22,7 @@ using Tellico::NewStuff::NewScript; NewScript::NewScript(Manager* manager_, TQWidget* parentWidget_) #if KDE_IS_VERSION(3,3,90) - : KNewStuffSecure(TQString::tqfromLatin1("tellico/data-source"), parentWidget_) + : KNewStuffSecure(TQString::fromLatin1("tellico/data-source"), parentWidget_) #else : TQObject(parentWidget_) #endif diff --git a/src/reportdialog.cpp b/src/reportdialog.cpp index d2cb615..adf5ec9 100644 --- a/src/reportdialog.cpp +++ b/src/reportdialog.cpp @@ -35,7 +35,7 @@ #include <ksortablevaluelist.h> #include <kfiledialog.h> -#include <tqlayout.h> +#include <layout.h> #include <tqfile.h> #include <tqlabel.h> #include <tqfileinfo.h> @@ -61,7 +61,7 @@ ReportDialog::ReportDialog(TQWidget* parent_, const char* name_/*=0*/) hlay->addWidget(l); // KStandardDirs::findAllResources(const char *type, const TQString &filter, bool recursive, bool uniq) - TQStringList files = KGlobal::dirs()->findAllResources("appdata", TQString::tqfromLatin1("report-templates/*.xsl"), + TQStringList files = KGlobal::dirs()->findAllResources("appdata", TQString::fromLatin1("report-templates/*.xsl"), false, true); KSortableValueList<TQString, TQString> templates; for(TQStringList::ConstIterator it = files.begin(); it != files.end(); ++it) { @@ -69,7 +69,7 @@ ReportDialog::ReportDialog(TQWidget* parent_, const char* name_/*=0*/) TQString file = fi.fileName(); TQString name = file.section('.', 0, -2); name.replace('_', ' '); - TQString title = i18n((name + TQString::tqfromLatin1(" XSL Template")).utf8(), name.utf8()); + TQString title = i18n((name + TQString::fromLatin1(" XSL Template")).utf8(), name.utf8()); templates.insert(title, file); } templates.sort(); @@ -80,7 +80,7 @@ ReportDialog::ReportDialog(TQWidget* parent_, const char* name_/*=0*/) hlay->addWidget(m_templateCombo); l->setBuddy(m_templateCombo); - KPushButton* pb1 = new KPushButton(SmallIconSet(TQString::tqfromLatin1("exec")), i18n("&Generate"), mainWidget); + KPushButton* pb1 = new KPushButton(SmallIconSet(TQString::fromLatin1("exec")), i18n("&Generate"), mainWidget); hlay->addWidget(pb1); connect(pb1, TQT_SIGNAL(clicked()), TQT_SLOT(slotGenerate())); @@ -101,32 +101,32 @@ ReportDialog::ReportDialog(TQWidget* parent_, const char* name_/*=0*/) m_HTMLPart->setPluginsEnabled(false); topLayout->addWidget(m_HTMLPart->view()); - TQString text = TQString::tqfromLatin1("<html><style>p{font-weight:bold;width:50%;" + TQString text = TQString::fromLatin1("<html><style>p{font-weight:bold;width:50%;" "margin:20% auto auto auto;text-align:center;" - "background:white;color:%1;}</style><body><p>").tqarg(contrastColor.name()) + "background:white;color:%1;}</style><body><p>").arg(contrastColor.name()) + i18n("Select a report template and click <em>Generate</em>.") + ' ' + i18n("Some reports may take several seconds to generate for large collections."); - + TQString::tqfromLatin1("</p></body></html>"); + + TQString::fromLatin1("</p></body></html>"); m_HTMLPart->begin(); m_HTMLPart->write(text); m_HTMLPart->end(); setMinimumWidth(TQMAX(minimumWidth(), REPORT_MIN_WIDTH)); setMinimumHeight(TQMAX(minimumHeight(), REPORT_MIN_HEIGHT)); - resize(configDialogSize(TQString::tqfromLatin1("Report Dialog Options"))); + resize(configDialogSize(TQString::fromLatin1("Report Dialog Options"))); } ReportDialog::~ReportDialog() { delete m_exporter; m_exporter = 0; - saveDialogSize(TQString::tqfromLatin1("Report Dialog Options")); + saveDialogSize(TQString::fromLatin1("Report Dialog Options")); } void ReportDialog::slotGenerate() { GUI::CursorSaver cs(TQt::waitCursor); - TQString fileName = TQString::tqfromLatin1("report-templates/") + m_templateCombo->currentData().toString(); + TQString fileName = TQString::fromLatin1("report-templates/") + m_templateCombo->currentData().toString(); TQString xsltFile = locate("appdata", fileName); if(xsltFile.isEmpty()) { kdWarning() << "ReportDialog::setXSLTFile() - can't locate " << m_templateCombo->currentData().toString() << endl; @@ -174,7 +174,7 @@ void ReportDialog::slotRefresh() { m_HTMLPart->begin(u); m_HTMLPart->write(m_exporter->text()); #if 0 - TQFile f(TQString::tqfromLatin1("/tmp/test.html")); + TQFile f(TQString::fromLatin1("/tmp/test.html")); if(f.open(IO_WriteOnly)) { TQTextStream t(&f); t << m_exporter->text(); @@ -183,7 +183,7 @@ void ReportDialog::slotRefresh() { #endif m_HTMLPart->end(); // is this needed? -// view()->tqlayout(); +// view()->layout(); } // actually the print button diff --git a/src/statusbar.cpp b/src/statusbar.cpp index c0e00a6..af8370e 100644 --- a/src/statusbar.cpp +++ b/src/statusbar.cpp @@ -37,17 +37,17 @@ StatusBar::StatusBar(TQWidget* parent_) : KStatusBar(parent_) { // don't care about text and id m_mainLabel = new KStatusBarLabel(TQString(), 0, this); m_mainLabel->setIndent(4); - m_mainLabel->tqsetAlignment(TQt::AlignLeft | TQt::AlignVCenter); + m_mainLabel->setAlignment(TQt::AlignLeft | TQt::AlignVCenter); addWidget(m_mainLabel, 3 /*stretch*/, true /*permanent*/); m_countLabel = new KStatusBarLabel(TQString(), 1, this); - m_countLabel->tqsetAlignment(TQt::AlignLeft | TQt::AlignVCenter); + m_countLabel->setAlignment(TQt::AlignLeft | TQt::AlignVCenter); m_countLabel->setIndent(4); addWidget(m_countLabel, 0, true); m_progress = new GUI::Progress(100, this); addWidget(m_progress, 1, true); - m_cancelButton = new KPushButton(SmallIcon(TQString::tqfromLatin1("cancel")), TQString(), this); + m_cancelButton = new KPushButton(SmallIcon(TQString::fromLatin1("cancel")), TQString(), this); TQToolTip::add(m_cancelButton, i18n("Cancel")); addWidget(m_cancelButton, 0, true); m_progress->hide(); @@ -64,7 +64,7 @@ void StatusBar::polish() { int h = 0; TQObjectList* list = queryList(TQWIDGET_OBJECT_NAME_STRING, 0, false, false); for(TQObject* o = list->first(); o; o = list->next()) { - int _h = TQT_TQWIDGET(o)->tqminimumSizeHint().height(); + int _h = TQT_TQWIDGET(o)->minimumSizeHint().height(); if(_h > h) { h = _h; } @@ -79,11 +79,11 @@ void StatusBar::polish() { delete list; } -void StatusBar::cleartqStatus() { - settqStatus(i18n("Ready.")); +void StatusBar::clearStatus() { + setStatus(i18n("Ready.")); } -void StatusBar::settqStatus(const TQString& status_) { +void StatusBar::setStatus(const TQString& status_) { // always add a space for asthetics m_mainLabel->setText(status_ + ' '); } diff --git a/src/statusbar.h b/src/statusbar.h index 7991277..cf1aadc 100644 --- a/src/statusbar.h +++ b/src/statusbar.h @@ -33,8 +33,8 @@ Q_OBJECT TQ_OBJECT public: - void cleartqStatus(); - void settqStatus(const TQString& status); + void clearStatus(); + void setStatus(const TQString& status); void setCount(const TQString& count); static StatusBar* self() { return s_self; } diff --git a/src/tellico_kernel.cpp b/src/tellico_kernel.cpp index 4268681..1c5fdec 100644 --- a/src/tellico_kernel.cpp +++ b/src/tellico_kernel.cpp @@ -283,7 +283,7 @@ bool Kernel::removeFilter(FilterPtr filter_) { } TQString str = i18n("Do you really want to delete this filter?"); - TQString dontAsk = TQString::tqfromLatin1("DeleteFilter"); + TQString dontAsk = TQString::fromLatin1("DeleteFilter"); int ret = KMessageBox::questionYesNo(m_widget, str, i18n("Delete Filter?"), KStdGuiItem::yes(), KStdGuiItem::no(), dontAsk); if(ret != KMessageBox::Yes) { @@ -371,8 +371,8 @@ TQPair<Tellico::Data::FieldVec, Tellico::Data::FieldVec> Kernel::mergeFields(Dat int Kernel::askAndMerge(Data::EntryPtr entry1_, Data::EntryPtr entry2_, Data::FieldPtr field_, TQString value1_, TQString value2_) { - TQString title1 = entry1_->field(TQString::tqfromLatin1("title")); - TQString title2 = entry2_->field(TQString::tqfromLatin1("title")); + TQString title1 = entry1_->field(TQString::fromLatin1("title")); + TQString title2 = entry2_->field(TQString::fromLatin1("title")); if(title1 == title2) { title1 = i18n("Entry 1"); title2 = i18n("Entry 2"); @@ -383,21 +383,21 @@ int Kernel::askAndMerge(Data::EntryPtr entry1_, Data::EntryPtr entry2_, Data::Fi if(value2_.isEmpty()) { value2_ = entry2_->field(field_); } - TQString text = TQString::tqfromLatin1("<qt>") - + i18n("Conflicting values for %1 were found while merging entries.").tqarg(field_->title()) - + TQString::tqfromLatin1("<br/><center><table><tr>" + TQString text = TQString::fromLatin1("<qt>") + + i18n("Conflicting values for %1 were found while merging entries.").arg(field_->title()) + + TQString::fromLatin1("<br/><center><table><tr>" "<th>%1</th>" - "<th>%2</th></tr>").tqarg(title1, title2) - + TQString::tqfromLatin1("<tr><td><em>%1</em></td>").tqarg(value1_) - + TQString::tqfromLatin1("<td><em>%1</em></td></tr></table></center>").tqarg(value2_) + "<th>%2</th></tr>").arg(title1, title2) + + TQString::fromLatin1("<tr><td><em>%1</em></td>").arg(value1_) + + TQString::fromLatin1("<td><em>%1</em></td></tr></table></center>").arg(value2_) + i18n("Please choose which value to keep.") - + TQString::tqfromLatin1("</qt>"); + + TQString::fromLatin1("</qt>"); int ret = KMessageBox::warningYesNoCancel(Kernel::self()->widget(), text, i18n("Merge Entries"), - i18n("Select value from %1").tqarg(title1), - i18n("Select value from %1").tqarg(title2)); + i18n("Select value from %1").arg(title1), + i18n("Select value from %1").arg(title2)); switch(ret) { case KMessageBox::Cancel: return 0; case KMessageBox::Yes: return -1; // keep original value diff --git a/src/tellico_utils.cpp b/src/tellico_utils.cpp index f04036a..275c096 100644 --- a/src/tellico_utils.cpp +++ b/src/tellico_utils.cpp @@ -35,7 +35,7 @@ namespace { TQColor Tellico::contrastColor; TQString Tellico::decodeHTML(TQString text) { - TQRegExp rx(TQString::tqfromLatin1("&(.+);")); + TQRegExp rx(TQString::fromLatin1("&(.+);")); rx.setMinimal(true); int pos = rx.search(text); while(pos > -1) { @@ -51,7 +51,7 @@ TQString Tellico::decodeHTML(TQString text) { TQString Tellico::uid(int l, bool prefix) { TQString uid; if(prefix) { - uid = TQString::tqfromLatin1("Tellico"); + uid = TQString::fromLatin1("Tellico"); } uid.append(kapp->randomString(TQMAX(l - uid.length(), 0))); return uid; @@ -80,7 +80,7 @@ uint Tellico::toUInt(const TQString& s, bool* ok) { TQString Tellico::i18nReplace(TQString text) { // Because TQDomDocument sticks in random newlines, go ahead and grab them too - static TQRegExp rx(TQString::tqfromLatin1("(?:\\n+ *)*<i18n>([^<]*)</i18n>(?: *\\n+)*")); + static TQRegExp rx(TQString::fromLatin1("(?:\\n+ *)*<i18n>([^<]*)</i18n>(?: *\\n+)*")); int pos = rx.search(text); while(pos > -1) { text.replace(pos, rx.matchedLength(), i18n(rx.cap(1).utf8())); @@ -118,7 +118,7 @@ int Tellico::stringHash(const TQString& str) { uint h = 0; uint g = 0; for(uint i = 0; i < str.length(); ++i) { - h = (h << 4) + str.tqunicode()[i].cell(); + h = (h << 4) + str.unicode()[i].cell(); if((g = h & 0xf0000000)) { h ^= g >> 24; } diff --git a/src/tests/latin1test.cpp b/src/tests/latin1test.cpp index 3550914..9f1deab 100644 --- a/src/tests/latin1test.cpp +++ b/src/tests/latin1test.cpp @@ -12,12 +12,12 @@ int main(int, char**) { assert(TQString() == Latin1Literal(0)); assert(TQString() != Latin1Literal("")); - assert(TQString::tqfromLatin1("") == Latin1Literal("")); - assert(TQString::tqfromLatin1("") != Latin1Literal(0)); - assert(TQString::tqfromLatin1("x") != Latin1Literal("")); - assert(TQString::tqfromLatin1("a") == Latin1Literal("a")); - assert(TQString::tqfromLatin1("a") != Latin1Literal("b")); - assert(TQString::tqfromLatin1("\xe4") == Latin1Literal("\xe4")); + assert(TQString::fromLatin1("") == Latin1Literal("")); + assert(TQString::fromLatin1("") != Latin1Literal(0)); + assert(TQString::fromLatin1("x") != Latin1Literal("")); + assert(TQString::fromLatin1("a") == Latin1Literal("a")); + assert(TQString::fromLatin1("a") != Latin1Literal("b")); + assert(TQString::fromLatin1("\xe4") == Latin1Literal("\xe4")); assert(TQString::fromUtf8("\xe2\x82\xac") != Latin1Literal("?")); kdDebug() << "\nLatin1Literal Test OK !" << endl; diff --git a/src/translators/alexandriaexporter.cpp b/src/translators/alexandriaexporter.cpp index f59cefe..51e6390 100644 --- a/src/translators/alexandriaexporter.cpp +++ b/src/translators/alexandriaexporter.cpp @@ -35,7 +35,7 @@ namespace { using Tellico::Export::AlexandriaExporter; TQString& AlexandriaExporter::escapeText(TQString& str_) { - str_.replace('"', TQString::tqfromLatin1("\\\"")); + str_.replace('"', TQString::fromLatin1("\\\"")); return str_; } @@ -50,7 +50,7 @@ bool AlexandriaExporter::exec() { return false; } - const TQString alexDirName = TQString::tqfromLatin1(".alexandria"); + const TQString alexDirName = TQString::fromLatin1(".alexandria"); // create if necessary TQDir libraryDir = TQDir::home(); @@ -66,7 +66,7 @@ bool AlexandriaExporter::exec() { int ret = KMessageBox::warningContinueCancel(Kernel::self()->widget(), i18n("<qt>An Alexandria library called <i>%1</i> already exists. " "Any existing books in that library could be overwritten.</qt>") - .tqarg(coll->title())); + .arg(coll->title())); if(ret == KMessageBox::Cancel) { return false; } @@ -97,13 +97,13 @@ bool AlexandriaExporter::exec() { // everything is put between quotes except for the rating, just to be sure it's interpreted as a string bool AlexandriaExporter::writeFile(const TQDir& dir_, Data::ConstEntryPtr entry_) { // the filename is the isbn without dashes, followed by .yaml - TQString isbn = entry_->field(TQString::tqfromLatin1("isbn")); + TQString isbn = entry_->field(TQString::fromLatin1("isbn")); if(isbn.isEmpty()) { return false; // can't write it since Alexandria uses isbn as name of file } isbn.remove('-'); // remove dashes - TQFile file(dir_.absPath() + TQDir::separator() + isbn + TQString::tqfromLatin1(".yaml")); + TQFile file(dir_.absPath() + TQDir::separator() + isbn + TQString::fromLatin1(".yaml")); if(!file.open(IO_WriteOnly)) { return false; } @@ -116,7 +116,7 @@ bool AlexandriaExporter::writeFile(const TQDir& dir_, Data::ConstEntryPtr entry_ ts.setEncoding(TQTextStream::UnicodeUTF8); ts << "--- !ruby/object:Alexandria::Book\n"; ts << "authors:\n"; - TQStringList authors = entry_->fields(TQString::tqfromLatin1("author"), format); + TQStringList authors = entry_->fields(TQString::fromLatin1("author"), format); for(TQStringList::Iterator it = authors.begin(); it != authors.end(); ++it) { ts << " - " << escapeText(*it) << "\n"; } @@ -125,30 +125,30 @@ bool AlexandriaExporter::writeFile(const TQDir& dir_, Data::ConstEntryPtr entry_ ts << " - n/a\n"; } - TQString tmp = entry_->field(TQString::tqfromLatin1("title"), format); + TQString tmp = entry_->field(TQString::fromLatin1("title"), format); ts << "title: \"" << escapeText(tmp) << "\"\n"; // Alexandria refers to the binding as the edition - tmp = entry_->field(TQString::tqfromLatin1("binding"), format); + tmp = entry_->field(TQString::fromLatin1("binding"), format); ts << "edition: \"" << escapeText(tmp) << "\"\n"; // sometimes Alexandria interprets the isbn as a number instead of a string // I have no idea how to debug ruby, so err on safe side and add quotes ts << "isbn: \"" << isbn << "\"\n"; - tmp = entry_->field(TQString::tqfromLatin1("comments"), format); + tmp = entry_->field(TQString::fromLatin1("comments"), format); ts << "notes: \"" << escapeText(tmp) << "\"\n"; - tmp = entry_->field(TQString::tqfromLatin1("publisher"), format); + tmp = entry_->field(TQString::fromLatin1("publisher"), format); // publisher uses n/a when empty - ts << "publisher: \"" << (tmp.isEmpty() ? TQString::tqfromLatin1("n/a") : escapeText(tmp)) << "\"\n"; + ts << "publisher: \"" << (tmp.isEmpty() ? TQString::fromLatin1("n/a") : escapeText(tmp)) << "\"\n"; - tmp = entry_->field(TQString::tqfromLatin1("pub_year"), format); + tmp = entry_->field(TQString::fromLatin1("pub_year"), format); if(!tmp.isEmpty()) { ts << "publishing_year: \"" << escapeText(tmp) << "\"\n"; } - tmp = entry_->field(TQString::tqfromLatin1("rating")); + tmp = entry_->field(TQString::fromLatin1("rating")); bool ok; int rating = Tellico::toUInt(tmp, &ok); if(ok) { @@ -157,7 +157,7 @@ bool AlexandriaExporter::writeFile(const TQDir& dir_, Data::ConstEntryPtr entry_ file.close(); - TQString cover = entry_->field(TQString::tqfromLatin1("cover")); + TQString cover = entry_->field(TQString::fromLatin1("cover")); if(cover.isEmpty() || !(options() & Export::ExportImages)) { return true; // all done } @@ -173,8 +173,8 @@ bool AlexandriaExporter::writeFile(const TQDir& dir_, Data::ConstEntryPtr entry_ } else { img2 = img1.smoothScale(ALEXANDRIA_MAX_SIZE_MEDIUM, ALEXANDRIA_MAX_SIZE_MEDIUM, TQ_ScaleMin); // scale up } - if(!img1.save(filename + TQString::tqfromLatin1("_medium.jpg"), "JPEG") - || !img2.save(filename + TQString::tqfromLatin1("_small.jpg"), "JPEG")) { + if(!img1.save(filename + TQString::fromLatin1("_medium.jpg"), "JPEG") + || !img2.save(filename + TQString::fromLatin1("_small.jpg"), "JPEG")) { return false; } return true; diff --git a/src/translators/alexandriaimporter.cpp b/src/translators/alexandriaimporter.cpp index c3a9db1..9feffec 100644 --- a/src/translators/alexandriaimporter.cpp +++ b/src/translators/alexandriaimporter.cpp @@ -25,7 +25,7 @@ #include <kapplication.h> #include <kstringhandler.h> -#include <tqlayout.h> +#include <layout.h> #include <tqlabel.h> #include <tqgroupbox.h> @@ -46,18 +46,18 @@ Tellico::Data::CollPtr AlexandriaImporter::collection() { dataDir.cd(m_library->currentText()); dataDir.setFilter(TQDir::Files | TQDir::Readable | TQDir::NoSymLinks); - const TQString title = TQString::tqfromLatin1("title"); - const TQString author = TQString::tqfromLatin1("author"); - const TQString year = TQString::tqfromLatin1("pub_year"); - const TQString binding = TQString::tqfromLatin1("binding"); - const TQString isbn = TQString::tqfromLatin1("isbn"); - const TQString pub = TQString::tqfromLatin1("publisher"); - const TQString rating = TQString::tqfromLatin1("rating"); - const TQString cover = TQString::tqfromLatin1("cover"); - const TQString comments = TQString::tqfromLatin1("comments"); + const TQString title = TQString::fromLatin1("title"); + const TQString author = TQString::fromLatin1("author"); + const TQString year = TQString::fromLatin1("pub_year"); + const TQString binding = TQString::fromLatin1("binding"); + const TQString isbn = TQString::fromLatin1("isbn"); + const TQString pub = TQString::fromLatin1("publisher"); + const TQString rating = TQString::fromLatin1("rating"); + const TQString cover = TQString::fromLatin1("cover"); + const TQString comments = TQString::fromLatin1("comments"); // start with yaml files - dataDir.setNameFilter(TQString::tqfromLatin1("*.yaml")); + dataDir.setNameFilter(TQString::fromLatin1("*.yaml")); const TQStringList files = dataDir.entryList(); const uint numFiles = files.count(); const uint stepSize = TQMAX(s_stepSize, numFiles/100); @@ -69,9 +69,9 @@ Tellico::Data::CollPtr AlexandriaImporter::collection() { ProgressItem::Done done(this); TQStringList covers; - covers << TQString::tqfromLatin1(".cover") - << TQString::tqfromLatin1("_medium.jpg") - << TQString::tqfromLatin1("_small.jpg"); + covers << TQString::fromLatin1(".cover") + << TQString::fromLatin1("_medium.jpg") + << TQString::fromLatin1("_small.jpg"); TQTextStream ts; ts.setEncoding(TQTextStream::UnicodeUTF8); // YAML is always utf8? @@ -95,7 +95,7 @@ Tellico::Data::CollPtr AlexandriaImporter::collection() { readNextLine = true; } // skip the line that starts with --- - if(line.isEmpty() || line.startsWith(TQString::tqfromLatin1("---"))) { + if(line.isEmpty() || line.startsWith(TQString::fromLatin1("---"))) { continue; } if(line.endsWith(TQChar('\\'))) { @@ -117,13 +117,13 @@ Tellico::Data::CollPtr AlexandriaImporter::collection() { if(alexField == Latin1Literal("authors")) { TQStringList authors; line = ts.readLine(); - TQRegExp begin(TQString::tqfromLatin1("^\\s*-\\s+")); + TQRegExp begin(TQString::fromLatin1("^\\s*-\\s+")); while(!line.isNull() && line.find(begin) > -1) { line.remove(begin); authors += clean(line); line = ts.readLine(); } - entry->setField(author, authors.join(TQString::tqfromLatin1("; "))); + entry->setField(author, authors.join(TQString::fromLatin1("; "))); // the next line has already been read readNextLine = false; @@ -196,10 +196,10 @@ TQWidget* AlexandriaImporter::widget(TQWidget* parent_, const char* name_/*=0*/) label->setBuddy(m_library); // .alexandria might not exist - if(m_libraryDir.cd(TQString::tqfromLatin1(".alexandria"))) { + if(m_libraryDir.cd(TQString::fromLatin1(".alexandria"))) { TQStringList dirs = m_libraryDir.entryList(); - dirs.remove(TQString::tqfromLatin1(".")); // why can't I tell TQDir not to include these? TQDir::Hidden doesn't work - dirs.remove(TQString::tqfromLatin1("..")); + dirs.remove(TQString::fromLatin1(".")); // why can't I tell TQDir not to include these? TQDir::Hidden doesn't work + dirs.remove(TQString::fromLatin1("..")); m_library->insertStringList(dirs); } @@ -209,10 +209,10 @@ TQWidget* AlexandriaImporter::widget(TQWidget* parent_, const char* name_/*=0*/) } TQString& AlexandriaImporter::cleanLine(TQString& str_) { - static TQRegExp escRx(TQString::tqfromLatin1("\\\\x(\\w\\w)"), false); - str_.remove(TQString::tqfromLatin1("\\r")); - str_.replace(TQString::tqfromLatin1("\\n"), TQString::tqfromLatin1("\n")); - str_.replace(TQString::tqfromLatin1("\\t"), TQString::tqfromLatin1("\t")); + static TQRegExp escRx(TQString::fromLatin1("\\\\x(\\w\\w)"), false); + str_.remove(TQString::fromLatin1("\\r")); + str_.replace(TQString::fromLatin1("\\n"), TQString::fromLatin1("\n")); + str_.replace(TQString::fromLatin1("\\t"), TQString::fromLatin1("\t")); // YAML uses escape sequences like \xC3 int pos = escRx.search(str_); @@ -236,7 +236,7 @@ TQString& AlexandriaImporter::cleanLine(TQString& str_) { } TQString AlexandriaImporter::clean(TQString& str_) { - const TQRegExp quote(TQString::tqfromLatin1("\\\\\"")); // equals \" + const TQRegExp quote(TQString::fromLatin1("\\\\\"")); // equals \" if(str_.startsWith(TQChar('\'')) || str_.startsWith(TQChar('"'))) { str_.remove(0, 1); } @@ -244,7 +244,7 @@ TQString AlexandriaImporter::clean(TQString& str_) { str_.truncate(str_.length()-1); } // we ignore YAML tags, this is not actually a good parser, but will do for now - str_.remove(TQRegExp(TQString::tqfromLatin1("^![^\\s]*\\s+"))); + str_.remove(TQRegExp(TQString::fromLatin1("^![^\\s]*\\s+"))); return str_.replace(quote, TQChar('"')); } diff --git a/src/translators/amcimporter.cpp b/src/translators/amcimporter.cpp index 0209ddc..185b8fc 100644 --- a/src/translators/amcimporter.cpp +++ b/src/translators/amcimporter.cpp @@ -64,7 +64,7 @@ Tellico::Data::CollPtr AMCImporter::collection() { TQMemArray<char> buffer(l+1); m_ds.readRawBytes(buffer.data(), l); TQString version = TQString::fromLocal8Bit(buffer, l); - TQRegExp versionRx(TQString::tqfromLatin1(".+AMC_(\\d+)\\.(\\d+).+")); + TQRegExp versionRx(TQString::fromLatin1(".+AMC_(\\d+)\\.(\\d+).+")); if(version.find(versionRx) == -1) { myDebug() << "AMCImporter::collection() - no file id match" << endl; return 0; @@ -145,11 +145,11 @@ TQString AMCImporter::readImage(const TQString& format_) { myDebug() << "AMCImporter::readImage() - null image" << endl; return TQString(); } - TQString format = TQString::tqfromLatin1("PNG"); + TQString format = TQString::fromLatin1("PNG"); if(format_ == Latin1Literal(".jpg")) { - format = TQString::tqfromLatin1("JPEG"); + format = TQString::fromLatin1("JPEG"); } else if(format_ == Latin1Literal(".gif")) { - format = TQString::tqfromLatin1("GIF"); + format = TQString::fromLatin1("GIF"); } return ImageFactory::addImage(img, format); } @@ -167,14 +167,14 @@ void AMCImporter::readEntry() { if(m_majVersion >= 3 && m_minVersion >= 5) { rating /= 10; } - e->setField(TQString::tqfromLatin1("rating"), TQString::number(rating)); + e->setField(TQString::fromLatin1("rating"), TQString::number(rating)); int year = readInt(); if(year > 0) { - e->setField(TQString::tqfromLatin1("year"), TQString::number(year)); + e->setField(TQString::fromLatin1("year"), TQString::number(year)); } int time = readInt(); if(time > 0) { - e->setField(TQString::tqfromLatin1("running-time"), TQString::number(time)); + e->setField(TQString::fromLatin1("running-time"), TQString::number(time)); } readInt(); // video bitrate @@ -182,55 +182,55 @@ void AMCImporter::readEntry() { readInt(); // number of files readBool(); // checked readString(); // media label - e->setField(TQString::tqfromLatin1("medium"), readString()); + e->setField(TQString::fromLatin1("medium"), readString()); readString(); // source readString(); // borrower TQString s = readString(); // title if(!s.isEmpty()) { - e->setField(TQString::tqfromLatin1("title"), s); + e->setField(TQString::fromLatin1("title"), s); } TQString s2 = readString(); // translated title if(s.isEmpty()) { - e->setField(TQString::tqfromLatin1("title"), s2); + e->setField(TQString::fromLatin1("title"), s2); } - e->setField(TQString::tqfromLatin1("director"), readString()); + e->setField(TQString::fromLatin1("director"), readString()); s = readString(); - TQRegExp roleRx(TQString::tqfromLatin1("(.+) \\(([^(]+)\\)")); + TQRegExp roleRx(TQString::fromLatin1("(.+) \\(([^(]+)\\)")); roleRx.setMinimal(true); if(s.find(roleRx) > -1) { TQString role = roleRx.cap(2).lower(); if(role == Latin1Literal("story") || role == Latin1Literal("written by")) { - e->setField(TQString::tqfromLatin1("writer"), roleRx.cap(1)); + e->setField(TQString::fromLatin1("writer"), roleRx.cap(1)); } else { - e->setField(TQString::tqfromLatin1("producer"), s); + e->setField(TQString::fromLatin1("producer"), s); } } else { - e->setField(TQString::tqfromLatin1("producer"), s); + e->setField(TQString::fromLatin1("producer"), s); } - e->setField(TQString::tqfromLatin1("nationality"), readString()); - e->setField(TQString::tqfromLatin1("genre"), readString().replace(TQString::tqfromLatin1(", "), TQString::tqfromLatin1("; "))); + e->setField(TQString::fromLatin1("nationality"), readString()); + e->setField(TQString::fromLatin1("genre"), readString().replace(TQString::fromLatin1(", "), TQString::fromLatin1("; "))); - e->setField(TQString::tqfromLatin1("cast"), parseCast(readString()).join(TQString::tqfromLatin1("; "))); + e->setField(TQString::fromLatin1("cast"), parseCast(readString()).join(TQString::fromLatin1("; "))); readString(); // url - e->setField(TQString::tqfromLatin1("plot"), readString()); - e->setField(TQString::tqfromLatin1("comments"), readString()); + e->setField(TQString::fromLatin1("plot"), readString()); + e->setField(TQString::fromLatin1("comments"), readString()); s = readString(); // video format - TQRegExp regionRx(TQString::tqfromLatin1("Region \\d")); + TQRegExp regionRx(TQString::fromLatin1("Region \\d")); if(s.find(regionRx) > -1) { - e->setField(TQString::tqfromLatin1("region"), regionRx.cap(0)); + e->setField(TQString::fromLatin1("region"), regionRx.cap(0)); } - e->setField(TQString::tqfromLatin1("audio-track"), readString()); // audio format + e->setField(TQString::fromLatin1("audio-track"), readString()); // audio format readString(); // resolution readString(); // frame rate - e->setField(TQString::tqfromLatin1("language"), readString()); // audio language - e->setField(TQString::tqfromLatin1("subtitle"), readString()); // subtitle + e->setField(TQString::fromLatin1("language"), readString()); // audio language + e->setField(TQString::fromLatin1("subtitle"), readString()); // subtitle readString(); // file size s = readString(); // picture extension s = readImage(s); // picture if(!s.isEmpty()) { - e->setField(TQString::tqfromLatin1("cover"), s); + e->setField(TQString::fromLatin1("cover"), s); } m_coll->addEntries(e); @@ -239,7 +239,7 @@ void AMCImporter::readEntry() { TQStringList AMCImporter::parseCast(const TQString& text_) { TQStringList cast; int nPar = 0; - TQRegExp castRx(TQString::tqfromLatin1("[,()]")); + TQRegExp castRx(TQString::fromLatin1("[,()]")); TQString person, role; int oldPos = 0; for(int pos = text_.find(castRx); pos > -1; pos = text_.find(castRx, pos+1)) { @@ -248,7 +248,7 @@ TQStringList AMCImporter::parseCast(const TQString& text_) { person += text_.mid(oldPos, pos-oldPos).stripWhiteSpace(); TQString all = person; if(!role.isEmpty()) { - if(role.startsWith(TQString::tqfromLatin1("as "))) { + if(role.startsWith(TQString::fromLatin1("as "))) { role = role.mid(3); } all += "::" + role; @@ -277,7 +277,7 @@ TQStringList AMCImporter::parseCast(const TQString& text_) { person += text_.mid(oldPos, pos-oldPos).stripWhiteSpace(); TQString all = person; if(!role.isEmpty()) { - if(role.startsWith(TQString::tqfromLatin1("as "))) { + if(role.startsWith(TQString::fromLatin1("as "))) { role = role.mid(3); } all += "::" + role; diff --git a/src/translators/audiofileimporter.cpp b/src/translators/audiofileimporter.cpp index e962b18..2e8054a 100644 --- a/src/translators/audiofileimporter.cpp +++ b/src/translators/audiofileimporter.cpp @@ -38,7 +38,7 @@ #include <kapplication.h> #include <tqlabel.h> -#include <tqlayout.h> +#include <layout.h> #include <tqvgroupbox.h> #include <tqcheckbox.h> #include <tqdir.h> @@ -102,13 +102,13 @@ Tellico::Data::CollPtr AudioFileImporter::collection() { } item.setTotalSteps(files.count()); - const TQString title = TQString::tqfromLatin1("title"); - const TQString artist = TQString::tqfromLatin1("artist"); - const TQString year = TQString::tqfromLatin1("year"); - const TQString genre = TQString::tqfromLatin1("genre"); - const TQString track = TQString::tqfromLatin1("track"); - const TQString comments = TQString::tqfromLatin1("comments"); - const TQString file = TQString::tqfromLatin1("file"); + const TQString title = TQString::fromLatin1("title"); + const TQString artist = TQString::fromLatin1("artist"); + const TQString year = TQString::fromLatin1("year"); + const TQString genre = TQString::fromLatin1("genre"); + const TQString track = TQString::fromLatin1("track"); + const TQString comments = TQString::fromLatin1("comments"); + const TQString file = TQString::fromLatin1("file"); m_coll = new Data::MusicCollection(true); @@ -122,12 +122,12 @@ Tellico::Data::CollPtr AudioFileImporter::collection() { f = new Data::Field(file, i18n("Files"), Data::Field::Table); m_coll->addField(f); } - f->setProperty(TQString::tqfromLatin1("column1"), i18n("Files")); + f->setProperty(TQString::fromLatin1("column1"), i18n("Files")); if(addBitrate) { - f->setProperty(TQString::tqfromLatin1("columns"), TQChar('2')); - f->setProperty(TQString::tqfromLatin1("column2"), i18n("Bitrate")); + f->setProperty(TQString::fromLatin1("columns"), TQChar('2')); + f->setProperty(TQString::fromLatin1("column2"), i18n("Bitrate")); } else { - f->setProperty(TQString::tqfromLatin1("columns"), TQChar('1')); + f->setProperty(TQString::fromLatin1("columns"), TQChar('1')); } } @@ -141,7 +141,7 @@ Tellico::Data::CollPtr AudioFileImporter::collection() { for(TQStringList::ConstIterator it = files.begin(); !m_cancelled && it != files.end(); ++it, ++j) { TagLib::FileRef f(TQFile::encodeName(*it)); if(f.isNull() || !f.tag()) { - if((*it).endsWith(TQString::tqfromLatin1("/.directory"))) { + if((*it).endsWith(TQString::fromLatin1("/.directory"))) { directoryFiles += *it; } continue; @@ -155,19 +155,19 @@ Tellico::Data::CollPtr AudioFileImporter::collection() { continue; } int disc = discNumber(f); - if(disc > 1 && !m_coll->hasField(TQString::tqfromLatin1("track%1").tqarg(disc))) { - Data::FieldPtr f2 = new Data::Field(TQString::tqfromLatin1("track%1").tqarg(disc), - i18n("Tracks (Disc %1)").tqarg(disc), + if(disc > 1 && !m_coll->hasField(TQString::fromLatin1("track%1").arg(disc))) { + Data::FieldPtr f2 = new Data::Field(TQString::fromLatin1("track%1").arg(disc), + i18n("Tracks (Disc %1)").arg(disc), Data::Field::Table); f2->setFormatFlag(Data::Field::FormatTitle); - f2->setProperty(TQString::tqfromLatin1("columns"), TQChar('3')); - f2->setProperty(TQString::tqfromLatin1("column1"), i18n("Title")); - f2->setProperty(TQString::tqfromLatin1("column2"), i18n("Artist")); - f2->setProperty(TQString::tqfromLatin1("column3"), i18n("Length")); + f2->setProperty(TQString::fromLatin1("columns"), TQChar('3')); + f2->setProperty(TQString::fromLatin1("column1"), i18n("Title")); + f2->setProperty(TQString::fromLatin1("column2"), i18n("Artist")); + f2->setProperty(TQString::fromLatin1("column3"), i18n("Length")); m_coll->addField(f2); if(changeTrackTitle) { Data::FieldPtr newTrack = new Data::Field(*m_coll->fieldByName(track)); - newTrack->setTitle(i18n("Tracks (Disc %1)").tqarg(1)); + newTrack->setTitle(i18n("Tracks (Disc %1)").arg(1)); m_coll->modifyField(newTrack); changeTrackTitle = false; } @@ -252,10 +252,10 @@ Tellico::Data::CollPtr AudioFileImporter::collection() { if(!tag->comment().stripWhiteSpace().isEmpty()) { TQString c = entry->field(comments); if(!c.isEmpty()) { - c += TQString::tqfromLatin1("<br/>"); + c += TQString::fromLatin1("<br/>"); } if(!tag->title().isEmpty()) { - c += TQString::tqfromLatin1("<em>") + TQString(TStringToQString(tag->title())).stripWhiteSpace() + TQString::tqfromLatin1("</em> - "); + c += TQString::fromLatin1("<em>") + TQString(TStringToQString(tag->title())).stripWhiteSpace() + TQString::fromLatin1("</em> - "); } c += TQString(TStringToQString(tag->comment().stripWhiteSpace())).stripWhiteSpace(); entry->setField(comments, c); @@ -286,7 +286,7 @@ Tellico::Data::CollPtr AudioFileImporter::collection() { } TQTextStream ts; - TQRegExp iconRx(TQString::tqfromLatin1("Icon\\s*=\\s*(.*)")); + TQRegExp iconRx(TQString::fromLatin1("Icon\\s*=\\s*(.*)")); for(TQStringList::ConstIterator it = directoryFiles.begin(); !m_cancelled && it != directoryFiles.end(); ++it, ++j) { TQFile file(*it); if(!file.open(IO_ReadOnly)) { @@ -309,7 +309,7 @@ Tellico::Data::CollPtr AudioFileImporter::collection() { u.setPath(fi.absFilePath()); TQString id = ImageFactory::addImage(u, true); if(!id.isEmpty()) { - entry->setField(TQString::tqfromLatin1("cover"), id); + entry->setField(TQString::fromLatin1("cover"), id); } break; } @@ -371,7 +371,7 @@ TQString AudioFileImporter::insertValue(const TQString& str_, const TQString& va myDebug() << "*** New value: " << value_ << endl; } list[pos_-1] = value_; - return list.join(TQString::tqfromLatin1("; ")); + return list.join(TQString::fromLatin1("; ")); } void AudioFileImporter::slotCancel() { diff --git a/src/translators/bibtexexporter.cpp b/src/translators/bibtexexporter.cpp index 2135c67..f79f79e 100644 --- a/src/translators/bibtexexporter.cpp +++ b/src/translators/bibtexexporter.cpp @@ -30,7 +30,7 @@ #include <tqregexp.h> #include <tqcheckbox.h> -#include <tqlayout.h> +#include <layout.h> #include <tqgroupbox.h> #include <tqwhatsthis.h> #include <tqlabel.h> @@ -69,7 +69,7 @@ bool BibtexExporter::exec() { TQString crossRefField; bool hasCrossRefs = false; - const TQString bibtex = TQString::tqfromLatin1("bibtex"); + const TQString bibtex = TQString::fromLatin1("bibtex"); // keep a list of all the 'ordinary' fields to iterate through later Data::FieldVec fields; Data::FieldVec vec = coll->fields(); @@ -98,12 +98,12 @@ bool BibtexExporter::exec() { return false; } - TQString text = TQString::tqfromLatin1("@comment{Generated by Tellico ") - + TQString::tqfromLatin1(VERSION) - + TQString::tqfromLatin1("}\n\n"); + TQString text = TQString::fromLatin1("@comment{Generated by Tellico ") + + TQString::fromLatin1(VERSION) + + TQString::fromLatin1("}\n\n"); if(!coll->preamble().isEmpty()) { - text += TQString::tqfromLatin1("@preamble{") + coll->preamble() + TQString::tqfromLatin1("}\n\n"); + text += TQString::fromLatin1("@preamble{") + coll->preamble() + TQString::fromLatin1("}\n\n"); } const TQStringList macros = coll->macroList().keys(); @@ -111,11 +111,11 @@ bool BibtexExporter::exec() { TQMap<TQString, TQString>::ConstIterator macroIt; for(macroIt = coll->macroList().constBegin(); macroIt != coll->macroList().constEnd(); ++macroIt) { if(!macroIt.data().isEmpty()) { - text += TQString::tqfromLatin1("@string{") + text += TQString::fromLatin1("@string{") + macroIt.key() - + TQString::tqfromLatin1("=") + + TQString::fromLatin1("=") + BibtexHandler::exportText(macroIt.data(), macros) - + TQString::tqfromLatin1("}\n\n"); + + TQString::fromLatin1("}\n\n"); } } } @@ -236,7 +236,7 @@ TQWidget* BibtexExporter::widget(TQWidget* parent_, const char* name_/*=0*/) { } void BibtexExporter::readOptions(KConfig* config_) { - KConfigGroup group(config_, TQString::tqfromLatin1("ExportOptions - %1").tqarg(formatString())); + KConfigGroup group(config_, TQString::fromLatin1("ExportOptions - %1").arg(formatString())); m_expandMacros = group.readBoolEntry("Expand Macros", m_expandMacros); m_packageURL = group.readBoolEntry("URL Package", m_packageURL); m_skipEmptyKeys = group.readBoolEntry("Skip Empty Keys", m_skipEmptyKeys); @@ -249,7 +249,7 @@ void BibtexExporter::readOptions(KConfig* config_) { } void BibtexExporter::saveOptions(KConfig* config_) { - KConfigGroup group(config_, TQString::tqfromLatin1("ExportOptions - %1").tqarg(formatString())); + KConfigGroup group(config_, TQString::fromLatin1("ExportOptions - %1").arg(formatString())); m_expandMacros = m_checkExpandMacros->isChecked(); group.writeEntry("Expand Macros", m_expandMacros); m_packageURL = m_checkPackageURL->isChecked(); @@ -269,8 +269,8 @@ void BibtexExporter::saveOptions(KConfig* config_) { void BibtexExporter::writeEntryText(TQString& text_, const Data::FieldVec& fields_, const Data::Entry& entry_, const TQString& type_, const TQString& key_) { const TQStringList macros = static_cast<const Data::BibtexCollection*>(Data::Document::self()->collection().data())->macroList().keys(); - const TQString bibtex = TQString::tqfromLatin1("bibtex"); - const TQString bibtexSep = TQString::tqfromLatin1("bibtex-separator"); + const TQString bibtex = TQString::fromLatin1("bibtex"); + const TQString bibtexSep = TQString::fromLatin1("bibtex-separator"); text_ += '@' + type_ + '{' + key_; @@ -287,7 +287,7 @@ void BibtexExporter::writeEntryText(TQString& text_, const Data::FieldVec& field // insert "and" in between them (e.g. author and editor) if(fIt->formatFlag() == Data::Field::FormatName && fIt->flags() & Data::Field::AllowMultiple) { - value.replace(Data::Field::delimiter(), TQString::tqfromLatin1(" and ")); + value.replace(Data::Field::delimiter(), TQString::fromLatin1(" and ")); } else if(fIt->flags() & Data::Field::AllowMultiple) { TQString bibsep = fIt->property(bibtexSep); if(!bibsep.isEmpty()) { @@ -295,11 +295,11 @@ void BibtexExporter::writeEntryText(TQString& text_, const Data::FieldVec& field } } else if(fIt->type() == Data::Field::Para) { // strip HTML from bibtex export - TQRegExp stripHTML(TQString::tqfromLatin1("<.*>"), true); + TQRegExp stripHTML(TQString::fromLatin1("<.*>"), true); stripHTML.setMinimal(true); value.remove(stripHTML); } else if(fIt->property(bibtex) == Latin1Literal("pages")) { - TQRegExp rx(TQString::tqfromLatin1("(\\d)-(\\d)")); + TQRegExp rx(TQString::fromLatin1("(\\d)-(\\d)")); for(int pos = rx.search(value); pos > -1; pos = rx.search(value, pos+2)) { value.replace(pos, 3, rx.cap(1)+"--"+rx.cap(2)); } @@ -308,19 +308,19 @@ void BibtexExporter::writeEntryText(TQString& text_, const Data::FieldVec& field if(m_packageURL && fIt->type() == Data::Field::URL) { bool b = BibtexHandler::s_quoteStyle == BibtexHandler::BRACES; value = (b ? TQChar('{') : TQChar('"')) - + TQString::tqfromLatin1("\\url{") + BibtexHandler::exportText(value, macros) + TQChar('}') + + TQString::fromLatin1("\\url{") + BibtexHandler::exportText(value, macros) + TQChar('}') + (b ? TQChar('}') : TQChar('"')); } else if(fIt->type() != Data::Field::Number) { // numbers aren't escaped, nor will they have macros // if m_expandMacros is true, then macros is empty, so this is ok even then value = BibtexHandler::exportText(value, macros); } - text_ += TQString::tqfromLatin1(",\n ") + text_ += TQString::fromLatin1(",\n ") + fIt->property(bibtex) - + TQString::tqfromLatin1(" = ") + + TQString::fromLatin1(" = ") + value; } - text_ += TQString::tqfromLatin1("\n}\n\n"); + text_ += TQString::fromLatin1("\n}\n\n"); } #include "bibtexexporter.moc" diff --git a/src/translators/bibtexhandler.cpp b/src/translators/bibtexhandler.cpp index 873dc27..1896f95 100644 --- a/src/translators/bibtexhandler.cpp +++ b/src/translators/bibtexhandler.cpp @@ -38,7 +38,7 @@ using Tellico::BibtexHandler; BibtexHandler::StringListMap* BibtexHandler::s_utf8LatexMap = 0; BibtexHandler::QuoteStyle BibtexHandler::s_quoteStyle = BibtexHandler::BRACES; -const TQRegExp BibtexHandler::s_badKeyChars(TQString::tqfromLatin1("[^0-9a-zA-Z-]")); +const TQRegExp BibtexHandler::s_badKeyChars(TQString::fromLatin1("[^0-9a-zA-Z-]")); TQStringList BibtexHandler::bibtexKeys(const Data::EntryVec& entries_) { TQStringList keys; @@ -57,7 +57,7 @@ TQString BibtexHandler::bibtexKey(Data::ConstEntryPtr entry_) { } const Data::BibtexCollection* c = static_cast<const Data::BibtexCollection*>(entry_->collection().data()); - Data::FieldPtr f = c->fieldByBibtexName(TQString::tqfromLatin1("key")); + Data::FieldPtr f = c->fieldByBibtexName(TQString::fromLatin1("key")); if(f) { TQString key = entry_->field(f->name()); if(!key.isEmpty()) { @@ -66,7 +66,7 @@ TQString BibtexHandler::bibtexKey(Data::ConstEntryPtr entry_) { } TQString author; - Data::FieldPtr authorField = c->fieldByBibtexName(TQString::tqfromLatin1("author")); + Data::FieldPtr authorField = c->fieldByBibtexName(TQString::fromLatin1("author")); if(authorField) { if(authorField->flags() & Data::Field::AllowMultiple) { // grab first author only; @@ -77,21 +77,21 @@ TQString BibtexHandler::bibtexKey(Data::ConstEntryPtr entry_) { } } - Data::FieldPtr titleField = c->fieldByBibtexName(TQString::tqfromLatin1("title")); + Data::FieldPtr titleField = c->fieldByBibtexName(TQString::fromLatin1("title")); TQString title; if(titleField) { title = entry_->field(titleField->name()); } - Data::FieldPtr yearField = c->fieldByBibtexName(TQString::tqfromLatin1("year")); + Data::FieldPtr yearField = c->fieldByBibtexName(TQString::fromLatin1("year")); TQString year; if(yearField) { year = entry_->field(yearField->name()); } if(year.isEmpty()) { - year = entry_->field(TQString::tqfromLatin1("pub_year")); + year = entry_->field(TQString::fromLatin1("pub_year")); if(year.isEmpty()) { - year = entry_->field(TQString::tqfromLatin1("cr_year")); + year = entry_->field(TQString::fromLatin1("cr_year")); } } year = year.section(';', 0, 0); @@ -120,7 +120,7 @@ TQString BibtexHandler::bibtexKey(const TQString& author_, const TQString& title } void BibtexHandler::loadTranslationMaps() { - TQString mapfile = locate("appdata", TQString::tqfromLatin1("bibtex-translation.xml")); + TQString mapfile = locate("appdata", TQString::fromLatin1("bibtex-translation.xml")); if(mapfile.isEmpty()) { return; } @@ -132,13 +132,13 @@ void BibtexHandler::loadTranslationMaps() { // no namespace processing TQDomDocument dom = FileHandler::readXMLFile(u, false); - TQDomNodeList keyList = dom.elementsByTagName(TQString::tqfromLatin1("key")); + TQDomNodeList keyList = dom.elementsByTagName(TQString::fromLatin1("key")); for(unsigned i = 0; i < keyList.count(); ++i) { - TQDomNodeList strList = keyList.item(i).toElement().elementsByTagName(TQString::tqfromLatin1("string")); + TQDomNodeList strList = keyList.item(i).toElement().elementsByTagName(TQString::fromLatin1("string")); // the strList might have more than one node since there are multiple ways // to represent a character in LaTex. - TQString s = keyList.item(i).toElement().attribute(TQString::tqfromLatin1("char")); + TQString s = keyList.item(i).toElement().attribute(TQString::fromLatin1("char")); for(unsigned j = 0; j < strList.count(); ++j) { (*s_utf8LatexMap)[s].append(strList.item(j).toElement().text()); // kdDebug() << "BibtexHandler::loadTranslationMaps - " @@ -164,9 +164,9 @@ TQString BibtexHandler::importText(char* text_) { // we need to lower-case any capitalized text after the first letter that is // NOT contained in braces - TQRegExp rx(TQString::tqfromLatin1("\\{([A-Z]+)\\}")); + TQRegExp rx(TQString::fromLatin1("\\{([A-Z]+)\\}")); rx.setMinimal(true); - str.replace(rx, TQString::tqfromLatin1("\\1")); + str.replace(rx, TQString::fromLatin1("\\1")); return str; } @@ -245,10 +245,10 @@ bool BibtexHandler::setFieldValue(Data::EntryPtr entry_, const TQString& bibtexF // special case, try to detect URLs // In qt 3.1, TQString::startsWith() is always case-sensitive if(bibtexField_ == Latin1Literal("url") - || vlower.startsWith(TQString::tqfromLatin1("http")) // may also be https - || vlower.startsWith(TQString::tqfromLatin1("ftp:/")) - || vlower.startsWith(TQString::tqfromLatin1("file:/")) - || vlower.startsWith(TQString::tqfromLatin1("/"))) { // assume this indicates a local path + || vlower.startsWith(TQString::fromLatin1("http")) // may also be https + || vlower.startsWith(TQString::fromLatin1("ftp:/")) + || vlower.startsWith(TQString::fromLatin1("file:/")) + || vlower.startsWith(TQString::fromLatin1("/"))) { // assume this indicates a local path myDebug() << "BibtexHandler::setFieldValue() - creating a URL field for " << bibtexField_ << endl; field = new Data::Field(bibtexField_, KStringHandler::capwords(bibtexField_), Data::Field::URL); } else { @@ -258,12 +258,12 @@ bool BibtexHandler::setFieldValue(Data::EntryPtr entry_, const TQString& bibtexF } else { field = new Data::Field(bibtexField_, KStringHandler::capwords(bibtexField_), Data::Field::Para); } - field->setProperty(TQString::tqfromLatin1("bibtex"), bibtexField_); + field->setProperty(TQString::fromLatin1("bibtex"), bibtexField_); c->addField(field); } // special case keywords, replace commas with semi-colons so they get separated TQString value = value_; - if(field->property(TQString::tqfromLatin1("bibtex")).startsWith(TQString::tqfromLatin1("keyword"))) { + if(field->property(TQString::fromLatin1("bibtex")).startsWith(TQString::fromLatin1("keyword"))) { value.replace(',', ';'); // special case refbase bibtex export, with multiple keywords fields TQString oValue = entry_->field(field); @@ -276,11 +276,11 @@ bool BibtexHandler::setFieldValue(Data::EntryPtr entry_, const TQString& bibtexF TQString& BibtexHandler::cleanText(TQString& text_) { // FIXME: need to improve this for removing all Latex entities -// TQRegExp rx(TQString::tqfromLatin1("(?=[^\\\\])\\\\.+\\{")); - TQRegExp rx(TQString::tqfromLatin1("\\\\.+\\{")); +// TQRegExp rx(TQString::fromLatin1("(?=[^\\\\])\\\\.+\\{")); + TQRegExp rx(TQString::fromLatin1("\\\\.+\\{")); rx.setMinimal(true); text_.replace(rx, TQString()); - text_.replace(TQRegExp(TQString::tqfromLatin1("[{}]")), TQString()); + text_.replace(TQRegExp(TQString::fromLatin1("[{}]")), TQString()); text_.replace('~', ' '); return text_; } diff --git a/src/translators/bibteximporter.cpp b/src/translators/bibteximporter.cpp index 0b4775b..5b639f4 100644 --- a/src/translators/bibteximporter.cpp +++ b/src/translators/bibteximporter.cpp @@ -25,11 +25,11 @@ #include <tqptrlist.h> #include <tqregexp.h> -#include <tqlayout.h> +#include <layout.h> #include <tqvbuttongroup.h> #include <tqradiobutton.h> #include <tqwhatsthis.h> -#include <tqtextcodec.h> +#include <textcodec.h> using Tellico::Import::BibtexImporter; @@ -95,7 +95,7 @@ Tellico::Data::CollPtr BibtexImporter::collection() { } Data::CollPtr coll = readCollection(text, count); if(!coll || coll->entryCount() == 0) { - setStatusMessage(i18n("No valid bibtex entries were found in file - %1").tqarg(url().fileName())); + setStatusMessage(i18n("No valid bibtex entries were found in file - %1").arg(url().fileName())); continue; } m_coll->addEntries(coll->entries()); @@ -160,17 +160,17 @@ Tellico::Data::CollPtr BibtexImporter::readCollection(const TQString& text, int str = TQString::fromUtf8(bt_entry_type(it.current())); // kdDebug() << "entry type: " << str << endl; // text is automatically put into lower-case by btparse - BibtexHandler::setFieldValue(entry, TQString::tqfromLatin1("entry-type"), str); + BibtexHandler::setFieldValue(entry, TQString::fromLatin1("entry-type"), str); str = TQString::fromUtf8(bt_entry_key(it.current())); // kdDebug() << "entry key: " << str << endl; - BibtexHandler::setFieldValue(entry, TQString::tqfromLatin1("key"), str); + BibtexHandler::setFieldValue(entry, TQString::fromLatin1("key"), str); char* name; AST* field = 0; while((field = bt_next_field(it.current(), field, &name))) { // kdDebug() << "\tfound: " << name << endl; -// str = TQString::tqfromLatin1(bt_get_text(field)); +// str = TQString::fromLatin1(bt_get_text(field)); str.truncate(0); AST* value = 0; bt_nodetype type; @@ -197,7 +197,7 @@ Tellico::Data::CollPtr BibtexImporter::readCollection(const TQString& text, int } TQString fieldName = TQString::fromUtf8(name); if(fieldName == Latin1Literal("author") || fieldName == Latin1Literal("editor")) { - str.replace(TQRegExp(TQString::tqfromLatin1("\\sand\\s")), TQString::tqfromLatin1("; ")); + str.replace(TQRegExp(TQString::fromLatin1("\\sand\\s")), TQString::fromLatin1("; ")); } BibtexHandler::setFieldValue(entry, fieldName, str); } @@ -235,8 +235,8 @@ void BibtexImporter::parseText(const TQString& text) { // bt_set_stringopts(BTE_PREAMBLE, BTO_CONVERT | BTO_EXPAND); TQString entry; - TQRegExp rx(TQString::tqfromLatin1("[{}]")); - TQRegExp macroName(TQString::tqfromLatin1("@string\\s*\\{\\s*(.*)="), false /*case sensitive*/); + TQRegExp rx(TQString::fromLatin1("[{}]")); + TQRegExp macroName(TQString::fromLatin1("@string\\s*\\{\\s*(.*)="), false /*case sensitive*/); macroName.setMinimal(true); bool needsCleanup = false; @@ -289,8 +289,8 @@ TQWidget* BibtexImporter::widget(TQWidget* parent_, const char* name_/*=0*/) { TQButtonGroup* box = new TQVButtonGroup(i18n("Bibtex Options"), m_widget); m_readUTF8 = new TQRadioButton(i18n("Use Unicode (UTF-8) encoding"), box); TQWhatsThis::add(m_readUTF8, i18n("Read the imported file in Unicode (UTF-8).")); - TQString localStr = i18n("Use user locale (%1) encoding").tqarg( - TQString::tqfromLatin1(TQTextCodec::codecForLocale()->name())); + TQString localStr = i18n("Use user locale (%1) encoding").arg( + TQString::fromLatin1(TQTextCodec::codecForLocale()->name())); m_readLocale = new TQRadioButton(localStr, box); m_readLocale->setChecked(true); TQWhatsThis::add(m_readLocale, i18n("Read the imported file in the local encoding.")); diff --git a/src/translators/bibtexmlexporter.cpp b/src/translators/bibtexmlexporter.cpp index 85934b2..23f84f9 100644 --- a/src/translators/bibtexmlexporter.cpp +++ b/src/translators/bibtexmlexporter.cpp @@ -28,7 +28,7 @@ #include <tqvbox.h> #include <tqdom.h> #include <tqregexp.h> -#include <tqtextcodec.h> +#include <textcodec.h> using Tellico::Export::BibtexmlExporter; @@ -53,7 +53,7 @@ bool BibtexmlExporter::exec() { // the key specifies the cite-key TQString keyField; - const TQString bibtex = TQString::tqfromLatin1("bibtex"); + const TQString bibtex = TQString::fromLatin1("bibtex"); // keep a list of all the 'ordinary' fields to iterate through later Data::FieldVec fields; Data::FieldVec vec = coll->fields(); @@ -69,28 +69,28 @@ bool BibtexmlExporter::exec() { } TQDomImplementation impl; - TQDomDocumentType doctype = impl.createDocumentType(TQString::tqfromLatin1("file"), + TQDomDocumentType doctype = impl.createDocumentType(TQString::fromLatin1("file"), TQString(), XML::dtdBibtexml); //default namespace const TQString& ns = XML::nsBibtexml; - TQDomDocument dom = impl.createDocument(ns, TQString::tqfromLatin1("file"), doctype); + TQDomDocument dom = impl.createDocument(ns, TQString::fromLatin1("file"), doctype); // root element TQDomElement root = dom.documentElement(); - TQString encodeStr = TQString::tqfromLatin1("version=\"1.0\" encoding=\""); + TQString encodeStr = TQString::fromLatin1("version=\"1.0\" encoding=\""); if(options() & Export::ExportUTF8) { - encodeStr += TQString::tqfromLatin1("UTF-8"); + encodeStr += TQString::fromLatin1("UTF-8"); } else { - encodeStr += TQString::tqfromLatin1(TQTextCodec::codecForLocale()->mimeName()); + encodeStr += TQString::fromLatin1(TQTextCodec::codecForLocale()->mimeName()); } encodeStr += '"'; // createDocument creates a root node, insert the processing instruction before it - dom.insertBefore(dom.createProcessingInstruction(TQString::tqfromLatin1("xml"), encodeStr), root); - TQString comment = TQString::tqfromLatin1("Generated by Tellico ") + TQString::tqfromLatin1(VERSION); + dom.insertBefore(dom.createProcessingInstruction(TQString::fromLatin1("xml"), encodeStr), root); + TQString comment = TQString::fromLatin1("Generated by Tellico ") + TQString::fromLatin1(VERSION); dom.insertBefore(dom.createComment(comment), root); Data::ConstFieldPtr field; @@ -115,8 +115,8 @@ bool BibtexmlExporter::exec() { key = newKey; usedKeys.add(key); - btElem = dom.createElement(TQString::tqfromLatin1("entry")); - btElem.setAttribute(TQString::tqfromLatin1("id"), key); + btElem = dom.createElement(TQString::fromLatin1("entry")); + btElem.setAttribute(TQString::fromLatin1("id"), key); root.appendChild(btElem); type = entryIt->field(typeField); @@ -149,12 +149,12 @@ bool BibtexmlExporter::exec() { elemName == Latin1Literal("editor") || elemName == Latin1Literal("keywords")) { if(elemName == Latin1Literal("author")) { - parElemName = TQString::tqfromLatin1("authorlist"); + parElemName = TQString::fromLatin1("authorlist"); } else if(elemName == Latin1Literal("editor")) { - parElemName = TQString::tqfromLatin1("editorlist"); + parElemName = TQString::fromLatin1("editorlist"); } else { // keywords - parElemName = TQString::tqfromLatin1("keywords"); - elemName = TQString::tqfromLatin1("keyword"); + parElemName = TQString::fromLatin1("keywords"); + elemName = TQString::fromLatin1("keyword"); } parentElem = dom.createElement(parElemName); diff --git a/src/translators/bibtexmlimporter.cpp b/src/translators/bibtexmlimporter.cpp index 9131320..bf33c02 100644 --- a/src/translators/bibtexmlimporter.cpp +++ b/src/translators/bibtexmlimporter.cpp @@ -40,14 +40,14 @@ Tellico::Data::CollPtr BibtexmlImporter::collection() { void BibtexmlImporter::loadDomDocument() { TQDomElement root = domDocument().documentElement(); if(root.isNull() || root.localName() != Latin1Literal("file")) { - setStatusMessage(i18n(errorLoad).tqarg(url().fileName())); + setStatusMessage(i18n(errorLoad).arg(url().fileName())); return; } const TQString& ns = XML::nsBibtexml; m_coll = new Data::BibtexCollection(true); - TQDomNodeList entryelems = root.elementsByTagNameNS(ns, TQString::tqfromLatin1("entry")); + TQDomNodeList entryelems = root.elementsByTagNameNS(ns, TQString::fromLatin1("entry")); // kdDebug() << "BibtexmlImporter::loadDomDocument - found " << entryelems.count() << " entries" << endl; const uint count = entryelems.count(); @@ -83,9 +83,9 @@ void BibtexmlImporter::readEntry(const TQDomNode& entryNode_) { <publisher>...</publisher> */ TQString type = node.firstChild().toElement().tagName(); - entry->setField(TQString::tqfromLatin1("entry-type"), type); - TQString id = node.toElement().attribute(TQString::tqfromLatin1("id")); - entry->setField(TQString::tqfromLatin1("bibtex-key"), id); + entry->setField(TQString::fromLatin1("entry-type"), type); + TQString id = node.toElement().attribute(TQString::fromLatin1("id")); + entry->setField(TQString::fromLatin1("bibtex-key"), id); TQString name, value; // field values are first child of first child of entry node @@ -112,23 +112,23 @@ void BibtexmlImporter::readEntry(const TQDomNode& entryNode_) { } else { name = n.firstChild().toElement().tagName(); if(name == Latin1Literal("keyword")) { - name = TQString::tqfromLatin1("keywords"); + name = TQString::fromLatin1("keywords"); } value.truncate(0); for(TQDomNode n2 = n.firstChild(); !n2.isNull(); n2 = n2.nextSibling()) { // n2 could have first, middle, lastname elements... if(name == Latin1Literal("person")) { TQStringList names; - names << TQString::tqfromLatin1("initials") << TQString::tqfromLatin1("first") - << TQString::tqfromLatin1("middle") << TQString::tqfromLatin1("prelast") - << TQString::tqfromLatin1("last") << TQString::tqfromLatin1("lineage"); + names << TQString::fromLatin1("initials") << TQString::fromLatin1("first") + << TQString::fromLatin1("middle") << TQString::fromLatin1("prelast") + << TQString::fromLatin1("last") << TQString::fromLatin1("lineage"); for(TQStringList::ConstIterator it = names.begin(); it != names.end(); ++it) { TQDomNodeList list = n2.toElement().elementsByTagName(*it); if(list.count() > 1) { value += list.item(0).toElement().text(); } if(*it != names.last()) { - value += TQString::tqfromLatin1(" "); + value += TQString::fromLatin1(" "); } } } @@ -139,11 +139,11 @@ void BibtexmlImporter::readEntry(const TQDomNode& entryNode_) { value += n3.toText().data(); } if(n3 != n2.lastChild()) { - value += TQString::tqfromLatin1(" "); + value += TQString::fromLatin1(" "); } } if(n2 != n.lastChild()) { - value += TQString::tqfromLatin1("; "); + value += TQString::fromLatin1("; "); } } } diff --git a/src/translators/btparse/ast.c b/src/translators/btparse/ast.c index e3479b7..d433f79 100644 --- a/src/translators/btparse/ast.c +++ b/src/translators/btparse/ast.c @@ -144,7 +144,7 @@ zzfree_ast(AST *tree) } /* build a tree (root child1 child2 ... NULL) - * If root is NULL, simply make the tqchildren siblings and return ptr + * If root is NULL, simply make the children siblings and return ptr * to 1st sibling (child1). If root is not single node, return NULL. * * Siblings that are actually siblins lists themselves are handled diff --git a/src/translators/btparse/postprocess.c b/src/translators/btparse/postprocess.c index 692e084..7f7bfd4 100644 --- a/src/translators/btparse/postprocess.c +++ b/src/translators/btparse/postprocess.c @@ -464,7 +464,7 @@ bt_postprocess_entry (AST * top, ushort options) "invalid node type (not entry root)"); strlwr (top->text); /* downcase entry type */ - if (top->down == NULL) return; /* no tqchildren at all */ + if (top->down == NULL) return; /* no children at all */ cur = top->down; if (cur->nodetype == BTAST_KEY) diff --git a/src/translators/csvexporter.cpp b/src/translators/csvexporter.cpp index d4831b3..2befed1 100644 --- a/src/translators/csvexporter.cpp +++ b/src/translators/csvexporter.cpp @@ -23,7 +23,7 @@ #include <tqgroupbox.h> #include <tqcheckbox.h> -#include <tqlayout.h> +#include <layout.h> #include <tqbuttongroup.h> #include <tqradiobutton.h> #include <tqwhatsthis.h> @@ -49,7 +49,7 @@ TQString& CSVExporter::escapeText(TQString& text_) { if(text_.find('"') != -1) { quotes = true; // quotation marks will be escaped by using a double pair - text_.replace('"', TQString::tqfromLatin1("\"\"")); + text_.replace('"', TQString::fromLatin1("\"\"")); } // if the text contains quotes or the delimiter, it needs to be surrounded by quotes if(quotes || text_.find(m_delimiter) != -1) { @@ -115,8 +115,8 @@ TQWidget* CSVExporter::widget(TQWidget* parent_, const char* name_/*=0*/) { "field titles.")); TQButtonGroup* delimiterGroup = new TQButtonGroup(0, Qt::Vertical, i18n("Delimiter"), box); - TQGridLayout* m_delimiterGroupLayout = new TQGridLayout(delimiterGroup->tqlayout()); - m_delimiterGroupLayout->tqsetAlignment(TQt::AlignTop); + TQGridLayout* m_delimiterGroupLayout = new TQGridLayout(delimiterGroup->layout()); + m_delimiterGroupLayout->setAlignment(TQt::AlignTop); TQWhatsThis::add(delimiterGroup, i18n("In addition to a comma, other characters may be used as " "a delimiter, separating each value in the file.")); @@ -165,7 +165,7 @@ TQWidget* CSVExporter::widget(TQWidget* parent_, const char* name_/*=0*/) { } void CSVExporter::readOptions(KConfig* config_) { - KConfigGroup group(config_, TQString::tqfromLatin1("ExportOptions - %1").tqarg(formatString())); + KConfigGroup group(config_, TQString::fromLatin1("ExportOptions - %1").arg(formatString())); m_includeTitles = group.readBoolEntry("Include Titles", m_includeTitles); m_delimiter = group.readEntry("Delimiter", m_delimiter); } @@ -182,7 +182,7 @@ void CSVExporter::saveOptions(KConfig* config_) { m_delimiter = m_editOther->text(); } - KConfigGroup group(config_, TQString::tqfromLatin1("ExportOptions - %1").tqarg(formatString())); + KConfigGroup group(config_, TQString::fromLatin1("ExportOptions - %1").arg(formatString())); group.writeEntry("Include Titles", m_includeTitles); group.writeEntry("Delimiter", m_delimiter); } diff --git a/src/translators/csvimporter.cpp b/src/translators/csvimporter.cpp index cf233bd..4b60540 100644 --- a/src/translators/csvimporter.cpp +++ b/src/translators/csvimporter.cpp @@ -37,7 +37,7 @@ extern "C" { #include <kmessagebox.h> #include <tqgroupbox.h> -#include <tqlayout.h> +#include <layout.h> #include <tqhbox.h> #include <tqlabel.h> #include <tqcheckbox.h> @@ -99,7 +99,7 @@ CSVImporter::CSVImporter(const KURL& url_) : Tellico::Import::TextImporter(url_) m_coll(0), m_existingCollection(0), m_firstRowHeader(false), - m_delimiter(TQString::tqfromLatin1(",")), + m_delimiter(TQString::fromLatin1(",")), m_cancelled(false), m_widget(0), m_table(0), @@ -202,7 +202,7 @@ Tellico::Data::CollPtr CSVImporter::collection() { } { - KConfigGroup config(KGlobal::config(), TQString::tqfromLatin1("ImportOptions - CSV")); + KConfigGroup config(KGlobal::config(), TQString::fromLatin1("ImportOptions - CSV")); config.writeEntry("Delimiter", m_delimiter); config.writeEntry("First Row Titles", m_firstRowHeader); } @@ -238,8 +238,8 @@ TQWidget* CSVImporter::widget(TQWidget* parent_, const char* name_) { TQHBox* hbox2 = new TQHBox(group); m_delimiterGroup = new TQButtonGroup(0, Qt::Vertical, i18n("Delimiter"), hbox2); - TQGridLayout* m_delimiterGroupLayout = new TQGridLayout(m_delimiterGroup->tqlayout(), 3, 3); - m_delimiterGroupLayout->tqsetAlignment(TQt::AlignTop); + TQGridLayout* m_delimiterGroupLayout = new TQGridLayout(m_delimiterGroup->layout(), 3, 3); + m_delimiterGroupLayout->setAlignment(TQt::AlignTop); TQWhatsThis::add(m_delimiterGroup, i18n("In addition to a comma, other characters may be used as " "a delimiter, separating each value in the file.")); connect(m_delimiterGroup, TQT_SIGNAL(clicked(int)), TQT_SLOT(slotDelimiter())); @@ -314,13 +314,13 @@ TQWidget* CSVImporter::widget(TQWidget* parent_, const char* name_) { m_setColumnBtn = new KPushButton(i18n("&Assign Field"), hbox); hlay->addWidget(m_setColumnBtn); - m_setColumnBtn->setIconSet(SmallIconSet(TQString::tqfromLatin1("apply"))); + m_setColumnBtn->setIconSet(SmallIconSet(TQString::fromLatin1("apply"))); connect(m_setColumnBtn, TQT_SIGNAL(clicked()), TQT_SLOT(slotSetColumnTitle())); hlay->addStretch(10); l->addStretch(1); - KConfigGroup config(KGlobal::config(), TQString::tqfromLatin1("ImportOptions - CSV")); + KConfigGroup config(KGlobal::config(), TQString::fromLatin1("ImportOptions - CSV")); m_delimiter = config.readEntry("Delimiter", m_delimiter); m_firstRowHeader = config.readBoolEntry("First Row Titles", m_firstRowHeader); diff --git a/src/translators/dcimporter.cpp b/src/translators/dcimporter.cpp index 5839255..19b8829 100644 --- a/src/translators/dcimporter.cpp +++ b/src/translators/dcimporter.cpp @@ -35,17 +35,17 @@ Tellico::Data::CollPtr DCImporter::collection() { TQDomDocument doc = domDocument(); - TQRegExp authorDateRX(TQString::tqfromLatin1(",?(\\s+\\d{4}-?(?:\\d{4})?\\.?)(.*)$")); - TQRegExp dateRX(TQString::tqfromLatin1("\\d{4}")); + TQRegExp authorDateRX(TQString::fromLatin1(",?(\\s+\\d{4}-?(?:\\d{4})?\\.?)(.*)$")); + TQRegExp dateRX(TQString::fromLatin1("\\d{4}")); - TQDomNodeList recordList = doc.elementsByTagNameNS(zing, TQString::tqfromLatin1("recordData")); + TQDomNodeList recordList = doc.elementsByTagNameNS(zing, TQString::fromLatin1("recordData")); myDebug() << "DCImporter::collection() - number of records: " << recordList.count() << endl; enum { UnknownNS, UseNS, NoNS } useNS = UnknownNS; #define GETELEMENTS(s) (useNS == NoNS) \ - ? elem.elementsByTagName(TQString::tqfromLatin1(s)) \ - : elem.elementsByTagNameNS(dc, TQString::tqfromLatin1(s)) + ? elem.elementsByTagName(TQString::fromLatin1(s)) \ + : elem.elementsByTagNameNS(dc, TQString::fromLatin1(s)) for(uint i = 0; i < recordList.count(); ++i) { Data::EntryPtr e = new Data::Entry(c); @@ -55,7 +55,7 @@ Tellico::Data::CollPtr DCImporter::collection() { TQDomNodeList nodeList = GETELEMENTS("title"); if(nodeList.count() == 0) { // no title, skip if(useNS == UnknownNS) { - nodeList = elem.elementsByTagName(TQString::tqfromLatin1("title")); + nodeList = elem.elementsByTagName(TQString::fromLatin1("title")); if(nodeList.count() > 0) { useNS = NoNS; } else { @@ -72,7 +72,7 @@ Tellico::Data::CollPtr DCImporter::collection() { TQString s = nodeList.item(0).toElement().text(); s.replace('\n', ' '); s = s.simplifyWhiteSpace(); - e->setField(TQString::tqfromLatin1("title"), s); + e->setField(TQString::fromLatin1("title"), s); nodeList = GETELEMENTS("creator"); TQStringList creators; @@ -91,33 +91,33 @@ Tellico::Data::CollPtr DCImporter::collection() { creators << s; } } - e->setField(TQString::tqfromLatin1("author"), creators.join(TQString::tqfromLatin1("; "))); + e->setField(TQString::fromLatin1("author"), creators.join(TQString::fromLatin1("; "))); nodeList = GETELEMENTS("publisher"); TQStringList publishers; for(uint j = 0; j < nodeList.count(); ++j) { publishers << nodeList.item(j).toElement().text(); } - e->setField(TQString::tqfromLatin1("publisher"), publishers.join(TQString::tqfromLatin1("; "))); + e->setField(TQString::fromLatin1("publisher"), publishers.join(TQString::fromLatin1("; "))); nodeList = GETELEMENTS("subject"); TQStringList keywords; for(uint j = 0; j < nodeList.count(); ++j) { keywords << nodeList.item(j).toElement().text(); } - e->setField(TQString::tqfromLatin1("keyword"), keywords.join(TQString::tqfromLatin1("; "))); + e->setField(TQString::fromLatin1("keyword"), keywords.join(TQString::fromLatin1("; "))); nodeList = GETELEMENTS("date"); if(nodeList.count() > 0) { TQString s = nodeList.item(0).toElement().text(); if(dateRX.search(s) > -1) { - e->setField(TQString::tqfromLatin1("pub_year"), dateRX.cap()); + e->setField(TQString::fromLatin1("pub_year"), dateRX.cap()); } } nodeList = GETELEMENTS("description"); if(nodeList.count() > 0) { // no title, skip - e->setField(TQString::tqfromLatin1("comments"), nodeList.item(0).toElement().text()); + e->setField(TQString::fromLatin1("comments"), nodeList.item(0).toElement().text()); } c->addEntries(e); diff --git a/src/translators/deliciousimporter.cpp b/src/translators/deliciousimporter.cpp index 78c128d..a82c006 100644 --- a/src/translators/deliciousimporter.cpp +++ b/src/translators/deliciousimporter.cpp @@ -24,7 +24,7 @@ using Tellico::Import::DeliciousImporter; DeliciousImporter::DeliciousImporter(const KURL& url_) : XSLTImporter(url_) { - TQString xsltFile = locate("appdata", TQString::tqfromLatin1("delicious2tellico.xsl")); + TQString xsltFile = locate("appdata", TQString::fromLatin1("delicious2tellico.xsl")); if(!xsltFile.isEmpty()) { KURL u; u.setPath(xsltFile); @@ -47,13 +47,13 @@ Tellico::Data::CollPtr DeliciousImporter::collection() { KURL libraryDir = url(); libraryDir.setPath(url().directory() + "Images/"); const TQStringList imageDirs = TQStringList() - << TQString::tqfromLatin1("Large Covers/") - << TQString::tqfromLatin1("Medium Covers/") - << TQString::tqfromLatin1("Small Covers/") - << TQString::tqfromLatin1("Plain Covers/"); - const TQString commField = TQString::tqfromLatin1("comments"); - const TQString uuidField = TQString::tqfromLatin1("uuid"); - const TQString coverField = TQString::tqfromLatin1("cover"); + << TQString::fromLatin1("Large Covers/") + << TQString::fromLatin1("Medium Covers/") + << TQString::fromLatin1("Small Covers/") + << TQString::fromLatin1("Plain Covers/"); + const TQString commField = TQString::fromLatin1("comments"); + const TQString uuidField = TQString::fromLatin1("uuid"); + const TQString coverField = TQString::fromLatin1("cover"); const bool isLocal = url().isLocalFile(); Data::EntryVec entries = coll->entries(); diff --git a/src/translators/filelistingimporter.cpp b/src/translators/filelistingimporter.cpp index 8f3afe1..f59cc8b 100644 --- a/src/translators/filelistingimporter.cpp +++ b/src/translators/filelistingimporter.cpp @@ -30,7 +30,7 @@ #include <tqcheckbox.h> #include <tqvgroupbox.h> -#include <tqlayout.h> +#include <layout.h> #include <tqwhatsthis.h> #include <tqfile.h> #include <tqfileinfo.h> @@ -80,20 +80,20 @@ Tellico::Data::CollPtr FileListingImporter::collection() { const bool usePreview = m_filePreview->isChecked(); - const TQString title = TQString::tqfromLatin1("title"); - const TQString url = TQString::tqfromLatin1("url"); - const TQString desc = TQString::tqfromLatin1("description"); - const TQString vol = TQString::tqfromLatin1("volume"); - const TQString folder = TQString::tqfromLatin1("folder"); - const TQString type = TQString::tqfromLatin1("mimetype"); - const TQString size = TQString::tqfromLatin1("size"); - const TQString perm = TQString::tqfromLatin1("permissions"); - const TQString owner = TQString::tqfromLatin1("owner"); - const TQString group = TQString::tqfromLatin1("group"); - const TQString created = TQString::tqfromLatin1("created"); - const TQString modified = TQString::tqfromLatin1("modified"); - const TQString metainfo = TQString::tqfromLatin1("metainfo"); - const TQString icon = TQString::tqfromLatin1("icon"); + const TQString title = TQString::fromLatin1("title"); + const TQString url = TQString::fromLatin1("url"); + const TQString desc = TQString::fromLatin1("description"); + const TQString vol = TQString::fromLatin1("volume"); + const TQString folder = TQString::fromLatin1("folder"); + const TQString type = TQString::fromLatin1("mimetype"); + const TQString size = TQString::fromLatin1("size"); + const TQString perm = TQString::fromLatin1("permissions"); + const TQString owner = TQString::fromLatin1("owner"); + const TQString group = TQString::fromLatin1("group"); + const TQString created = TQString::fromLatin1("created"); + const TQString modified = TQString::fromLatin1("modified"); + const TQString metainfo = TQString::fromLatin1("metainfo"); + const TQString icon = TQString::fromLatin1("icon"); m_coll = new Data::FileCatalog(true); TQString tmp; @@ -144,7 +144,7 @@ Tellico::Data::CollPtr FileListingImporter::collection() { } } } - entry->setField(metainfo, strings.join(TQString::tqfromLatin1("; "))); + entry->setField(metainfo, strings.join(TQString::fromLatin1("; "))); } if(!m_cancelled && usePreview) { @@ -158,7 +158,7 @@ Tellico::Data::CollPtr FileListingImporter::collection() { if(!m_pixmap.isNull()) { // is png best option? - TQString id = ImageFactory::addImage(m_pixmap, TQString::tqfromLatin1("PNG")); + TQString id = ImageFactory::addImage(m_pixmap, TQString::fromLatin1("PNG")); if(!id.isEmpty()) { entry->setField(icon, id); } @@ -248,7 +248,7 @@ TQString FileListingImporter::volumeName() const { char buf[VOLUME_NAME_SIZE]; int ret = fread(buf, 1, VOLUME_NAME_SIZE, dev); if(ret == VOLUME_NAME_SIZE) { - volume = TQString::tqfromLatin1(buf, VOLUME_NAME_SIZE).stripWhiteSpace(); + volume = TQString::fromLatin1(buf, VOLUME_NAME_SIZE).stripWhiteSpace(); } } else { myDebug() << "FileListingImporter::volumeName() - can't seek " << devName << endl; diff --git a/src/translators/freedbimporter.cpp b/src/translators/freedbimporter.cpp index 8a13ed3..8f08e45 100644 --- a/src/translators/freedbimporter.cpp +++ b/src/translators/freedbimporter.cpp @@ -43,7 +43,7 @@ #include <tqfile.h> #include <tqdir.h> #include <tqlabel.h> -#include <tqlayout.h> +#include <layout.h> #include <tqgroupbox.h> #include <tqwhatsthis.h> #include <tqradiobutton.h> @@ -81,7 +81,7 @@ void FreeDBImporter::readCDROM() { #ifdef HAVE_KCDDB TQString drivePath = m_driveCombo->currentText(); if(drivePath.isEmpty()) { - setStatusMessage(i18n("<qt>Tellico was unable to access the CD-ROM device - <i>%1</i>.</qt>").tqarg(drivePath)); + setStatusMessage(i18n("<qt>Tellico was unable to access the CD-ROM device - <i>%1</i>.</qt>").arg(drivePath)); myDebug() << "FreeDBImporter::readCDROM() - no drive!" << endl; return; } @@ -96,7 +96,7 @@ void FreeDBImporter::readCDROM() { } { - KConfigGroup config(KGlobal::config(), TQString::tqfromLatin1("ImportOptions - FreeDB")); + KConfigGroup config(KGlobal::config(), TQString::fromLatin1("ImportOptions - FreeDB")); config.writeEntry("CD-ROM Devices", drives); config.writeEntry("Last Device", drivePath); config.writeEntry("Cache Files Only", false); @@ -167,7 +167,7 @@ void FreeDBImporter::readCDROM() { #endif if(list.isEmpty()) { - setStatusMessage(i18n("<qt>Tellico was unable to access the CD-ROM device - <i>%1</i>.</qt>").tqarg(drivePath)); + setStatusMessage(i18n("<qt>Tellico was unable to access the CD-ROM device - <i>%1</i>.</qt>").arg(drivePath)); return; } // myDebug() << KCDDB::CDDB::trackOffsetListToId(list) << endl; @@ -185,9 +185,9 @@ void FreeDBImporter::readCDROM() { TQStringList list; KCDDB::CDInfoList infoList = client.lookupResponse(); for(KCDDB::CDInfoList::iterator it = infoList.begin(); it != infoList.end(); ++it) { - list.append(TQString::tqfromLatin1("%1, %2, %3").tqarg((*it).artist) - .tqarg((*it).title) - .tqarg((*it).genre)); + list.append(TQString::fromLatin1("%1, %2, %3").arg((*it).artist) + .arg((*it).title) + .arg((*it).genre)); } // switch back to pointer cursor @@ -254,23 +254,23 @@ void FreeDBImporter::readCDROM() { Data::EntryPtr entry = new Data::Entry(m_coll); // obviously a CD - entry->setField(TQString::tqfromLatin1("medium"), i18n("Compact Disc")); - entry->setField(TQString::tqfromLatin1("title"), info.title); - entry->setField(TQString::tqfromLatin1("artist"), info.artist); - entry->setField(TQString::tqfromLatin1("genre"), info.genre); + entry->setField(TQString::fromLatin1("medium"), i18n("Compact Disc")); + entry->setField(TQString::fromLatin1("title"), info.title); + entry->setField(TQString::fromLatin1("artist"), info.artist); + entry->setField(TQString::fromLatin1("genre"), info.genre); if(info.year > 0) { - entry->setField(TQString::tqfromLatin1("year"), TQString::number(info.year)); + entry->setField(TQString::fromLatin1("year"), TQString::number(info.year)); } - entry->setField(TQString::tqfromLatin1("keyword"), info.category); + entry->setField(TQString::fromLatin1("keyword"), info.category); TQString extd = info.extd; - extd.replace('\n', TQString::tqfromLatin1("<br/>")); - entry->setField(TQString::tqfromLatin1("comments"), extd); + extd.replace('\n', TQString::fromLatin1("<br/>")); + entry->setField(TQString::fromLatin1("comments"), extd); TQStringList trackList; KCDDB::TrackInfoList t = info.trackInfoList; for(uint i = 0; i < t.count(); ++i) { #if KDE_IS_VERSION(3,4,90) - TQString s = t[i].get(TQString::tqfromLatin1("title")).toString() + "::" + info.artist; + TQString s = t[i].get(TQString::fromLatin1("title")).toString() + "::" + info.artist; #else TQString s = t[i].title + "::" + info.artist; #endif @@ -280,7 +280,7 @@ void FreeDBImporter::readCDROM() { trackList << s; // TODO: KDE4 will probably have track length too } - entry->setField(TQString::tqfromLatin1("track"), trackList.join(TQString::tqfromLatin1("; "))); + entry->setField(TQString::fromLatin1("track"), trackList.join(TQString::fromLatin1("; "))); m_coll->addEntries(entry); readCDText(drive); @@ -291,7 +291,7 @@ void FreeDBImporter::readCache() { #ifdef HAVE_KCDDB { // remember the import options - KConfigGroup config(KGlobal::config(), TQString::tqfromLatin1("ImportOptions - FreeDB")); + KConfigGroup config(KGlobal::config(), TQString::fromLatin1("ImportOptions - FreeDB")); config.writeEntry("Cache Files Only", true); } @@ -320,12 +320,12 @@ void FreeDBImporter::readCache() { // kapp->processEvents(); // really needed ? } - const TQString title = TQString::tqfromLatin1("title"); - const TQString artist = TQString::tqfromLatin1("artist"); - const TQString year = TQString::tqfromLatin1("year"); - const TQString genre = TQString::tqfromLatin1("genre"); - const TQString track = TQString::tqfromLatin1("track"); - const TQString comments = TQString::tqfromLatin1("comments"); + const TQString title = TQString::fromLatin1("title"); + const TQString artist = TQString::fromLatin1("artist"); + const TQString year = TQString::fromLatin1("year"); + const TQString genre = TQString::fromLatin1("genre"); + const TQString track = TQString::fromLatin1("track"); + const TQString comments = TQString::fromLatin1("comments"); uint numFiles = files.count(); if(numFiles == 0) { @@ -372,39 +372,39 @@ void FreeDBImporter::readCache() { // create a new entry and set fields Data::EntryPtr entry = new Data::Entry(m_coll); // obviously a CD - entry->setField(TQString::tqfromLatin1("medium"), i18n("Compact Disc")); + entry->setField(TQString::fromLatin1("medium"), i18n("Compact Disc")); entry->setField(title, info.title); entry->setField(artist, info.artist); entry->setField(genre, info.genre); if(info.year > 0) { - entry->setField(TQString::tqfromLatin1("year"), TQString::number(info.year)); + entry->setField(TQString::fromLatin1("year"), TQString::number(info.year)); } - entry->setField(TQString::tqfromLatin1("keyword"), info.category); + entry->setField(TQString::fromLatin1("keyword"), info.category); TQString extd = info.extd; - extd.replace('\n', TQString::tqfromLatin1("<br/>")); - entry->setField(TQString::tqfromLatin1("comments"), extd); + extd.replace('\n', TQString::fromLatin1("<br/>")); + entry->setField(TQString::fromLatin1("comments"), extd); // step through trackList TQStringList trackList; KCDDB::TrackInfoList t = info.trackInfoList; for(uint i = 0; i < t.count(); ++i) { #if KDE_IS_VERSION(3,4,90) - trackList << t[i].get(TQString::tqfromLatin1("title")).toString(); + trackList << t[i].get(TQString::fromLatin1("title")).toString(); #else trackList << t[i].title; #endif } - entry->setField(track, trackList.join(TQString::tqfromLatin1("; "))); + entry->setField(track, trackList.join(TQString::fromLatin1("; "))); #if 0 // add CDDB info - const TQString br = TQString::tqfromLatin1("<br/>"); + const TQString br = TQString::fromLatin1("<br/>"); TQString comment; if(!info.extd.isEmpty()) { comment.append(info.extd + br); } if(!info.id.isEmpty()) { - comment.append(TQString::tqfromLatin1("CDDB-ID: ") + info.id + br); + comment.append(TQString::fromLatin1("CDDB-ID: ") + info.id + br); } if(info.length > 0) { comment.append("Length: " + TQString::number(info.length) + br); @@ -427,8 +427,8 @@ void FreeDBImporter::readCache() { } #define SETFIELD(name,value) \ - if(entry->field(TQString::tqfromLatin1(name)).isEmpty()) { \ - entry->setField(TQString::tqfromLatin1(name), value); \ + if(entry->field(TQString::fromLatin1(name)).isEmpty()) { \ + entry->setField(TQString::fromLatin1(name), value); \ } void FreeDBImporter::readCDText(const TQCString& drive_) { @@ -443,7 +443,7 @@ void FreeDBImporter::readCDText(const TQCString& drive_) { } if(!entry) { entry = new Data::Entry(m_coll); - entry->setField(TQString::tqfromLatin1("medium"), i18n("Compact Disc")); + entry->setField(TQString::fromLatin1("medium"), i18n("Compact Disc")); m_coll->addEntries(entry); } @@ -470,7 +470,7 @@ void FreeDBImporter::readCDText(const TQCString& drive_) { artist = i18n("Various"); } } - SETFIELD("track", tracks.join(TQString::tqfromLatin1("; "))); + SETFIELD("track", tracks.join(TQString::fromLatin1("; "))); // something special for compilations and such SETFIELD("title", i18n(Data::Collection::s_emptyGroupTitle)); @@ -515,14 +515,14 @@ TQWidget* FreeDBImporter::widget(TQWidget* parent_, const char* name_/*=0*/) { l->addStretch(1); // now read config options - KConfigGroup config(KGlobal::config(), TQString::tqfromLatin1("ImportOptions - FreeDB")); + KConfigGroup config(KGlobal::config(), TQString::fromLatin1("ImportOptions - FreeDB")); TQStringList devices = config.readListEntry("CD-ROM Devices"); if(devices.isEmpty()) { #if defined(__OpenBSD__) - devices += TQString::tqfromLatin1("/dev/rcd0c"); + devices += TQString::fromLatin1("/dev/rcd0c"); #endif - devices += TQString::tqfromLatin1("/dev/cdrom"); - devices += TQString::tqfromLatin1("/dev/dvd"); + devices += TQString::fromLatin1("/dev/cdrom"); + devices += TQString::fromLatin1("/dev/dvd"); } m_driveCombo->insertStringList(devices); TQString device = config.readEntry("Last Device"); diff --git a/src/translators/gcfilmsexporter.cpp b/src/translators/gcfilmsexporter.cpp index 279a3ab..91a4d8e 100644 --- a/src/translators/gcfilmsexporter.cpp +++ b/src/translators/gcfilmsexporter.cpp @@ -61,19 +61,19 @@ bool GCfilmsExporter::exec() { char d = GCFILMS_DELIMITER; bool format = options() & Export::ExportFormatted; // when importing GCfilms, a url field is added - bool hasURL = coll->hasField(TQString::tqfromLatin1("url")) - && coll->fieldByName(TQString::tqfromLatin1("url"))->type() == Data::Field::URL; + bool hasURL = coll->hasField(TQString::fromLatin1("url")) + && coll->fieldByName(TQString::fromLatin1("url"))->type() == Data::Field::URL; uint minRating = 1; uint maxRating = 5; - Data::FieldPtr f = coll->fieldByName(TQString::tqfromLatin1("rating")); + Data::FieldPtr f = coll->fieldByName(TQString::fromLatin1("rating")); if(f) { bool ok; - uint n = Tellico::toUInt(f->property(TQString::tqfromLatin1("minimum")), &ok); + uint n = Tellico::toUInt(f->property(TQString::fromLatin1("minimum")), &ok); if(ok) { minRating = n; } - n = Tellico::toUInt(f->property(TQString::tqfromLatin1("maximum")), &ok); + n = Tellico::toUInt(f->property(TQString::fromLatin1("maximum")), &ok); if(ok) { maxRating = n; } @@ -83,8 +83,8 @@ bool GCfilmsExporter::exec() { KURL imageDir; if(url().isLocalFile()) { imageDir = url(); - imageDir.cd(TQString::tqfromLatin1("..")); - imageDir.addPath(url().fileName().section('.', 0, 0) + TQString::tqfromLatin1("_images/")); + imageDir.cd(TQString::fromLatin1("..")); + imageDir.addPath(url().fileName().section('.', 0, 0) + TQString::fromLatin1("_images/")); if(!KIO::NetAccess::exists(imageDir, false, 0)) { bool success = KIO::NetAccess::mkdir(imageDir, Kernel::self()->widget()); if(!success) { @@ -103,7 +103,7 @@ bool GCfilmsExporter::exec() { push(ts, "nationality", entry, format); push(ts, "genre", entry, format); // do image - TQString tmp = entry->field(TQString::tqfromLatin1("cover")); + TQString tmp = entry->field(TQString::fromLatin1("cover")); if(!tmp.isEmpty() && !imageDir.isEmpty()) { images << tmp; ts << imageDir.path() << tmp; @@ -111,9 +111,9 @@ bool GCfilmsExporter::exec() { ts << d; // do not format cast since the commas could get mixed up - const TQStringList cast = entry->fields(TQString::tqfromLatin1("cast"), false); + const TQStringList cast = entry->fields(TQString::fromLatin1("cast"), false); for(TQStringList::ConstIterator it = cast.begin(); it != cast.end(); ++it) { - ts << (*it).section(TQString::tqfromLatin1("::"), 0, 0); + ts << (*it).section(TQString::fromLatin1("::"), 0, 0); if(it != cast.fromLast()) { ts << ", "; } @@ -142,7 +142,7 @@ bool GCfilmsExporter::exec() { // gcfilms's ratings go 0-10, just multiply by two bool ok; - int rat = Tellico::toUInt(entry->field(TQString::tqfromLatin1("rating"), format), &ok); + int rat = Tellico::toUInt(entry->field(TQString::fromLatin1("rating"), format), &ok); if(ok) { ts << rat * 10/(maxRating-minRating); } @@ -154,7 +154,7 @@ bool GCfilmsExporter::exec() { push(ts, "subtitle", entry, format); // values[20] is borrower name, values[21] is loan date - if(entry->field(TQString::tqfromLatin1("loaned")).isEmpty()) { + if(entry->field(TQString::fromLatin1("loaned")).isEmpty()) { ts << d << d; } else { // find loan @@ -179,7 +179,7 @@ bool GCfilmsExporter::exec() { ts << d; // for certification, only thing we can do is assume default american ratings - tmp = entry->field(TQString::tqfromLatin1("certification"), format); + tmp = entry->field(TQString::fromLatin1("certification"), format); int age = 0; if(tmp == Latin1Literal("U (USA)")) { age = 1; @@ -218,14 +218,14 @@ bool GCfilmsExporter::exec() { } void GCfilmsExporter::push(TQTextOStream& ts_, TQCString fieldName_, Data::EntryVec::ConstIterator entry_, bool format_) { - Data::FieldPtr f = collection()->fieldByName(TQString::tqfromLatin1(fieldName_)); + Data::FieldPtr f = collection()->fieldByName(TQString::fromLatin1(fieldName_)); // don't format multiple names cause commas will cause problems if(f->formatFlag() == Data::Field::FormatName && (f->flags() & Data::Field::AllowMultiple)) { format_ = false; } - TQString s = entry_->field(TQString::tqfromLatin1(fieldName_), format_); + TQString s = entry_->field(TQString::fromLatin1(fieldName_), format_); if(f->flags() & Data::Field::AllowMultiple) { - ts_ << s.replace(TQString::tqfromLatin1("; "), TQChar(',')); + ts_ << s.replace(TQString::fromLatin1("; "), TQChar(',')); } else { ts_ << s; } diff --git a/src/translators/gcfilmsimporter.cpp b/src/translators/gcfilmsimporter.cpp index 027a233..6e24f59 100644 --- a/src/translators/gcfilmsimporter.cpp +++ b/src/translators/gcfilmsimporter.cpp @@ -24,7 +24,7 @@ #include <kapplication.h> #include <kstandarddirs.h> -#include <tqtextcodec.h> +#include <textcodec.h> #define CHECKLIMITS(n) if(values.count() <= n) continue @@ -55,11 +55,11 @@ Tellico::Data::CollPtr GCfilmsImporter::collection() { TQString str = text(); TQTextIStream t(&str); TQString line = t.readLine(); - if(line.startsWith(TQString::tqfromLatin1("GCfilms"))) { + if(line.startsWith(TQString::fromLatin1("GCfilms"))) { readGCfilms(str); } else { // need to reparse the string if it's in utf-8 - if(line.lower().find(TQString::tqfromLatin1("utf-8")) > 0) { + if(line.lower().find(TQString::fromLatin1("utf-8")) > 0) { str = TQString::fromUtf8(str.local8Bit()); } readGCstar(str); @@ -70,10 +70,10 @@ Tellico::Data::CollPtr GCfilmsImporter::collection() { void GCfilmsImporter::readGCfilms(const TQString& text_) { m_coll = new Data::VideoCollection(true); bool hasURL = false; - if(m_coll->hasField(TQString::tqfromLatin1("url"))) { - hasURL = m_coll->fieldByName(TQString::tqfromLatin1("url"))->type() == Data::Field::URL; + if(m_coll->hasField(TQString::fromLatin1("url"))) { + hasURL = m_coll->fieldByName(TQString::fromLatin1("url"))->type() == Data::Field::URL; } else { - Data::FieldPtr field = new Data::Field(TQString::tqfromLatin1("url"), i18n("URL"), Data::Field::URL); + Data::FieldPtr field = new Data::Field(TQString::fromLatin1("url"), i18n("URL"), Data::Field::URL); field->setCategory(i18n("General")); m_coll->addField(field); hasURL = true; @@ -81,10 +81,10 @@ void GCfilmsImporter::readGCfilms(const TQString& text_) { bool convertUTF8 = false; TQMap<TQString, Data::BorrowerPtr> borrowers; - const TQRegExp rx(TQString::tqfromLatin1("\\s*,\\s*")); - TQRegExp year(TQString::tqfromLatin1("\\d{4}")); - TQRegExp runTimeHr(TQString::tqfromLatin1("(\\d+)\\s?hr?")); - TQRegExp runTimeMin(TQString::tqfromLatin1("(\\d+)\\s?mi?n?")); + const TQRegExp rx(TQString::fromLatin1("\\s*,\\s*")); + TQRegExp year(TQString::fromLatin1("\\d{4}")); + TQRegExp runTimeHr(TQString::fromLatin1("(\\d+)\\s?hr?")); + TQRegExp runTimeMin(TQString::fromLatin1("(\\d+)\\s?mi?n?")); bool gotFirstLine = false; uint total = 0; @@ -126,9 +126,9 @@ void GCfilmsImporter::readGCfilms(const TQString& text_) { Data::EntryPtr entry = new Data::Entry(m_coll); entry->setId(Tellico::toUInt(values[0], &ok)); - entry->setField(TQString::tqfromLatin1("title"), values[1]); + entry->setField(TQString::fromLatin1("title"), values[1]); if(year.search(values[2]) > -1) { - entry->setField(TQString::tqfromLatin1("year"), year.cap()); + entry->setField(TQString::fromLatin1("year"), year.cap()); } uint time = 0; @@ -139,35 +139,35 @@ void GCfilmsImporter::readGCfilms(const TQString& text_) { time += Tellico::toUInt(runTimeMin.cap(1), &ok); } if(time > 0) { - entry->setField(TQString::tqfromLatin1("running-time"), TQString::number(time)); + entry->setField(TQString::fromLatin1("running-time"), TQString::number(time)); } - entry->setField(TQString::tqfromLatin1("director"), splitJoin(rx, values[4])); - entry->setField(TQString::tqfromLatin1("nationality"), splitJoin(rx, values[5])); - entry->setField(TQString::tqfromLatin1("genre"), splitJoin(rx, values[6])); + entry->setField(TQString::fromLatin1("director"), splitJoin(rx, values[4])); + entry->setField(TQString::fromLatin1("nationality"), splitJoin(rx, values[5])); + entry->setField(TQString::fromLatin1("genre"), splitJoin(rx, values[6])); KURL u = KURL::fromPathOrURL(values[7]); if(!u.isEmpty()) { TQString id = ImageFactory::addImage(u, true /* quiet */); if(!id.isEmpty()) { - entry->setField(TQString::tqfromLatin1("cover"), id); + entry->setField(TQString::fromLatin1("cover"), id); } } - entry->setField(TQString::tqfromLatin1("cast"), splitJoin(rx, values[8])); + entry->setField(TQString::fromLatin1("cast"), splitJoin(rx, values[8])); // values[9] is the original title - entry->setField(TQString::tqfromLatin1("plot"), values[10]); + entry->setField(TQString::fromLatin1("plot"), values[10]); if(hasURL) { - entry->setField(TQString::tqfromLatin1("url"), values[11]); + entry->setField(TQString::fromLatin1("url"), values[11]); } CHECKLIMITS(12); // values[12] is whether the film has been viewed or not - entry->setField(TQString::tqfromLatin1("medium"), values[13]); + entry->setField(TQString::fromLatin1("medium"), values[13]); // values[14] is number of DVDS? // values[15] is place? // gcfilms's ratings go 0-10, just divide by two - entry->setField(TQString::tqfromLatin1("rating"), TQString::number(int(Tellico::toUInt(values[16], &ok)/2))); - entry->setField(TQString::tqfromLatin1("comments"), values[17]); + entry->setField(TQString::fromLatin1("rating"), TQString::number(int(Tellico::toUInt(values[16], &ok)/2))); + entry->setField(TQString::fromLatin1("comments"), values[17]); CHECKLIMITS(18); @@ -177,10 +177,10 @@ void GCfilmsImporter::readGCfilms(const TQString& text_) { langs << (*it).section(';', 0, 0); tracks << (*it).section(';', 1, 1); } - entry->setField(TQString::tqfromLatin1("language"), langs.join(TQString::tqfromLatin1("; "))); - entry->setField(TQString::tqfromLatin1("audio-track"), tracks.join(TQString::tqfromLatin1("; "))); + entry->setField(TQString::fromLatin1("language"), langs.join(TQString::fromLatin1("; "))); + entry->setField(TQString::fromLatin1("audio-track"), tracks.join(TQString::fromLatin1("; "))); - entry->setField(TQString::tqfromLatin1("subtitle"), splitJoin(rx, values[19])); + entry->setField(TQString::fromLatin1("subtitle"), splitJoin(rx, values[19])); CHECKLIMITS(20); @@ -199,7 +199,7 @@ void GCfilmsImporter::readGCfilms(const TQString& text_) { int m = Tellico::toUInt(tmp.section('/', 1, 1), &ok); int y = Tellico::toUInt(tmp.section('/', 2, 2), &ok); b->addLoan(new Data::Loan(entry, TQDate(y, m, d), TQDate(), TQString())); - entry->setField(TQString::tqfromLatin1("loaned"), TQString::tqfromLatin1("true")); + entry->setField(TQString::fromLatin1("loaned"), TQString::fromLatin1("true")); } } // values[22] is history ? @@ -209,15 +209,15 @@ void GCfilmsImporter::readGCfilms(const TQString& text_) { int age = Tellico::toUInt(values[23], &ok); if(age < 2) { - entry->setField(TQString::tqfromLatin1("certification"), TQString::tqfromLatin1("U (USA)")); + entry->setField(TQString::fromLatin1("certification"), TQString::fromLatin1("U (USA)")); } else if(age < 3) { - entry->setField(TQString::tqfromLatin1("certification"), TQString::tqfromLatin1("G (USA)")); + entry->setField(TQString::fromLatin1("certification"), TQString::fromLatin1("G (USA)")); } else if(age < 6) { - entry->setField(TQString::tqfromLatin1("certification"), TQString::tqfromLatin1("PG (USA)")); + entry->setField(TQString::fromLatin1("certification"), TQString::fromLatin1("PG (USA)")); } else if(age < 14) { - entry->setField(TQString::tqfromLatin1("certification"), TQString::tqfromLatin1("PG-13 (USA)")); + entry->setField(TQString::fromLatin1("certification"), TQString::fromLatin1("PG-13 (USA)")); } else { - entry->setField(TQString::tqfromLatin1("certification"), TQString::tqfromLatin1("R (USA)")); + entry->setField(TQString::fromLatin1("certification"), TQString::fromLatin1("R (USA)")); } m_coll->addEntries(entry); @@ -241,7 +241,7 @@ void GCfilmsImporter::readGCfilms(const TQString& text_) { } void GCfilmsImporter::readGCstar(const TQString& text_) { - TQString xsltFile = locate("appdata", TQString::tqfromLatin1("gcstar2tellico.xsl")); + TQString xsltFile = locate("appdata", TQString::fromLatin1("gcstar2tellico.xsl")); XSLTHandler handler(xsltFile); if(!handler.isValid()) { setStatusMessage(i18n("Tellico encountered an error in XSLT processing.")); @@ -262,7 +262,7 @@ void GCfilmsImporter::readGCstar(const TQString& text_) { inline TQString GCfilmsImporter::splitJoin(const TQRegExp& rx, const TQString& s) { - return TQStringList::split(rx, s, false).join(TQString::tqfromLatin1("; ")); + return TQStringList::split(rx, s, false).join(TQString::fromLatin1("; ")); } void GCfilmsImporter::slotCancel() { diff --git a/src/translators/griffithimporter.cpp b/src/translators/griffithimporter.cpp index 953a159..ea4da5e 100644 --- a/src/translators/griffithimporter.cpp +++ b/src/translators/griffithimporter.cpp @@ -34,19 +34,19 @@ GriffithImporter::~GriffithImporter() { } Tellico::Data::CollPtr GriffithImporter::collection() { - TQString filename = TQDir::homeDirPath() + TQString::tqfromLatin1("/.griffith/griffith.db"); + TQString filename = TQDir::homeDirPath() + TQString::fromLatin1("/.griffith/griffith.db"); if(!TQFile::exists(filename)) { myWarning() << "GriffithImporter::collection() - database not found: " << filename << endl; return 0; } - TQString python = KStandardDirs::findExe(TQString::tqfromLatin1("python")); + TQString python = KStandardDirs::findExe(TQString::fromLatin1("python")); if(python.isEmpty()) { myWarning() << "GriffithImporter::collection() - python not found!" << endl; return 0; } - TQString griffith = KGlobal::dirs()->findResource("appdata", TQString::tqfromLatin1("griffith2tellico.py")); + TQString griffith = KGlobal::dirs()->findResource("appdata", TQString::fromLatin1("griffith2tellico.py")); if(griffith.isEmpty()) { myWarning() << "GriffithImporter::collection() - griffith2tellico.py not found!" << endl; return 0; diff --git a/src/translators/grs1importer.cpp b/src/translators/grs1importer.cpp index 30c9a69..f987720 100644 --- a/src/translators/grs1importer.cpp +++ b/src/translators/grs1importer.cpp @@ -26,20 +26,20 @@ void GRS1Importer::initTagMap() { if(!s_tagMap) { s_tagMap = new TagMap(); // BT is special and is handled separately - s_tagMap->insert(TagPair(2, 1), TQString::tqfromLatin1("title")); - s_tagMap->insert(TagPair(2, 2), TQString::tqfromLatin1("author")); - s_tagMap->insert(TagPair(2, 4), TQString::tqfromLatin1("year")); - s_tagMap->insert(TagPair(2, 7), TQString::tqfromLatin1("publisher")); - s_tagMap->insert(TagPair(2, 31), TQString::tqfromLatin1("publisher")); - s_tagMap->insert(TagPair(2, 20), TQString::tqfromLatin1("language")); - s_tagMap->insert(TagPair(2, 21), TQString::tqfromLatin1("keyword")); - s_tagMap->insert(TagPair(3, TQString::tqfromLatin1("isbn/issn")), TQString::tqfromLatin1("isbn")); - s_tagMap->insert(TagPair(3, TQString::tqfromLatin1("isbn")), TQString::tqfromLatin1("isbn")); - s_tagMap->insert(TagPair(3, TQString::tqfromLatin1("notes")), TQString::tqfromLatin1("note")); - s_tagMap->insert(TagPair(3, TQString::tqfromLatin1("note")), TQString::tqfromLatin1("note")); - s_tagMap->insert(TagPair(3, TQString::tqfromLatin1("series")), TQString::tqfromLatin1("series")); - s_tagMap->insert(TagPair(3, TQString::tqfromLatin1("physical description")), TQString::tqfromLatin1("note")); - s_tagMap->insert(TagPair(3, TQString::tqfromLatin1("subtitle")), TQString::tqfromLatin1("subtitle")); + s_tagMap->insert(TagPair(2, 1), TQString::fromLatin1("title")); + s_tagMap->insert(TagPair(2, 2), TQString::fromLatin1("author")); + s_tagMap->insert(TagPair(2, 4), TQString::fromLatin1("year")); + s_tagMap->insert(TagPair(2, 7), TQString::fromLatin1("publisher")); + s_tagMap->insert(TagPair(2, 31), TQString::fromLatin1("publisher")); + s_tagMap->insert(TagPair(2, 20), TQString::fromLatin1("language")); + s_tagMap->insert(TagPair(2, 21), TQString::fromLatin1("keyword")); + s_tagMap->insert(TagPair(3, TQString::fromLatin1("isbn/issn")), TQString::fromLatin1("isbn")); + s_tagMap->insert(TagPair(3, TQString::fromLatin1("isbn")), TQString::fromLatin1("isbn")); + s_tagMap->insert(TagPair(3, TQString::fromLatin1("notes")), TQString::fromLatin1("note")); + s_tagMap->insert(TagPair(3, TQString::fromLatin1("note")), TQString::fromLatin1("note")); + s_tagMap->insert(TagPair(3, TQString::fromLatin1("series")), TQString::fromLatin1("series")); + s_tagMap->insert(TagPair(3, TQString::fromLatin1("physical description")), TQString::fromLatin1("note")); + s_tagMap->insert(TagPair(3, TQString::fromLatin1("subtitle")), TQString::fromLatin1("subtitle")); } } @@ -54,12 +54,12 @@ bool GRS1Importer::canImport(int type) const { Tellico::Data::CollPtr GRS1Importer::collection() { Data::CollPtr coll = new Data::BibtexCollection(true); - Data::FieldPtr f = new Data::Field(TQString::tqfromLatin1("isbn"), i18n("ISBN#")); + Data::FieldPtr f = new Data::Field(TQString::fromLatin1("isbn"), i18n("ISBN#")); f->setCategory(i18n("Publishing")); f->setDescription(i18n("International Standard Book Number")); coll->addField(f); - f = new Data::Field(TQString::tqfromLatin1("language"), i18n("Language")); + f = new Data::Field(TQString::fromLatin1("language"), i18n("Language")); f->setCategory(i18n("Publishing")); f->setFlags(Data::Field::AllowCompletion | Data::Field::AllowGrouped | Data::Field::AllowMultiple); coll->addField(f); @@ -68,10 +68,10 @@ Tellico::Data::CollPtr GRS1Importer::collection() { bool empty = true; // in format "(tag, tag) value" - TQRegExp rx(TQString::tqfromLatin1("\\s*\\((\\d+),\\s*(.+)\\s*\\)\\s*(.+)\\s*")); + TQRegExp rx(TQString::fromLatin1("\\s*\\((\\d+),\\s*(.+)\\s*\\)\\s*(.+)\\s*")); // rx.setMinimal(true); - TQRegExp dateRx(TQString::tqfromLatin1(",[^,]*\\d{3,4}[^,]*")); // remove dates from authors - TQRegExp pubRx(TQString::tqfromLatin1("([^:]+):([^,]+),?")); // split location and publisher + TQRegExp dateRx(TQString::fromLatin1(",[^,]*\\d{3,4}[^,]*")); // remove dates from authors + TQRegExp pubRx(TQString::fromLatin1("([^:]+):([^,]+),?")); // split location and publisher bool ok; int n; @@ -109,14 +109,14 @@ Tellico::Data::CollPtr GRS1Importer::collection() { } else if(field == Latin1Literal("publisher")) { int pos = val.find(pubRx); if(pos > -1) { - e->setField(TQString::tqfromLatin1("address"), pubRx.cap(1)); + e->setField(TQString::fromLatin1("address"), pubRx.cap(1)); val = pubRx.cap(2); } } tmp = e->field(field); if(!tmp.isEmpty()) { - tmp += TQString::tqfromLatin1("; "); + tmp += TQString::fromLatin1("; "); } e->setField(field, tmp + val); } diff --git a/src/translators/htmlexporter.cpp b/src/translators/htmlexporter.cpp index 333ebfd..31701d4 100644 --- a/src/translators/htmlexporter.cpp +++ b/src/translators/htmlexporter.cpp @@ -34,7 +34,7 @@ #include <tqdom.h> #include <tqgroupbox.h> -#include <tqlayout.h> +#include <layout.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::tqfromLatin1("tellico2html.xsl")) { + m_xsltFile(TQString::fromLatin1("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::tqfromLatin1("tellico2html.xsl")) { + m_xsltFile(TQString::fromLatin1("tellico2html.xsl")) { } HTMLExporter::~HTMLExporter() { @@ -201,7 +201,7 @@ bool HTMLExporter::loadXSLTFile() { } if(!m_collectionURL.isEmpty()) { - TQString s = TQString::tqfromLatin1("../") + m_collectionURL.fileName(); + TQString s = TQString::fromLatin1("../") + 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::tqfromLatin1("pics/tellico.png")); + m_dataDir = KGlobal::dirs()->findResourceDir("appdata", TQString::fromLatin1("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::tqfromLatin1("/tmp/test.xml")); + TQFile f(TQString::fromLatin1("/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::tqfromLatin1("/tmp/test.html")); + TQFile f2(TQString::fromLatin1("/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::tqcurrentDate()).utf8()); + m_handler->addStringParam("cdate", KGlobal::locale()->formatDate(TQDate::currentDate()).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)").tqarg(s); + sortString = i18n("(grouped by %1)").arg(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::tqfromLatin1("tc:") + *it + TQString::tqfromLatin1("s/tc:") + *it; + groupFields += TQString::fromLatin1("tc:") + *it + TQString::fromLatin1("s/tc:") + *it; } else { - groupFields += TQString::tqfromLatin1("tc:") + *it; + groupFields += TQString::fromLatin1("tc:") + *it; } int ncols = 0; if(f->type() == Data::Field::Table) { bool ok; - ncols = Tellico::toUInt(f->property(TQString::tqfromLatin1("columns")), &ok); + ncols = Tellico::toUInt(f->property(TQString::fromLatin1("columns")), &ok); if(!ok) { ncols = 1; } } if(ncols > 1) { - groupFields += TQString::tqfromLatin1("/tc:column[1]"); + groupFields += TQString::fromLatin1("/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::tqfromLatin1("ExportOptions - %1").tqarg(formatString())); + KConfigGroup exportConfig(config_, TQString::fromLatin1("ExportOptions - %1").arg(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::tqfromLatin1("entry-templates/") - + m_entryXSLTFile + TQString::tqfromLatin1(".xsl")); + m_entryXSLTFile = locate("appdata", TQString::fromLatin1("entry-templates/") + + m_entryXSLTFile + TQString::fromLatin1(".xsl")); } void HTMLExporter::saveOptions(KConfig* config_) { - KConfigGroup cfg(config_, TQString::tqfromLatin1("ExportOptions - %1").tqarg(formatString())); + KConfigGroup cfg(config_, TQString::fromLatin1("ExportOptions - %1").arg(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::tqfromLatin1("..")); + fileDir.cd(TQString::fromLatin1("..")); fileDir.addPath(fileDirName()); return fileDir; } TQString HTMLExporter::fileDirName() const { if(!m_collectionURL.isEmpty()) { - return TQString::tqfromLatin1("/"); + return TQString::fromLatin1("/"); } - return url().fileName().section('.', 0, 0) + TQString::tqfromLatin1("_files/"); + return url().fileName().section('.', 0, 0) + TQString::fromLatin1("_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::tqfromLatin1("pics/")); + const bool isPic = link_.startsWith(m_dataDir + TQString::fromLatin1("pics/")); TQString midDir; if(m_exportEntryFiles && isPic) { - midDir = TQString::tqfromLatin1("pics/"); + midDir = TQString::fromLatin1("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::tqfromLatin1("url("); + const TQString url = TQString::fromLatin1("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::tqfromLatin1("[^-a-zA-Z0-9]")); + const TQRegExp badChars(TQString::fromLatin1("[^-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::tqfromLatin1("title"); - const TQString html = TQString::tqfromLatin1(".html"); + const TQString title = TQString::fromLatin1("title"); + const TQString html = TQString::fromLatin1(".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::tqfromLatin1("checkmark.png"); + dataImages << TQString::fromLatin1("checkmark.png"); for(uint i = 1; i <= 10; ++i) { - dataImages << TQString::tqfromLatin1("stars%1.png").tqarg(i); + dataImages << TQString::fromLatin1("stars%1.png").arg(i); } KURL dataDir; - dataDir.setPath(KGlobal::dirs()->findResourceDir("appdata", TQString::tqfromLatin1("pics/tellico.png")) + "pics/"); + dataDir.setPath(KGlobal::dirs()->findResourceDir("appdata", TQString::fromLatin1("pics/tellico.png")) + "pics/"); KURL target = fileDir(); - target.addPath(TQString::tqfromLatin1("pics/")); + target.addPath(TQString::fromLatin1("pics/")); KIO::NetAccess::mkdir(target, m_widget); for(TQStringList::ConstIterator it = dataImages.begin(); it != dataImages.end(); ++it) { dataDir.setFileName(*it); diff --git a/src/translators/importer.h b/src/translators/importer.h index d10e027..08fe3f1 100644 --- a/src/translators/importer.h +++ b/src/translators/importer.h @@ -98,7 +98,7 @@ public: * Returns a string useful for the ProgressManager */ TQString progressLabel() const { - if(url().isEmpty()) return i18n("Loading data..."); else return i18n("Loading %1...").tqarg(url().fileName()); + if(url().isEmpty()) return i18n("Loading data..."); else return i18n("Loading %1...").arg(url().fileName()); } public slots: diff --git a/src/translators/onixexporter.cpp b/src/translators/onixexporter.cpp index 65b85ee..bca59fd 100644 --- a/src/translators/onixexporter.cpp +++ b/src/translators/onixexporter.cpp @@ -33,7 +33,7 @@ #include <tqfile.h> #include <tqdatetime.h> #include <tqbuffer.h> -#include <tqlayout.h> +#include <layout.h> #include <tqwhatsthis.h> #include <tqcheckbox.h> #include <tqgroupbox.h> @@ -42,14 +42,14 @@ using Tellico::Export::ONIXExporter; ONIXExporter::ONIXExporter() : Tellico::Export::Exporter(), m_handler(0), - m_xsltFile(TQString::tqfromLatin1("tellico2onix.xsl")), + m_xsltFile(TQString::fromLatin1("tellico2onix.xsl")), m_includeImages(true), m_widget(0) { } ONIXExporter::ONIXExporter(Data::CollPtr coll_) : Tellico::Export::Exporter(coll_), m_handler(0), - m_xsltFile(TQString::tqfromLatin1("tellico2onix.xsl")), + m_xsltFile(TQString::fromLatin1("tellico2onix.xsl")), m_includeImages(true), m_widget(0) { } @@ -80,18 +80,18 @@ bool ONIXExporter::exec() { KZip zip(TQT_TQIODEVICE(&buf)); zip.open(IO_WriteOnly); - zip.writeFile(TQString::tqfromLatin1("onix.xml"), TQString(), TQString(), xml.length(), xml); + zip.writeFile(TQString::fromLatin1("onix.xml"), TQString(), TQString(), xml.length(), xml); // use a dict for fast random access to keep track of which images were written to the file if(m_includeImages) { // for now, we're ignoring (options() & Export::ExportImages) - const TQString cover = TQString::tqfromLatin1("cover"); + const TQString cover = TQString::fromLatin1("cover"); StringSet imageSet; for(Data::EntryVec::ConstIterator it = entries().begin(); it != entries().end(); ++it) { const Data::Image& img = ImageFactory::imageById(it->field(cover)); if(!img.isNull() && !imageSet.has(img.id()) && (img.format() == "JPEG" || img.format() == "JPG" || img.format() == "GIF")) { /// onix only understands jpeg and gif TQByteArray ba = img.byteArray(); - zip.writeFile(TQString::tqfromLatin1("images/") + it->field(cover), + zip.writeFile(TQString::fromLatin1("images/") + it->field(cover), TQString(), TQString(), ba.size(), ba); imageSet.add(img.id()); } @@ -140,8 +140,8 @@ TQString ONIXExporter::text() { delete m_handler; m_handler = new XSLTHandler(dom, TQFile::encodeName(xsltfile)); - TQDateTime now = TQDateTime::tqcurrentDateTime(); - m_handler->addStringParam("sentDate", now.toString(TQString::tqfromLatin1("yyyyMMddhhmm")).utf8()); + TQDateTime now = TQDateTime::currentDateTime(); + m_handler->addStringParam("sentDate", now.toString(TQString::fromLatin1("yyyyMMddhhmm")).utf8()); m_handler->addStringParam("version", VERSION); @@ -155,7 +155,7 @@ TQString ONIXExporter::text() { exporter.setOptions(options() | Export::ExportUTF8); TQDomDocument output = exporter.exportXML(); #if 0 - TQFile f(TQString::tqfromLatin1("/tmp/test.xml")); + TQFile f(TQString::fromLatin1("/tmp/test.xml")); if(f.open(IO_WriteOnly)) { TQTextStream t(&f); t << output.toString(); @@ -185,14 +185,14 @@ TQWidget* ONIXExporter::widget(TQWidget* parent_, const char* name_/*=0*/) { } void ONIXExporter::readOptions(KConfig* config_) { - KConfigGroup group(config_, TQString::tqfromLatin1("ExportOptions - %1").tqarg(formatString())); + KConfigGroup group(config_, TQString::fromLatin1("ExportOptions - %1").arg(formatString())); m_includeImages = group.readBoolEntry("Include Images", m_includeImages); } void ONIXExporter::saveOptions(KConfig* config_) { m_includeImages = m_checkIncludeImages->isChecked(); - KConfigGroup group(config_, TQString::tqfromLatin1("ExportOptions - %1").tqarg(formatString())); + KConfigGroup group(config_, TQString::fromLatin1("ExportOptions - %1").arg(formatString())); group.writeEntry("Include Images", m_includeImages); } diff --git a/src/translators/pdfimporter.cpp b/src/translators/pdfimporter.cpp index 09df294..a258995 100644 --- a/src/translators/pdfimporter.cpp +++ b/src/translators/pdfimporter.cpp @@ -48,7 +48,7 @@ bool PDFImporter::canImport(int type_) const { } Tellico::Data::CollPtr PDFImporter::collection() { - TQString xsltfile = ::locate("appdata", TQString::tqfromLatin1("xmp2tellico.xsl")); + TQString xsltfile = ::locate("appdata", TQString::fromLatin1("xmp2tellico.xsl")); if(xsltfile.isEmpty()) { kdWarning() << "DropHandler::handleURL() - can not locate xmp2tellico.xsl" << endl; return 0; @@ -100,7 +100,7 @@ Tellico::Data::CollPtr PDFImporter::collection() { setStatusMessage(i18n("Tellico was unable to read any metadata from the PDF file.")); } else { entry = newColl->entries().front(); - hasDOI |= !entry->field(TQString::tqfromLatin1("doi")).isEmpty(); + hasDOI |= !entry->field(TQString::fromLatin1("doi")).isEmpty(); } } @@ -119,21 +119,21 @@ Tellico::Data::CollPtr PDFImporter::collection() { if(doc && !doc->isLocked()) { // now the question is, do we overwrite XMP data with Poppler data? // for now, let's say yes conditionally - TQString s = doc->getInfo(TQString::tqfromLatin1("Title")).simplifyWhiteSpace(); + TQString s = doc->getInfo(TQString::fromLatin1("Title")).simplifyWhiteSpace(); if(!s.isEmpty()) { - entry->setField(TQString::tqfromLatin1("title"), s); + entry->setField(TQString::fromLatin1("title"), s); } // author could be separated by commas, "and" or whatever // we're not going to overwrite it - if(entry->field(TQString::tqfromLatin1("author")).isEmpty()) { - TQRegExp rx(TQString::tqfromLatin1("\\s*(and|,|;)\\s*")); - TQStringList authors = TQStringList::split(rx, doc->getInfo(TQString::tqfromLatin1("Author")).simplifyWhiteSpace()); - entry->setField(TQString::tqfromLatin1("author"), authors.join(TQString::tqfromLatin1("; "))); + if(entry->field(TQString::fromLatin1("author")).isEmpty()) { + TQRegExp rx(TQString::fromLatin1("\\s*(and|,|;)\\s*")); + TQStringList authors = TQStringList::split(rx, doc->getInfo(TQString::fromLatin1("Author")).simplifyWhiteSpace()); + entry->setField(TQString::fromLatin1("author"), authors.join(TQString::fromLatin1("; "))); } - s = doc->getInfo(TQString::tqfromLatin1("Keywords")).simplifyWhiteSpace(); + s = doc->getInfo(TQString::fromLatin1("Keywords")).simplifyWhiteSpace(); if(!s.isEmpty()) { // keywords are also separated by semi-colons in poppler - entry->setField(TQString::tqfromLatin1("keyword"), s); + entry->setField(TQString::fromLatin1("keyword"), s); } // now parse the first page text and try to guess @@ -142,7 +142,7 @@ Tellico::Data::CollPtr PDFImporter::collection() { // a null rectangle means get all text on page TQString text = page->getText(Poppler::Rectangle()); // borrowed from Referencer - TQRegExp rx(TQString::tqfromLatin1("(?:" + TQRegExp rx(TQString::fromLatin1("(?:" "(?:[Dd][Oo][Ii]:? *)" "|" "(?:[Dd]igital *[Oo]bject *[Ii]dentifier:? *)" @@ -157,10 +157,10 @@ Tellico::Data::CollPtr PDFImporter::collection() { if(rx.search(text) > -1) { TQString doi = rx.cap(1); myDebug() << "PDFImporter::collection() - in PDF file, found DOI: " << doi << endl; - entry->setField(TQString::tqfromLatin1("doi"), doi); + entry->setField(TQString::fromLatin1("doi"), doi); hasDOI = true; } - rx = TQRegExp(TQString::tqfromLatin1("arXiv:" + rx = TQRegExp(TQString::fromLatin1("arXiv:" "(" "[^\\/\\s]+" "[\\/\\.]" @@ -169,12 +169,12 @@ Tellico::Data::CollPtr PDFImporter::collection() { if(rx.search(text) > -1) { TQString arxiv = rx.cap(1); myDebug() << "PDFImporter::collection() - in PDF file, found arxiv: " << arxiv << endl; - if(entry->collection()->fieldByName(TQString::tqfromLatin1("arxiv")) == 0) { - Data::FieldPtr field = new Data::Field(TQString::tqfromLatin1("arxiv"), i18n("arXiv ID")); + if(entry->collection()->fieldByName(TQString::fromLatin1("arxiv")) == 0) { + Data::FieldPtr field = new Data::Field(TQString::fromLatin1("arxiv"), i18n("arXiv ID")); field->setCategory(i18n("Publishing")); entry->collection()->addField(field); } - entry->setField(TQString::tqfromLatin1("arxiv"), arxiv); + entry->setField(TQString::fromLatin1("arxiv"), arxiv); hasArxiv = true; } @@ -186,22 +186,22 @@ Tellico::Data::CollPtr PDFImporter::collection() { delete doc; #endif - entry->setField(TQString::tqfromLatin1("url"), (*it).url()); + entry->setField(TQString::fromLatin1("url"), (*it).url()); // always an article? - entry->setField(TQString::tqfromLatin1("entry-type"), TQString::tqfromLatin1("article")); + entry->setField(TQString::fromLatin1("entry-type"), TQString::fromLatin1("article")); TQPixmap pix = NetAccess::filePreview(ref->fileName(), PDF_FILE_PREVIEW_SIZE); delete ref; // removes temp file if(!pix.isNull()) { // is png best option? - TQString id = ImageFactory::addImage(pix, TQString::tqfromLatin1("PNG")); + TQString id = ImageFactory::addImage(pix, TQString::fromLatin1("PNG")); if(!id.isEmpty()) { - Data::FieldPtr field = newColl->fieldByName(TQString::tqfromLatin1("cover")); + Data::FieldPtr field = newColl->fieldByName(TQString::fromLatin1("cover")); if(!field && !newColl->imageFields().isEmpty()) { field = newColl->imageFields().front(); } else if(!field) { - field = new Data::Field(TQString::tqfromLatin1("cover"), i18n("Front Cover"), Data::Field::Image); + field = new Data::Field(TQString::fromLatin1("cover"), i18n("Front Cover"), Data::Field::Image); newColl->addField(field); } entry->setField(field, id); @@ -233,7 +233,7 @@ Tellico::Data::CollPtr PDFImporter::collection() { "CrossRef.org. However, you must create an CrossRef account and add a new " "data source with your account information."), TQString(), - TQString::tqfromLatin1("CrossRefSourceNeeded")); + TQString::fromLatin1("CrossRefSourceNeeded")); } else { Data::EntryVec entries = coll->entries(); for(Fetch::FetcherVec::Iterator fetcher = vec.begin(); fetcher != vec.end(); ++fetcher) { @@ -263,8 +263,8 @@ Tellico::Data::CollPtr PDFImporter::collection() { for(Data::EntryVecIt entry = entries.begin(); entry != entries.end(); ++entry) { if(entry->title().isEmpty()) { // use file name - KURL u = entry->field(TQString::tqfromLatin1("url")); - entry->setField(TQString::tqfromLatin1("title"), u.fileName()); + KURL u = entry->field(TQString::fromLatin1("url")); + entry->setField(TQString::fromLatin1("title"), u.fileName()); } } diff --git a/src/translators/pilotdbexporter.cpp b/src/translators/pilotdbexporter.cpp index a4f2e72..1b3a89a 100644 --- a/src/translators/pilotdbexporter.cpp +++ b/src/translators/pilotdbexporter.cpp @@ -24,11 +24,11 @@ #include <kglobal.h> #include <kcharsets.h> -#include <tqlayout.h> +#include <layout.h> #include <tqgroupbox.h> #include <tqcheckbox.h> #include <tqwhatsthis.h> -#include <tqtextcodec.h> +#include <textcodec.h> #include <tqdatetime.h> using Tellico::Export::PilotDBExporter; @@ -58,7 +58,7 @@ bool PilotDBExporter::exec() { TQTextCodec* codec = 0; { // Latin1 is default - KConfigGroup group(KGlobal::config(), TQString::tqfromLatin1("ExportOptions - %1").tqarg(formatString())); + KConfigGroup group(KGlobal::config(), TQString::fromLatin1("ExportOptions - %1").arg(formatString())); codec = KGlobal::charsets()->codecForName(group.readEntry("Charset")); } if(!codec) { @@ -153,8 +153,8 @@ bool PilotDBExporter::exec() { Data::FieldVec::ConstIterator fIt, end = outputFields.constEnd(); bool format = options() & Export::ExportFormatted; - TQRegExp br(TQString::tqfromLatin1("<br/?>"), false /*case-sensitive*/); - TQRegExp tags(TQString::tqfromLatin1("<.*>")); + TQRegExp br(TQString::fromLatin1("<br/?>"), false /*case-sensitive*/); + TQRegExp tags(TQString::fromLatin1("<.*>")); tags.setMinimal(true); TQString value; @@ -167,9 +167,9 @@ bool PilotDBExporter::exec() { if(fIt->type() == Data::Field::Date) { TQStringList s = TQStringList::split('-', value, true); bool ok = true; - int y = s.count() > 0 ? s[0].toInt(&ok) : TQDate::tqcurrentDate().year(); + int y = s.count() > 0 ? s[0].toInt(&ok) : TQDate::currentDate().year(); if(!ok) { - y = TQDate::tqcurrentDate().year(); + y = TQDate::currentDate().year(); } int m = s.count() > 1 ? s[1].toInt(&ok) : 1; if(!ok) { @@ -180,7 +180,7 @@ bool PilotDBExporter::exec() { d = 1; } TQDate date(y, m, d); - value = date.toString(TQString::tqfromLatin1("yyyy/MM/dd")); + value = date.toString(TQString::fromLatin1("yyyy/MM/dd")); } else if(fIt->type() == Data::Field::Para) { value.replace(br, TQChar('\n')); value.replace(tags, TQString()); @@ -219,12 +219,12 @@ TQWidget* PilotDBExporter::widget(TQWidget* parent_, const char* name_/*=0*/) { } void PilotDBExporter::readOptions(KConfig* config_) { - KConfigGroup group(config_, TQString::tqfromLatin1("ExportOptions - %1").tqarg(formatString())); + KConfigGroup group(config_, TQString::fromLatin1("ExportOptions - %1").arg(formatString())); m_backup = group.readBoolEntry("Backup", m_backup); } void PilotDBExporter::saveOptions(KConfig* config_) { - KConfigGroup group(config_, TQString::tqfromLatin1("ExportOptions - %1").tqarg(formatString())); + KConfigGroup group(config_, TQString::fromLatin1("ExportOptions - %1").arg(formatString())); m_backup = m_checkBackup->isChecked(); group.writeEntry("Backup", m_backup); } diff --git a/src/translators/referencerimporter.cpp b/src/translators/referencerimporter.cpp index 332bf8c..e3cb72c 100644 --- a/src/translators/referencerimporter.cpp +++ b/src/translators/referencerimporter.cpp @@ -21,7 +21,7 @@ using Tellico::Import::ReferencerImporter; ReferencerImporter::ReferencerImporter(const KURL& url_) : XSLTImporter(url_) { - TQString xsltFile = locate("appdata", TQString::tqfromLatin1("referencer2tellico.xsl")); + TQString xsltFile = locate("appdata", TQString::fromLatin1("referencer2tellico.xsl")); if(!xsltFile.isEmpty()) { KURL u; u.setPath(xsltFile); @@ -41,17 +41,17 @@ Tellico::Data::CollPtr ReferencerImporter::collection() { return 0; } - Data::FieldPtr field = coll->fieldByName(TQString::tqfromLatin1("cover")); + Data::FieldPtr field = coll->fieldByName(TQString::fromLatin1("cover")); if(!field && !coll->imageFields().isEmpty()) { field = coll->imageFields().front(); } else if(!field) { - field = new Data::Field(TQString::tqfromLatin1("cover"), i18n("Front Cover"), Data::Field::Image); + field = new Data::Field(TQString::fromLatin1("cover"), i18n("Front Cover"), Data::Field::Image); coll->addField(field); } Data::EntryVec entries = coll->entries(); for(Data::EntryVecIt entry = entries.begin(); entry != entries.end(); ++entry) { - TQString url = entry->field(TQString::tqfromLatin1("url")); + TQString url = entry->field(TQString::fromLatin1("url")); if(url.isEmpty()) { continue; } @@ -59,7 +59,7 @@ Tellico::Data::CollPtr ReferencerImporter::collection() { if(pix.isNull()) { continue; } - TQString id = ImageFactory::addImage(pix, TQString::tqfromLatin1("PNG")); + TQString id = ImageFactory::addImage(pix, TQString::fromLatin1("PNG")); if(id.isEmpty()) { continue; } diff --git a/src/translators/risimporter.cpp b/src/translators/risimporter.cpp index bcf4db5..087397e 100644 --- a/src/translators/risimporter.cpp +++ b/src/translators/risimporter.cpp @@ -37,33 +37,33 @@ void RISImporter::initTagMap() { if(!s_tagMap) { s_tagMap = new TQMap<TQString, TQString>(); // BT is special and is handled separately - s_tagMap->insert(TQString::tqfromLatin1("TY"), TQString::tqfromLatin1("entry-type")); - s_tagMap->insert(TQString::tqfromLatin1("ID"), TQString::tqfromLatin1("bibtex-key")); - s_tagMap->insert(TQString::tqfromLatin1("T1"), TQString::tqfromLatin1("title")); - s_tagMap->insert(TQString::tqfromLatin1("TI"), TQString::tqfromLatin1("title")); - s_tagMap->insert(TQString::tqfromLatin1("T2"), TQString::tqfromLatin1("booktitle")); - s_tagMap->insert(TQString::tqfromLatin1("A1"), TQString::tqfromLatin1("author")); - s_tagMap->insert(TQString::tqfromLatin1("AU"), TQString::tqfromLatin1("author")); - s_tagMap->insert(TQString::tqfromLatin1("ED"), TQString::tqfromLatin1("editor")); - s_tagMap->insert(TQString::tqfromLatin1("YR"), TQString::tqfromLatin1("year")); - s_tagMap->insert(TQString::tqfromLatin1("PY"), TQString::tqfromLatin1("year")); - s_tagMap->insert(TQString::tqfromLatin1("N1"), TQString::tqfromLatin1("note")); - s_tagMap->insert(TQString::tqfromLatin1("AB"), TQString::tqfromLatin1("abstract")); // should be note? - s_tagMap->insert(TQString::tqfromLatin1("N2"), TQString::tqfromLatin1("abstract")); - s_tagMap->insert(TQString::tqfromLatin1("KW"), TQString::tqfromLatin1("keyword")); - s_tagMap->insert(TQString::tqfromLatin1("JF"), TQString::tqfromLatin1("journal")); - s_tagMap->insert(TQString::tqfromLatin1("JO"), TQString::tqfromLatin1("journal")); - s_tagMap->insert(TQString::tqfromLatin1("JA"), TQString::tqfromLatin1("journal")); - s_tagMap->insert(TQString::tqfromLatin1("VL"), TQString::tqfromLatin1("volume")); - s_tagMap->insert(TQString::tqfromLatin1("IS"), TQString::tqfromLatin1("number")); - s_tagMap->insert(TQString::tqfromLatin1("PB"), TQString::tqfromLatin1("publisher")); - s_tagMap->insert(TQString::tqfromLatin1("SN"), TQString::tqfromLatin1("isbn")); - s_tagMap->insert(TQString::tqfromLatin1("AD"), TQString::tqfromLatin1("address")); - s_tagMap->insert(TQString::tqfromLatin1("CY"), TQString::tqfromLatin1("address")); - s_tagMap->insert(TQString::tqfromLatin1("UR"), TQString::tqfromLatin1("url")); - s_tagMap->insert(TQString::tqfromLatin1("L1"), TQString::tqfromLatin1("pdf")); - s_tagMap->insert(TQString::tqfromLatin1("T3"), TQString::tqfromLatin1("series")); - s_tagMap->insert(TQString::tqfromLatin1("EP"), TQString::tqfromLatin1("pages")); + s_tagMap->insert(TQString::fromLatin1("TY"), TQString::fromLatin1("entry-type")); + s_tagMap->insert(TQString::fromLatin1("ID"), TQString::fromLatin1("bibtex-key")); + s_tagMap->insert(TQString::fromLatin1("T1"), TQString::fromLatin1("title")); + s_tagMap->insert(TQString::fromLatin1("TI"), TQString::fromLatin1("title")); + s_tagMap->insert(TQString::fromLatin1("T2"), TQString::fromLatin1("booktitle")); + s_tagMap->insert(TQString::fromLatin1("A1"), TQString::fromLatin1("author")); + s_tagMap->insert(TQString::fromLatin1("AU"), TQString::fromLatin1("author")); + s_tagMap->insert(TQString::fromLatin1("ED"), TQString::fromLatin1("editor")); + s_tagMap->insert(TQString::fromLatin1("YR"), TQString::fromLatin1("year")); + s_tagMap->insert(TQString::fromLatin1("PY"), TQString::fromLatin1("year")); + s_tagMap->insert(TQString::fromLatin1("N1"), TQString::fromLatin1("note")); + s_tagMap->insert(TQString::fromLatin1("AB"), TQString::fromLatin1("abstract")); // should be note? + s_tagMap->insert(TQString::fromLatin1("N2"), TQString::fromLatin1("abstract")); + s_tagMap->insert(TQString::fromLatin1("KW"), TQString::fromLatin1("keyword")); + s_tagMap->insert(TQString::fromLatin1("JF"), TQString::fromLatin1("journal")); + s_tagMap->insert(TQString::fromLatin1("JO"), TQString::fromLatin1("journal")); + s_tagMap->insert(TQString::fromLatin1("JA"), TQString::fromLatin1("journal")); + s_tagMap->insert(TQString::fromLatin1("VL"), TQString::fromLatin1("volume")); + s_tagMap->insert(TQString::fromLatin1("IS"), TQString::fromLatin1("number")); + s_tagMap->insert(TQString::fromLatin1("PB"), TQString::fromLatin1("publisher")); + s_tagMap->insert(TQString::fromLatin1("SN"), TQString::fromLatin1("isbn")); + s_tagMap->insert(TQString::fromLatin1("AD"), TQString::fromLatin1("address")); + s_tagMap->insert(TQString::fromLatin1("CY"), TQString::fromLatin1("address")); + s_tagMap->insert(TQString::fromLatin1("UR"), TQString::fromLatin1("url")); + s_tagMap->insert(TQString::fromLatin1("L1"), TQString::fromLatin1("pdf")); + s_tagMap->insert(TQString::fromLatin1("T3"), TQString::fromLatin1("series")); + s_tagMap->insert(TQString::fromLatin1("EP"), TQString::fromLatin1("pages")); } } @@ -72,41 +72,41 @@ void RISImporter::initTypeMap() { if(!s_typeMap) { s_typeMap = new TQMap<TQString, TQString>(); // leave capitalized, except for bibtex types - s_typeMap->insert(TQString::tqfromLatin1("ABST"), TQString::tqfromLatin1("Abstract")); - s_typeMap->insert(TQString::tqfromLatin1("ADVS"), TQString::tqfromLatin1("Audiovisual material")); - s_typeMap->insert(TQString::tqfromLatin1("ART"), TQString::tqfromLatin1("Art Work")); - s_typeMap->insert(TQString::tqfromLatin1("BILL"), TQString::tqfromLatin1("Bill/Resolution")); - s_typeMap->insert(TQString::tqfromLatin1("BOOK"), TQString::tqfromLatin1("book")); // bibtex - s_typeMap->insert(TQString::tqfromLatin1("CASE"), TQString::tqfromLatin1("Case")); - s_typeMap->insert(TQString::tqfromLatin1("CHAP"), TQString::tqfromLatin1("inbook")); // == "inbook" ? - s_typeMap->insert(TQString::tqfromLatin1("COMP"), TQString::tqfromLatin1("Computer program")); - s_typeMap->insert(TQString::tqfromLatin1("CONF"), TQString::tqfromLatin1("inproceedings")); // == "conference" ? - s_typeMap->insert(TQString::tqfromLatin1("CTLG"), TQString::tqfromLatin1("Catalog")); - s_typeMap->insert(TQString::tqfromLatin1("DATA"), TQString::tqfromLatin1("Data file")); - s_typeMap->insert(TQString::tqfromLatin1("ELEC"), TQString::tqfromLatin1("Electronic Citation")); - s_typeMap->insert(TQString::tqfromLatin1("GEN"), TQString::tqfromLatin1("Generic")); - s_typeMap->insert(TQString::tqfromLatin1("HEAR"), TQString::tqfromLatin1("Hearing")); - s_typeMap->insert(TQString::tqfromLatin1("ICOMM"), TQString::tqfromLatin1("Internet Communication")); - s_typeMap->insert(TQString::tqfromLatin1("INPR"), TQString::tqfromLatin1("In Press")); - s_typeMap->insert(TQString::tqfromLatin1("JFULL"), TQString::tqfromLatin1("Journal (full)")); // = "periodical" ? - s_typeMap->insert(TQString::tqfromLatin1("JOUR"), TQString::tqfromLatin1("article")); // "Journal" - s_typeMap->insert(TQString::tqfromLatin1("MAP"), TQString::tqfromLatin1("Map")); - s_typeMap->insert(TQString::tqfromLatin1("MGZN"), TQString::tqfromLatin1("article")); // bibtex - s_typeMap->insert(TQString::tqfromLatin1("MPCT"), TQString::tqfromLatin1("Motion picture")); - s_typeMap->insert(TQString::tqfromLatin1("MUSIC"), TQString::tqfromLatin1("Music score")); - s_typeMap->insert(TQString::tqfromLatin1("NEWS"), TQString::tqfromLatin1("Newspaper")); - s_typeMap->insert(TQString::tqfromLatin1("PAMP"), TQString::tqfromLatin1("Pamphlet")); // = "booklet" ? - s_typeMap->insert(TQString::tqfromLatin1("PAT"), TQString::tqfromLatin1("Patent")); - s_typeMap->insert(TQString::tqfromLatin1("PCOMM"), TQString::tqfromLatin1("Personal communication")); - s_typeMap->insert(TQString::tqfromLatin1("RPRT"), TQString::tqfromLatin1("Report")); // = "techreport" ? - s_typeMap->insert(TQString::tqfromLatin1("SER"), TQString::tqfromLatin1("Serial (BookMonograph)")); - s_typeMap->insert(TQString::tqfromLatin1("SLIDE"), TQString::tqfromLatin1("Slide")); - s_typeMap->insert(TQString::tqfromLatin1("SOUND"), TQString::tqfromLatin1("Sound recording")); - s_typeMap->insert(TQString::tqfromLatin1("STAT"), TQString::tqfromLatin1("Statute")); - s_typeMap->insert(TQString::tqfromLatin1("THES"), TQString::tqfromLatin1("phdthesis")); // "mastersthesis" ? - s_typeMap->insert(TQString::tqfromLatin1("UNBILL"), TQString::tqfromLatin1("Unenacted bill/resolution")); - s_typeMap->insert(TQString::tqfromLatin1("UNPB"), TQString::tqfromLatin1("unpublished")); // bibtex - s_typeMap->insert(TQString::tqfromLatin1("VIDEO"), TQString::tqfromLatin1("Video recording")); + s_typeMap->insert(TQString::fromLatin1("ABST"), TQString::fromLatin1("Abstract")); + s_typeMap->insert(TQString::fromLatin1("ADVS"), TQString::fromLatin1("Audiovisual material")); + s_typeMap->insert(TQString::fromLatin1("ART"), TQString::fromLatin1("Art Work")); + s_typeMap->insert(TQString::fromLatin1("BILL"), TQString::fromLatin1("Bill/Resolution")); + s_typeMap->insert(TQString::fromLatin1("BOOK"), TQString::fromLatin1("book")); // bibtex + s_typeMap->insert(TQString::fromLatin1("CASE"), TQString::fromLatin1("Case")); + s_typeMap->insert(TQString::fromLatin1("CHAP"), TQString::fromLatin1("inbook")); // == "inbook" ? + s_typeMap->insert(TQString::fromLatin1("COMP"), TQString::fromLatin1("Computer program")); + s_typeMap->insert(TQString::fromLatin1("CONF"), TQString::fromLatin1("inproceedings")); // == "conference" ? + s_typeMap->insert(TQString::fromLatin1("CTLG"), TQString::fromLatin1("Catalog")); + s_typeMap->insert(TQString::fromLatin1("DATA"), TQString::fromLatin1("Data file")); + s_typeMap->insert(TQString::fromLatin1("ELEC"), TQString::fromLatin1("Electronic Citation")); + s_typeMap->insert(TQString::fromLatin1("GEN"), TQString::fromLatin1("Generic")); + s_typeMap->insert(TQString::fromLatin1("HEAR"), TQString::fromLatin1("Hearing")); + s_typeMap->insert(TQString::fromLatin1("ICOMM"), TQString::fromLatin1("Internet Communication")); + s_typeMap->insert(TQString::fromLatin1("INPR"), TQString::fromLatin1("In Press")); + s_typeMap->insert(TQString::fromLatin1("JFULL"), TQString::fromLatin1("Journal (full)")); // = "periodical" ? + s_typeMap->insert(TQString::fromLatin1("JOUR"), TQString::fromLatin1("article")); // "Journal" + s_typeMap->insert(TQString::fromLatin1("MAP"), TQString::fromLatin1("Map")); + s_typeMap->insert(TQString::fromLatin1("MGZN"), TQString::fromLatin1("article")); // bibtex + s_typeMap->insert(TQString::fromLatin1("MPCT"), TQString::fromLatin1("Motion picture")); + s_typeMap->insert(TQString::fromLatin1("MUSIC"), TQString::fromLatin1("Music score")); + s_typeMap->insert(TQString::fromLatin1("NEWS"), TQString::fromLatin1("Newspaper")); + s_typeMap->insert(TQString::fromLatin1("PAMP"), TQString::fromLatin1("Pamphlet")); // = "booklet" ? + s_typeMap->insert(TQString::fromLatin1("PAT"), TQString::fromLatin1("Patent")); + s_typeMap->insert(TQString::fromLatin1("PCOMM"), TQString::fromLatin1("Personal communication")); + s_typeMap->insert(TQString::fromLatin1("RPRT"), TQString::fromLatin1("Report")); // = "techreport" ? + s_typeMap->insert(TQString::fromLatin1("SER"), TQString::fromLatin1("Serial (BookMonograph)")); + s_typeMap->insert(TQString::fromLatin1("SLIDE"), TQString::fromLatin1("Slide")); + s_typeMap->insert(TQString::fromLatin1("SOUND"), TQString::fromLatin1("Sound recording")); + s_typeMap->insert(TQString::fromLatin1("STAT"), TQString::fromLatin1("Statute")); + s_typeMap->insert(TQString::fromLatin1("THES"), TQString::fromLatin1("phdthesis")); // "mastersthesis" ? + s_typeMap->insert(TQString::fromLatin1("UNBILL"), TQString::fromLatin1("Unenacted bill/resolution")); + s_typeMap->insert(TQString::fromLatin1("UNPB"), TQString::fromLatin1("unpublished")); // bibtex + s_typeMap->insert(TQString::fromLatin1("VIDEO"), TQString::fromLatin1("Video recording")); } } @@ -134,7 +134,7 @@ Tellico::Data::CollPtr RISImporter::collection() { Data::FieldVec vec = currColl->fields(); for(Data::FieldVec::Iterator it = vec.begin(); it != vec.end(); ++it) { // continue if property is empty - TQString ris = it->property(TQString::tqfromLatin1("ris")); + TQString ris = it->property(TQString::fromLatin1("ris")); if(ris.isEmpty()) { continue; } @@ -144,7 +144,7 @@ Tellico::Data::CollPtr RISImporter::collection() { f = new Data::Field(*it); m_coll->addField(f); } - f->setProperty(TQString::tqfromLatin1("ris"), ris); + f->setProperty(TQString::fromLatin1("ris"), ris); risFields.insert(ris, f); } @@ -189,7 +189,7 @@ void RISImporter::readURL(const KURL& url_, int n, const TQDict<Data::Field>& ri // however, at least one website (Springer) outputs RIS with no space after the final "ER -" // so just strip the white space later // also be gracious and allow only any amount of space before hyphen - TQRegExp rx(TQString::tqfromLatin1("^(\\w\\w)\\s+-(.*)$")); + TQRegExp rx(TQString::fromLatin1("^(\\w\\w)\\s+-(.*)$")); TQString currLine, nextLine; for(currLine = t.readLine(); !m_cancelled && !currLine.isNull(); currLine = nextLine, j += currLine.length()) { nextLine = t.readLine(); @@ -225,7 +225,7 @@ void RISImporter::readURL(const KURL& url_, int n, const TQDict<Data::Field>& ri sp = value; if(!ep.isEmpty()) { value = sp + '-' + ep; - tag = TQString::tqfromLatin1("EP"); + tag = TQString::fromLatin1("EP"); sp = TQString(); ep = TQString(); } else { @@ -253,10 +253,10 @@ void RISImporter::readURL(const KURL& url_, int n, const TQDict<Data::Field>& ri // special case for BT // primary title for books, secondary for everything else if(tag == Latin1Literal("BT")) { - if(entry->field(TQString::tqfromLatin1("entry-type")) == Latin1Literal("book")) { - f = m_coll->fieldByName(TQString::tqfromLatin1("title")); + if(entry->field(TQString::fromLatin1("entry-type")) == Latin1Literal("book")) { + f = m_coll->fieldByName(TQString::fromLatin1("title")); } else { - f = m_coll->fieldByName(TQString::tqfromLatin1("booktitle")); + f = m_coll->fieldByName(TQString::fromLatin1("booktitle")); } } else { f = fieldByTag(tag); @@ -272,7 +272,7 @@ void RISImporter::readURL(const KURL& url_, int n, const TQDict<Data::Field>& ri f->addAllowed(value); // if the field can have multiple values, append current values to new value if((f->flags() & Data::Field::AllowMultiple) && !entry->field(f->name()).isEmpty()) { - value.prepend(entry->field(f->name()) + TQString::tqfromLatin1("; ")); + value.prepend(entry->field(f->name()) + TQString::fromLatin1("; ")); } entry->setField(f, value); @@ -293,15 +293,15 @@ Tellico::Data::FieldPtr RISImporter::fieldByTag(const TQString& tag_) { if(!fieldTag.isEmpty()) { f = m_coll->fieldByName(fieldTag); if(f) { - f->setProperty(TQString::tqfromLatin1("ris"), tag_); + f->setProperty(TQString::fromLatin1("ris"), tag_); return f; } } // add non-default fields if not already there if(tag_== Latin1Literal("L1")) { - f = new Data::Field(TQString::tqfromLatin1("pdf"), i18n("PDF"), Data::Field::URL); - f->setProperty(TQString::tqfromLatin1("ris"), TQString::tqfromLatin1("L1")); + f = new Data::Field(TQString::fromLatin1("pdf"), i18n("PDF"), Data::Field::URL); + f->setProperty(TQString::fromLatin1("ris"), TQString::fromLatin1("L1")); f->setCategory(i18n("Miscellaneous")); } m_coll->addField(f); diff --git a/src/translators/tellico_xml.cpp b/src/translators/tellico_xml.cpp index d1ad3c1..bcfb412 100644 --- a/src/translators/tellico_xml.cpp +++ b/src/translators/tellico_xml.cpp @@ -19,9 +19,9 @@ #include <tqregexp.h> -const TQString Tellico::XML::nsXSL = TQString::tqfromLatin1("http://www.w3.org/1999/XSL/Transform"); -const TQString Tellico::XML::nsBibtexml = TQString::tqfromLatin1("http://bibtexml.sf.net/"); -const TQString Tellico::XML::dtdBibtexml = TQString::tqfromLatin1("bibtexml.dtd"); +const TQString Tellico::XML::nsXSL = TQString::fromLatin1("http://www.w3.org/1999/XSL/Transform"); +const TQString Tellico::XML::nsBibtexml = TQString::fromLatin1("http://bibtexml.sf.net/"); +const TQString Tellico::XML::dtdBibtexml = TQString::fromLatin1("bibtexml.dtd"); /* * VERSION 2 added namespaces, changed to multiple elements, @@ -48,19 +48,19 @@ const TQString Tellico::XML::dtdBibtexml = TQString::tqfromLatin1("bibtexml.dtd" * VERSION 10 added the game board collection. */ const uint Tellico::XML::syntaxVersion = 10; -const TQString Tellico::XML::nsTellico = TQString::tqfromLatin1("http://periapsis.org/tellico/"); +const TQString Tellico::XML::nsTellico = TQString::fromLatin1("http://periapsis.org/tellico/"); -const TQString Tellico::XML::nsBookcase = TQString::tqfromLatin1("http://periapsis.org/bookcase/"); -const TQString Tellico::XML::nsDublinCore = TQString::tqfromLatin1("http://purl.org/dc/elements/1.1/"); -const TQString Tellico::XML::nsZing = TQString::tqfromLatin1("http://www.loc.gov/zing/srw/"); -const TQString Tellico::XML::nsZingDiag = TQString::tqfromLatin1("http://www.loc.gov/zing/srw/diagnostic/"); +const TQString Tellico::XML::nsBookcase = TQString::fromLatin1("http://periapsis.org/bookcase/"); +const TQString Tellico::XML::nsDublinCore = TQString::fromLatin1("http://purl.org/dc/elements/1.1/"); +const TQString Tellico::XML::nsZing = TQString::fromLatin1("http://www.loc.gov/zing/srw/"); +const TQString Tellico::XML::nsZingDiag = TQString::fromLatin1("http://www.loc.gov/zing/srw/diagnostic/"); TQString Tellico::XML::pubTellico(int version) { - return TQString::tqfromLatin1("-//Robby Stephenson/DTD Tellico V%1.0//EN").tqarg(version); + return TQString::fromLatin1("-//Robby Stephenson/DTD Tellico V%1.0//EN").arg(version); } TQString Tellico::XML::dtdTellico(int version) { - return TQString::tqfromLatin1("http://periapsis.org/tellico/dtd/v%1/tellico.dtd").tqarg(version); + return TQString::fromLatin1("http://periapsis.org/tellico/dtd/v%1/tellico.dtd").arg(version); } bool Tellico::XML::validXMLElementName(const TQString& name_) { @@ -70,14 +70,14 @@ bool Tellico::XML::validXMLElementName(const TQString& name_) { TQString Tellico::XML::elementName(const TQString& name_) { TQString name = name_; // change white space to dashes - name.replace(TQRegExp(TQString::tqfromLatin1("\\s+")), TQString::tqfromLatin1("-")); + name.replace(TQRegExp(TQString::fromLatin1("\\s+")), TQString::fromLatin1("-")); // first cut, if it passes, we're done if(XML::validXMLElementName(name)) { return name; } // next check first characters IS_DIGIT is defined in libxml/vali.d - for(uint i = 0; i < name.length() && (!IS_LETTER(name[i].tqunicode()) || name[i] == '_'); ++i) { + for(uint i = 0; i < name.length() && (!IS_LETTER(name[i].unicode()) || name[i] == '_'); ++i) { name = name.mid(1); } if(name.isEmpty() || XML::validXMLElementName(name)) { diff --git a/src/translators/tellicoimporter.cpp b/src/translators/tellicoimporter.cpp index c7ac869..5dfc933 100644 --- a/src/translators/tellicoimporter.cpp +++ b/src/translators/tellicoimporter.cpp @@ -109,11 +109,11 @@ void TellicoImporter::loadXMLData(const TQByteArray& data_, bool loadImages_) { TQString errorMsg; int errorLine, errorColumn; if(!dom.setContent(data_, true, &errorMsg, &errorLine, &errorColumn)) { - TQString str = i18n(errorLoad).tqarg(url().fileName()) + TQChar('\n'); - str += i18n("There is an XML parsing error in line %1, column %2.").tqarg(errorLine).tqarg(errorColumn); - str += TQString::tqfromLatin1("\n"); + TQString str = i18n(errorLoad).arg(url().fileName()) + TQChar('\n'); + str += i18n("There is an XML parsing error in line %1, column %2.").arg(errorLine).arg(errorColumn); + str += TQString::fromLatin1("\n"); str += i18n("The error message from TQt is:"); - str += TQString::tqfromLatin1("\n\t") + errorMsg; + str += TQString::fromLatin1("\n\t") + errorMsg; myDebug() << str << endl; setStatusMessage(str); m_format = Error; @@ -124,13 +124,13 @@ void TellicoImporter::loadXMLData(const TQByteArray& data_, bool loadImages_) { // the syntax version field name changed from "version" to "syntaxVersion" in version 3 uint syntaxVersion; - if(root.hasAttribute(TQString::tqfromLatin1("syntaxVersion"))) { - syntaxVersion = root.attribute(TQString::tqfromLatin1("syntaxVersion")).toInt(); - } else if (root.hasAttribute(TQString::tqfromLatin1("version"))) { - syntaxVersion = root.attribute(TQString::tqfromLatin1("version")).toInt(); + if(root.hasAttribute(TQString::fromLatin1("syntaxVersion"))) { + syntaxVersion = root.attribute(TQString::fromLatin1("syntaxVersion")).toInt(); + } else if (root.hasAttribute(TQString::fromLatin1("version"))) { + syntaxVersion = root.attribute(TQString::fromLatin1("version")).toInt(); } else { if(!url().isEmpty()) { - setStatusMessage(i18n(errorLoad).tqarg(url().fileName())); + setStatusMessage(i18n(errorLoad).arg(url().fileName())); } m_format = Error; return; @@ -140,7 +140,7 @@ void TellicoImporter::loadXMLData(const TQByteArray& data_, bool loadImages_) { if((syntaxVersion > 6 && root.tagName() != Latin1Literal("tellico")) || (syntaxVersion < 7 && root.tagName() != Latin1Literal("bookcase"))) { if(!url().isEmpty()) { - setStatusMessage(i18n(errorLoad).tqarg(url().fileName())); + setStatusMessage(i18n(errorLoad).arg(url().fileName())); } m_format = Error; return; @@ -148,7 +148,7 @@ void TellicoImporter::loadXMLData(const TQByteArray& data_, bool loadImages_) { if(syntaxVersion > XML::syntaxVersion) { if(!url().isEmpty()) { - TQString str = i18n(errorLoad).tqarg(url().fileName()) + TQChar('\n'); + TQString str = i18n(errorLoad).arg(url().fileName()) + TQChar('\n'); str += i18n("It is from a future version of Tellico."); myDebug() << str << endl; setStatusMessage(str); @@ -185,7 +185,7 @@ void TellicoImporter::loadXMLData(const TQByteArray& data_, bool loadImages_) { return; } - TQString title = collelem.attribute(TQString::tqfromLatin1("title")); + TQString title = collelem.attribute(TQString::fromLatin1("title")); // be careful not to have element name collision // for fields, each true field element is a child of a fields element @@ -198,8 +198,8 @@ void TellicoImporter::loadXMLData(const TQByteArray& data_, bool loadImages_) { if((syntaxVersion > 3 && n.localName() == Latin1Literal("fields")) || (syntaxVersion < 4 && n.localName() == Latin1Literal("attributes"))) { TQDomElement e = n.toElement(); - fieldelems = e.elementsByTagNameNS(m_namespace, (syntaxVersion > 3) ? TQString::tqfromLatin1("field") - : TQString::tqfromLatin1("attribute")); + fieldelems = e.elementsByTagNameNS(m_namespace, (syntaxVersion > 3) ? TQString::fromLatin1("field") + : TQString::fromLatin1("attribute")); break; } } @@ -209,9 +209,9 @@ void TellicoImporter::loadXMLData(const TQByteArray& data_, bool loadImages_) { // if there are no attributes or if the first one has the special name of _default bool addFields = (fieldelems.count() == 0); if(!addFields) { - TQString name = fieldelems.item(0).toElement().attribute(TQString::tqfromLatin1("name")); + TQString name = fieldelems.item(0).toElement().attribute(TQString::fromLatin1("name")); addFields = (name == Latin1Literal("_default")); - // removeChild only works for immediate tqchildren + // removeChild only works for immediate children // remove _default field if(addFields) { fieldelems.item(0).parentNode().removeChild(fieldelems.item(0)); @@ -223,12 +223,12 @@ void TellicoImporter::loadXMLData(const TQByteArray& data_, bool loadImages_) { // on the entryName of the collection. A type field was added to the collection element // to specify what type of collection it is. if(syntaxVersion > 3) { - entryName = TQString::tqfromLatin1("entry"); - TQString typeStr = collelem.attribute(TQString::tqfromLatin1("type")); + entryName = TQString::fromLatin1("entry"); + TQString typeStr = collelem.attribute(TQString::fromLatin1("type")); Data::Collection::Type type = static_cast<Data::Collection::Type>(typeStr.toInt()); m_coll = CollectionFactory::collection(type, addFields); } else { - entryName = collelem.attribute(TQString::tqfromLatin1("unit")); + entryName = collelem.attribute(TQString::fromLatin1("unit")); m_coll = CollectionFactory::collection(entryName, addFields); } @@ -248,14 +248,14 @@ void TellicoImporter::loadXMLData(const TQByteArray& data_, bool loadImages_) { continue; } if(n.localName() == Latin1Literal("macros")) { - macroelems = n.toElement().elementsByTagNameNS(m_namespace, TQString::tqfromLatin1("macro")); + macroelems = n.toElement().elementsByTagNameNS(m_namespace, TQString::fromLatin1("macro")); break; } } // myDebug() << "TellicoImporter::loadXMLData() - found " << macroelems.count() << " macros" << endl; for(uint j = 0; c && j < macroelems.count(); ++j) { TQDomElement elem = macroelems.item(j).toElement(); - c->addMacro(elem.attribute(TQString::tqfromLatin1("name")), elem.text()); + c->addMacro(elem.attribute(TQString::fromLatin1("name")), elem.text()); } for(TQDomNode n = collelem.firstChild(); !n.isNull(); n = n.nextSibling()) { @@ -276,7 +276,7 @@ void TellicoImporter::loadXMLData(const TQByteArray& data_, bool loadImages_) { // as a special case, for old book collections with a bibtex-id field, convert to Bibtex if(syntaxVersion < 4 && m_coll->type() == Data::Collection::Book - && m_coll->hasField(TQString::tqfromLatin1("bibtex-id"))) { + && m_coll->hasField(TQString::fromLatin1("bibtex-id"))) { m_coll = Data::BibtexCollection::convertBookCollection(m_coll); } @@ -295,7 +295,7 @@ void TellicoImporter::loadXMLData(const TQByteArray& data_, bool loadImages_) { continue; } if(n.localName() == Latin1Literal("images")) { - imgelems = n.toElement().elementsByTagNameNS(m_namespace, TQString::tqfromLatin1("image")); + imgelems = n.toElement().elementsByTagNameNS(m_namespace, TQString::fromLatin1("image")); break; } } @@ -337,12 +337,12 @@ void TellicoImporter::loadXMLData(const TQByteArray& data_, bool loadImages_) { continue; } if(n.localName() == Latin1Literal("borrowers")) { - TQDomNodeList borrowerElems = n.toElement().elementsByTagNameNS(m_namespace, TQString::tqfromLatin1("borrower")); + TQDomNodeList borrowerElems = n.toElement().elementsByTagNameNS(m_namespace, TQString::fromLatin1("borrower")); for(uint j = 0; j < borrowerElems.count(); ++j) { readBorrower(borrowerElems.item(j).toElement()); } } else if(n.localName() == Latin1Literal("filters")) { - TQDomNodeList filterElems = n.toElement().elementsByTagNameNS(m_namespace, TQString::tqfromLatin1("filter")); + TQDomNodeList filterElems = n.toElement().elementsByTagNameNS(m_namespace, TQString::fromLatin1("filter")); for(uint j = 0; j < filterElems.count(); ++j) { readFilter(filterElems.item(j).toElement()); } @@ -361,21 +361,21 @@ void TellicoImporter::loadXMLData(const TQByteArray& data_, bool loadImages_) { void TellicoImporter::readField(uint syntaxVersion_, const TQDomElement& elem_) { // special case: if the i18n attribute equals true, then translate the title, description, and category - bool isI18n = elem_.attribute(TQString::tqfromLatin1("i18n")) == Latin1Literal("true"); + bool isI18n = elem_.attribute(TQString::fromLatin1("i18n")) == Latin1Literal("true"); - TQString name = elem_.attribute(TQString::tqfromLatin1("name"), TQString::tqfromLatin1("unknown")); - TQString title = elem_.attribute(TQString::tqfromLatin1("title"), i18n("Unknown")); + TQString name = elem_.attribute(TQString::fromLatin1("name"), TQString::fromLatin1("unknown")); + TQString title = elem_.attribute(TQString::fromLatin1("title"), i18n("Unknown")); if(isI18n) { title = i18n(title.utf8()); } - TQString typeStr = elem_.attribute(TQString::tqfromLatin1("type"), TQString::number(Data::Field::Line)); + TQString typeStr = elem_.attribute(TQString::fromLatin1("type"), TQString::number(Data::Field::Line)); Data::Field::Type type = static_cast<Data::Field::Type>(typeStr.toInt()); Data::FieldPtr field; if(type == Data::Field::Choice) { - TQStringList allowed = TQStringList::split(TQString::tqfromLatin1(";"), - elem_.attribute(TQString::tqfromLatin1("allowed"))); + TQStringList allowed = TQStringList::split(TQString::fromLatin1(";"), + elem_.attribute(TQString::fromLatin1("allowed"))); if(isI18n) { for(TQStringList::Iterator it = allowed.begin(); it != allowed.end(); ++it) { (*it) = i18n((*it).utf8()); @@ -386,9 +386,9 @@ void TellicoImporter::readField(uint syntaxVersion_, const TQDomElement& elem_) field = new Data::Field(name, title, type); } - if(elem_.hasAttribute(TQString::tqfromLatin1("category"))) { + if(elem_.hasAttribute(TQString::fromLatin1("category"))) { // at one point, the categories had keyboard accels - TQString cat = elem_.attribute(TQString::tqfromLatin1("category")); + TQString cat = elem_.attribute(TQString::fromLatin1("category")); if(syntaxVersion_ < 9 && cat.find('&') > -1) { cat.remove('&'); } @@ -398,8 +398,8 @@ void TellicoImporter::readField(uint syntaxVersion_, const TQDomElement& elem_) field->setCategory(cat); } - if(elem_.hasAttribute(TQString::tqfromLatin1("flags"))) { - int flags = elem_.attribute(TQString::tqfromLatin1("flags")).toInt(); + if(elem_.hasAttribute(TQString::fromLatin1("flags"))) { + int flags = elem_.attribute(TQString::fromLatin1("flags")).toInt(); // I also changed the enum values for syntax 3, but the only custom field // would have been bibtex-id if(syntaxVersion_ < 3 && field->name() == Latin1Literal("bibtex-id")) { @@ -414,12 +414,12 @@ void TellicoImporter::readField(uint syntaxVersion_, const TQDomElement& elem_) field->setFlags(flags); } - TQString formatStr = elem_.attribute(TQString::tqfromLatin1("format"), TQString::number(Data::Field::FormatNone)); + TQString formatStr = elem_.attribute(TQString::fromLatin1("format"), TQString::number(Data::Field::FormatNone)); Data::Field::FormatFlag format = static_cast<Data::Field::FormatFlag>(formatStr.toInt()); field->setFormatFlag(format); - if(elem_.hasAttribute(TQString::tqfromLatin1("description"))) { - TQString desc = elem_.attribute(TQString::tqfromLatin1("description")); + if(elem_.hasAttribute(TQString::fromLatin1("description"))) { + TQString desc = elem_.attribute(TQString::fromLatin1("description")); if(isI18n) { desc = i18n(desc.utf8()); } @@ -427,42 +427,42 @@ void TellicoImporter::readField(uint syntaxVersion_, const TQDomElement& elem_) } if(syntaxVersion_ >= 5) { - TQDomNodeList props = elem_.elementsByTagNameNS(m_namespace, TQString::tqfromLatin1("prop")); + TQDomNodeList props = elem_.elementsByTagNameNS(m_namespace, TQString::fromLatin1("prop")); for(uint i = 0; i < props.count(); ++i) { TQDomElement e = props.item(i).toElement(); - field->setProperty(e.attribute(TQString::tqfromLatin1("name")), e.text()); + field->setProperty(e.attribute(TQString::fromLatin1("name")), e.text()); } // all track fields in music collections prior to version 9 get converted to three columns if(syntaxVersion_ < 9) { if(m_coll->type() == Data::Collection::Album && field->name() == Latin1Literal("track")) { - field->setProperty(TQString::tqfromLatin1("columns"), TQChar('3')); - field->setProperty(TQString::tqfromLatin1("column1"), i18n("Title")); - field->setProperty(TQString::tqfromLatin1("column2"), i18n("Artist")); - field->setProperty(TQString::tqfromLatin1("column3"), i18n("Length")); + field->setProperty(TQString::fromLatin1("columns"), TQChar('3')); + field->setProperty(TQString::fromLatin1("column1"), i18n("Title")); + field->setProperty(TQString::fromLatin1("column2"), i18n("Artist")); + field->setProperty(TQString::fromLatin1("column3"), i18n("Length")); } else if(m_coll->type() == Data::Collection::Video && field->name() == Latin1Literal("cast")) { - field->setProperty(TQString::tqfromLatin1("column1"), i18n("Actor/Actress")); - field->setProperty(TQString::tqfromLatin1("column2"), i18n("Role")); + field->setProperty(TQString::fromLatin1("column1"), i18n("Actor/Actress")); + field->setProperty(TQString::fromLatin1("column2"), i18n("Role")); } } - } else if(elem_.hasAttribute(TQString::tqfromLatin1("bibtex-field"))) { - field->setProperty(TQString::tqfromLatin1("bibtex"), elem_.attribute(TQString::tqfromLatin1("bibtex-field"))); + } else if(elem_.hasAttribute(TQString::fromLatin1("bibtex-field"))) { + field->setProperty(TQString::fromLatin1("bibtex"), elem_.attribute(TQString::fromLatin1("bibtex-field"))); } // Table2 is deprecated if(field->type() == Data::Field::Table2) { field->setType(Data::Field::Table); - field->setProperty(TQString::tqfromLatin1("columns"), TQChar('2')); + field->setProperty(TQString::fromLatin1("columns"), TQChar('2')); } // for syntax 8, rating fields got their own type if(syntaxVersion_ < 8) { Data::Field::convertOldRating(field); // does all its own checking } m_coll->addField(field); -// myDebug() << TQString(" Added field: %1, %2").tqarg(field->name()).tqarg(field->title()) << endl; +// myDebug() << TQString(" Added field: %1, %2").arg(field->name()).arg(field->title()) << endl; } void TellicoImporter::readEntry(uint syntaxVersion_, const TQDomElement& entryElem_) { - const int id = entryElem_.attribute(TQString::tqfromLatin1("id")).toInt(); + const int id = entryElem_.attribute(TQString::fromLatin1("id")).toInt(); Data::EntryPtr entry; if(id > 0) { entry = new Data::Entry(m_coll, id); @@ -472,20 +472,20 @@ void TellicoImporter::readEntry(uint syntaxVersion_, const TQDomElement& entryEl bool oldMusic = (syntaxVersion_ < 9 && m_coll->type() == Data::Collection::Album); - // iterate over all field value tqchildren + // iterate over all field value children for(TQDomNode node = entryElem_.firstChild(); !node.isNull(); node = node.nextSibling()) { TQDomElement elem = node.toElement(); if(elem.isNull()) { continue; } - bool isI18n = elem.attribute(TQString::tqfromLatin1("i18n")) == Latin1Literal("true"); + bool isI18n = elem.attribute(TQString::fromLatin1("i18n")) == Latin1Literal("true"); // Entry::setField checks to see if an field of 'name' is allowed // in version 3 and prior, checkbox attributes had no text(), set it to "true" now if(syntaxVersion_ < 4 && elem.text().isEmpty()) { // "true" means checked - entry->setField(elem.localName(), TQString::tqfromLatin1("true")); + entry->setField(elem.localName(), TQString::fromLatin1("true")); continue; } @@ -493,7 +493,7 @@ void TellicoImporter::readEntry(uint syntaxVersion_, const TQDomElement& entryEl Data::FieldPtr f = m_coll->fieldByName(name); // if the first child of the node is a text node, just set the attribute text - // otherwise, recurse over the node's tqchildren + // otherwise, recurse over the node's children // this is the case for <authors><author>..</author></authors> // but if there's nothing but white space, then it's a BaseNode for some reason // if(node.firstChild().nodeType() == TQDomNode::TextNode) { @@ -507,17 +507,17 @@ void TellicoImporter::readEntry(uint syntaxVersion_, const TQDomElement& entryEl if(f->type() == Data::Field::Date) { if(elem.hasChildNodes()) { TQString value; - TQDomNode yNode = elem.elementsByTagNameNS(m_namespace, TQString::tqfromLatin1("year")).item(0); + TQDomNode yNode = elem.elementsByTagNameNS(m_namespace, TQString::fromLatin1("year")).item(0); if(!yNode.isNull()) { value += yNode.toElement().text(); } value += '-'; - TQDomNode mNode = elem.elementsByTagNameNS(m_namespace, TQString::tqfromLatin1("month")).item(0); + TQDomNode mNode = elem.elementsByTagNameNS(m_namespace, TQString::fromLatin1("month")).item(0); if(!mNode.isNull()) { value += mNode.toElement().text(); } value += '-'; - TQDomNode dNode = elem.elementsByTagNameNS(m_namespace, TQString::tqfromLatin1("day")).item(0); + TQDomNode dNode = elem.elementsByTagNameNS(m_namespace, TQString::fromLatin1("day")).item(0); if(!dNode.isNull()) { value += dNode.toElement().text(); } @@ -571,7 +571,7 @@ void TellicoImporter::readEntry(uint syntaxVersion_, const TQDomElement& entryEl } } else if(syntaxVersion_ < 2 && name == Latin1Literal("keywords")) { // in version 2, "keywords" changed to "keyword" - name = TQString::tqfromLatin1("keyword"); + name = TQString::fromLatin1("keyword"); } // special case: if the i18n attribute equals true, then translate the title, description, and category if(isI18n) { @@ -580,13 +580,13 @@ void TellicoImporter::readEntry(uint syntaxVersion_, const TQDomElement& entryEl // special case for isbn fields, go ahead and validate if(name == Latin1Literal("isbn")) { const ISBNValidator val(0); - if(elem.attribute(TQString::tqfromLatin1("validate")) != Latin1Literal("no")) { + if(elem.attribute(TQString::fromLatin1("validate")) != Latin1Literal("no")) { val.fixup(value); } } entry->setField(name, value); } - } else { // if no field by the tag name, then it has tqchildren, iterate through them + } else { // if no field by the tag name, then it has children, iterate through them // the field name has the final 's', so remove it name.truncate(name.length() - 1); f = m_coll->fieldByName(name); @@ -603,24 +603,24 @@ void TellicoImporter::readEntry(uint syntaxVersion_, const TQDomElement& entryEl for(TQDomNode childNode = node.firstChild(); !childNode.isNull(); childNode = childNode.nextSibling()) { TQString value; // don't worry about i18n here, Tables are never translated - TQDomNodeList cols = childNode.toElement().elementsByTagNameNS(m_namespace, TQString::tqfromLatin1("column")); + TQDomNodeList cols = childNode.toElement().elementsByTagNameNS(m_namespace, TQString::fromLatin1("column")); if(cols.count() > 0) { for(uint i = 0; i < cols.count(); ++i) { // special case for old tracks if(oldTracks && i == 1) { // if the second column holds the track length, bump it to next column - TQRegExp rx(TQString::tqfromLatin1("\\d+:\\d\\d")); + TQRegExp rx(TQString::fromLatin1("\\d+:\\d\\d")); if(rx.exactMatch(cols.item(i).toElement().text())) { - value += entry->field(TQString::tqfromLatin1("artist")); - value += TQString::tqfromLatin1("::"); + value += entry->field(TQString::fromLatin1("artist")); + value += TQString::fromLatin1("::"); } } value += cols.item(i).toElement().text().stripWhiteSpace(); if(i < cols.count()-1) { - value += TQString::tqfromLatin1("::"); + value += TQString::fromLatin1("::"); } else if(oldTracks && cols.count() == 1) { - value += TQString::tqfromLatin1("::"); - value += entry->field(TQString::tqfromLatin1("artist")); + value += TQString::fromLatin1("::"); + value += entry->field(TQString::fromLatin1("artist")); } } values += value; @@ -634,15 +634,15 @@ void TellicoImporter::readEntry(uint syntaxVersion_, const TQDomElement& entryEl value += s; } if(oldTracks) { - value += TQString::tqfromLatin1("::"); - value += entry->field(TQString::tqfromLatin1("artist")); + value += TQString::fromLatin1("::"); + value += entry->field(TQString::fromLatin1("artist")); } if(values.findIndex(value) == -1) { values += value; } } } - entry->setField(name, values.join(TQString::tqfromLatin1("; "))); + entry->setField(name, values.join(TQString::fromLatin1("; "))); } } // end field value loop @@ -650,10 +650,10 @@ void TellicoImporter::readEntry(uint syntaxVersion_, const TQDomElement& entryEl } void TellicoImporter::readImage(const TQDomElement& elem_, bool loadImage_) { - TQString format = elem_.attribute(TQString::tqfromLatin1("format")); - const bool link = elem_.attribute(TQString::tqfromLatin1("link")) == Latin1Literal("true"); - TQString id = shareString(link ? elem_.attribute(TQString::tqfromLatin1("id")) - : Data::Image::idClean(elem_.attribute(TQString::tqfromLatin1("id")))); + TQString format = elem_.attribute(TQString::fromLatin1("format")); + const bool link = elem_.attribute(TQString::fromLatin1("link")) == Latin1Literal("true"); + TQString id = shareString(link ? elem_.attribute(TQString::fromLatin1("id")) + : Data::Image::idClean(elem_.attribute(TQString::fromLatin1("id")))); bool readInfo = true; if(loadImage_) { @@ -670,8 +670,8 @@ void TellicoImporter::readImage(const TQDomElement& elem_, bool loadImage_) { } if(readInfo) { // a width or height of 0 is ok here - int width = elem_.attribute(TQString::tqfromLatin1("width")).toInt(); - int height = elem_.attribute(TQString::tqfromLatin1("height")).toInt(); + int width = elem_.attribute(TQString::fromLatin1("width")).toInt(); + int height = elem_.attribute(TQString::fromLatin1("height")).toInt(); Data::ImageInfo info(id, format.latin1(), width, height, link); ImageFactory::cacheImageInfo(info); } @@ -679,29 +679,29 @@ void TellicoImporter::readImage(const TQDomElement& elem_, bool loadImage_) { void TellicoImporter::readFilter(const TQDomElement& elem_) { FilterPtr f = new Filter(Filter::MatchAny); - f->setName(elem_.attribute(TQString::tqfromLatin1("name"))); + f->setName(elem_.attribute(TQString::fromLatin1("name"))); - TQString match = elem_.attribute(TQString::tqfromLatin1("match")); + TQString match = elem_.attribute(TQString::fromLatin1("match")); if(match == Latin1Literal("all")) { f->setMatch(Filter::MatchAll); } - TQDomNodeList rules = elem_.elementsByTagNameNS(m_namespace, TQString::tqfromLatin1("rule")); + TQDomNodeList rules = elem_.elementsByTagNameNS(m_namespace, TQString::fromLatin1("rule")); for(uint i = 0; i < rules.count(); ++i) { TQDomElement e = rules.item(i).toElement(); if(e.isNull()) { continue; } - TQString field = e.attribute(TQString::tqfromLatin1("field")); + TQString field = e.attribute(TQString::fromLatin1("field")); // empty field means match any of them - TQString pattern = e.attribute(TQString::tqfromLatin1("pattern")); + TQString pattern = e.attribute(TQString::fromLatin1("pattern")); // empty pattern is bad if(pattern.isEmpty()) { kdWarning() << "TellicoImporter::readFilter() - empty rule!" << endl; continue; } - TQString function = e.attribute(TQString::tqfromLatin1("function")).lower(); + TQString function = e.attribute(TQString::fromLatin1("function")).lower(); FilterRule::Function func; if(function == Latin1Literal("contains")) { func = FilterRule::FuncContains; @@ -728,36 +728,36 @@ void TellicoImporter::readFilter(const TQDomElement& elem_) { } void TellicoImporter::readBorrower(const TQDomElement& elem_) { - TQString name = elem_.attribute(TQString::tqfromLatin1("name")); - TQString uid = elem_.attribute(TQString::tqfromLatin1("uid")); + TQString name = elem_.attribute(TQString::fromLatin1("name")); + TQString uid = elem_.attribute(TQString::fromLatin1("uid")); Data::BorrowerPtr b = new Data::Borrower(name, uid); - TQDomNodeList loans = elem_.elementsByTagNameNS(m_namespace, TQString::tqfromLatin1("loan")); + TQDomNodeList loans = elem_.elementsByTagNameNS(m_namespace, TQString::fromLatin1("loan")); for(uint i = 0; i < loans.count(); ++i) { TQDomElement e = loans.item(i).toElement(); if(e.isNull()) { continue; } - long id = e.attribute(TQString::tqfromLatin1("entryRef")).toLong(); + long id = e.attribute(TQString::fromLatin1("entryRef")).toLong(); Data::EntryPtr entry = m_coll->entryById(id); if(!entry) { myDebug() << "TellicoImporter::readBorrower() - no entry with id = " << id << endl; continue; } - TQString uid = e.attribute(TQString::tqfromLatin1("uid")); + TQString uid = e.attribute(TQString::fromLatin1("uid")); TQDate loanDate, dueDate; - TQString s = e.attribute(TQString::tqfromLatin1("loanDate")); + TQString s = e.attribute(TQString::fromLatin1("loanDate")); if(!s.isEmpty()) { loanDate = TQDate::fromString(s, Qt::ISODate); } - s = e.attribute(TQString::tqfromLatin1("dueDate")); + s = e.attribute(TQString::fromLatin1("dueDate")); if(!s.isEmpty()) { dueDate = TQDate::fromString(s, Qt::ISODate); } Data::LoanPtr loan = new Data::Loan(entry, loanDate, dueDate, e.text()); loan->setUID(uid); b->addLoan(loan); - s = e.attribute(TQString::tqfromLatin1("calendar")); + s = e.attribute(TQString::fromLatin1("calendar")); loan->setInCalendar(s == Latin1Literal("true")); } if(!b->isEmpty()) { @@ -776,7 +776,7 @@ void TellicoImporter::loadZipData() { m_zip = new KZip(TQT_TQIODEVICE(m_buffer)); } if(!m_zip->open(IO_ReadOnly)) { - setStatusMessage(i18n(errorLoad).tqarg(url().fileName())); + setStatusMessage(i18n(errorLoad).arg(url().fileName())); m_format = Error; delete m_zip; m_zip = 0; @@ -787,7 +787,7 @@ void TellicoImporter::loadZipData() { const KArchiveDirectory* dir = m_zip->directory(); if(!dir) { - TQString str = i18n(errorLoad).tqarg(url().fileName()) + TQChar('\n'); + TQString str = i18n(errorLoad).arg(url().fileName()) + TQChar('\n'); str += i18n("The file is empty."); setStatusMessage(str); m_format = Error; @@ -800,12 +800,12 @@ void TellicoImporter::loadZipData() { } // main file was changed from bookcase.xml to tellico.xml as of version 0.13 - const KArchiveEntry* entry = dir->entry(TQString::tqfromLatin1("tellico.xml")); + const KArchiveEntry* entry = dir->entry(TQString::fromLatin1("tellico.xml")); if(!entry) { - entry = dir->entry(TQString::tqfromLatin1("bookcase.xml")); + entry = dir->entry(TQString::fromLatin1("bookcase.xml")); } if(!entry || !entry->isFile()) { - TQString str = i18n(errorLoad).tqarg(url().fileName()) + TQChar('\n'); + TQString str = i18n(errorLoad).arg(url().fileName()) + TQChar('\n'); str += i18n("The file contains no collection data."); setStatusMessage(str); m_format = Error; @@ -838,7 +838,7 @@ void TellicoImporter::loadZipData() { return; } - const KArchiveEntry* imgDirEntry = dir->entry(TQString::tqfromLatin1("images")); + const KArchiveEntry* imgDirEntry = dir->entry(TQString::fromLatin1("images")); if(!imgDirEntry || !imgDirEntry->isDirectory()) { m_zip->close(); delete m_zip; @@ -913,7 +913,7 @@ bool TellicoImporter::loadAllImages(const KURL& url_) { KZip zip(url_.path()); if(!zip.open(IO_ReadOnly)) { if(u != url_) { - Kernel::self()->sorry(i18n(errorImageLoad).tqarg(url_.fileName())); + Kernel::self()->sorry(i18n(errorImageLoad).arg(url_.fileName())); } u = url_; return false; @@ -922,14 +922,14 @@ bool TellicoImporter::loadAllImages(const KURL& url_) { const KArchiveDirectory* dir = zip.directory(); if(!dir) { if(u != url_) { - Kernel::self()->sorry(i18n(errorImageLoad).tqarg(url_.fileName())); + Kernel::self()->sorry(i18n(errorImageLoad).arg(url_.fileName())); } u = url_; zip.close(); return false; } - const KArchiveEntry* imgDirEntry = dir->entry(TQString::tqfromLatin1("images")); + const KArchiveEntry* imgDirEntry = dir->entry(TQString::fromLatin1("images")); if(!imgDirEntry || !imgDirEntry->isDirectory()) { zip.close(); return false; @@ -949,38 +949,38 @@ bool TellicoImporter::loadAllImages(const KURL& url_) { void TellicoImporter::addDefaultFilters() { switch(m_coll->type()) { case Data::Collection::Book: - if(m_coll->hasField(TQString::tqfromLatin1("read"))) { + if(m_coll->hasField(TQString::fromLatin1("read"))) { FilterPtr f = new Filter(Filter::MatchAny); f->setName(i18n("Unread Books")); - f->append(new FilterRule(TQString::tqfromLatin1("read"), TQString::tqfromLatin1("true"), FilterRule::FuncNotContains)); + f->append(new FilterRule(TQString::fromLatin1("read"), TQString::fromLatin1("true"), FilterRule::FuncNotContains)); m_coll->addFilter(f); m_modified = true; } break; case Data::Collection::Video: - if(m_coll->hasField(TQString::tqfromLatin1("year"))) { + if(m_coll->hasField(TQString::fromLatin1("year"))) { FilterPtr f = new Filter(Filter::MatchAny); f->setName(i18n("Old Movies")); // old movies from before 1960 - f->append(new FilterRule(TQString::tqfromLatin1("year"), TQString::tqfromLatin1("19[012345]\\d"), FilterRule::FuncRegExp)); + f->append(new FilterRule(TQString::fromLatin1("year"), TQString::fromLatin1("19[012345]\\d"), FilterRule::FuncRegExp)); m_coll->addFilter(f); m_modified = true; } - if(m_coll->hasField(TQString::tqfromLatin1("widescreen"))) { + if(m_coll->hasField(TQString::fromLatin1("widescreen"))) { FilterPtr f = new Filter(Filter::MatchAny); f->setName(i18n("Widescreen")); - f->append(new FilterRule(TQString::tqfromLatin1("widescreen"), TQString::tqfromLatin1("true"), FilterRule::FuncContains)); + f->append(new FilterRule(TQString::fromLatin1("widescreen"), TQString::fromLatin1("true"), FilterRule::FuncContains)); m_coll->addFilter(f); m_modified = true; } break; case Data::Collection::Album: - if(m_coll->hasField(TQString::tqfromLatin1("year"))) { + if(m_coll->hasField(TQString::fromLatin1("year"))) { FilterPtr f = new Filter(Filter::MatchAny); f->setName(i18n("80's Music")); - f->append(new FilterRule(TQString::tqfromLatin1("year"), TQString::tqfromLatin1("198\\d"),FilterRule::FuncRegExp)); + f->append(new FilterRule(TQString::fromLatin1("year"), TQString::fromLatin1("198\\d"),FilterRule::FuncRegExp)); m_coll->addFilter(f); m_modified = true; } @@ -989,22 +989,22 @@ void TellicoImporter::addDefaultFilters() { default: break; } - if(m_coll->hasField(TQString::tqfromLatin1("rating"))) { + if(m_coll->hasField(TQString::fromLatin1("rating"))) { FilterPtr filter = new Filter(Filter::MatchAny); filter->setName(i18n("Favorites")); // check all the numbers, and use top 20% or so - Data::FieldPtr field = m_coll->fieldByName(TQString::tqfromLatin1("rating")); + Data::FieldPtr field = m_coll->fieldByName(TQString::fromLatin1("rating")); bool ok; - uint min = Tellico::toUInt(field->property(TQString::tqfromLatin1("minimum")), &ok); + uint min = Tellico::toUInt(field->property(TQString::fromLatin1("minimum")), &ok); if(!ok) { min = 1; } - uint max = Tellico::toUInt(field->property(TQString::tqfromLatin1("maximum")), &ok); + uint max = Tellico::toUInt(field->property(TQString::fromLatin1("maximum")), &ok); if(!ok) { min = 5; } for(uint i = TQMAX(min, static_cast<uint>(0.8*(max-min+1))); i <= max; ++i) { - filter->append(new FilterRule(TQString::tqfromLatin1("rating"), TQString::number(i), FilterRule::FuncContains)); + filter->append(new FilterRule(TQString::fromLatin1("rating"), TQString::number(i), FilterRule::FuncContains)); } if(!filter->isEmpty()) { m_coll->addFilter(filter); diff --git a/src/translators/tellicoxmlexporter.cpp b/src/translators/tellicoxmlexporter.cpp index 221a11b..8f71140 100644 --- a/src/translators/tellicoxmlexporter.cpp +++ b/src/translators/tellicoxmlexporter.cpp @@ -33,12 +33,12 @@ #include <kglobal.h> #include <kcalendarsystem.h> -#include <tqlayout.h> +#include <layout.h> #include <tqgroupbox.h> #include <tqcheckbox.h> #include <tqwhatsthis.h> #include <tqdom.h> -#include <tqtextcodec.h> +#include <textcodec.h> using Tellico::Export::TellicoXMLExporter; @@ -78,29 +78,29 @@ TQDomDocument TellicoXMLExporter::exportXML() const { : XML::syntaxVersion; TQDomImplementation impl; - TQDomDocumentType doctype = impl.createDocumentType(TQString::tqfromLatin1("tellico"), + TQDomDocumentType doctype = impl.createDocumentType(TQString::fromLatin1("tellico"), XML::pubTellico(exportVersion), XML::dtdTellico(exportVersion)); //default namespace const TQString& ns = XML::nsTellico; - TQDomDocument dom = impl.createDocument(ns, TQString::tqfromLatin1("tellico"), doctype); + TQDomDocument dom = impl.createDocument(ns, TQString::fromLatin1("tellico"), doctype); // root tellico element TQDomElement root = dom.documentElement(); - TQString encodeStr = TQString::tqfromLatin1("version=\"1.0\" encoding=\""); + TQString encodeStr = TQString::fromLatin1("version=\"1.0\" encoding=\""); if(options() & Export::ExportUTF8) { - encodeStr += TQString::tqfromLatin1("UTF-8"); + encodeStr += TQString::fromLatin1("UTF-8"); } else { - encodeStr += TQString::tqfromLatin1(TQTextCodec::codecForLocale()->mimeName()); + encodeStr += TQString::fromLatin1(TQTextCodec::codecForLocale()->mimeName()); } encodeStr += TQChar('"'); // createDocument creates a root node, insert the processing instruction before it - dom.insertBefore(dom.createProcessingInstruction(TQString::tqfromLatin1("xml"), encodeStr), root); + dom.insertBefore(dom.createProcessingInstruction(TQString::fromLatin1("xml"), encodeStr), root); - root.setAttribute(TQString::tqfromLatin1("syntaxVersion"), exportVersion); + root.setAttribute(TQString::fromLatin1("syntaxVersion"), exportVersion); exportCollectionXML(dom, root, options() & Export::ExportFormatted); @@ -121,11 +121,11 @@ void TellicoXMLExporter::exportCollectionXML(TQDomDocument& dom_, TQDomElement& return; } - TQDomElement collElem = dom_.createElement(TQString::tqfromLatin1("collection")); - collElem.setAttribute(TQString::tqfromLatin1("type"), coll->type()); - collElem.setAttribute(TQString::tqfromLatin1("title"), coll->title()); + TQDomElement collElem = dom_.createElement(TQString::fromLatin1("collection")); + collElem.setAttribute(TQString::fromLatin1("type"), coll->type()); + collElem.setAttribute(TQString::fromLatin1("title"), coll->title()); - TQDomElement fieldsElem = dom_.createElement(TQString::tqfromLatin1("fields")); + TQDomElement fieldsElem = dom_.createElement(TQString::fromLatin1("fields")); collElem.appendChild(fieldsElem); Data::FieldVec fields = coll->fields(); @@ -136,16 +136,16 @@ void TellicoXMLExporter::exportCollectionXML(TQDomDocument& dom_, TQDomElement& if(coll->type() == Data::Collection::Bibtex) { const Data::BibtexCollection* c = static_cast<const Data::BibtexCollection*>(coll.data()); if(!c->preamble().isEmpty()) { - TQDomElement preElem = dom_.createElement(TQString::tqfromLatin1("bibtex-preamble")); + TQDomElement preElem = dom_.createElement(TQString::fromLatin1("bibtex-preamble")); preElem.appendChild(dom_.createTextNode(c->preamble())); collElem.appendChild(preElem); } - TQDomElement macrosElem = dom_.createElement(TQString::tqfromLatin1("macros")); + TQDomElement macrosElem = dom_.createElement(TQString::fromLatin1("macros")); for(StringMap::ConstIterator macroIt = c->macroList().constBegin(); macroIt != c->macroList().constEnd(); ++macroIt) { if(!macroIt.data().isEmpty()) { - TQDomElement macroElem = dom_.createElement(TQString::tqfromLatin1("macro")); - macroElem.setAttribute(TQString::tqfromLatin1("name"), macroIt.key()); + TQDomElement macroElem = dom_.createElement(TQString::fromLatin1("macro")); + macroElem.setAttribute(TQString::fromLatin1("name"), macroIt.key()); macroElem.appendChild(dom_.createTextNode(macroIt.data())); macrosElem.appendChild(macroElem); } @@ -161,7 +161,7 @@ void TellicoXMLExporter::exportCollectionXML(TQDomDocument& dom_, TQDomElement& } if(!m_images.isEmpty() && (options() & Export::ExportImages)) { - TQDomElement imgsElem = dom_.createElement(TQString::tqfromLatin1("images")); + TQDomElement imgsElem = dom_.createElement(TQString::fromLatin1("images")); collElem.appendChild(imgsElem); const TQStringList imageIds = m_images.toList(); for(TQStringList::ConstIterator it = imageIds.begin(); it != imageIds.end(); ++it) { @@ -177,7 +177,7 @@ void TellicoXMLExporter::exportCollectionXML(TQDomDocument& dom_, TQDomElement& // the borrowers and filters are in the tellico object, not the collection if(options() & Export::ExportComplete) { - TQDomElement bElem = dom_.createElement(TQString::tqfromLatin1("borrowers")); + TQDomElement bElem = dom_.createElement(TQString::fromLatin1("borrowers")); Data::BorrowerVec borrowers = coll->borrowers(); for(Data::BorrowerVec::Iterator bIt = borrowers.begin(); bIt != borrowers.end(); ++bIt) { exportBorrowerXML(dom_, bElem, bIt); @@ -186,7 +186,7 @@ void TellicoXMLExporter::exportCollectionXML(TQDomDocument& dom_, TQDomElement& parent_.appendChild(bElem); } - TQDomElement fElem = dom_.createElement(TQString::tqfromLatin1("filters")); + TQDomElement fElem = dom_.createElement(TQString::fromLatin1("filters")); FilterVec filters = coll->filters(); for(FilterVec::Iterator fIt = filters.begin(); fIt != filters.end(); ++fIt) { exportFilterXML(dom_, fElem, fIt); @@ -198,31 +198,31 @@ void TellicoXMLExporter::exportCollectionXML(TQDomDocument& dom_, TQDomElement& } void TellicoXMLExporter::exportFieldXML(TQDomDocument& dom_, TQDomElement& parent_, Data::FieldPtr field_) const { - TQDomElement elem = dom_.createElement(TQString::tqfromLatin1("field")); + TQDomElement elem = dom_.createElement(TQString::fromLatin1("field")); - elem.setAttribute(TQString::tqfromLatin1("name"), field_->name()); - elem.setAttribute(TQString::tqfromLatin1("title"), field_->title()); - elem.setAttribute(TQString::tqfromLatin1("category"), field_->category()); - elem.setAttribute(TQString::tqfromLatin1("type"), field_->type()); - elem.setAttribute(TQString::tqfromLatin1("flags"), field_->flags()); - elem.setAttribute(TQString::tqfromLatin1("format"), field_->formatFlag()); + elem.setAttribute(TQString::fromLatin1("name"), field_->name()); + elem.setAttribute(TQString::fromLatin1("title"), field_->title()); + elem.setAttribute(TQString::fromLatin1("category"), field_->category()); + elem.setAttribute(TQString::fromLatin1("type"), field_->type()); + elem.setAttribute(TQString::fromLatin1("flags"), field_->flags()); + elem.setAttribute(TQString::fromLatin1("format"), field_->formatFlag()); if(field_->type() == Data::Field::Choice) { - elem.setAttribute(TQString::tqfromLatin1("allowed"), field_->allowed().join(TQString::tqfromLatin1(";"))); + elem.setAttribute(TQString::fromLatin1("allowed"), field_->allowed().join(TQString::fromLatin1(";"))); } // only save description if it's not equal to title, which is the default // title is never empty, so this indirectly checks for empty descriptions if(field_->description() != field_->title()) { - elem.setAttribute(TQString::tqfromLatin1("description"), field_->description()); + elem.setAttribute(TQString::fromLatin1("description"), field_->description()); } for(StringMap::ConstIterator it = field_->propertyList().begin(); it != field_->propertyList().end(); ++it) { if(it.data().isEmpty()) { continue; } - TQDomElement e = dom_.createElement(TQString::tqfromLatin1("prop")); - e.setAttribute(TQString::tqfromLatin1("name"), it.key()); + TQDomElement e = dom_.createElement(TQString::fromLatin1("prop")); + e.setAttribute(TQString::fromLatin1("name"), it.key()); e.appendChild(dom_.createTextNode(it.data())); elem.appendChild(e); } @@ -231,8 +231,8 @@ void TellicoXMLExporter::exportFieldXML(TQDomDocument& dom_, TQDomElement& paren } void TellicoXMLExporter::exportEntryXML(TQDomDocument& dom_, TQDomElement& parent_, Data::EntryPtr entry_, bool format_) const { - TQDomElement entryElem = dom_.createElement(TQString::tqfromLatin1("entry")); - entryElem.setAttribute(TQString::tqfromLatin1("id"), entry_->id()); + TQDomElement entryElem = dom_.createElement(TQString::fromLatin1("entry")); + entryElem.setAttribute(TQString::fromLatin1("id"), entry_->id()); // iterate through every field for the entry Data::FieldVec fields = entry_->collection()->fields(); @@ -268,7 +268,7 @@ void TellicoXMLExporter::exportEntryXML(TQDomDocument& dom_, TQDomElement& paren entryElem.appendChild(parElem); // the space after the semi-colon is enforced when the field is set for the entry - TQStringList fields = TQStringList::split(TQString::tqfromLatin1("; "), fieldValue, true); + TQStringList fields = TQStringList::split(TQString::fromLatin1("; "), fieldValue, true); for(TQStringList::ConstIterator it = fields.begin(); it != fields.end(); ++it) { // element for field value, child of either entryElem or ParentElem TQDomElement fieldElem = dom_.createElement(fieldName); @@ -276,7 +276,7 @@ void TellicoXMLExporter::exportEntryXML(TQDomDocument& dom_, TQDomElement& paren int ncols = 0; if(fIt->type() == Data::Field::Table) { bool ok; - ncols = Tellico::toUInt(fIt->property(TQString::tqfromLatin1("columns")), &ok); + ncols = Tellico::toUInt(fIt->property(TQString::fromLatin1("columns")), &ok); if(!ok) { ncols = 1; } @@ -284,8 +284,8 @@ void TellicoXMLExporter::exportEntryXML(TQDomDocument& dom_, TQDomElement& paren if(ncols > 1) { for(int col = 0; col < ncols; ++col) { TQDomElement elem; - elem = dom_.createElement(TQString::tqfromLatin1("column")); - elem.appendChild(dom_.createTextNode((*it).section(TQString::tqfromLatin1("::"), col, col))); + elem = dom_.createElement(TQString::fromLatin1("column")); + elem.appendChild(dom_.createTextNode((*it).section(TQString::fromLatin1("::"), col, col))); fieldElem.appendChild(elem); } } else { @@ -298,25 +298,25 @@ void TellicoXMLExporter::exportEntryXML(TQDomDocument& dom_, TQDomElement& paren entryElem.appendChild(fieldElem); // Date fields get special treatment if(fIt->type() == Data::Field::Date) { - fieldElem.setAttribute(TQString::tqfromLatin1("calendar"), KGlobal::locale()->calendar()->calendarName()); + fieldElem.setAttribute(TQString::fromLatin1("calendar"), KGlobal::locale()->calendar()->calendarName()); TQStringList s = TQStringList::split('-', fieldValue, true); if(s.count() > 0 && !s[0].isEmpty()) { - TQDomElement e = dom_.createElement(TQString::tqfromLatin1("year")); + TQDomElement e = dom_.createElement(TQString::fromLatin1("year")); fieldElem.appendChild(e); e.appendChild(dom_.createTextNode(s[0])); } if(s.count() > 1 && !s[1].isEmpty()) { - TQDomElement e = dom_.createElement(TQString::tqfromLatin1("month")); + TQDomElement e = dom_.createElement(TQString::fromLatin1("month")); fieldElem.appendChild(e); e.appendChild(dom_.createTextNode(s[1])); } if(s.count() > 2 && !s[2].isEmpty()) { - TQDomElement e = dom_.createElement(TQString::tqfromLatin1("day")); + TQDomElement e = dom_.createElement(TQString::fromLatin1("day")); fieldElem.appendChild(e); e.appendChild(dom_.createTextNode(s[2])); } } else if(fIt->type() == Data::Field::URL && - fIt->property(TQString::tqfromLatin1("relative")) == Latin1Literal("true") && + fIt->property(TQString::fromLatin1("relative")) == Latin1Literal("true") && !url().isEmpty()) { // if a relative URL and url() is not empty, change the value! KURL old_url(Kernel::self()->URL(), fieldValue); @@ -343,35 +343,35 @@ void TellicoXMLExporter::exportImageXML(TQDomDocument& dom_, TQDomElement& paren } // myLog() << "TellicoXMLExporter::exportImageXML() - id = " << id_ << endl; - TQDomElement imgElem = dom_.createElement(TQString::tqfromLatin1("image")); + TQDomElement imgElem = dom_.createElement(TQString::fromLatin1("image")); if(m_includeImages) { const Data::Image& img = ImageFactory::imageById(id_); if(img.isNull()) { myDebug() << "TellicoXMLExporter::exportImageXML() - null image - " << id_ << endl; return; } - imgElem.setAttribute(TQString::tqfromLatin1("format"), img.format().data()); - imgElem.setAttribute(TQString::tqfromLatin1("id"), img.id()); - imgElem.setAttribute(TQString::tqfromLatin1("width"), img.width()); - imgElem.setAttribute(TQString::tqfromLatin1("height"), img.height()); + imgElem.setAttribute(TQString::fromLatin1("format"), img.format().data()); + imgElem.setAttribute(TQString::fromLatin1("id"), img.id()); + imgElem.setAttribute(TQString::fromLatin1("width"), img.width()); + imgElem.setAttribute(TQString::fromLatin1("height"), img.height()); if(img.linkOnly()) { - imgElem.setAttribute(TQString::tqfromLatin1("link"), TQString::tqfromLatin1("true")); + imgElem.setAttribute(TQString::fromLatin1("link"), TQString::fromLatin1("true")); } TQCString imgText = KCodecs::base64Encode(img.byteArray()); - imgElem.appendChild(dom_.createTextNode(TQString::tqfromLatin1(imgText))); + imgElem.appendChild(dom_.createTextNode(TQString::fromLatin1(imgText))); } else { const Data::ImageInfo& info = ImageFactory::imageInfo(id_); if(info.isNull()) { return; } - imgElem.setAttribute(TQString::tqfromLatin1("format"), info.format.data()); - imgElem.setAttribute(TQString::tqfromLatin1("id"), info.id); + imgElem.setAttribute(TQString::fromLatin1("format"), info.format.data()); + imgElem.setAttribute(TQString::fromLatin1("id"), info.id); // only load the images to read the size if necessary const bool loadImageIfNecessary = options() & Export::ExportImageSize; - imgElem.setAttribute(TQString::tqfromLatin1("width"), info.width(loadImageIfNecessary)); - imgElem.setAttribute(TQString::tqfromLatin1("height"), info.height(loadImageIfNecessary)); + imgElem.setAttribute(TQString::fromLatin1("width"), info.width(loadImageIfNecessary)); + imgElem.setAttribute(TQString::fromLatin1("height"), info.height(loadImageIfNecessary)); if(info.linkOnly) { - imgElem.setAttribute(TQString::tqfromLatin1("link"), TQString::tqfromLatin1("true")); + imgElem.setAttribute(TQString::fromLatin1("link"), TQString::fromLatin1("true")); } } parent_.appendChild(imgElem); @@ -380,21 +380,21 @@ void TellicoXMLExporter::exportImageXML(TQDomDocument& dom_, TQDomElement& paren void TellicoXMLExporter::exportGroupXML(TQDomDocument& dom_, TQDomElement& parent_) const { Data::EntryVec vec = entries(); // need a copy for ::contains(); bool exportAll = collection()->entries().count() == vec.count(); - // iterate over each group, which are the first tqchildren + // iterate over each group, which are the first children for(GroupIterator gIt = Controller::self()->groupIterator(); gIt.group(); ++gIt) { if(gIt.group()->isEmpty()) { continue; } - TQDomElement groupElem = dom_.createElement(TQString::tqfromLatin1("group")); - groupElem.setAttribute(TQString::tqfromLatin1("title"), gIt.group()->groupName()); + TQDomElement groupElem = dom_.createElement(TQString::fromLatin1("group")); + groupElem.setAttribute(TQString::fromLatin1("title"), gIt.group()->groupName()); // now iterate over all entry items in the group Data::EntryVec sorted = Data::Document::self()->sortEntries(*gIt.group()); for(Data::EntryVec::Iterator eIt = sorted.begin(); eIt != sorted.end(); ++eIt) { if(!exportAll && !vec.contains(eIt)) { continue; } - TQDomElement entryRefElem = dom_.createElement(TQString::tqfromLatin1("entryRef")); - entryRefElem.setAttribute(TQString::tqfromLatin1("id"), eIt->id()); + TQDomElement entryRefElem = dom_.createElement(TQString::fromLatin1("entryRef")); + entryRefElem.setAttribute(TQString::fromLatin1("id"), eIt->id()); groupElem.appendChild(entryRefElem); } if(groupElem.hasChildNodes()) { @@ -404,34 +404,34 @@ void TellicoXMLExporter::exportGroupXML(TQDomDocument& dom_, TQDomElement& paren } void TellicoXMLExporter::exportFilterXML(TQDomDocument& dom_, TQDomElement& parent_, FilterPtr filter_) const { - TQDomElement filterElem = dom_.createElement(TQString::tqfromLatin1("filter")); - filterElem.setAttribute(TQString::tqfromLatin1("name"), filter_->name()); + TQDomElement filterElem = dom_.createElement(TQString::fromLatin1("filter")); + filterElem.setAttribute(TQString::fromLatin1("name"), filter_->name()); - TQString match = (filter_->op() == Filter::MatchAll) ? TQString::tqfromLatin1("all") : TQString::tqfromLatin1("any"); - filterElem.setAttribute(TQString::tqfromLatin1("match"), match); + TQString match = (filter_->op() == Filter::MatchAll) ? TQString::fromLatin1("all") : TQString::fromLatin1("any"); + filterElem.setAttribute(TQString::fromLatin1("match"), match); for(TQPtrListIterator<FilterRule> it(*filter_); it.current(); ++it) { - TQDomElement ruleElem = dom_.createElement(TQString::tqfromLatin1("rule")); - ruleElem.setAttribute(TQString::tqfromLatin1("field"), it.current()->fieldName()); - ruleElem.setAttribute(TQString::tqfromLatin1("pattern"), it.current()->pattern()); + TQDomElement ruleElem = dom_.createElement(TQString::fromLatin1("rule")); + ruleElem.setAttribute(TQString::fromLatin1("field"), it.current()->fieldName()); + ruleElem.setAttribute(TQString::fromLatin1("pattern"), it.current()->pattern()); switch(it.current()->function()) { case FilterRule::FuncContains: - ruleElem.setAttribute(TQString::tqfromLatin1("function"), TQString::tqfromLatin1("contains")); + ruleElem.setAttribute(TQString::fromLatin1("function"), TQString::fromLatin1("contains")); break; case FilterRule::FuncNotContains: - ruleElem.setAttribute(TQString::tqfromLatin1("function"), TQString::tqfromLatin1("notcontains")); + ruleElem.setAttribute(TQString::fromLatin1("function"), TQString::fromLatin1("notcontains")); break; case FilterRule::FuncEquals: - ruleElem.setAttribute(TQString::tqfromLatin1("function"), TQString::tqfromLatin1("equals")); + ruleElem.setAttribute(TQString::fromLatin1("function"), TQString::fromLatin1("equals")); break; case FilterRule::FuncNotEquals: - ruleElem.setAttribute(TQString::tqfromLatin1("function"), TQString::tqfromLatin1("notequals")); + ruleElem.setAttribute(TQString::fromLatin1("function"), TQString::fromLatin1("notequals")); break; case FilterRule::FuncRegExp: - ruleElem.setAttribute(TQString::tqfromLatin1("function"), TQString::tqfromLatin1("regexp")); + ruleElem.setAttribute(TQString::fromLatin1("function"), TQString::fromLatin1("regexp")); break; case FilterRule::FuncNotRegExp: - ruleElem.setAttribute(TQString::tqfromLatin1("function"), TQString::tqfromLatin1("notregexp")); + ruleElem.setAttribute(TQString::fromLatin1("function"), TQString::fromLatin1("notregexp")); break; default: kdWarning() << "TellicoXMLExporter::exportFilterXML() - no matching rule function!" << endl; @@ -448,23 +448,23 @@ void TellicoXMLExporter::exportBorrowerXML(TQDomDocument& dom_, TQDomElement& pa return; } - TQDomElement bElem = dom_.createElement(TQString::tqfromLatin1("borrower")); + TQDomElement bElem = dom_.createElement(TQString::fromLatin1("borrower")); parent_.appendChild(bElem); - bElem.setAttribute(TQString::tqfromLatin1("name"), borrower_->name()); - bElem.setAttribute(TQString::tqfromLatin1("uid"), borrower_->uid()); + bElem.setAttribute(TQString::fromLatin1("name"), borrower_->name()); + bElem.setAttribute(TQString::fromLatin1("uid"), borrower_->uid()); const Data::LoanVec& loans = borrower_->loans(); for(Data::LoanVec::ConstIterator it = loans.constBegin(); it != loans.constEnd(); ++it) { - TQDomElement lElem = dom_.createElement(TQString::tqfromLatin1("loan")); + TQDomElement lElem = dom_.createElement(TQString::fromLatin1("loan")); bElem.appendChild(lElem); - lElem.setAttribute(TQString::tqfromLatin1("uid"), it->uid()); - lElem.setAttribute(TQString::tqfromLatin1("entryRef"), it->entry()->id()); - lElem.setAttribute(TQString::tqfromLatin1("loanDate"), it->loanDate().toString(Qt::ISODate)); - lElem.setAttribute(TQString::tqfromLatin1("dueDate"), it->dueDate().toString(Qt::ISODate)); + lElem.setAttribute(TQString::fromLatin1("uid"), it->uid()); + lElem.setAttribute(TQString::fromLatin1("entryRef"), it->entry()->id()); + lElem.setAttribute(TQString::fromLatin1("loanDate"), it->loanDate().toString(Qt::ISODate)); + lElem.setAttribute(TQString::fromLatin1("dueDate"), it->dueDate().toString(Qt::ISODate)); if(it->inCalendar()) { - lElem.setAttribute(TQString::tqfromLatin1("calendar"), TQString::tqfromLatin1("true")); + lElem.setAttribute(TQString::fromLatin1("calendar"), TQString::fromLatin1("true")); } lElem.appendChild(dom_.createTextNode(it->note())); @@ -491,14 +491,14 @@ TQWidget* TellicoXMLExporter::widget(TQWidget* parent_, const char* name_/*=0*/) } void TellicoXMLExporter::readOptions(KConfig* config_) { - KConfigGroup group(config_, TQString::tqfromLatin1("ExportOptions - %1").tqarg(formatString())); + KConfigGroup group(config_, TQString::fromLatin1("ExportOptions - %1").arg(formatString())); m_includeImages = group.readBoolEntry("Include Images", m_includeImages); } void TellicoXMLExporter::saveOptions(KConfig* config_) { m_includeImages = m_checkIncludeImages->isChecked(); - KConfigGroup group(config_, TQString::tqfromLatin1("ExportOptions - %1").tqarg(formatString())); + KConfigGroup group(config_, TQString::fromLatin1("ExportOptions - %1").arg(formatString())); group.writeEntry("Include Images", m_includeImages); } diff --git a/src/translators/tellicozipexporter.cpp b/src/translators/tellicozipexporter.cpp index 582003f..629a998 100644 --- a/src/translators/tellicozipexporter.cpp +++ b/src/translators/tellicozipexporter.cpp @@ -73,14 +73,14 @@ bool TellicoZipExporter::exec() { KZip zip(TQT_TQIODEVICE(&buf)); zip.open(IO_WriteOnly); - zip.writeFile(TQString::tqfromLatin1("tellico.xml"), TQString(), TQString(), xml.length(), xml); + zip.writeFile(TQString::fromLatin1("tellico.xml"), TQString(), TQString(), xml.length(), xml); if(m_includeImages) { ProgressManager::self()->setProgress(this, 10); // gonna be lazy and just increment progress every 3 images // it might be less, might be more uint j = 0; - const TQString imagesDir = TQString::tqfromLatin1("images/"); + const TQString imagesDir = TQString::fromLatin1("images/"); StringSet imageSet; Data::FieldVec imageFields = coll->imageFields(); // already took 10%, only 90% left diff --git a/src/translators/xmlimporter.cpp b/src/translators/xmlimporter.cpp index 99cf002..d3a522f 100644 --- a/src/translators/xmlimporter.cpp +++ b/src/translators/xmlimporter.cpp @@ -40,10 +40,10 @@ XMLImporter::XMLImporter(const TQByteArray& data_) : Import::Importer(KURL()) { TQString errorMsg; int errorLine, errorColumn; if(!m_dom.setContent(data_, true, &errorMsg, &errorLine, &errorColumn)) { - TQString str = i18n("There is an XML parsing error in line %1, column %2.").tqarg(errorLine).tqarg(errorColumn); - str += TQString::tqfromLatin1("\n"); + TQString str = i18n("There is an XML parsing error in line %1, column %2.").arg(errorLine).arg(errorColumn); + str += TQString::fromLatin1("\n"); str += i18n("The error message from TQt is:"); - str += TQString::tqfromLatin1("\n\t") + errorMsg; + str += TQString::fromLatin1("\n\t") + errorMsg; setStatusMessage(str); return; } @@ -57,10 +57,10 @@ void XMLImporter::setText(const TQString& text_) { TQString errorMsg; int errorLine, errorColumn; if(!m_dom.setContent(text_, true, &errorMsg, &errorLine, &errorColumn)) { - TQString str = i18n("There is an XML parsing error in line %1, column %2.").tqarg(errorLine).tqarg(errorColumn); - str += TQString::tqfromLatin1("\n"); + TQString str = i18n("There is an XML parsing error in line %1, column %2.").arg(errorLine).arg(errorColumn); + str += TQString::fromLatin1("\n"); str += i18n("The error message from TQt is:"); - str += TQString::tqfromLatin1("\n\t") + errorMsg; + str += TQString::fromLatin1("\n\t") + errorMsg; setStatusMessage(str); } } diff --git a/src/translators/xsltexporter.cpp b/src/translators/xsltexporter.cpp index f7151fd..727eec3 100644 --- a/src/translators/xsltexporter.cpp +++ b/src/translators/xsltexporter.cpp @@ -21,7 +21,7 @@ #include <tqlabel.h> #include <tqgroupbox.h> -#include <tqlayout.h> +#include <layout.h> #include <tqhbox.h> #include <tqdom.h> #include <tqwhatsthis.h> diff --git a/src/translators/xslthandler.cpp b/src/translators/xslthandler.cpp index 853f6a6..b7acb1f 100644 --- a/src/translators/xslthandler.cpp +++ b/src/translators/xslthandler.cpp @@ -17,7 +17,7 @@ #include "../tellico_utils.h" #include <tqdom.h> -#include <tqtextcodec.h> +#include <textcodec.h> #include <kurl.h> @@ -43,7 +43,7 @@ static int writeToTQString(void* context, const char* buffer, int len) { static void closeTQString(void* context) { TQString* t = static_cast<TQString*>(context); - *t += TQString::tqfromLatin1("\n"); + *t += TQString::fromLatin1("\n"); } using Tellico::XSLTHandler; @@ -151,8 +151,8 @@ void XSLTHandler::setXSLTDoc(const TQDomDocument& dom_, const TQCString& xsltFil for(uint j = 0; j < childs.count(); ++j) { if(childs.item(j).isProcessingInstruction()) { TQDomProcessingInstruction pi = childs.item(j).toProcessingInstruction(); - if(pi.data().lower().contains(TQString::tqfromLatin1("encoding"))) { - if(!pi.data().lower().contains(TQString::tqfromLatin1("utf-8"))) { + if(pi.data().lower().contains(TQString::fromLatin1("encoding"))) { + if(!pi.data().lower().contains(TQString::fromLatin1("utf-8"))) { utf8 = false; // } else { // myDebug() << "XSLTHandler::setXSLTDoc() - PI = " << pi.data() << endl; @@ -258,8 +258,8 @@ TQDomDocument& XSLTHandler::setLocaleEncoding(TQDomDocument& dom_) { for(unsigned j = 0; j < childs.count(); ++j) { if(childs.item(j).isElement() && childs.item(j).nodeName() == Latin1Literal("xsl:output")) { TQDomElement e = childs.item(j).toElement(); - const TQString encoding = TQString::tqfromLatin1(TQTextCodec::codecForLocale()->name()); - e.setAttribute(TQString::tqfromLatin1("encoding"), encoding); + const TQString encoding = TQString::fromLatin1(TQTextCodec::codecForLocale()->name()); + e.setAttribute(TQString::fromLatin1("encoding"), encoding); break; } } diff --git a/src/translators/xsltimporter.cpp b/src/translators/xsltimporter.cpp index 3edbcf6..bdcb5fd 100644 --- a/src/translators/xsltimporter.cpp +++ b/src/translators/xsltimporter.cpp @@ -22,7 +22,7 @@ #include <tqhbox.h> #include <tqlabel.h> -#include <tqlayout.h> +#include <layout.h> #include <tqgroupbox.h> #include <memory> @@ -41,7 +41,7 @@ static bool isUTF8(const KURL& url_) { ref->open(); TQTextStream stream(ref->file()); TQString line = stream.readLine().lower(); - return line.find(TQString::tqfromLatin1("utf-8")) > 0; + return line.find(TQString::fromLatin1("utf-8")) > 0; } } diff --git a/src/upcvalidator.cpp b/src/upcvalidator.cpp index fb2bd87..73cc0d6 100644 --- a/src/upcvalidator.cpp +++ b/src/upcvalidator.cpp @@ -46,7 +46,7 @@ TQValidator::State UPCValidator::validate(TQString& input_, int& pos_) const { } // once it gets converted to an ISBN, remember that, and use it for later - if(input_.startsWith(TQString::tqfromLatin1("978")) || input_.startsWith(TQString::tqfromLatin1("979"))) { + if(input_.startsWith(TQString::fromLatin1("978")) || input_.startsWith(TQString::fromLatin1("979"))) { ISBNValidator val(0); TQValidator::State s = val.validate(input_, pos_); if(s == TQValidator::Acceptable) { @@ -77,7 +77,7 @@ void UPCValidator::fixup(TQString& input_) const { } const uint len = input_.length(); - if(len > 12 && (input_.startsWith(TQString::tqfromLatin1("978")) || input_.startsWith(TQString::tqfromLatin1("979")))) { + if(len > 12 && (input_.startsWith(TQString::fromLatin1("978")) || input_.startsWith(TQString::fromLatin1("979")))) { TQString s = input_; ISBNValidator val(0); int p = 0; @@ -95,7 +95,7 @@ TQValidator::State UPCValidator::decodeCat(TQString& input_) const { if(input_.length() < 3) { return Intermediate; } - if(!input_.startsWith(TQString::tqfromLatin1(".C3"))) { // all cuecat codes start with .C3 + if(!input_.startsWith(TQString::fromLatin1(".C3"))) { // all cuecat codes start with .C3 return Invalid; } const int periods = input_.contains('.'); @@ -119,7 +119,7 @@ TQValidator::State UPCValidator::decodeCat(TQString& input_) const { } } - code = TQString::tqfromLatin1(KCodecs::base64Decode(TQCString(code.latin1()))); + code = TQString::fromLatin1(KCodecs::base64Decode(TQCString(code.latin1()))); for(uint i = 0; i < code.length(); ++i) { char c = code[i].latin1() ^ 'C'; diff --git a/src/xmphandler.cpp b/src/xmphandler.cpp index 9841596..f53646e 100644 --- a/src/xmphandler.cpp +++ b/src/xmphandler.cpp @@ -16,7 +16,7 @@ #include <config.h> #include <tqfile.h> -#include <tqtextstream.h> +#include <textstream.h> #ifdef HAVE_EXEMPI #include <exempi/xmp.h> #endif @@ -72,7 +72,7 @@ TQString XMPHandler::extractXMP(const TQString& file) { // myDebug() << result << endl; #if 0 kdWarning() << "XMPHandler::parse() - turn me off!" << endl; - TQFile f1(TQString::tqfromLatin1("/tmp/xmp.xml")); + TQFile f1(TQString::fromLatin1("/tmp/xmp.xml")); if(f1.open(IO_WriteOnly)) { TQTextStream t(&f1); t << result; |