6
1
Fork 0

rename the following methods:

tqfind find
tqreplace replace
tqcontains contains


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/bibletime@1246075 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 13 anos atrás
commit fbb51be9cf

@ -166,7 +166,7 @@ char BT_GBFHTML::processText(sword::SWBuf& buf, const sword::SWKey * key, const
//insert the span
if (!insertedTag) { //we have to insert a new tag end and beginning, i.e. our first loop
e.tqreplace(pos, tag.matchedLength(), "</span>");
e.replace(pos, tag.matchedLength(), "</span>");
pos += 7;
//skip blanks, commas, dots and stuff at the beginning, it doesn't belong to the morph code
@ -200,7 +200,7 @@ char BT_GBFHTML::processText(sword::SWBuf& buf, const sword::SWKey * key, const
//search the existing attribute start
TQRegExp attrRegExp( isMorph ? "morph=\".+(?=\")" : "lemma=\".+(?=\")" );
attrRegExp.setMinimal(true);
const int foundPos = e.tqfind(attrRegExp, tagAttributeStart);
const int foundPos = e.find(attrRegExp, tagAttributeStart);
if (foundPos != -1) {
e.insert(foundPos + attrRegExp.matchedLength(), TQString("|").append(value));
@ -239,7 +239,7 @@ char BT_GBFHTML::processText(sword::SWBuf& buf, const sword::SWKey * key, const
}
bool BT_GBFHTML::handleToken(sword::SWBuf &buf, const char *token, sword::BasicFilterUserData *userData) {
if (!substituteToken(buf, token)) { //more than a simple tqreplace
if (!substituteToken(buf, token)) { //more than a simple replace
const unsigned int tokenLength = strlen(token);
unsigned long i;
sword::SWBuf value;

@ -354,7 +354,7 @@ bool BT_OSISHTML::handleToken(sword::SWBuf &buf, const char *token, sword::Basic
Q_ASSERT(mod);
//if the osisRef like "GerLut:key" contains a module, use that
int pos = ref.tqfind(":");
int pos = ref.find(":");
if ((pos >= 0) && ref.at(pos-1).isLetter() && ref.at(pos+1).isLetter()) {
TQString newModuleName = ref.left(pos);

@ -140,7 +140,7 @@ char BT_ThMLHTML::processText(sword::SWBuf& buf, const sword::SWKey* key, const
//insert the span
if (!insertedTag) {
e.tqreplace(pos, tag.matchedLength(), "</span>");
e.replace(pos, tag.matchedLength(), "</span>");
pos += 7;
TQString rep;
@ -166,7 +166,7 @@ char BT_ThMLHTML::processText(sword::SWBuf& buf, const sword::SWKey* key, const
//search the existing attribute start
TQRegExp attrRegExp( isMorph ? "morph=\".+(?=\")" : "lemma=\".+(?=\")" );
attrRegExp.setMinimal(true);
const int foundAttrPos = e.tqfind(attrRegExp, pos);
const int foundAttrPos = e.find(attrRegExp, pos);
if (foundAttrPos != -1) {
e.insert(foundAttrPos + attrRegExp.matchedLength(), TQString("|").append(value));
@ -177,7 +177,7 @@ char BT_ThMLHTML::processText(sword::SWBuf& buf, const sword::SWKey* key, const
}
}
else { //attribute was not yet inserted
const int attrPos = e.tqfind(TQRegExp("morph=|lemma="), 0);
const int attrPos = e.find(TQRegExp("morph=|lemma="), 0);
if (attrPos >= 0) {
TQString attr;

@ -117,7 +117,7 @@ namespace Rendering {
TQString text = oldText;
TQRegExp re("(\\b)(?=\\w)"); //word begin marker
int pos = text.tqfind(re, 0);
int pos = text.find(re, 0);
while (pos != -1) { //word begin found
//qWarning("found word at %i in %i", pos, text.length());
@ -126,7 +126,7 @@ namespace Rendering {
//qWarning("matched %s", text.mid(pos+1, 4).latin1());
//find end of word and put a marker around it
endPos = text.tqfind(TQRegExp("\\b|[,.:]"), pos+1);
endPos = text.find(TQRegExp("\\b|[,.:]"), pos+1);
if ((endPos != -1) && !CToolClass::inHTMLTag(endPos, text) && (endPos - pos >= 3)) { //reuire wordslonger than 3 chars
text.insert(endPos, "</span>");
text.insert(pos, "<span class=\"word\">");
@ -134,7 +134,7 @@ namespace Rendering {
endPos += 26;
}
}
pos = text.tqfind(re, endPos);
pos = text.find(re, endPos);
}
*/
const CLanguageMgr::Language* const lang =

@ -44,7 +44,7 @@ CDisplayTemplateMgr::~CDisplayTemplateMgr() {}
\fn CDisplayTemplateMgr::fillTemplate( const TQString& name, const TQString& title, const TQString& content )
*/
const TQString CDisplayTemplateMgr::fillTemplate( const TQString& name, const TQString& content, Settings& settings ) {
const TQString templateName = m_templateMap.tqcontains(name) ? name : defaultTemplate();
const TQString templateName = m_templateMap.contains(name) ? name : defaultTemplate();
TQString displayTypeString;
@ -145,22 +145,22 @@ const TQString CDisplayTemplateMgr::fillTemplate( const TQString& name, const TQ
// qWarning("Outputing unformated text");
const TQString t = TQString(m_templateMap[ templateName ]) //don't change the map's content directly, use a copy
.tqreplace("#TITLE#", settings.title)
.tqreplace("#LANG_ABBREV#", settings.langAbbrev.isEmpty() ? TQString("en") : settings.langAbbrev)
.tqreplace("#DISPLAYTYPE#", displayTypeString)
.tqreplace("#LANG_CSS#", langCSS)
.tqreplace("#PAGE_DIRECTION#", settings.pageDirection)
.tqreplace("#CONTENT#", newContent);
.replace("#TITLE#", settings.title)
.replace("#LANG_ABBREV#", settings.langAbbrev.isEmpty() ? TQString("en") : settings.langAbbrev)
.replace("#DISPLAYTYPE#", displayTypeString)
.replace("#LANG_CSS#", langCSS)
.replace("#PAGE_DIRECTION#", settings.pageDirection)
.replace("#CONTENT#", newContent);
//printf("%s\n\n", t.latin1());
return t;
/* TQString(m_templateMap[ templateName ]) //don't change the map's content directly, use a copy
.tqreplace("#TITLE#", settings.title)
.tqreplace("#LANG_ABBREV#", settings.langAbbrev.isEmpty() ? TQString("en") : settings.langAbbrev)
.tqreplace("#DISPLAYTYPE#", displayTypeString)
.tqreplace("#LANG_CSS#", langCSS)
.tqreplace("#PAGE_DIRECTION#", settings.pageDirection)
.tqreplace("#CONTENT#", newContent);*/
.replace("#TITLE#", settings.title)
.replace("#LANG_ABBREV#", settings.langAbbrev.isEmpty() ? TQString("en") : settings.langAbbrev)
.replace("#DISPLAYTYPE#", displayTypeString)
.replace("#LANG_CSS#", langCSS)
.replace("#PAGE_DIRECTION#", settings.pageDirection)
.replace("#CONTENT#", newContent);*/
}

@ -97,7 +97,7 @@ const CLanguageMgr::LangMap& CLanguageMgr::availableLanguages() {
// for (CSwordModuleInfo* m = mods.first(); m; m = mods.next()) {
abbrev = (*it)->module()->Lang();
if (abbrev && !abbrevs.tqcontains(abbrev)) {
if (abbrev && !abbrevs.contains(abbrev)) {
abbrevs.append( abbrev );
}
};
@ -122,7 +122,7 @@ const CLanguageMgr::LangMap& CLanguageMgr::availableLanguages() {
};
const CLanguageMgr::Language* const CLanguageMgr::languageForAbbrev( const TQString& abbrev ) const {
Language* lang = m_langMap.tqfind(abbrev);
Language* lang = m_langMap.find(abbrev);
if (lang) {
return lang;
@ -131,7 +131,7 @@ const CLanguageMgr::Language* const CLanguageMgr::languageForAbbrev( const TQStr
//try to search in the alternative abbrevs
//const LangMapIterator end = m_langMap.constEnd();
for ( LangMapIterator it( m_langMap ); it.current(); ++it ) {
if (it.current()->alternativeAbbrevs() && it.current()->alternativeAbbrevs()->tqcontains(abbrev)) {
if (it.current()->alternativeAbbrevs() && it.current()->alternativeAbbrevs()->contains(abbrev)) {
return it.current();
}
}

@ -159,7 +159,7 @@ const bool CReferenceManager::decodeHyperlink( const TQString& hyperlink, TQStri
if (ref.at(0) != '/' ) { //we have a module given
while (true) {
const int pos = ref.tqfind("/");
const int pos = ref.find("/");
if ((pos>0) && ref.at(pos-1) != '\\') { //found a slash which is not escaped
module = ref.mid(0,pos);
@ -179,7 +179,7 @@ const bool CReferenceManager::decodeHyperlink( const TQString& hyperlink, TQStri
}
//the key may be an osis key like "NASBLex:Moses", which sets the module, too
// const int modPos = key.tqfind(":");
// const int modPos = key.find(":");
// if (modPos != -1 && key.at(modPos-1).isLetter() && key.at(modPos+1).isLetter()) {
// module = key.left(modPos);
// key = key.mid(modPos+1);
@ -187,8 +187,8 @@ const bool CReferenceManager::decodeHyperlink( const TQString& hyperlink, TQStri
// qWarning("found the module name %s with key %s", module.latin1(), key.latin1());
// }
//tqreplace \/ escapes with /
key.tqreplace(TQRegExp("\\\\/"), "/");
//replace \/ escapes with /
key.replace(TQRegExp("\\\\/"), "/");
}
else if (ref.left(8).lower() == "morph://" || ref.left(10).lower() == "strongs://") { //strongs or morph URL have the same format
enum PreType {IsMorph, IsStrongs};
@ -204,7 +204,7 @@ const bool CReferenceManager::decodeHyperlink( const TQString& hyperlink, TQStri
}
//part up to next slash is the language
const int pos = ref.tqfind("/");
const int pos = ref.find("/");
if (pos>0) { //found
const TQString language = ref.mid(0,pos);
@ -253,7 +253,7 @@ const TQString CReferenceManager::encodeReference(const TQString &module, const
}
void CReferenceManager::decodeReference(TQString &dragreference, TQString &module, TQString &reference) {
const int pos = dragreference.tqfind(")");
const int pos = dragreference.find(")");
const TQString fallbackModule = dragreference.mid( 1, pos - 1);
dragreference = dragreference.mid(pos+1);

@ -329,7 +329,7 @@ CSwordModuleInfo* const CSwordBackend::findModuleByDescription(const TQString& d
/** This function searches for a module with the specified description */
const TQString CSwordBackend::findModuleNameByDescription(const TQString& description) {
if (m_moduleDescriptionMap.tqcontains(description)) {
if (m_moduleDescriptionMap.contains(description)) {
return m_moduleDescriptionMap[description];
}

@ -81,7 +81,7 @@ const TQString CSwordKey::renderedText( const CSwordKey::TextRenderType mode ) {
if (m_module->type() == CSwordModuleInfo::Lexicon) {
m_module->snap();
/* In lexicons make sure that our key (e.g. 123) was successfully set to the module,
i.e. the module key contains this key (e.g. 0123 tqcontains 123) */
i.e. the module key contains this key (e.g. 0123 contains 123) */
if ( strcasecmp(m_module->module()->getKey()->getText(), buffer)
&& !strstr(m_module->module()->getKey()->getText(), buffer)
@ -108,7 +108,7 @@ const TQString CSwordKey::renderedText( const CSwordKey::TextRenderType mode ) {
TQString number = rx.cap(2);
TQString paddednumber = number.rightJustify(5, '0'); // Form 00123
text.tqreplace(
text.replace(
TQRegExp( TQString(
"(>[^<>]+)" // Avoid replacing inside tags
"\\b(0*%1)\\b").tqarg(number) ), // And span around 0's

@ -496,7 +496,7 @@ const TQString CSwordModuleInfo::config(const CSwordModuleInfo::ConfigEntry entr
case AbsoluteDataPath: {
TQString path( getSimpleConfigEntry("AbsoluteDataPath") );
path.tqreplace(TQRegExp("/./"), "/"); // make /abs/path/./modules/ looking better
path.replace(TQRegExp("/./"), "/"); // make /abs/path/./modules/ looking better
//make sure we have a trailing slash!
if (path.right(1) != "/") {
@ -510,7 +510,7 @@ const TQString CSwordModuleInfo::config(const CSwordModuleInfo::ConfigEntry entr
TQString path(getSimpleConfigEntry("DataPath"));
if ((type() == CSwordModuleInfo::GenericBook) || (type() == CSwordModuleInfo::Lexicon)) {
int pos = path.tqfindRev("/"); //last slash in the string
int pos = path.findRev("/"); //last slash in the string
if (pos != -1) {
path = path.left(pos + 1); //include the slash

@ -172,7 +172,7 @@ ListCSwordModuleInfo CTextRendering::KeyTree::collectModules() const {
/*ToDo: Use the const iterators as soon as we use TQt > 3.1
const ListCSwordModuleInfo::const_iterator c_end = childMods.end();
for (ListCSwordModuleInfo::const_iterator c_it = childMods.constBegin(); c_it != c_end; ++c_it) {
if (!modules.tqcontains(*c_it)) {
if (!modules.contains(*c_it)) {
modules.append(*c_it);
}
}*/
@ -181,7 +181,7 @@ ListCSwordModuleInfo CTextRendering::KeyTree::collectModules() const {
ListCSwordModuleInfo::iterator end_it = childMods.end();
for (ListCSwordModuleInfo::iterator it(childMods.begin()); it != end_it; ++it) {
if (!modules.tqcontains(*it)) {
if (!modules.contains(*it)) {
modules.append(*it);
}
}

@ -53,7 +53,7 @@ bool BibleTimeInterface::process(const TQCString &fun, const TQByteArray &data,
for ( int i = 0; BibleTimeInterface_ftable[i][1]; i++ )
fdict->insert( BibleTimeInterface_ftable[i][1], new int( i ) );
}
int* fp = fdict->tqfind( fun );
int* fp = fdict->find( fun );
switch ( fp?*fp:-1) {
case 0: { // void syncAllBibles(TQString)
TQString arg0;

@ -102,7 +102,7 @@ namespace BookshelfManager {
for (TQStringList::const_iterator it = targets.begin(); it != targets.end(); ++it) {
TQString t = *it;
if (t.tqcontains( TQString("%1/.sword").tqarg(getenv("HOME")) )) {
if (t.contains( TQString("%1/.sword").tqarg(getenv("HOME")) )) {
//we don't want HOME/.sword in the config
continue;
}

@ -386,8 +386,8 @@ const CBTConfig::StringMap CBTConfig::get
const CBTConfig::FontSettingsPair CBTConfig::get
( const CLanguageMgr::Language* const language ) {
if (fontConfigMap && fontConfigMap->tqcontains(language)) {
return fontConfigMap->tqfind(language).data();
if (fontConfigMap && fontConfigMap->contains(language)) {
return fontConfigMap->find(language).data();
}
if (!fontConfigMap) {
@ -515,7 +515,7 @@ void CBTConfig::set
config->setGroup("font standard settings");
config->writeEntry(getKey(language), value.first);
if (fontConfigMap && fontConfigMap->tqcontains(language)) {
if (fontConfigMap && fontConfigMap->contains(language)) {
fontConfigMap->remove
(language); //remove it from the cache
}

@ -356,7 +356,7 @@ namespace InfoDisplay {
TQString value = "";
TQString valueClass = "";
int valStart = (*it).tqfind(':');
int valStart = (*it).find(':');
if (valStart > -1) {
valueClass = (*it).mid(0, valStart);
module = CPointers::backend()->findModuleByName( valueClass );

@ -90,7 +90,7 @@ COptionsDialog::~COptionsDialog() {
/** */
void COptionsDialog::newDisplayWindowFontSelected(const TQFont &newFont) {
CBTConfig::FontSettingsPair oldSettings = m_settings.fonts.fontMap[ m_settings.fonts.usage->currentText() ];
m_settings.fonts.fontMap.tqreplace( m_settings.fonts.usage->currentText(), CBTConfig::FontSettingsPair(oldSettings.first, newFont) );
m_settings.fonts.fontMap.replace( m_settings.fonts.usage->currentText(), CBTConfig::FontSettingsPair(oldSettings.first, newFont) );
}
/** Called when the combobox contents is changed */
@ -267,7 +267,7 @@ void COptionsDialog::initLanguages() {
);
TQString currentLanguageName;
if ( l->isValid() && languageNames.tqcontains(l->translatedName()) ) { //tranlated language name is in the box
if ( l->isValid() && languageNames.contains(l->translatedName()) ) { //tranlated language name is in the box
currentLanguageName = l->translatedName();
}
else { //a language like "German Abbrevs" might be the language to set

@ -38,7 +38,7 @@ m_tqgeometry(10,20,640,480) {
}
else if (m_filename.isEmpty() && !name.isEmpty()) {
m_filename = name;
m_filename.tqreplace(TQRegExp("\\s=#."),"_");
m_filename.replace(TQRegExp("\\s=#."),"_");
KStandardDirs stdDirs;
m_filename = stdDirs.saveLocation("data", "bibletime/sessions/") + m_filename + ".xml";
init(m_filename);

@ -239,7 +239,7 @@ the module remote installation feature!</b>")
void CSwordSetupDialog::initManageIndices()
{
TQFrame* page = m_manageIndiciesPage = addPage(i18n("Manage search indicies"),
TQString(), SmallIcon("filetqfind",32));
TQString(), SmallIcon("filefind",32));
page->setMinimumSize(500,400);
TQVBoxLayout* box = new TQVBoxLayout(page, 4, 4);
@ -364,12 +364,12 @@ the module remote installation feature!</b>")
TQString source = sourceName;
TQString rep = i18n("[Local]") + " ";
int i = source.tqfind(rep);
int i = source.find(rep);
if (i>=0) {
source.remove(i, rep.length());
}
rep = i18n("[Remote]") + " ";
i = source.tqfind(rep);
i = source.find(rep);
if (i>=0) {
source.remove(i, rep.length());
}
@ -420,8 +420,8 @@ the module remote installation feature!</b>")
dataPath = dataPath.mid(2);
}
if (prefixPath.tqcontains(dataPath)) { //remove module part to get the prefix path
prefixPath = prefixPath.remove( prefixPath.tqfind(dataPath), dataPath.length() );
if (prefixPath.contains(dataPath)) { //remove module part to get the prefix path
prefixPath = prefixPath.remove( prefixPath.find(dataPath), dataPath.length() );
}
else { //fall back to default Sword config path
prefixPath = TQString::tqfromLatin1(backend()->prefixPath);
@ -753,9 +753,9 @@ the module remote installation feature!</b>")
dataPath = dataPath.mid(2);
}
if (prefixPath.tqcontains(dataPath)) {
prefixPath.remove( prefixPath.tqfind(dataPath), dataPath.length() ); //complicated to work with TQt 3.0
//prefixPath = prefixPath.tqreplace(dataPath, ""); //old code working with TQt 3.2
if (prefixPath.contains(dataPath)) {
prefixPath.remove( prefixPath.find(dataPath), dataPath.length() ); //complicated to work with TQt 3.0
//prefixPath = prefixPath.replace(dataPath, ""); //old code working with TQt 3.2
}
else {
prefixPath = TQString::tqfromLatin1(backend()->prefixPath);
@ -885,12 +885,12 @@ the module remote installation feature!</b>")
const TQString CSwordSetupDialog::currentInstallSource() {
TQString source = m_sourceCombo->currentText();
TQString rep = i18n("[Local]") + " ";
int i = source.tqfind(rep);
int i = source.find(rep);
if (i>=0) {
source.remove(i, rep.length());
}
rep = i18n("[Remote]") + " ";
i = source.tqfind(rep);
i = source.find(rep);
if (i>=0) {
source.remove(i, rep.length());
}

@ -43,7 +43,7 @@ CHTMLWriteDisplay::~CHTMLWriteDisplay() {}
void CHTMLWriteDisplay::setText( const TQString& newText ) {
TQString text = newText;
// text.tqreplace("\n<br/><!-- BT newline -->\n", "\n");
// text.replace("\n<br/><!-- BT newline -->\n", "\n");
TQTextEdit::setText(text);
}

@ -42,8 +42,8 @@ void CPlainWriteDisplay::selectAll() {
void CPlainWriteDisplay::setText( const TQString& newText ) {
//make sure the text has been converted to show \n instead of <br/>
TQString text = newText;
// text.tqreplace("\n<br /><!-- BT newline -->\n", "\n");
text.tqreplace("<br />", "\n"); //inserted by BT or the TQt textedit widget
// text.replace("\n<br /><!-- BT newline -->\n", "\n");
text.replace("<br />", "\n"); //inserted by BT or the TQt textedit widget
TQTextEdit::setText(text);
}
@ -80,7 +80,7 @@ const TQString CPlainWriteDisplay::plainText() {
TQString ret = TQTextEdit::text();
//in plain text mode the text just contains newlines, convert them into <br/> before we return the text for display in a HTML widget
ret.tqreplace("\n", "<br />");
ret.replace("\n", "<br />");
return ret;
}

@ -421,7 +421,7 @@ void CDisplayWindow::lookup( const TQString& moduleName, const TQString& keyName
}
//ToDo: check for containsRef compat
if (m && modules().tqcontains(m)) {
if (m && modules().contains(m)) {
key()->key(keyName);
keyChooser()->setKey(key()); //the key chooser does send an update signal
}

@ -85,7 +85,7 @@ CSwordModuleInfo* CModuleChooserButton::module() {
for (unsigned int i = 0; i < popup->count(); i++) {
if ( m_popup->isItemChecked(popup->idAt(i)) ) {
TQString mod = popup->text(popup->idAt(i)).remove('&');
return backend()->findModuleByName( mod.left(mod.tqfind(" ")) );
return backend()->findModuleByName( mod.left(mod.find(" ")) );
}
}
@ -197,7 +197,7 @@ void CModuleChooserButton::populateMenu() {
}
}
if (languages.tqfind( lang ) == languages.end() ) { //this lang was not yet added
if (languages.find( lang ) == languages.end() ) { //this lang was not yet added
languages += lang;
KPopupMenu* menu = new KPopupMenu;
@ -258,14 +258,14 @@ void CModuleChooserButton::updateMenuItems() {
for (unsigned int i = 0; i < popup->count(); i++) {
moduleName = popup->text(popup->idAt(i)).remove('&');
module = backend()->findModuleByName( moduleName.left(moduleName.tqfindRev(" ")) );
module = backend()->findModuleByName( moduleName.left(moduleName.findRev(" ")) );
Q_ASSERT(module);
// if (!module) {
// qWarning("Can't find module with name %s", moduleName.latin1());
// }
bool alreadyChosen = chosenModules.tqcontains( module );
bool alreadyChosen = chosenModules.contains( module );
if (m_module) {
alreadyChosen = alreadyChosen && (m_module->name() != moduleName);
}

@ -122,8 +122,8 @@ void CPlainWriteWindow::saveCurrentText( const TQString& /*key*/ ) {
//since t is a complete HTML page at the moment, strip away headers and footers of a HTML page
TQRegExp re("(?:<html.*>.+<body.*>)", false); //remove headers, case insensitive
re.setMinimal(true);
t.tqreplace(re, "");
t.tqreplace(TQRegExp("</body></html>", false), "");//remove footer
t.replace(re, "");
t.replace(TQRegExp("</body></html>", false), "");//remove footer
const TQString& oldKey = this->key()->key();
if( modules().first()->isWritable() ) {

@ -44,7 +44,7 @@ bool CKCComboBox::eventFilter( TQObject *o, TQEvent *e ) {
TQFocusEvent* f = TQT_TQFOCUSEVENT(e);
if (TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(lineEdit()) && f->reason() == TQFocusEvent::Tab) {
int index = listBox()->index( listBox()->tqfindItem(currentText()) );
int index = listBox()->index( listBox()->findItem(currentText()) );
if (index == -1) {
index = 0;// return 0 if not found
}

@ -75,7 +75,7 @@ void CLexiconKeyChooser::setKey(CSwordKey* key) {
// qWarning("setKey start");
TQString newKey = m_key->key();
const int index = m_widget->comboBox()->listBox()->index(m_widget->comboBox()->listBox()->tqfindItem( newKey ));
const int index = m_widget->comboBox()->listBox()->index(m_widget->comboBox()->listBox()->findItem( newKey ));
m_widget->comboBox()->setCurrentItem(index);
// qWarning("setKey end");

@ -667,7 +667,7 @@ void CTreeFolder::initTree() {
TQString lang = TQString::tqfromLatin1((*it)->module()->Lang());
// if (lang.isEmpty())
// lang = ");
if (!usedLangs.tqcontains(lang)) {
if (!usedLangs.contains(lang)) {
usedLangs.append(lang);
}
}
@ -1163,7 +1163,7 @@ void CGlossaryFolder::initTree() {
(*it)->config(CSwordModuleInfo::GlossaryTo)
);
if (!usedLangs.tqcontains(langPair)) {
if (!usedLangs.contains(langPair)) {
usedLangs.append(langPair);
}
}

@ -768,7 +768,7 @@ void CMainIndex::readSettings() {
unsigned int index = 1;
for (TQStringList::Iterator p_it( path.begin() ); p_it != path.end(); ++p_it) {
TQString itemName = (*p_it).tqreplace("\\/", "/");
TQString itemName = (*p_it).replace("\\/", "/");
while (item && (item->text(0) != itemName)) {
item = item->nextSibling();
@ -835,7 +835,7 @@ void CMainIndex::saveSettings() {
TQString fullName = i->text(0);
while (i->tqparent()) {
i = i->tqparent();
fullName.prepend("/").prepend( i->text(0).tqreplace("/", "\\/")); // tqparent / child
fullName.prepend("/").prepend( i->text(0).replace("/", "\\/")); // tqparent / child
}
openGroups << fullName;
}

@ -186,7 +186,7 @@ void CModuleChooser::initTree() {
// for (modsForType.first(); modsForType.current(); modsForType.next()) {
ListCSwordModuleInfo::iterator end_it = modsForType.end();
for (ListCSwordModuleInfo::iterator it(modsForType.begin()); it != end_it; ++it) {
if ( !langs.tqcontains(TQString( (*it)->module()->Lang() ))) {
if ( !langs.contains(TQString( (*it)->module()->Lang() ))) {
langs.append( (*it)->module()->Lang() );
}
};
@ -256,7 +256,7 @@ void CModuleChooser::setModules( ListCSwordModuleInfo modules ) {
TQListViewItemIterator it( this );
for ( ; it.current(); ++it ) {
if ( ModuleCheckBoxItem* i = dynamic_cast<ModuleCheckBoxItem*>(it.current()) ) {
i->setOn(modules.tqcontains(i->module())); //set the status for the module checkbox item
i->setOn(modules.contains(i->module())); //set the status for the module checkbox item
// if (i->isOn()) { //if it's checked, show the item
// qWarning("show item!");
// ensureItemVisible(i);

@ -125,7 +125,7 @@ void CModuleResultView::setupTree( ListCSwordModuleInfo modules, const TQString&
// I choose option number 2 at this time.
//----------------------------------------------------------------------
int sstIndex, sTokenIndex; // strong search text index for finding "strong:"
if ((sstIndex = searchedText.tqfind("strong:", 0)) != -1) {
if ((sstIndex = searchedText.find("strong:", 0)) != -1) {
TQString sNumber;
//--------------------------------------------------
// get the strongs number from the search text
@ -133,7 +133,7 @@ void CModuleResultView::setupTree( ListCSwordModuleInfo modules, const TQString&
// first find the first space after "strong:"
// this should indicate a change in search token
sstIndex = sstIndex + 7;
sTokenIndex = searchedText.tqfind(" ", sstIndex);
sTokenIndex = searchedText.find(" ", sstIndex);
sNumber = searchedText.mid(sstIndex, sTokenIndex - sstIndex);
setupStrongsResults((*it), item, sNumber);

@ -190,7 +190,7 @@ void CRangeChooserDialog::parseRange() {
//hack: repair range to work with Sword 1.5.6
TQString range( m_rangeEdit->text() );
range.tqreplace(TQRegExp("\\s{0,}-\\s{0,}"), "-" );
range.replace(TQRegExp("\\s{0,}-\\s{0,}"), "-" );
sword::VerseKey key;
sword::ListKey verses = key.ParseVerseList((const char*)range.utf8(), "Genesis 1:1", true);
@ -207,7 +207,7 @@ void CRangeChooserDialog::rangeChanged() {
) {
TQString range( m_rangeEdit->text() );
//hack: repair range to work with Sword 1.5.6
range.tqreplace(TQRegExp("\\s{0,}-\\s{0,}"), "-" );
range.replace(TQRegExp("\\s{0,}-\\s{0,}"), "-" );
i->setRange(range);
};
}

@ -161,7 +161,7 @@ void CSearchAnalysis::analyse(ListCSwordModuleInfo modules) {
ListCSwordModuleInfo::iterator end_it = m_moduleList.end();
for (ListCSwordModuleInfo::iterator it(m_moduleList.begin()); it != end_it; ++it) {
KApplication::kApplication()->tqprocessEvents( 10 ); //10 ms only
if (!m_lastPosList.tqcontains(*it)) {
if (!m_lastPosList.contains(*it)) {
m_lastPosList.insert(*it,0);
}
@ -281,7 +281,7 @@ const unsigned int CSearchAnalysis::getCount( const TQString book, CSwordModuleI
i++;
++count;
}
m_lastPosList.tqcontains(module) ? m_lastPosList.tqreplace(module,i) : m_lastPosList.insert(module,i);
m_lastPosList.contains(module) ? m_lastPosList.replace(module,i) : m_lastPosList.insert(module,i);
return count;
}
@ -453,7 +453,7 @@ void CSearchAnalysisView::ToolTip::maybeTip(const TQPoint& p) {
TQPoint p2 = view->viewport()->mapTo(view, view->contentsToViewport(i->rect().bottomRight()));
p2.setY(view->height());
TQRect r = TQRect( p1, p2 );
if (r.tqcontains(p))
if (r.contains(p))
tip(r, text);
}
@ -535,7 +535,7 @@ void CSearchAnalysis::saveAsHTML() {
key.key("Genesis 1:1");
CSearchAnalysisItem* analysisItem = m_canvasItemList.tqfind( key.book() );
CSearchAnalysisItem* analysisItem = m_canvasItemList.find( key.book() );
TQString text = "<html>\n<head>\n<title>" + i18n("BibleTime Search Analysis") + "</title>\n" + txtCSS + metaEncoding + "</head>\n<body>\n";
text += "<table>\n<tr><th>" + i18n("Search text :") + "</th><th>" + CSearchDialog::getSearchDialog()->searchText() + "</th></tr>\n";
@ -560,7 +560,7 @@ void CSearchAnalysis::saveAsHTML() {
bool ok = true;
while (ok) {
m_searchAnalysisHTML += TQString("<tr><td>") + key.book() + TQString("</td>");
analysisItem = m_canvasItemList.tqfind( key.book() );
analysisItem = m_canvasItemList.find( key.book() );
// for (moduleIndex = 0, m_moduleList.first(); m_moduleList.current(); m_moduleList.next(), ++moduleIndex) {
moduleIndex = 0;

@ -121,25 +121,25 @@ TQString StrongsResultClass::getStrongsNumberText(const TQString& verseContent,
const bool cs = false;
if (*startIndex == 0) {
index = verseContent.tqfind("<body", 0);
index = verseContent.find("<body", 0);
}
else {
index = *startIndex;
}
// find all the "lemma=" inside the the content
while((index = verseContent.tqfind("lemma=", index, cs)) != -1) {
while((index = verseContent.find("lemma=", index, cs)) != -1) {
// get the strongs number after the lemma and compare it with the
// strongs number we are looking for
idx1 = verseContent.tqfind("\"", index) + 1;
idx2 = verseContent.tqfind("\"", idx1 + 1);
idx1 = verseContent.find("\"", index) + 1;
idx2 = verseContent.find("\"", idx1 + 1);
sNumber = verseContent.mid(idx1, idx2 - idx1);
if (sNumber == lemmaText) {
// strongs number is found now we need to get the text of this node
// search right until the ">" is found. Get the text from here to
// the next "<".
index = verseContent.tqfind(">", index, cs) + 1;
idx2 = verseContent.tqfind("<", index, cs);
index = verseContent.find(">", index, cs) + 1;
idx2 = verseContent.find("<", index, cs);
strongsText = verseContent.mid(index, idx2 - index);
index = idx2;
*startIndex = index;
@ -413,12 +413,12 @@ TQStringList CSearchResultPage::QueryParser(const TQString& queryString) {
}
// if the token contains a ^ then trim the remainder of the
// token from the ^
else if ( (pos = (*it).tqcontains("^")) >= 0 ) {
else if ( (pos = (*it).contains("^")) >= 0 ) {
(*it) = (*it).left(pos - 1);
}
// if the token contains a ~ then trim the remainder of the
// token from the ~
else if ( (pos = (*it).tqcontains("~")) >= 0 ) {
else if ( (pos = (*it).contains("~")) >= 0 ) {
(*it) = (*it).left(pos - 2) + "*";
}
}
@ -432,7 +432,7 @@ const TQString CSearchResultPage::highlightSearchedText(const TQString& content,
const bool cs = false;
// int index = 0;
int index = ret.tqfind("<body", 0);
int index = ret.find("<body", 0);
int matchLen = 0;
int length = searchedText.length();
@ -449,7 +449,7 @@ const TQString CSearchResultPage::highlightSearchedText(const TQString& content,
//---------------------------------------------------------------------
// search the searched text for "strong:" until it is not found anymore
sstIndex = 0;
while ((sstIndex = newSearchText.tqfind("strong:", sstIndex)) != -1) {
while ((sstIndex = newSearchText.find("strong:", sstIndex)) != -1) {
int idx1, idx2, sTokenIndex, sTokenIndex2;
TQString sNumber, lemmaText;
const TQString rep3("style=\"background-color:#FFFF66;\" ");
@ -461,8 +461,8 @@ const TQString CSearchResultPage::highlightSearchedText(const TQString& content,
// first find the first space after "strong:"
// this should indicate a change in search token
sstIndex = sstIndex + 7;
sTokenIndex = newSearchText.tqfind(" ", sstIndex);
sTokenIndex2 = newSearchText.tqfind("|", sstIndex);
sTokenIndex = newSearchText.find(" ", sstIndex);
sTokenIndex2 = newSearchText.find("|", sstIndex);
if ((sTokenIndex2 != -1) && (sTokenIndex2 < sTokenIndex)) {
sNumber = newSearchText.mid(sstIndex, sTokenIndex2 - sstIndex);
}
@ -471,13 +471,13 @@ const TQString CSearchResultPage::highlightSearchedText(const TQString& content,
}
// remove this strong entry
sstIndex -= 7;
newSearchText.tqreplace(sstIndex, sTokenIndex - sstIndex, "");
newSearchText.replace(sstIndex, sTokenIndex - sstIndex, "");
// find all the "lemma=" inside the the content
while((strongIndex = ret.tqfind("lemma=", strongIndex, cs)) != -1) {
while((strongIndex = ret.find("lemma=", strongIndex, cs)) != -1) {
// get the strongs number after the lemma and compare it with the
// strongs number we are looking for
idx1 = ret.tqfind("\"", strongIndex) + 1;
idx2 = ret.tqfind("\"", idx1 + 1);
idx1 = ret.find("\"", strongIndex) + 1;
idx2 = ret.find("\"", idx1 + 1);
lemmaText = ret.mid(idx1, idx2 - idx1);
if (lemmaText == sNumber) {
// strongs number is found now we need to highlight it
@ -521,9 +521,9 @@ const TQString CSearchResultPage::highlightSearchedText(const TQString& content,
for ( int wi = 0; (unsigned int)wi < words.count(); ++wi ) { //search for every word in the list
TQRegExp findExp;
TQString word = words[ wi ];
if (word.tqcontains("*")) {
if (word.contains("*")) {
length = word.length() - 1;
word.tqreplace('*', "\\S*"); //match within a word
word.replace('*', "\\S*"); //match within a word
findExp = TQRegExp(word);
findExp.setMinimal(TRUE);
}
@ -533,9 +533,9 @@ const TQString CSearchResultPage::highlightSearchedText(const TQString& content,
}
// index = 0; //for every word start at the beginning
index = ret.tqfind("<body", 0);
index = ret.find("<body", 0);
findExp.setCaseSensitive(cs);
//while ( (index = ret.tqfind(findExp, index)) != -1 ) { //while we found the word
//while ( (index = ret.find(findExp, index)) != -1 ) { //while we found the word
while ( (index = findExp.search(ret, index)) != -1 ) { //while we found the word
matchLen = findExp.matchedLength();
if (!CToolClass::inHTMLTag(index, ret)) {
@ -658,7 +658,7 @@ void CSearchOptionsPage::setModules( ListCSwordModuleInfo modules ) {
continue;
}
if ( !m_modules.tqcontains(*it) ) {
if ( !m_modules.contains(*it) ) {
m_modules.append( *it );
t.append( (*it)->name() );
if (*it != modules.last()) {

@ -78,7 +78,7 @@ public:
return keyNameList.count();
}
void addKeyName(const TQString& keyName) {
if (keyNameList.tqfindIndex(keyName) == -1)
if (keyNameList.findIndex(keyName) == -1)
keyNameList.append(keyName);
}
TQStringList* getKeyList() {

@ -57,7 +57,7 @@ CSortListViewItem::~CSortListViewItem() {
int CSortListViewItem::compare( TQListViewItem* i, int col, bool ascending ) const {
int ret = 0;
if ( !columnSorting.tqcontains(col) ) {
if ( !columnSorting.contains(col) ) {
return KListViewItem::compare(i, col, ascending);
}

@ -79,14 +79,14 @@ namespace CResMgr {
namespace search {
TQString tooltip;
const TQString icon = "tqfind";
const TQString icon = "find";
const KShortcut accel = TQt::CTRL + TQt::Key_O;
const char* actionName = "mainindex_search_action";
}
namespace searchdefaultbible {
TQString tooltip;
const TQString icon = "tqfind";
const TQString icon = "find";
const KShortcut accel = TQt::CTRL + TQt::ALT + TQt::Key_F;
const char* actionName = "mainindex_searchdefaultbible_action";
}
@ -248,7 +248,7 @@ namespace CResMgr {
} //end of main menu
namespace searchdialog {
const TQString icon = "tqfind";
const TQString icon = "find";
namespace searchButton {
TQString tooltip;
@ -379,7 +379,7 @@ namespace CResMgr {
namespace search {
TQString tooltip;
const TQString icon = "tqfind";
const TQString icon = "find";
const KShortcut accel = TQt::CTRL + TQt::Key_L;
const char* actionName = "window_search_action";
}
@ -668,7 +668,7 @@ namespace CResMgr {
namespace search {
TQString tooltip;
const TQString icon = "tqfind";
const TQString icon = "find";
const KShortcut accel = TQt::CTRL + TQt::ALT + TQt::Key_M;
const char* actionName = "GMsearch_action";
}

@ -47,22 +47,22 @@ TQString CToolClass::locatehtml(const TQString &filename) {
TQString CToolClass::htmlToText(const TQString& html) {
TQString newText = html;
// convert some tags we need in code
newText.tqreplace( TQRegExp(" "),"#SPACE#" );
newText.tqreplace( TQRegExp("<br/?>\\s*"), "<br/>\n" );
newText.tqreplace( TQRegExp("#SPACE#")," " );
newText.replace( TQRegExp(" "),"#SPACE#" );
newText.replace( TQRegExp("<br/?>\\s*"), "<br/>\n" );
newText.replace( TQRegExp("#SPACE#")," " );
TQRegExp re("<.+>");
re.setMinimal(true);
newText.tqreplace( re,"" );
newText.replace( re,"" );
return newText;
}
/** Converts text to HTML (\n to <BR>) */
TQString CToolClass::textToHTML(const TQString& text) {
TQString newText = text;
newText.tqreplace( TQRegExp("<BR>\n"),"#NEWLINE#" );
newText.tqreplace( TQRegExp("\n"),"<BR>\n" );
newText.tqreplace( TQRegExp("#NEWLINE#"),"<BR>\n");
newText.replace( TQRegExp("<BR>\n"),"#NEWLINE#" );
newText.replace( TQRegExp("\n"),"<BR>\n" );
newText.replace( TQRegExp("#NEWLINE#"),"<BR>\n");
return newText;
}
@ -169,10 +169,10 @@ TQLabel* CToolClass::explanationLabel(TQWidget* tqparent, const TQString& headin
/** No descriptions */
bool CToolClass::inHTMLTag(int pos, TQString & text) {
int i1=text.tqfindRev("<",pos);
int i2=text.tqfindRev(">",pos);
int i3=text.tqfind(">",pos);
int i4=text.tqfind("<",pos);
int i1=text.findRev("<",pos);
int i2=text.findRev(">",pos);
int i3=text.find(">",pos);
int i4=text.find("<",pos);
// if ((i1>0) && (i2==-1)) //we're in th first html tag

Carregando…
Cancelar
Salvar