rename the following methods:

tqfind find
tqreplace replace
tqcontains contains


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1246075 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 14 years ago
parent 341ad02235
commit 9a3f0aacd4

@ -137,7 +137,7 @@ bool BackTrace::usefulBacktrace()
{
// remove crap
if( !m_krashconf->removeFromBacktraceRegExp().isEmpty())
m_strBt.tqreplace(TQRegExp( m_krashconf->removeFromBacktraceRegExp()), TQString());
m_strBt.replace(TQRegExp( m_krashconf->removeFromBacktraceRegExp()), TQString());
if( m_krashconf->disableChecks())
return true;
@ -146,16 +146,16 @@ bool BackTrace::usefulBacktrace()
// how many " ?? " in the bt ?
int unknown = 0;
if( !m_krashconf->invalidStackFrameRegExp().isEmpty())
unknown = strBt.tqcontains( TQRegExp( m_krashconf->invalidStackFrameRegExp()));
unknown = strBt.contains( TQRegExp( m_krashconf->invalidStackFrameRegExp()));
// how many stack frames in the bt ?
int frames = 0;
if( !m_krashconf->frameRegExp().isEmpty())
frames = strBt.tqcontains( TQRegExp( m_krashconf->frameRegExp()));
frames = strBt.contains( TQRegExp( m_krashconf->frameRegExp()));
else
frames = strBt.tqcontains('\n');
frames = strBt.contains('\n');
bool tooShort = false;
if( !m_krashconf->neededInValidBacktraceRegExp().isEmpty())
tooShort = ( strBt.tqfind( TQRegExp( m_krashconf->neededInValidBacktraceRegExp())) == -1 );
tooShort = ( strBt.find( TQRegExp( m_krashconf->neededInValidBacktraceRegExp())) == -1 );
return !m_strBt.isNull() && !tooShort && (unknown < frames);
}

