rename the following methods:

tqfind find
tqreplace replace
tqcontains contains


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/ksquirrel@1246075 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 13 years ago
parent bab0c762c4
commit 79128018a1

@ -89,10 +89,10 @@ void SQ_Converter::slotStartEdit()
startEditPrivate();
}
TQString SQ_Converter::adjustFileName(const TQString &globalprefix, const TQString &name1, int tqreplace, TQString putto, bool paged, int page)
TQString SQ_Converter::adjustFileName(const TQString &globalprefix, const TQString &name1, int replace, TQString putto, bool paged, int page)
{
TQFileInfo ff(name1);
TQString name = ff.dirPath() + '/' + (tqreplace == 0 ? globalprefix : (tqreplace == 2 ? TQString() : globalprefix)) + ff.fileName();
TQString name = ff.dirPath() + '/' + (replace == 0 ? globalprefix : (replace == 2 ? TQString() : globalprefix)) + ff.fileName();
ff = TQFileInfo(name);
TQString result, inner, filter = lw->filter;
@ -113,7 +113,7 @@ TQString SQ_Converter::adjustFileName(const TQString &globalprefix, const TQStri
suffix = (SQ_LibraryHandler::instance()->knownExtension(TQString::tqfromLatin1("*.") + ext))
? TQString(lw->codec->extension(32)) : ext;
if(tqreplace == 0 || tqreplace == 2)
if(replace == 0 || replace == 2)
result = (!paged) ? (prefix + inner + suffix) : (prefix + spage + inner + suffix);
else
{
@ -143,7 +143,7 @@ void SQ_Converter::decodingCycle()
RGBA *scan;
int errors, gerrors = 0, current;
TQString putto;
int tqreplace = imageopt.where_to_put;
int replace = imageopt.where_to_put;
bool brk;
SQ_Config::instance()->setGroup("Edit tools");
@ -229,9 +229,9 @@ void SQ_Converter::decodingCycle()
if(i == SQE_NOTOK || brk)
{
if(current == 1)
name = adjustFileName(prefix, *it, tqreplace, putto);
name = adjustFileName(prefix, *it, replace, putto);
else
name = adjustFileName(prefix, *it, tqreplace, putto, true, current);
name = adjustFileName(prefix, *it, replace, putto, true, current);
lastFrame = last;
@ -242,7 +242,7 @@ void SQ_Converter::decodingCycle()
i = SQE_OK;
if(tqreplace == 2)
if(replace == 2)
{
emit convertText(i18n("Removing") + KStringHandler::rsqueeze(ff.fileName()) + TQString("... "), false);
@ -262,7 +262,7 @@ void SQ_Converter::decodingCycle()
if(current)
{
name = adjustFileName(prefix, *it, tqreplace, putto, true, current);
name = adjustFileName(prefix, *it, replace, putto, true, current);
lastFrame = false;

@ -77,7 +77,7 @@ class SQ_Converter : public TQObject
/*
* Determine file name. In this file SQ_Converter will save new image.
*/
TQString adjustFileName(const TQString &globalprefix, const TQString &name, int tqreplace,
TQString adjustFileName(const TQString &globalprefix, const TQString &name, int replace,
TQString putto, bool paged = false, int page = 0);
void determineNextScan(const fmt_image &im, RGBA *scan, int y);

@ -17,7 +17,7 @@ int SQ_ImageEditOptions::exec(SQ_ImageOptions *o)
{
kurl->setURL(o->putto);
TQButton *b = buttonGroup1->tqfind(o->where_to_put);
TQButton *b = buttonGroup1->find(o->where_to_put);
if(b)
b->animateClick();

@ -794,7 +794,7 @@ void KSquirrel::createActions()
pARescan = KStdAction::redisplay(TQT_TQOBJECT(this), TQT_SLOT(slotRescan()), actionCollection(), "SQ rescan libraries");
pARescan->setText(i18n("Reload codecs from disk"));
pAExtTools = new KAction(i18n("Configure external tools..."), "launch", 0, TQT_TQOBJECT(this), TQT_SLOT(slotExtTools()), actionCollection(), "SQ external tools");
pAFilters = new KAction(i18n("Configure filters..."), "filetqfind", 0, TQT_TQOBJECT(this), TQT_SLOT(slotFilters()), actionCollection(), "SQ filters");
pAFilters = new KAction(i18n("Configure filters..."), "filefind", 0, TQT_TQOBJECT(this), TQT_SLOT(slotFilters()), actionCollection(), "SQ filters");
pAGotoTray = new KAction(i18n("Go to tray"), "background", CTRL+TQt::Key_T, TQT_TQOBJECT(this), TQT_SLOT(slotGotoTray()), actionCollection(), "SQ goto tray");
pAOpenAndSet = new KAction(i18n("Open file and change directory"), "fileopen", CTRL+ALT+TQt::Key_O, TQT_TQOBJECT(this), TQT_SLOT(slotOpenFileAndSet()), actionCollection(), "SQ open and set");
pAOpen = new KAction(i18n("Open file"), "fileopen", CTRL+TQt::Key_O, TQT_TQOBJECT(this), TQT_SLOT(slotOpenFile()), actionCollection(), "SQ open file");
@ -1741,7 +1741,7 @@ void KSquirrel::navigatorSend(const TQString &command)
//
void KSquirrel::control(const TQString &command)
{
TQMap<TQString, int>::iterator it = messages.tqfind(command);
TQMap<TQString, int>::iterator it = messages.find(command);
// known action
if(it != messages.end())

@ -172,7 +172,7 @@ void KSquirrelPart::slotZoom()
{
bool ok;
int z = sa->currentText().tqreplace(TQChar('%'), "").toInt(&ok);
int z = sa->currentText().replace(TQChar('%'), "").toInt(&ok);
if(ok)
gl->zoom((float)z / 100.0f);

@ -201,8 +201,8 @@ void SQ_ExternalTool::slotActivateTool(int id)
Tool *tool = &at(index);
TQString comm = tool->command;
int per_f = comm.tqcontains("%f");
int per_F = comm.tqcontains("%F");
int per_f = comm.contains("%f");
int per_F = comm.contains("%F");
// %f = single file
// %F = multiple files
@ -219,7 +219,7 @@ void SQ_ExternalTool::slotActivateTool(int id)
else if(per_f)
{
KURL u = list.first();
comm.tqreplace("%f", KShellProcess::quote(u.isLocalFile() ? u.path() : u.prettyURL()));
comm.replace("%f", KShellProcess::quote(u.isLocalFile() ? u.path() : u.prettyURL()));
proc << comm;
}
else
@ -234,7 +234,7 @@ void SQ_ExternalTool::slotActivateTool(int id)
files.append(" ");
}
comm.tqreplace("%F", files);
comm.replace("%F", files);
proc << comm;
}

@ -64,7 +64,7 @@ SQ_GLView::~SQ_GLView()
SQ_TextSetter* SQ_GLView::sbarWidget(const TQString &name)
{
SQ_Setters::iterator it = map.tqfind(name);
SQ_Setters::iterator it = map.find(name);
return (it == map.end() ? tmp : it.data());
}

@ -162,9 +162,9 @@ void SQ_ImageProperties::setMetaInfo(TQValueVector<TQPair<TQString,TQString> > m
for(TQValueVector<TQPair<TQString,TQString> >::iterator it = meta.begin();it != itEnd;++it)
{
if(after)
item = new TQListViewItem(listMeta, after, (*it).first+TQString::tqfromLatin1(" "), (*it).second.tqreplace(TQChar('\n'), TQChar(' ')));
item = new TQListViewItem(listMeta, after, (*it).first+TQString::tqfromLatin1(" "), (*it).second.replace(TQChar('\n'), TQChar(' ')));
else
after = item = new TQListViewItem(listMeta, (*it).first+TQString::tqfromLatin1(" "), (*it).second.tqreplace(TQChar('\n'), TQChar(' ')));
after = item = new TQListViewItem(listMeta, (*it).first+TQString::tqfromLatin1(" "), (*it).second.replace(TQChar('\n'), TQChar(' ')));
listMeta->insertItem(item);
}

@ -84,7 +84,7 @@ SQ_LIBRARY* SQ_LibraryHandler::libraryForFile(const KURL &url)
{
if((*it).mime_multi)
{
if((*it).mimetype.tqfind(mime->name()) != -1)
if((*it).mimetype.find(mime->name()) != -1)
{
l = &(*it);
break;
@ -276,7 +276,7 @@ void SQ_LibraryHandler::add(TQStringList &foundLibraries)
{
libtmp.mime = TQPixmap(reinterpret_cast<const char **>(o.pixmap));
libtmp.mimetype = o.mimetype;
libtmp.mime_multi = libtmp.mimetype.tqfind(';') != -1;
libtmp.mime_multi = libtmp.mimetype.find(';') != -1;
libtmp.quickinfo = q;
libtmp.filter = o.filter;
libtmp.version = o.version;
@ -339,7 +339,7 @@ bool SQ_LibraryHandler::alreadyInMap(const TQString &quick) const
{
const_iterator itEnd = end();
// go through array and tqfind 'quick'
// go through array and find 'quick'
for(const_iterator it = begin();it != itEnd;++it)
if((*it).quickinfo == quick)
return true;
@ -380,7 +380,7 @@ bool SQ_LibraryHandler::knownExtension(const TQString &ext)
// go through array and compare extensions
for(iterator it = begin();it != itEnd;++it)
{
if((*it).filter.tqcontains(ext, false))
if((*it).filter.contains(ext, false))
return true;
}
@ -554,10 +554,10 @@ SQ_LibraryHandler::Support SQ_LibraryHandler::maybeSupported(const KURL &u, cons
{
if((*it).mime_multi)
{
if((*it).mimetype.tqfind(mimeDet, 0, false) != -1)
if((*it).mimetype.find(mimeDet, 0, false) != -1)
return SQ_LibraryHandler::Yes;
}
else if((*it).mimetype == mimeDet) // don't waste CPU time with tqfind()
else if((*it).mimetype == mimeDet) // don't waste CPU time with find()
return SQ_LibraryHandler::Yes;
}

@ -69,7 +69,7 @@ KFileTreeViewItem* SQ_CategoriesViewBranch::createTreeViewItem(KFileTreeViewItem
if(i)
{
TQString n = i->fileItem()->name();
int ind = n.tqfindRev('.');
int ind = n.findRev('.');
// OOPS
if(ind != -1)

@ -253,7 +253,7 @@ void SQ_CategoryBrowserMenu::initialize()
title = c.readEntry("Name", title);
TQString s = c.readEntry("Icon");
if(!_icons->tqcontains(s)) {
if(!_icons->contains(s)) {
icon = KGlobal::iconLoader()->loadIcon(s, KIcon::Small, KIcon::SizeSmall,
KIcon::DefaultState, 0, true);
@ -351,7 +351,7 @@ void SQ_CategoryBrowserMenu::append(const TQPixmap &pixmap, const TQString &titl
{
// avoid &'s being converted to accelerators
TQString newTitle = title;
newTitle.tqreplace("&", "&&");
newTitle.replace("&", "&&");
newTitle = KStringHandler::cEmSqueeze( newTitle, fontMetrics(), 20 );
// insert menu item
@ -369,7 +369,7 @@ void SQ_CategoryBrowserMenu::append(const TQPixmap &pixmap, const TQString &titl
{
// avoid &'s being converted to accelerators
TQString newTitle = title;
newTitle.tqreplace("&", "&&");
newTitle.replace("&", "&&");
newTitle = KStringHandler::cEmSqueeze( newTitle, fontMetrics(), 20 );
// insert submenu
@ -396,7 +396,7 @@ void SQ_CategoryBrowserMenu::mouseMoveEvent(TQMouseEvent *e)
// get id
int id = idAt(_lastpress);
if(!_filemap.tqcontains(id)) return;
if(!_filemap.contains(id)) return;
// reset _lastpress
_lastpress = TQPoint(-1, -1);
@ -429,7 +429,7 @@ void SQ_CategoryBrowserMenu::slotExec(int id)
{
kapp->propagateSessionManager();
if(!_filemap.tqcontains(id)) return;
if(!_filemap.contains(id)) return;
KURL url;
url.setPath(path() + '/' + _filemap[id]);
@ -468,8 +468,8 @@ void SQ_CategoryBrowserMenu::slotMimeCheck()
file = KStringHandler::cEmSqueeze( file, fontMetrics(), 20 );
file.tqreplace("&", "&&");
if(!_icons->tqcontains(icon)) {
file.replace("&", "&&");
if(!_icons->contains(icon)) {
TQPixmap pm = SmallIcon(icon);
if( pm.height() > 16 )
{

@ -90,7 +90,7 @@ void SQ_ImageBasket::insertNewFiles(const KFileItemList &list)
for(; (tmp = it.current()); ++it)
{
n = tmp->name();
ind = n.tqfindRev('.');
ind = n.findRev('.');
// OOPS
if(ind != -1)

@ -111,7 +111,7 @@ void SQ_MountView::reload(bool current)
{
colum = 1;
if(mounted.tqfind((*it)->mountPoint()) == mounted.end())
if(mounted.find((*it)->mountPoint()) == mounted.end())
{
mounted.append((*it)->mountPoint());

@ -48,7 +48,7 @@ KURL SQ_StorageFile::readStorageFile(const TQString &path)
{
TQString n = SQ_StorageFile::readStorageFileAsString(path);
int ind = n.tqfind('\n');
int ind = n.find('\n');
if(ind != -1)
n.truncate(ind);

@ -122,7 +122,7 @@ void SQ_ThreadDirLister::appendURL(const KURL &url)
inline
bool SQ_ThreadDirLister::hasURL(const KURL &url)
{
return todo.tqfind(url) != todo.end();
return todo.find(url) != todo.end();
}
inline

@ -494,7 +494,7 @@ void SQ_TreeView::stopAnimation(KFileTreeViewItem *item)
if(!item)
return;
int f = m_mapFolders.tqfind(item);
int f = m_mapFolders.find(item);
if(f != -1)
{

@ -79,7 +79,7 @@ void SQ_ArchiveHandler::fillProtocols()
TQString SQ_ArchiveHandler::findProtocolByMime(const TQString &mime)
{
// find protocol
TQMap<TQString, TQString>::iterator it = tqfind(mime);
TQMap<TQString, TQString>::iterator it = find(mime);
// return protocol number, if found, and -1 otherwise
return (it == end() ? TQString() : it.data());

@ -625,7 +625,7 @@ void SQ_DirOperator::smartUpdate()
oldSelected = *fileview->selectedItems();
oldCurrentItem = fileview->currentFileItem();
// heh, 'items' now tqcontains "..", we should remove it!
// heh, 'items' now contains "..", we should remove it!
removeCdUpItem();
// clear view and add items (see SQ_FileThumbView::insertItem() for more)
@ -726,7 +726,7 @@ void SQ_DirOperator::clearListers()
void SQ_DirOperator::urlAdded(const KURL &_url)
{
// avoid duplications
if(listers.tqcontains(_url) || _url.equals(url(), true))
if(listers.contains(_url) || _url.equals(url(), true))
return;
KDirLister *lister = new KDirLister(true);
@ -751,7 +751,7 @@ void SQ_DirOperator::urlAdded(const KURL &_url)
void SQ_DirOperator::urlRemoved(const KURL &url)
{
// for safety
SQ_Listers::iterator it = listers.tqfind(url);
SQ_Listers::iterator it = listers.find(url);
if(it == listers.end())
return;

@ -201,8 +201,8 @@ void SQ_ExternalTool::slotActivateTool(int id)
Tool *tool = &at(index);
TQString comm = tool->command;
int per_f = comm.tqcontains("%f");
int per_F = comm.tqcontains("%F");
int per_f = comm.contains("%f");
int per_F = comm.contains("%F");
// %f = single file
// %F = multiple files
@ -219,7 +219,7 @@ void SQ_ExternalTool::slotActivateTool(int id)
else if(per_f)
{
KURL u = list.first();
comm.tqreplace("%f", KShellProcess::quote(u.isLocalFile() ? u.path() : u.prettyURL()));
comm.replace("%f", KShellProcess::quote(u.isLocalFile() ? u.path() : u.prettyURL()));
proc << comm;
}
else
@ -234,7 +234,7 @@ void SQ_ExternalTool::slotActivateTool(int id)
files.append(" ");
}
comm.tqreplace("%F", files);
comm.replace("%F", files);
proc << comm;
}

@ -113,7 +113,7 @@ void SQ_FileIconViewBase::contentsMouseDoubleClickEvent(TQMouseEvent *e)
{
TQIconView::contentsMouseDoubleClickEvent(e);
TQIconViewItem *item = tqfindItem(e->pos());
TQIconViewItem *item = findItem(e->pos());
// double click on item
if(item)

@ -211,8 +211,8 @@ KFileItemList SQ_FileThumbView::itemsToUpdate(bool fromAll)
KFileItemList list;
TQRect rect(contentsX(), contentsY(), viewport()->width(), viewport()->height());
TQIconViewItem *first = fromAll ? firstItem() : tqfindFirstVisibleItem(rect);
TQIconViewItem *last = fromAll ? lastItem() : tqfindLastVisibleItem(rect);
TQIconViewItem *first = fromAll ? firstItem() : findFirstVisibleItem(rect);
TQIconViewItem *last = fromAll ? lastItem() : findLastVisibleItem(rect);
if(first && last)
{
@ -378,7 +378,7 @@ void SQ_FileThumbView::slotDelayedAddItems()
while((fi = it.current()))
{
if(visItems.tqfindRef(fi) == -1)
if(visItems.findRef(fi) == -1)
_newItems.removeRef(fi); // also does ++it
else
++it;

@ -23,7 +23,7 @@ void SQ_GLInfo::init()
for(TQMap<TQString, GLenum>::ConstIterator it = v.constBegin(); it != v.constEnd(); ++it)
{
item = listGL->tqfindItem(it.key().latin1(), 0);
item = listGL->findItem(it.key().latin1(), 0);
if(item)
{

@ -162,9 +162,9 @@ void SQ_ImageProperties::setMetaInfo(TQValueVector<TQPair<TQString,TQString> > m
for(TQValueVector<TQPair<TQString,TQString> >::iterator it = meta.begin();it != itEnd;++it)
{
if(after)
item = new TQListViewItem(listMeta, after, (*it).first+TQString::tqfromLatin1(" "), (*it).second.tqreplace(TQChar('\n'), TQChar(' ')));
item = new TQListViewItem(listMeta, after, (*it).first+TQString::tqfromLatin1(" "), (*it).second.replace(TQChar('\n'), TQChar(' ')));
else
after = item = new TQListViewItem(listMeta, (*it).first+TQString::tqfromLatin1(" "), (*it).second.tqreplace(TQChar('\n'), TQChar(' ')));
after = item = new TQListViewItem(listMeta, (*it).first+TQString::tqfromLatin1(" "), (*it).second.replace(TQChar('\n'), TQChar(' ')));
listMeta->insertItem(item);
}

@ -157,7 +157,7 @@ void SQ_KIPIManager::slotReplug()
{
category = plugin->category(*actionIt);
fnd = cmenus.tqfind(category);
fnd = cmenus.find(category);
if(fnd == cmenus.end())
continue;

@ -84,7 +84,7 @@ SQ_LIBRARY* SQ_LibraryHandler::libraryForFile(const KURL &url)
{
if((*it).mime_multi)
{
if((*it).mimetype.tqfind(mime->name()) != -1)
if((*it).mimetype.find(mime->name()) != -1)
{
l = &(*it);
break;
@ -276,7 +276,7 @@ void SQ_LibraryHandler::add(TQStringList &foundLibraries)
{
libtmp.mime = TQPixmap(reinterpret_cast<const char **>(o.pixmap));
libtmp.mimetype = o.mimetype;
libtmp.mime_multi = libtmp.mimetype.tqfind(';') != -1;
libtmp.mime_multi = libtmp.mimetype.find(';') != -1;
libtmp.quickinfo = q;
libtmp.filter = o.filter;
libtmp.version = o.version;
@ -339,7 +339,7 @@ bool SQ_LibraryHandler::alreadyInMap(const TQString &quick) const
{
const_iterator itEnd = end();
// go through array and tqfind 'quick'
// go through array and find 'quick'
for(const_iterator it = begin();it != itEnd;++it)
if((*it).quickinfo == quick)
return true;
@ -380,7 +380,7 @@ bool SQ_LibraryHandler::knownExtension(const TQString &ext)
// go through array and compare extensions
for(iterator it = begin();it != itEnd;++it)
{
if((*it).filter.tqcontains(ext, false))
if((*it).filter.contains(ext, false))
return true;
}
@ -554,10 +554,10 @@ SQ_LibraryHandler::Support SQ_LibraryHandler::maybeSupported(const KURL &u, cons
{
if((*it).mime_multi)
{
if((*it).mimetype.tqfind(mimeDet, 0, false) != -1)
if((*it).mimetype.find(mimeDet, 0, false) != -1)
return SQ_LibraryHandler::Yes;
}
else if((*it).mimetype == mimeDet) // don't waste CPU time with tqfind()
else if((*it).mimetype == mimeDet) // don't waste CPU time with find()
return SQ_LibraryHandler::Yes;
}

@ -90,7 +90,7 @@ void SQ_PixmapCache::insert(const KURL &key, const SQ_Thumbnail &thumb)
*/
void SQ_PixmapCache::removeEntry(const KURL &key)
{
iterator it = tqfind(key);
iterator it = find(key);
// no item to remove ?
if(it == end())
@ -116,9 +116,9 @@ void SQ_PixmapCache::removeEntryFull(const KURL &key)
/*
* Check if pixmap, represented by 'key', is already in cache.
*/
bool SQ_PixmapCache::tqcontains2(const KURL &key, SQ_Thumbnail &th)
bool SQ_PixmapCache::contains2(const KURL &key, SQ_Thumbnail &th)
{
iterator it = tqfind(key);
iterator it = find(key);
// item found
if(it != end())

@ -70,7 +70,7 @@ class SQ_PixmapCache : public TQObject, public TQMap<KURL, SQ_Thumbnail>
/*
* Check if pixmap, represented by 'key', is already in cache.
*/
bool tqcontains2(const KURL &key, SQ_Thumbnail &th);
bool contains2(const KURL &key, SQ_Thumbnail &th);
/*
* Calculate total size used by cache (not exact!)

@ -96,7 +96,7 @@ void SQ_SlideShow::slotActivated(int id)
void SQ_SlideShow::appendPath(const TQString &path)
{
if(items.tqfindIndex(path) == -1)
if(items.findIndex(path) == -1)
{
items.append(path);
pushHistory->popup()->insertItem(path);

@ -348,7 +348,7 @@ bool SQ_ThumbnailLoadJob::statResultThumbnail()
{
SQ_Thumbnail th;
if(SQ_PixmapCache::instance()->tqcontains2(mCurrentURL, th))
if(SQ_PixmapCache::instance()->contains2(mCurrentURL, th))
{
emitThumbnailLoaded(th);
return true;
@ -387,7 +387,7 @@ void SQ_ThumbnailLoadJob::createThumbnail(const KURL &pixPath)
SQ_Thumbnail th;
bool loaded = false;
if(SQ_PixmapCache::instance()->tqcontains2(pixPath, th))
if(SQ_PixmapCache::instance()->contains2(pixPath, th))
{
emitThumbnailLoaded(th);
// kdDebug() << "CREATE found in cache \"" << pixPath << "\"" << endl;

@ -38,7 +38,7 @@ SQ_ThumbnailsUnused::~SQ_ThumbnailsUnused()
bool SQ_ThumbnailsUnused::needUpdate(const KURL &u, time_t t)
{
iterator it = tqfind(u);
iterator it = find(u);
if(it == end())
return true;

Loading…
Cancel
Save