@ -110,8 +110,8 @@ void KrashDebugger :: slotSave()
else
{
TQString defname = m_krashconf->execName() + TQString::tqfromLatin1( ".kcrash" );
if( defname.tqcontains( '/' ))
defname = defname.mid( defname.tqfindRev( '/' ) + 1 );
if( defname.contains( '/' ))
defname = defname.mid( defname.findRev( '/' ) + 1 );
TQString filename = KFileDialog::getSaveFileName(defname, TQString::null, this, i18n("Select Filename"));
if (!filename.isEmpty())
{

@ -61,13 +61,13 @@ bool scanDesktopFile( TQPtrList<AppLnkCache> &appCache, const TQString &templ,
// find out the name of the file to store
destName = templ;
int pos = templ.tqfind( "kappfinder/apps/" );
int pos = templ.find( "kappfinder/apps/" );
if ( pos > 0 )
destName = destName.mid( pos + strlen( "kappfinder/apps/" ) );
// calculate real dir and filename
destName = destDir + destName;
pos = destName.tqfindRev( '/' );
pos = destName.findRev( '/' );
if ( pos > 0 ) {
destDir = destName.left( pos );
destName = destName.mid( pos + 1 );
@ -77,7 +77,7 @@ bool scanDesktopFile( TQPtrList<AppLnkCache> &appCache, const TQString &templ,
TQString exec = desktop.readPathEntry( "TryExec" );
if ( exec.isEmpty() )
exec = desktop.readPathEntry( "Exec" );
pos = exec.tqfind( ' ' );
pos = exec.find( ' ' );
if ( pos > 0 )
exec = exec.left( pos );
@ -117,7 +117,7 @@ void createDesktopFiles( TQPtrList<AppLnkCache> &appCache, int &added )
destDir += "/";
TQDir d;
int pos = -1;
while ( ( pos = destDir.tqfind( '/', pos + 1 ) ) >= 0 ) {
while ( ( pos = destDir.find( '/', pos + 1 ) ) >= 0 ) {
TQString path = destDir.left( pos + 1 );
d = path;
if ( !d.exists() )
@ -144,7 +144,7 @@ void decorateDirs( TQString destDir )
for ( it = dirs.begin(); it != dirs.end(); ++it ) {
// find out the name of the file to store
TQString destName = *it;
int pos = destName.tqfind( "kappfinder/apps/" );
int pos = destName.find( "kappfinder/apps/" );
if ( pos > 0 )
destName = destName.mid( pos + strlen( "kappfinder/apps/" ) );

@ -100,7 +100,7 @@ TopLevel::TopLevel( const TQString &destDir, TQWidget *parent, const char *name
adjustSize();
mDestDir = destDir;
mDestDir = mDestDir.tqreplace( TQRegExp( "^~/" ), TQDir::homeDirPath() + "/" );
mDestDir = mDestDir.replace( TQRegExp( "^~/" ), TQDir::homeDirPath() + "/" );
KStartupInfo::appStarted();
@ -183,9 +183,9 @@ void TopLevel::slotScan()
mProgress->setProgress( mProgress->progress() + 1 );
TQString desktopName = *it;
int i = desktopName.tqfindRev('/');
int i = desktopName.findRev('/');
desktopName = desktopName.mid(i+1);
i = desktopName.tqfindRev('.');
i = desktopName.findRev('.');
if (i != -1)
desktopName = desktopName.left(i);
@ -207,9 +207,9 @@ void TopLevel::slotScan()
// copy over the desktop file, if exists
if ( scanDesktopFile( mAppCache, *it, mDestDir ) ) {
TQString relPath = *it;
int pos = relPath.tqfind( "kappfinder/apps/" );
int pos = relPath.find( "kappfinder/apps/" );
relPath = relPath.mid( pos + strlen( "kappfinder/apps/" ) );
relPath = relPath.left( relPath.tqfindRev( '/' ) + 1 );
relPath = relPath.left( relPath.findRev( '/' ) + 1 );
TQStringList dirList = TQStringList::split( '/', relPath );
TQListViewItem *dirItem = 0;

@ -375,7 +375,7 @@ KateMainWindow *KateApp::activeMainWindow ()
if (m_mainWindows.isEmpty())
return 0;
int n = m_mainWindows.tqfindIndex ((KateMainWindow *)activeWindow());
int n = m_mainWindows.findIndex ((KateMainWindow *)activeWindow());
if (n < 0)
n=0;

@ -194,7 +194,7 @@ const KateDocumentInfo *KateDocManager::documentInfo (Kate::Document *doc)
int KateDocManager::findDocument (Kate::Document *doc)
{
return m_docList.tqfind (doc);
return m_docList.find (doc);
}
uint KateDocManager::documents ()
@ -306,7 +306,7 @@ bool KateDocManager::closeDocument(class Kate::Document *doc,bool closeURL)
KateApp::self()->mainWindow(i)->viewManager()->closeViews(documentNumber);
}
if ( closeURL && m_tempFiles.tqcontains( documentNumber ) )
if ( closeURL && m_tempFiles.contains( documentNumber ) )
{
TQFileInfo fi( m_tempFiles[ documentNumber ].first.path() );
if ( fi.lastModified() <= m_tempFiles[ documentNumber ].second /*||

@ -127,7 +127,7 @@ bool KateExternalTool::checkExec()
bool KateExternalTool::valid( const TQString &mt ) const
{
return mimetypes.isEmpty() || mimetypes.tqcontains( mt );
return mimetypes.isEmpty() || mimetypes.contains( mt );
}
//END KateExternalTool
@ -330,8 +330,8 @@ void KateExternalToolsMenuAction::reload()
bool sepadded = false;
for (TQStringList::iterator itg = dtools.begin(); itg != dtools.end(); ++itg )
{
if ( ! tools.tqcontains( *itg ) &&
! removed.tqcontains( *itg ) )
if ( ! tools.contains( *itg ) &&
! removed.contains( *itg ) )
{
if ( ! sepadded )
{
@ -394,7 +394,7 @@ void KateExternalToolsMenuAction::slotDocumentChanged()
if ( action )
{
l = action->tool->mimetypes;
b = ( ! l.count() || l.tqcontains( mt ) );
b = ( ! l.count() || l.contains( mt ) );
action->setEnabled( b );
}
}
@ -745,7 +745,7 @@ void KateExternalToolsConfigWidget::slotNew()
// This is sticky, it does not change again, so that shortcuts sticks
// TODO check for dups
t->acname = "externaltool_" + TQString(t->name).tqreplace( TQRegExp("\\W+"), "" );
t->acname = "externaltool_" + TQString(t->name).replace( TQRegExp("\\W+"), "" );
new ToolItem ( lbTools, t->icon.isEmpty() ? blankIcon() : SmallIcon( t->icon ), t );

@ -692,13 +692,13 @@ void KFSConfigPage::init()
KAction *ac;
TQListBox *lb;
for ( TQStringList::Iterator it=allActions.begin(); it != allActions.end(); ++it ) {
lb = l.tqcontains( *it ) ? acSel->selectedListBox() : acSel->availableListBox();
lb = l.contains( *it ) ? acSel->selectedListBox() : acSel->availableListBox();
if ( *it == "bookmarks" || *it == "sync_dir" )
ac = fileSelector->actionCollection()->action( (*it).latin1() );
else
ac = fileSelector->dirOperator()->actionCollection()->action( (*it).latin1() );
if ( ac )
new ActionLBItem( lb, SmallIcon( ac->icon() ), ac->text().tqreplace( re, "" ), *it );
new ActionLBItem( lb, SmallIcon( ac->icon() ), ac->text().replace( re, "" ), *it );
}
// sync

@ -286,11 +286,11 @@ void GrepTool::itemSelected(const TQString& item)
TQString filename, linenumber;
TQString str = item;
if ( (pos = str.tqfind(':')) != -1)
if ( (pos = str.find(':')) != -1)
{
filename = str.left(pos);
str = str.mid(pos+1);
if ( (pos = str.tqfind(':')) != -1)
if ( (pos = str.find(':')) != -1)
{
filename = m_workingDir + TQDir::separator() + filename;
linenumber = str.left(pos);
@ -302,7 +302,7 @@ void GrepTool::itemSelected(const TQString& item)
void GrepTool::processOutput()
{
int pos;
while ( (pos = buf.tqfind('\n')) != -1)
while ( (pos = buf.find('\n')) != -1)
{
TQString item = buf.mid(2,pos-2);
if (!item.isEmpty())
@ -329,7 +329,7 @@ void GrepTool::slotSearch()
return;
}
if ( ! leTemplate->text().tqcontains("%s") )
if ( ! leTemplate->text().contains("%s") )
{
leTemplate->setFocus();
return;
@ -347,9 +347,9 @@ void GrepTool::slotSearch()
TQString s = cmbPattern->currentText();
if ( ! cbRegex->isChecked() )
s.tqreplace( TQRegExp( "([^\\w'()<>])" ), "\\\\1" );
s.replace( TQRegExp( "([^\\w'()<>])" ), "\\\\1" );
TQString pattern = leTemplate->text();
pattern.tqreplace( "%s", s );
pattern.replace( "%s", s );
childproc = new KProcess();
childproc->setWorkingDirectory( m_workingDir );

@ -340,7 +340,7 @@ ToolView *Sidebar::addWidget (const TQPixmap &icon, const TQString &text, ToolVi
bool Sidebar::removeWidget (ToolView *widget)
{
if (!m_widgetToId.tqcontains(widget))
if (!m_widgetToId.contains(widget))
return false;
removeTab(m_widgetToId[widget]);
@ -370,7 +370,7 @@ bool Sidebar::removeWidget (ToolView *widget)
bool Sidebar::showWidget (ToolView *widget)
{
if (!m_widgetToId.tqcontains(widget))
if (!m_widgetToId.contains(widget))
return false;
// hide other non-persistent views
@ -395,7 +395,7 @@ bool Sidebar::showWidget (ToolView *widget)
bool Sidebar::hideWidget (ToolView *widget)
{
if (!m_widgetToId.tqcontains(widget))
if (!m_widgetToId.contains(widget))
return false;
bool anyVis = false;

@ -215,7 +215,7 @@ void KateViewManager::slotCloseTab()
if (m_viewSpaceContainerList.count() <= 1) return;
if (!m_currentContainer) return;
int pos = m_viewSpaceContainerList.tqfind (m_currentContainer);
int pos = m_viewSpaceContainerList.find (m_currentContainer);
if (pos == -1)
return;

@ -275,7 +275,7 @@ void KateViewSpaceContainer::activateView ( Kate::View *view )
}
setActiveView (view);
m_viewList.tqfindRef (view);
m_viewList.findRef (view);
mainWindow()->toolBar ()->tqsetUpdatesEnabled (false);
@ -337,7 +337,7 @@ void KateViewSpaceContainer::slotViewChanged()
void KateViewSpaceContainer::activateNextView()
{
uint i = m_viewSpaceList.tqfind (activeViewSpace())+1;
uint i = m_viewSpaceList.find (activeViewSpace())+1;
if (i >= m_viewSpaceList.count())
i=0;
@ -348,7 +348,7 @@ void KateViewSpaceContainer::activateNextView()
void KateViewSpaceContainer::activatePrevView()
{
int i = m_viewSpaceList.tqfind (activeViewSpace())-1;
int i = m_viewSpaceList.find (activeViewSpace())-1;
if (i < 0)
i=m_viewSpaceList.count()-1;
@ -521,7 +521,7 @@ void KateViewSpaceContainer::removeViewSpace (KateViewSpace *viewspace)
// Figure out where to put views that are still needed
KateViewSpace* next;
if (m_viewSpaceList.tqfind(viewspace) == 0)
if (m_viewSpaceList.find(viewspace) == 0)
next = m_viewSpaceList.next();
else
next = m_viewSpaceList.prev();
@ -684,12 +684,12 @@ void KateViewSpaceContainer::saveSplitterConfig( KateMDI::Splitter* s, int idx,
TQString n; // name for child list, see below
// For KateViewSpaces, ask them to save the file list.
if ( obj->isA("KateViewSpace") ) {
n = TQString(viewConfGrp+"-ViewSpace %1").arg( m_viewSpaceList.tqfind((KateViewSpace*)obj) );
((KateViewSpace*)obj)->saveConfig ( config, m_viewSpaceList.tqfind((KateViewSpace*)obj), viewConfGrp);
n = TQString(viewConfGrp+"-ViewSpace %1").arg( m_viewSpaceList.find((KateViewSpace*)obj) );
((KateViewSpace*)obj)->saveConfig ( config, m_viewSpaceList.find((KateViewSpace*)obj), viewConfGrp);
// save active viewspace
if ( ((KateViewSpace*)obj)->isActiveSpace() ) {
config->setGroup(viewConfGrp);
config->writeEntry("Active Viewspace", m_viewSpaceList.tqfind((KateViewSpace*)obj) );
config->writeEntry("Active Viewspace", m_viewSpaceList.find((KateViewSpace*)obj) );
}
}
// For KateSplitters, recurse

@ -458,7 +458,7 @@ void KWrite::readProperties(KConfig *config)
void KWrite::saveProperties(KConfig *config)
{
writeConfig(config);
config->writeEntry("DocumentNumber",docList.tqfind(m_view->document()) + 1);
config->writeEntry("DocumentNumber",docList.find(m_view->document()) + 1);
if (KTextEditor::sessionConfigInterface(m_view))
KTextEditor::sessionConfigInterface(m_view)->writeSessionConfig(config);
@ -485,7 +485,7 @@ void KWrite::saveGlobalProperties(KConfig *config) //save documents
TQString buf = TQString("Window %1").arg(z);
config->setGroup(buf);
config->writeEntry("DocumentNumber",docList.tqfind(winList.tqat(z-1)->view()->document()) + 1);
config->writeEntry("DocumentNumber",docList.find(winList.tqat(z-1)->view()->document()) + 1);
}
}

@ -113,10 +113,10 @@ void KCMInit::runModules( int phase )
TQString libName = TQString("kcm_%1").arg(library);
// try to load the library
if (! alreadyInitialized.tqcontains( libName.ascii() )) {
if (! alreadyInitialized.contains( libName.ascii() )) {
if (!runModule(libName, service)) {
libName = TQString("libkcm_%1").arg(library);
if (! alreadyInitialized.tqcontains( libName.ascii() )) {
if (! alreadyInitialized.contains( libName.ascii() )) {
runModule(libName, service);
alreadyInitialized.append( libName.ascii() );
}

@ -240,7 +240,7 @@ void BGAdvancedDialog::updateUI()
void BGAdvancedDialog::removeProgram(const TQString &name)
{
if (m_programItems.tqfind(name))
if (m_programItems.find(name))
{
delete m_programItems[name];
m_programItems.remove(name);
@ -265,7 +265,7 @@ void BGAdvancedDialog::addProgram(const TQString &name)
void BGAdvancedDialog::selectProgram(const TQString &name)
{
if (m_programItems.tqfind(name))
if (m_programItems.find(name))
{
TQListViewItem *item = m_programItems[name];
dlg->m_listPrograms->ensureItemVisible(item);

@ -510,7 +510,7 @@ void BGDialog::loadWallpaperFilesList() {
KSimpleConfig fileConfig(*it);
fileConfig.setGroup("Wallpaper");
int slash = (*it).tqfindRev('/') + 1;
int slash = (*it).findRev('/') + 1;
TQString directory = (*it).left(slash);
TQString imageCaption = fileConfig.readEntry("Name");
@ -524,14 +524,14 @@ void BGDialog::loadWallpaperFilesList() {
if (imageCaption.isEmpty())
{
imageCaption = fileName;
imageCaption.tqreplace('_', ' ');
imageCaption.replace('_', ' ');
imageCaption = KStringHandler::capwords(imageCaption);
}
// avoid name collisions
TQString rs = imageCaption;
TQString lrs = rs.lower();
for (int n = 1; papers.tqfind(lrs) != papers.end(); ++n)
for (int n = 1; papers.find(lrs) != papers.end(); ++n)
{
rs = imageCaption + " (" + TQString::number(n) + ')';
lrs = rs.lower();
@ -562,8 +562,8 @@ void BGDialog::loadWallpaperFilesList() {
if (imageCaption.isEmpty())
{
int slash = (*it).tqfindRev('/') + 1;
int endDot = (*it).tqfindRev('.');
int slash = (*it).findRev('/') + 1;
int endDot = (*it).findRev('.');
// strip the extension if it exists
if (endDot != -1 && endDot > slash)
@ -571,14 +571,14 @@ void BGDialog::loadWallpaperFilesList() {
else
imageCaption = (*it).mid(slash);
imageCaption.tqreplace('_', ' ');
imageCaption.replace('_', ' ');
imageCaption = KStringHandler::capwords(imageCaption);
}
// avoid name collisions
TQString rs = imageCaption;
TQString lrs = rs.lower();
for (int n = 1; papers.tqfind(lrs) != papers.end(); ++n)
for (int n = 1; papers.find(lrs) != papers.end(); ++n)
{
rs = imageCaption + " (" + TQString::number(n) + ')';
lrs = rs.lower();
@ -606,12 +606,12 @@ void BGDialog::setWallpaper(const TQString &s)
KComboBox *comboWallpaper = m_urlWallpaperBox;
comboWallpaper->blockSignals(true);
if (m_wallpaper.tqfind(s) == m_wallpaper.end())
if (m_wallpaper.find(s) == m_wallpaper.end())
{
int i = comboWallpaper->count();
TQString imageCaption;
int slash = s.tqfindRev('/') + 1;
int endDot = s.tqfindRev('.');
int slash = s.findRev('/') + 1;
int endDot = s.findRev('.');
// strip the extension if it exists
if (endDot != -1 && endDot > slash)
@ -750,7 +750,7 @@ void BGDialog::updateUI()
case KBackgroundSettings::Pattern:
{
int i = m_patterns.tqfindIndex(r->KBackgroundPattern::name());
int i = m_patterns.findIndex(r->KBackgroundPattern::name());
if (i >= 0)
m_comboPattern->setCurrentItem(NR_PREDEF_PATTERNS+i);
else

@ -124,7 +124,7 @@ TQString KBackgroundRenderer::buildCommand()
if (cmd.isEmpty())
return TQString();
while ((pos = cmd.tqfind('%', pos)) != -1) {
while ((pos = cmd.find('%', pos)) != -1) {
if (pos == (int) (cmd.length() - 1))
break;
@ -132,24 +132,24 @@ TQString KBackgroundRenderer::buildCommand()
switch (cmd.tqat(pos+1).latin1()) {
case 'f':
createTempFile();
cmd.tqreplace(pos, 2, KShellProcess::quote(m_Tempfile->name()));
cmd.replace(pos, 2, KShellProcess::quote(m_Tempfile->name()));
pos += m_Tempfile->name().length() - 2;
break;
case 'x':
num.setNum(m_Size.width());
cmd.tqreplace(pos, 2, num);
cmd.replace(pos, 2, num);
pos += num.length() - 2;
break;
case 'y':
num.setNum(m_Size.height());
cmd.tqreplace(pos, 2, num);
cmd.replace(pos, 2, num);
pos += num.length() - 2;
break;
case '%':
cmd.tqreplace(pos, 2, "%");
cmd.replace(pos, 2, "%");
pos--;
break;
default:
@ -584,7 +584,7 @@ void KBackgroundRenderer::fastWallpaperBlend()
m_Pixmap.convertFromImage( m_Wallpaper );
return;
}
else if( m_WallpaperRect.tqcontains( TQRect( TQPoint( 0, 0 ), m_Size ))
else if( m_WallpaperRect.contains( TQRect( TQPoint( 0, 0 ), m_Size ))
&& !m_Wallpaper.hasAlphaBuffer()) // wallpaper covers all and no blending
m_Pixmap = TQPixmap( m_Size );
else if (m_Background.size() == m_Size)
@ -1251,7 +1251,7 @@ void KVirtualBGRenderer::screenDone(int _desk, int _screen)
Q_UNUSED(_screen);
const KBackgroundRenderer * sender = dynamic_cast<const KBackgroundRenderer*>(this->sender());
int screen = m_renderer.tqfind(sender);
int screen = m_renderer.find(sender);
if (screen == -1)
//??
return;

@ -122,7 +122,7 @@ void KBackgroundPattern::readSettings()
m_Pattern = m_pConfig->readPathEntry("File");
m_Comment = m_pConfig->readEntry("Comment");
if (m_Comment.isEmpty())
m_Comment = m_File.mid(m_File.tqfindRev('/')+1);
m_Comment = m_File.mid(m_File.findRev('/')+1);
}
@ -190,10 +190,10 @@ TQStringList KBackgroundPattern::list()
TQStringList::Iterator it;
for (it=lst.begin(); it!=lst.end(); ++it) {
// Strip path and suffix
int pos = (*it).tqfindRev('/');
int pos = (*it).findRev('/');
if (pos != -1)
(*it) = (*it).mid(pos+1);
pos = (*it).tqfindRev('.');
pos = (*it).findRev('.');
if (pos != -1)
(*it) = (*it).left(pos);
}
@ -401,10 +401,10 @@ TQStringList KBackgroundProgram::list()
TQStringList::Iterator it;
for (it=lst.begin(); it!=lst.end(); ++it) {
// Strip path and suffix
int pos = (*it).tqfindRev('/');
int pos = (*it).findRev('/');
if (pos != -1)
(*it) = (*it).mid(pos+1);
pos = (*it).tqfindRev('.');
pos = (*it).findRev('.');
if (pos != -1)
(*it) = (*it).left(pos);
}
@ -665,7 +665,7 @@ void KBackgroundSettings::setWallpaperList(TQStringList list)
}
updateWallpaperFiles();
// Try to keep the current wallpaper (-1 to set position to one before it)
m_CurrentWallpaper = m_WallpaperFiles.tqfindIndex(m_CurrentWallpaperName) - 1;
m_CurrentWallpaper = m_WallpaperFiles.findIndex(m_CurrentWallpaperName) - 1;
changeWallpaper(m_CurrentWallpaper < 0);
}
@ -751,7 +751,7 @@ void KBackgroundSettings::readSettings(bool reparse)
m_BackgroundMode = defBackgroundMode;
s = m_pConfig->readEntry("BackgroundMode", "invalid");
if (m_BMMap.tqcontains(s)) {
if (m_BMMap.contains(s)) {
int mode = m_BMMap[s];
// consistency check
if ( ((mode != Pattern) && (mode != Program)) ||
@ -763,7 +763,7 @@ void KBackgroundSettings::readSettings(bool reparse)
m_BlendMode = defBlendMode;
s = m_pConfig->readEntry("BlendMode", "invalid");
if (m_BlMMap.tqcontains(s)) {
if (m_BlMMap.contains(s)) {
m_BlendMode = m_BlMMap[s];
}
@ -784,14 +784,14 @@ void KBackgroundSettings::readSettings(bool reparse)
m_MultiMode = defMultiMode;
s = m_pConfig->readEntry("MultiWallpaperMode");
if (m_MMMap.tqcontains(s)) {
if (m_MMMap.contains(s)) {
int mode = m_MMMap[s];
m_MultiMode = mode;
}
updateWallpaperFiles();
if( !m_CurrentWallpaperName.isEmpty())
m_CurrentWallpaper = m_WallpaperFiles.tqfindIndex(m_CurrentWallpaperName);
m_CurrentWallpaper = m_WallpaperFiles.findIndex(m_CurrentWallpaperName);
if(m_CurrentWallpaper < 0)
m_CurrentWallpaper = 0;
@ -799,7 +799,7 @@ void KBackgroundSettings::readSettings(bool reparse)
m_WallpaperMode = defWallpaperMode;
m_Wallpaper = m_pConfig->readPathEntry("Wallpaper");
s = m_pConfig->readEntry("WallpaperMode", "invalid");
if (m_WMMap.tqcontains(s)) {
if (m_WMMap.contains(s)) {
int mode = m_WMMap[s];
// consistency check.
if ((mode == NoWallpaper) || !m_Wallpaper.isEmpty() || (m_MultiMode == InOrder || m_MultiMode == Random))

@ -272,7 +272,7 @@ void Dtime::save()
list.append(timeServerList->currentText());
for ( int i=0; i<timeServerList->count();i++ ) {
TQString text = timeServerList->text(i);
if( list.tqfind(text) == list.end())
if( list.find(text) == list.end())
list.append(text);
// Limit so errors can go away and not stored forever
if( list.count() == 10)
@ -284,9 +284,9 @@ void Dtime::save()
if(setDateTimeAuto->isChecked() && !ntpUtility.isEmpty()){
// NTP Time setting
TQString timeServer = timeServerList->currentText();
if( timeServer.tqfind( TQRegExp(".*\\(.*\\)$") ) != -1 ) {
timeServer.tqreplace( TQRegExp(".*\\("), "" );
timeServer.tqreplace( TQRegExp("\\).*"), "" );
if( timeServer.find( TQRegExp(".*\\(.*\\)$") ) != -1 ) {
timeServer.replace( TQRegExp(".*\\("), "" );
timeServer.replace( TQRegExp("\\).*"), "" );
// Would this be better?: s/^.*\(([^)]*)\).*$/\1/
}
KProcess proc;

@ -113,7 +113,7 @@ void Tzone::save()
for (TQString line = is.readLine(); !line.isNull();
line = is.readLine())
{
if (line.tqfind("TZ=") == 0)
if (line.find("TZ=") == 0)
{
*ts << "TZ=" << selectedzone << endl;
found = true;

@ -444,7 +444,7 @@ void KColorScheme::slotSave( )
if (!entry) return;
sCurrentScheme = entry->path;
KSimpleConfig *config = new KSimpleConfig(sCurrentScheme );
int i = sCurrentScheme.tqfindRev('/');
int i = sCurrentScheme.findRev('/');
if (i >= 0)
sCurrentScheme = sCurrentScheme.mid(i+1);
@ -800,7 +800,7 @@ void KColorScheme::readScheme( int index )
sCurrentScheme = entry->path;
config = new KSimpleConfig(sCurrentScheme, true);
config->setGroup("Color Scheme");
int i = sCurrentScheme.tqfindRev('/');
int i = sCurrentScheme.findRev('/');
if (i >= 0)
sCurrentScheme = sCurrentScheme.mid(i+1);
}
@ -905,7 +905,7 @@ int KColorScheme::findSchemeByName(const TQString &scheme)
return 1;
TQString search = scheme;
int i = search.tqfindRev('/');
int i = search.findRev('/');
if (i >= 0)
search = search.mid(i+1);
@ -972,7 +972,7 @@ void KColorScheme::insertEntry(const TQString &sFile, const TQString &sName)
{
KColorSchemeEntry *newEntry = new KColorSchemeEntry(sFile, sName, true);
mSchemeList->inSort(newEntry);
int newIndex = mSchemeList->tqfindRef(newEntry)+nSysSchemes;
int newIndex = mSchemeList->findRef(newEntry)+nSysSchemes;
sList->insertItem(sName, newIndex);
sList->setCurrentItem(newIndex);
}

@ -64,7 +64,7 @@ void WidgetCanvas::paintEvent(TQPaintEvent *)
void WidgetCanvas::mousePressEvent( TQMouseEvent *me )
{
for ( int i = 0; i < MAX_HOTSPOTS; i++ )
if ( hotspots[i].rect.tqcontains( me->pos() ) ) {
if ( hotspots[i].rect.contains( me->pos() ) ) {
emit widgetSelected( hotspots[i].number );
return;
}
@ -73,7 +73,7 @@ void WidgetCanvas::mousePressEvent( TQMouseEvent *me )
void WidgetCanvas::mouseMoveEvent( TQMouseEvent *me )
{
for ( int i = 0; i < MAX_HOTSPOTS; i++ )
if ( hotspots[i].rect.tqcontains( me->pos() ) ) {
if ( hotspots[i].rect.contains( me->pos() ) ) {
if ( i != currentHotspot ) {
TQString tip = tips[hotspots[i].number];
TQToolTip::remove( this );
@ -91,7 +91,7 @@ void WidgetCanvas::dropEvent( TQDropEvent *e)
TQColor c;
if (KColorDrag::decode( e, c)) {
for ( int i = 0; i < MAX_HOTSPOTS; i++ )
if ( hotspots[i].rect.tqcontains( e->pos() ) ) {
if ( hotspots[i].rect.contains( e->pos() ) ) {
emit colorDropped( hotspots[i].number, c);
return;
}

@ -128,7 +128,7 @@ OtherCertItem::OtherCertItem( TQListView *view, const TQString& sub, const TQStr
m_module = module;
KSSLX509Map cert(sub);
setText(0, cert.getValue("O"));
setText(1, cert.getValue("CN").tqreplace("\n", ", "));
setText(1, cert.getValue("CN").replace("\n", ", "));
if (_exp.date().year() > 3000 || _exp.date().year() < 1900)
_exp.setDate(TQDate(3000,1,1));
@ -151,7 +151,7 @@ YourCertItem::YourCertItem( TQListView *view, TQString pkcs, TQString pass, TQSt
{
m_module = module;
KSSLX509Map cert(name);
TQString tmp = cert.getValue("CN").tqreplace("\n", ", ");
TQString tmp = cert.getValue("CN").replace("\n", ", ");
setText(0, tmp);
setText(1, cert.getValue("Email"));
_pkcs = pkcs;
@ -180,10 +180,10 @@ KSSLX509Map mcert(name);
TQString tmp;
setText(0, mcert.getValue("O"));
tmp = mcert.getValue("OU");
tmp.tqreplace("\n", ", ");
tmp.replace("\n", ", ");
setText(1, tmp);
tmp = mcert.getValue("CN");
tmp.tqreplace("\n", ", ");
tmp.replace("\n", ", ");
setText(2, tmp);
_name = name;
_cert = cert;
@ -1921,7 +1921,7 @@ void KCryptoConfig::slotCAImport() {
if (certStore) { KOSSL::self()->X509_STORE_free(certStore);
certStore = NULL; }
if (certtext.tqcontains("-----BEGIN CERTIFICATE-----")) {
if (certtext.contains("-----BEGIN CERTIFICATE-----")) {
qf.reset();
certtext = TQString();
while (!qf.atEnd()) {
@ -1929,10 +1929,10 @@ void KCryptoConfig::slotCAImport() {
qf.readLine(xx, qf.size());
certtext += xx;
}
certtext = certtext.tqreplace("-----BEGIN CERTIFICATE-----", TQString());
certtext = certtext.tqreplace("-----END CERTIFICATE-----", TQString());
certtext = certtext.replace("-----BEGIN CERTIFICATE-----", TQString());
certtext = certtext.replace("-----END CERTIFICATE-----", TQString());
certtext = certtext.stripWhiteSpace();
certtext = certtext.tqreplace("\n", TQString());
certtext = certtext.replace("\n", TQString());
} else {
// Must [could?] be DER
qf.close();
@ -2350,7 +2350,7 @@ SSL_CONST SSL_METHOD *meth;
break;
// Leak of sc*?
TQString scn(sc->name);
if (scn.tqcontains("ADH-") || scn.tqcontains("NULL-") || scn.tqcontains("DES-CBC3-SHA") || scn.tqcontains("FZA-")) {
if (scn.contains("ADH-") || scn.contains("NULL-") || scn.contains("DES-CBC3-SHA") || scn.contains("FZA-")) {
continue;
}
k = SSL_CIPHER_get_bits(sc, &j);
@ -2378,7 +2378,7 @@ SSL_CONST SSL_METHOD *meth;
break;
// Leak of sc*?
TQString scn(sc->name);
if (scn.tqcontains("ADH-") || scn.tqcontains("NULL-") || scn.tqcontains("DES-CBC3-SHA") || scn.tqcontains("FZA-")) {
if (scn.contains("ADH-") || scn.contains("NULL-") || scn.contains("DES-CBC3-SHA") || scn.contains("FZA-")) {
continue;
}
k = SSL_CIPHER_get_bits(sc, &j);

@ -23,16 +23,16 @@ bool CSSTemplate::expand(TQString destname, const TQMap<TQString,TQString> &dict
{
line = is.readLine();
int start = line.tqfind('$');
int start = line.find('$');
if (start >= 0)
{
int end = line.tqfind('$', start+1);
int end = line.find('$', start+1);
if (end >= 0)
{
TQString expr = line.mid(start+1, end-start-1);
TQString res = dict[expr];
line.tqreplace(start, end-start+1, res);
line.replace(start, end-start+1, res);
}
}
os << line << endl;

@ -85,7 +85,7 @@ void KCMDisplay::save()
void KCMDisplay::moduleChanged( bool isChanged )
{
TQMap<KCModule*, bool>::Iterator currentModule = m_modules.tqfind(static_cast<KCModule*>(TQT_TQWIDGET(const_cast<TQObject*>(TQT_TQOBJECT_CONST(sender())))));
TQMap<KCModule*, bool>::Iterator currentModule = m_modules.find(static_cast<KCModule*>(TQT_TQWIDGET(const_cast<TQObject*>(TQT_TQOBJECT_CONST(sender())))));
Q_ASSERT(currentModule != m_modules.end());
if (currentModule.data() == isChanged)
return;

@ -459,7 +459,7 @@ SearchProviderItem *FilterOptions::displaySearchProvider(SearchProvider *p, bool
item = new SearchProviderItem(m_dlg->lvSearchProviders, p);
if (m_favoriteEngines.tqfind(p->desktopEntryName())!=m_favoriteEngines.end())
if (m_favoriteEngines.find(p->desktopEntryName())!=m_favoriteEngines.end())
item->setOn(true);
for (itemCount = 1; itemCount < totalCount; itemCount++)

@ -64,7 +64,7 @@ TQString KURISearchFilterEngine::webShortcutQuery( const TQString& typedString )
if (m_bWebShortcutsEnabled)
{
TQString search = typedString;
int pos = search.tqfind(m_cKeywordDelimiter);
int pos = search.find(m_cKeywordDelimiter);
TQString key;
if (pos > -1)
@ -98,7 +98,7 @@ TQString KURISearchFilterEngine::autoWebSearchQuery( const TQString& typedString
if (m_bWebShortcutsEnabled && !m_defaultSearchEngine.isEmpty())
{
// Make sure we ignore supported protocols, e.g. "smb:", "http:"
int pos = typedString.tqfind(':');
int pos = typedString.find(':');
if (pos == -1 || !KProtocolInfo::isKnownProtocol(typedString.left(pos)))
{
@ -147,7 +147,7 @@ TQStringList KURISearchFilterEngine::modifySubstitutionMap(SubstMap& map,
int i = 0;
int n = 0;
TQString s = userquery.mid (pos, qsexpr.matchedLength());
while ((i = s.tqfind(" ")) != -1)
while ((i = s.find(" ")) != -1)
{
s = s.replace (i, 1, "%20");
n++;
@ -163,11 +163,11 @@ TQStringList KURISearchFilterEngine::modifySubstitutionMap(SubstMap& map,
// Back-substitute quoted strings (%20 -> " "):
{
int i = 0;
while ((i = userquery.tqfind("%20")) != -1)
userquery = userquery.tqreplace(i, 3, " ");
while ((i = userquery.find("%20")) != -1)
userquery = userquery.replace(i, 3, " ");
for ( TQStringList::Iterator it = l.begin(); it != l.end(); ++it )
*it = (*it).tqreplace("%20", " ");
*it = (*it).replace("%20", " ");
}
PIDDBG << "Generating substitution map:\n";
@ -187,23 +187,23 @@ TQStringList KURISearchFilterEngine::modifySubstitutionMap(SubstMap& map,
v = l[i-1];
// Back-substitute quoted strings (%20 -> " "):
while ((j = v.tqfind("%20")) != -1)
v = v.tqreplace(j, 3, " ");
while ((j = v.find("%20")) != -1)
v = v.replace(j, 3, " ");
// Insert partial queries (referenced by \1 ... \n) to map:
map.tqreplace(TQString::number(i), v);
map.replace(TQString::number(i), v);
PDVAR (" map['" + nr + "']", map[nr]);
// Insert named references (referenced by \name) to map:
j = 0;
if ((i>0) && (pos = v.tqfind("=")) > 0)
if ((i>0) && (pos = v.find("=")) > 0)
{
TQString s = v.mid(pos + 1);
TQString k = v.left(pos);
// Back-substitute references contained in references (e.g. '\refname' substitutes to 'thisquery=\0')
while ((j = s.tqfind("%5C")) != -1) s = s.tqreplace(j, 3, "\\");
map.tqreplace(k, s);
while ((j = s.find("%5C")) != -1) s = s.replace(j, 3, "\\");
map.replace(k, s);
PDVAR (" map['" + k + "']", map[k]);
}
}
@ -231,12 +231,12 @@ TQString KURISearchFilterEngine::substituteQuery(const TQString& url, SubstMap &
// Check, if old style '\1' is found and replace it with \{@} (compatibility mode):
{
int pos = -1;
if ((pos = newurl.tqfind("\\1")) >= 0)
if ((pos = newurl.find("\\1")) >= 0)
{
PIDDBG << "WARNING: Using compatibility mode for newurl='" << newurl
<< "'. Please replace old style '\\1' with new style '\\{0}' "
"in the query definition.\n";
newurl = newurl.tqreplace(pos, 2, "\\{@}");
newurl = newurl.replace(pos, 2, "\\{@}");
}
}
@ -275,7 +275,7 @@ TQString KURISearchFilterEngine::substituteQuery(const TQString& url, SubstMap &
// Substitute a range of keywords
if (range.search(rlitem, 0) >= 0)
{
int pos = rlitem.tqfind("-");
int pos = rlitem.find("-");
int first = rlitem.left(pos).toInt();
int last = rlitem.right(rlitem.length()-pos-1).toInt();
@ -307,7 +307,7 @@ TQString KURISearchFilterEngine::substituteQuery(const TQString& url, SubstMap &
v = encodeString(s, encodingMib);
PDVAR (" default", s);
}
else if (map.tqcontains(rlitem))
else if (map.contains(rlitem))
{
// Use value from substitution map:
found = true;
@ -340,7 +340,7 @@ TQString KURISearchFilterEngine::substituteQuery(const TQString& url, SubstMap &
// Encode '+', otherwise it would be interpreted as space in the resulting url:
int vpos = 0;
while ((vpos = v.tqfind('+')) != -1)
while ((vpos = v.find('+')) != -1)
v = v.replace (vpos, 1, "%2B");
}
@ -353,7 +353,7 @@ TQString KURISearchFilterEngine::substituteQuery(const TQString& url, SubstMap &
i++;
}
newurl = newurl.tqreplace(pos, reflist.matchedLength(), v);
newurl = newurl.replace(pos, reflist.matchedLength(), v);
}
// Special handling for \{@};
@ -370,7 +370,7 @@ TQString KURISearchFilterEngine::substituteQuery(const TQString& url, SubstMap &
// Substitute \{@} with list of unmatched query strings
int vpos = 0;
while ((vpos = newurl.tqfind("\\@")) != -1)
while ((vpos = newurl.find("\\@")) != -1)
newurl = newurl.replace (vpos, 2, v);
}
}
@ -397,7 +397,7 @@ TQString KURISearchFilterEngine::formatResult( const TQString& url,
{
// Return nothing if userquery is empty and it contains
// substitution strings...
if (query.isEmpty() && url.tqfind(TQRegExp(TQRegExp::escape("\\{"))) > 0)
if (query.isEmpty() && url.find(TQRegExp(TQRegExp::escape("\\{"))) > 0)
return TQString::null;
// Debug info of map:
@ -427,13 +427,13 @@ TQString KURISearchFilterEngine::formatResult( const TQString& url,
PDVAR ("query definition", url);
// Add charset indicator for the query to substitution map:
map.tqreplace("ikw_charset", cseta);
map.replace("ikw_charset", cseta);
// Add charset indicator for the fallback query to substitution map:
TQString csetb = cset2;
if (csetb.isEmpty())
csetb = "iso-8859-1";
map.tqreplace("wsc_charset", csetb);
map.replace("wsc_charset", csetb);
TQString newurl = substituteQuery (url, map, userquery, csetacodec->mibEnum());

@ -60,7 +60,7 @@ SearchProviderDialog::SearchProviderDialog(SearchProvider *provider,
m_dlg->leName->setText(m_provider->name())