rename the following methods:

tqfind find
tqreplace replace
tqcontains contains


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/ktorrent@1246075 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 13 years ago
parent 100dcb6968
commit 2a99db3ebc

@ -161,7 +161,7 @@ void FileSelectDlg::accept()
{ {
TQString groupName = m_cmbGroups->currentText(); TQString groupName = m_cmbGroups->currentText();
Group* group = m_gman->tqfind(groupName); Group* group = m_gman->find(groupName);
if(group) if(group)
{ {
group->addTorrent(tc); group->addTorrent(tc);

@ -97,7 +97,7 @@ bool FilterBar::matchesFilter(kt::TorrentInterface* tc)
if (m_name_filter.length() == 0) if (m_name_filter.length() == 0)
return true; return true;
else else
return tc->getStats().torrent_name.tqcontains(m_name_filter,cs); return tc->getStats().torrent_name.contains(m_name_filter,cs);
} }
void FilterBar::slotChangeFilter(const TQString& nameFilter) void FilterBar::slotChangeFilter(const TQString& nameFilter)

@ -99,7 +99,7 @@ namespace kt
Group* GroupManager::newGroup(const TQString & name) Group* GroupManager::newGroup(const TQString & name)
{ {
if (tqfind(name)) if (find(name))
return 0; return 0;
Group* g = new TorrentGroup(name); Group* g = new TorrentGroup(name);
@ -109,7 +109,7 @@ namespace kt
bool GroupManager::canRemove(const Group* g) const bool GroupManager::canRemove(const Group* g) const
{ {
return default_groups.tqfind(g->groupName()) == 0; return default_groups.find(g->groupName()) == 0;
} }
@ -180,7 +180,7 @@ namespace kt
throw; throw;
} }
if (!tqfind(g->groupName())) if (!find(g->groupName()))
insert(g->groupName(),g); insert(g->groupName(),g);
else else
delete g; delete g;
@ -203,7 +203,7 @@ namespace kt
void GroupManager::renameGroup(const TQString & old_name,const TQString & new_name) void GroupManager::renameGroup(const TQString & old_name,const TQString & new_name)
{ {
Group* g = tqfind(old_name); Group* g = find(old_name);
if (!g) if (!g)
return; return;
@ -216,6 +216,6 @@ namespace kt
Group* GroupManager::findDefault(const TQString & name) Group* GroupManager::findDefault(const TQString & name)
{ {
return default_groups.tqfind(name); return default_groups.find(name);
} }
} }

@ -161,7 +161,7 @@ namespace kt
if (name.isNull() || name.length() == 0) if (name.isNull() || name.length() == 0)
return; return;
if (gman->tqfind(name)) if (gman->find(name))
{ {
KMessageBox::error(this,i18n("The group %1 already exists.").tqarg(name)); KMessageBox::error(this,i18n("The group %1 already exists.").tqarg(name));
return; return;
@ -177,7 +177,7 @@ namespace kt
if (!current_item) if (!current_item)
return; return;
Group* g = groups.tqfind(current_item); Group* g = groups.find(current_item);
if (!g) if (!g)
return; return;
@ -200,7 +200,7 @@ namespace kt
if (!current_item) if (!current_item)
return; return;
Group* g = groups.tqfind(current_item); Group* g = groups.find(current_item);
if (!g) if (!g)
return; return;
@ -212,7 +212,7 @@ namespace kt
if (g->groupName() == name) if (g->groupName() == name)
return; return;
if (gman->tqfind(name)) if (gman->find(name))
{ {
KMessageBox::error(this,i18n("The group %1 already exists.").tqarg(name)); KMessageBox::error(this,i18n("The group %1 already exists.").tqarg(name));
} }
@ -252,7 +252,7 @@ namespace kt
Group* g = 0; Group* g = 0;
if (current_item) if (current_item)
g = groups.tqfind(current_item); g = groups.find(current_item);
if (!g ||!gman->canRemove(g)) if (!g ||!gman->canRemove(g))
{ {
@ -278,7 +278,7 @@ namespace kt
if (!li) if (!li)
return; return;
Group* g = groups.tqfind(li); Group* g = groups.find(li);
if (g) if (g)
{ {
current = g; current = g;
@ -292,7 +292,7 @@ namespace kt
if (!li) if (!li)
return; return;
TorrentGroup* g = dynamic_cast<TorrentGroup*>(groups.tqfind(li)); TorrentGroup* g = dynamic_cast<TorrentGroup*>(groups.find(li));
if (g) if (g)
{ {
TQValueList<TorrentInterface*> sel; TQValueList<TorrentInterface*> sel;
@ -329,7 +329,7 @@ namespace kt
void GroupView::onGroupsSubMenuItemActivated(KTorrentView* v,const TQString & group) void GroupView::onGroupsSubMenuItemActivated(KTorrentView* v,const TQString & group)
{ {
Group* g = gman->tqfind(group); Group* g = gman->find(group);
if (g) if (g)
{ {
v->addSelectionToGroup(g); v->addSelectionToGroup(g);
@ -339,7 +339,7 @@ namespace kt
const Group* GroupView::findGroup(const TQString & name) const const Group* GroupView::findGroup(const TQString & name) const
{ {
Group* g = gman->tqfind(name); Group* g = gman->find(name);
if (!g) if (!g)
g = gman->findDefault(name); g = gman->findDefault(name);
@ -351,7 +351,7 @@ namespace kt
if (!current_item) if (!current_item)
return; return;
Group* g = groups.tqfind(current_item); Group* g = groups.find(current_item);
if (g) if (g)
openNewTab(g); openNewTab(g);
} }

@ -65,7 +65,7 @@ void IPFilterWidget::btnAdd_clicked()
if(v.validate( ip, var ) == TQValidator::Acceptable) if(v.validate( ip, var ) == TQValidator::Acceptable)
{ {
if(lstPeers->tqfindItem(ip, 0) == 0) if(lstPeers->findItem(ip, 0) == 0)
new KListViewItem(lstPeers, ip); new KListViewItem(lstPeers, ip);
} }
else else

@ -363,7 +363,7 @@ void KTorrent::addTabPage(TQWidget* page,const TQPixmap & icon,
void KTorrent::removeTabPage(TQWidget* page) void KTorrent::removeTabPage(TQWidget* page)
{ {
if (!m_tab_map.tqcontains(page)) if (!m_tab_map.contains(page))
return; return;
m_tab_map.erase(page); m_tab_map.erase(page);
@ -558,7 +558,7 @@ void KTorrent::setupActions()
i18n("Check Data Integrity"), i18n("Check Data Integrity"),
TQString(),0,m_view_man,TQT_SLOT(checkDataIntegrity()),actionCollection(),"check_data"); TQString(),0,m_view_man,TQT_SLOT(checkDataIntegrity()),actionCollection(),"check_data");
m_tqfind = KStdAction::find(TQT_TQOBJECT(this),TQT_SLOT(tqfind()),actionCollection()); m_find = KStdAction::find(TQT_TQOBJECT(this),TQT_SLOT(find()),actionCollection());
//Plug actions to systemtray context menu //Plug actions to systemtray context menu
m_startall_systray->plug(m_systray_icon->contextMenu()); m_startall_systray->plug(m_systray_icon->contextMenu());
@ -1006,7 +1006,7 @@ void KTorrent::statusBarMsgExpired()
m_statusInfo->clear(); m_statusInfo->clear();
} }
void KTorrent::tqfind() void KTorrent::find()
{ {
KTorrentView* v = m_view_man->getCurrentView(); KTorrentView* v = m_view_man->getCurrentView();
if (v) if (v)

@ -182,7 +182,7 @@ private slots:
void currentTabChanged(TQWidget* w); void currentTabChanged(TQWidget* w);
void openDefaultView(); void openDefaultView();
void statusBarMsgExpired(); void statusBarMsgExpired();
void tqfind(); void find();
private: private:
void setupAccel(); void setupAccel();
@ -231,7 +231,7 @@ private:
KAction* m_queueaction; KAction* m_queueaction;
KAction* m_datacheck; KAction* m_datacheck;
KAction* m_ipfilter; KAction* m_ipfilter;
KAction* m_tqfind; KAction* m_find;
KProgress* m_status_prog; KProgress* m_status_prog;
}; };

@ -347,7 +347,7 @@ void KTorrentCore::downloadFinishedSilently(KIO::Job *job)
else else
{ {
TQString dir; TQString dir;
if (custom_save_locations.tqcontains(j)) if (custom_save_locations.contains(j))
{ {
// we have a custom save location so save to that // we have a custom save location so save to that
dir = custom_save_locations[j].path(); dir = custom_save_locations[j].path();

@ -485,7 +485,7 @@ void KTorrentView::addTorrent(TorrentInterface* tc)
void KTorrentView::removeTorrent(TorrentInterface* tc) void KTorrentView::removeTorrent(TorrentInterface* tc)
{ {
TQMap<kt::TorrentInterface*,KTorrentViewItem*>::iterator i = items.tqfind(tc); TQMap<kt::TorrentInterface*,KTorrentViewItem*>::iterator i = items.find(tc);
if (i != items.end()) if (i != items.end())
{ {
KTorrentViewItem* tvi = i.data(); KTorrentViewItem* tvi = i.data();

@ -78,7 +78,7 @@ Button::~Button()
if (r.search(m_realText) > -1) if (r.search(m_realText) > -1)
{ {
TQString text = m_realText; TQString text = m_realText;
if (text.tqcontains(r2)) if (text.contains(r2))
text.remove(r2); text.remove(r2);
config->writeEntry(TQString("button_%1").tqarg(text), r.cap(1)); config->writeEntry(TQString("button_%1").tqarg(text), r.cap(1));
} }
@ -304,7 +304,7 @@ void Button::contextMenuEvent(TQContextMenuEvent *e)
/* TQPopupMenu menu; /* TQPopupMenu menu;
m_assignAccelAction->plug(&menu); m_assignAccelAction->plug(&menu);
if (m_realText.tqcontains(TQRegExp("^&[0-9]\\s"))) if (m_realText.contains(TQRegExp("^&[0-9]\\s")))
m_clearAccelAction->plug(&menu); m_clearAccelAction->plug(&menu);
emit contextMenu( &menu ); emit contextMenu( &menu );
@ -341,7 +341,7 @@ TQString Button::realTextWithoutAccel() const
{ {
TQString text = m_realText; TQString text = m_realText;
TQRegExp r("^&[0-9]\\s"); TQRegExp r("^&[0-9]\\s");
if (text.tqcontains(r)) if (text.contains(r))
text.remove(r); text.remove(r);
return text; return text;
} }

@ -249,7 +249,7 @@ void ButtonBar::deshrink(int preferredDimension, int actualDimension)
int i = 0; int i = 0;
for (TQValueList<uint>::iterator it = texts.begin(); it != texts.end(); ++it, i++) for (TQValueList<uint>::iterator it = texts.begin(); it != texts.end(); ++it, i++)
{ {
if (m_buttons[i]->text().tqcontains("...")) if (m_buttons[i]->text().contains("..."))
(*it)++; (*it)++;
newTextLength += *it; newTextLength += *it;
} }
@ -309,7 +309,7 @@ Button *ButtonBar::firstButton()
Button *ButtonBar::nextTo(Button *button) Button *ButtonBar::nextTo(Button *button)
{ {
ButtonList::iterator it = m_buttons.tqfind(button); ButtonList::iterator it = m_buttons.find(button);
Button *next = 0; Button *next = 0;
if ((*it) == m_buttons.last()) if ((*it) == m_buttons.last())
next = m_buttons.first(); next = m_buttons.first();
@ -326,7 +326,7 @@ Button *ButtonBar::nextTo(Button *button)
Button *ButtonBar::prevTo(Button *button) Button *ButtonBar::prevTo(Button *button)
{ {
ButtonList::iterator it = m_buttons.tqfind(button); ButtonList::iterator it = m_buttons.find(button);
Button *prev = 0; Button *prev = 0;
if (it == m_buttons.begin()) if (it == m_buttons.begin())
prev = m_buttons.last(); prev = m_buttons.last();

@ -404,7 +404,7 @@ void DDockWindow::moveToDockBottom()
void DDockWindow::moveToDock(DDockWindow::Position position ) void DDockWindow::moveToDock(DDockWindow::Position position )
{ {
if ( m_widgets.tqcontains( m_lastContextMenuButton ) ) if ( m_widgets.contains( m_lastContextMenuButton ) )
{ {
mainWindow()->moveWidget( position, m_widgets[ m_lastContextMenuButton ], m_lastContextMenuButton->realTextWithoutAccel() ); mainWindow()->moveWidget( position, m_widgets[ m_lastContextMenuButton ], m_lastContextMenuButton->realTextWithoutAccel() );
} }

@ -121,10 +121,10 @@ void DMainWindow::addWidget(DTabWidget *tab, TQWidget *widget, const TQString &t
void DMainWindow::removeWidget(TQWidget *widget) void DMainWindow::removeWidget(TQWidget *widget)
{ {
if (!m_widgets.tqcontains(widget)) if (!m_widgets.contains(widget))
return; //not a widget in main window return; //not a widget in main window
if (m_widgetTabs.tqcontains(widget)) if (m_widgetTabs.contains(widget))
{ {
DTabWidget *tab = m_widgetTabs[widget]; DTabWidget *tab = m_widgetTabs[widget];
if (tab->indexOf(widget) >= 0) if (tab->indexOf(widget) >= 0)
@ -193,12 +193,12 @@ void DMainWindow::invalidateActiveTabWidget()
kdDebug(9000) << "tqinvalidate: " << focused << endl; kdDebug(9000) << "tqinvalidate: " << focused << endl;
if (focused == 0) if (focused == 0)
return; return;
if (!m_widgets.tqcontains(focused)) if (!m_widgets.contains(focused))
{ {
kdDebug(9000) << " focused is not in m_widgets" << endl; kdDebug(9000) << " focused is not in m_widgets" << endl;
return; return;
} }
if (m_widgetTabs.tqcontains(focused)) if (m_widgetTabs.contains(focused))
{ {
kdDebug(9000) << " focused is in m_widgets and m_widgetTabs" << endl; kdDebug(9000) << " focused is in m_widgets and m_widgetTabs" << endl;
DTabWidget *tab = m_widgetTabs[focused]; DTabWidget *tab = m_widgetTabs[focused];
@ -223,7 +223,7 @@ DTabWidget *DMainWindow::createTab()
bool DMainWindow::eventFilter(TQObject *obj, TQEvent *ev) bool DMainWindow::eventFilter(TQObject *obj, TQEvent *ev)
{ {
TQWidget *w = (TQWidget*)obj; TQWidget *w = (TQWidget*)obj;
if (!m_widgets.tqcontains(w)) if (!m_widgets.contains(w))
return KParts::MainWindow::eventFilter(obj, ev); return KParts::MainWindow::eventFilter(obj, ev);
if ((m_currentWidget != w) && (ev->type() == TQEvent::FocusIn)) if ((m_currentWidget != w) && (ev->type() == TQEvent::FocusIn))
@ -233,7 +233,7 @@ bool DMainWindow::eventFilter(TQObject *obj, TQEvent *ev)
} }
else if (ev->type() == TQEvent::IconChange) else if (ev->type() == TQEvent::IconChange)
{ {
if (m_widgetTabs.tqcontains(w)) if (m_widgetTabs.contains(w))
{ {
DTabWidget *tab = m_widgetTabs[w]; DTabWidget *tab = m_widgetTabs[w];
tab->setTabIconSet(w, w->icon() ? (*(w->icon())) : TQPixmap()); tab->setTabIconSet(w, w->icon() ? (*(w->icon())) : TQPixmap());
@ -266,7 +266,7 @@ void DMainWindow::closeTab(TQWidget *)
void DMainWindow::moveWidget(DDockWindow::Position position, TQWidget * view, const TQString & title) void DMainWindow::moveWidget(DDockWindow::Position position, TQWidget * view, const TQString & title)
{ {
if (m_docks.tqcontains(view)) if (m_docks.contains(view))
{ {
toolWindow(m_docks[view])->removeWidget(view); toolWindow(m_docks[view])->removeWidget(view);
@ -296,7 +296,7 @@ void DMainWindow::removeDockWidget(TQWidget *view)
bool DMainWindow::hasDockWidget(TQWidget *view) bool DMainWindow::hasDockWidget(TQWidget *view)
{ {
return m_docks.tqcontains(view); return m_docks.contains(view);
} }
DDockWindow::Position DMainWindow::dockWidgetPosition(TQWidget *view) DDockWindow::Position DMainWindow::dockWidgetPosition(TQWidget *view)
@ -308,7 +308,7 @@ void DMainWindow::widgetDestroyed()
{ {
TQWidget *w = TQT_TQWIDGET(const_cast<TQT_BASE_OBJECT_NAME*>(sender())); TQWidget *w = TQT_TQWIDGET(const_cast<TQT_BASE_OBJECT_NAME*>(sender()));
if (m_docks.tqcontains(w)) if (m_docks.contains(w))
{ {
kdError() << "Widget destroyed before being removed from UI!" << endl; kdError() << "Widget destroyed before being removed from UI!" << endl;
m_docks.remove(w); m_docks.remove(w);
@ -317,4 +317,4 @@ void DMainWindow::widgetDestroyed()
#include "dmainwindow.moc" #include "dmainwindow.moc"
// kate: space-indent on; indent-width 4; tab-width 4; tqreplace-tabs on // kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on

@ -130,7 +130,7 @@ void KTorrentPreferences::addPrefPage(kt::PrefPageInterface* prefInterface)
void KTorrentPreferences::removePrefPage(kt::PrefPageInterface* pp) void KTorrentPreferences::removePrefPage(kt::PrefPageInterface* pp)
{ {
if (!pages.tqcontains(pp)) if (!pages.contains(pp))
return; return;
TQFrame* fr = pages[pp]; TQFrame* fr = pages[pp];

@ -356,7 +356,7 @@ void SetMaxRate::rateSelected(int id)
{ {
int rate; int rate;
TQString ratestr = text(id).remove('&'); TQString ratestr = text(id).remove('&');
if (ratestr.tqcontains(i18n("Unlimited"))) if (ratestr.contains(i18n("Unlimited")))
rate = 0; rate = 0;
else else
rate = ratestr.toInt(); rate = ratestr.toInt();

@ -70,7 +70,7 @@ namespace kt
{ {
size += file.getSize(); size += file.getSize();
setText(1,BytesToString(size)); setText(1,BytesToString(size));
int p = path.tqfind(bt::DirSeparator()); int p = path.find(bt::DirSeparator());
if (p == -1) if (p == -1)
{ {
tqchildren.insert(path,newFileTreeItem(path,file)); tqchildren.insert(path,newFileTreeItem(path,file));
@ -78,7 +78,7 @@ namespace kt
else else
{ {
TQString subdir = path.left(p); TQString subdir = path.left(p);
FileTreeDirItem* sd = subdirs.tqfind(subdir); FileTreeDirItem* sd = subdirs.find(subdir);
if (!sd) if (!sd)
{ {
sd = newFileTreeDirItem(subdir); sd = newFileTreeDirItem(subdir);

@ -58,7 +58,7 @@ namespace dht
{ {
// add node to todo list // add node to todo list
KBucketEntry e = UnpackBucketEntry(n,i*26); KBucketEntry e = UnpackBucketEntry(n,i*26);
if (!todo.tqcontains(e) && !visited.tqcontains(e) && if (!todo.contains(e) && !visited.contains(e) &&
todo.count() < 100) todo.count() < 100)
{ {
todo.append(e); todo.append(e);
@ -78,7 +78,7 @@ namespace dht
// add the peer who responded to the answered list, so we can do an announce // add the peer who responded to the answered list, so we can do an announce
KBucketEntry e(rsp->getOrigin(),rsp->getID()); KBucketEntry e(rsp->getOrigin(),rsp->getID());
if (!answered.tqcontains(KBucketEntryAndToken(e,gpr->getToken())) && !answered_visited.tqcontains(e)) if (!answered.contains(KBucketEntryAndToken(e,gpr->getToken())) && !answered_visited.contains(e))
{ {
answered.append(KBucketEntryAndToken(e,gpr->getToken())); answered.append(KBucketEntryAndToken(e,gpr->getToken()));
} }
@ -101,7 +101,7 @@ namespace dht
while (!answered.empty() && canDoRequest()) while (!answered.empty() && canDoRequest())
{ {
KBucketEntryAndToken & e = answered.first(); KBucketEntryAndToken & e = answered.first();
if (!answered_visited.tqcontains(e)) if (!answered_visited.contains(e))
{ {
AnnounceReq* anr = new AnnounceReq(node->getOurID(),info_hash,port,e.getToken()); AnnounceReq* anr = new AnnounceReq(node->getOurID(),info_hash,port,e.getToken());
anr->setOrigin(e.getAddress()); anr->setOrigin(e.getAddress());
@ -117,7 +117,7 @@ namespace dht
{ {
KBucketEntry e = todo.first(); KBucketEntry e = todo.first();
// onLy send a findNode if we haven't allrready visited the node // onLy send a findNode if we haven't allrready visited the node
if (!visited.tqcontains(e)) if (!visited.contains(e))
{ {
// send a findNode to the node // send a findNode to the node
GetPeersReq* gpr = new GetPeersReq(node->getOurID(),info_hash); GetPeersReq* gpr = new GetPeersReq(node->getOurID(),info_hash);

@ -72,7 +72,7 @@ namespace dht
void Database::store(const dht::Key & key,const DBItem & dbi) void Database::store(const dht::Key & key,const DBItem & dbi)
{ {
DBItemList* dbl = items.tqfind(key); DBItemList* dbl = items.find(key);
if (!dbl) if (!dbl)
{ {
dbl = new DBItemList(); dbl = new DBItemList();
@ -83,7 +83,7 @@ namespace dht
void Database::sample(const dht::Key & key,DBItemList & tdbl,bt::Uint32 max_entries) void Database::sample(const dht::Key & key,DBItemList & tdbl,bt::Uint32 max_entries)
{ {
DBItemList* dbl = items.tqfind(key); DBItemList* dbl = items.find(key);
if (!dbl) if (!dbl)
return; return;
@ -144,7 +144,7 @@ namespace dht
bool Database::checkToken(const dht::Key & token,Uint32 ip,Uint16 port) bool Database::checkToken(const dht::Key & token,Uint32 ip,Uint16 port)
{ {
// the token must be in the map // the token must be in the map
if (!tokens.tqcontains(token)) if (!tokens.contains(token))
{ {
Out(SYS_DHT|LOG_DEBUG) << "Unknown token" << endl; Out(SYS_DHT|LOG_DEBUG) << "Unknown token" << endl;
return false; return false;
@ -169,14 +169,14 @@ namespace dht
return true; return true;
} }
bool Database::tqcontains(const dht::Key & key) const bool Database::contains(const dht::Key & key) const
{ {
return items.tqfind(key) != 0; return items.find(key) != 0;
} }
void Database::insert(const dht::Key & key) void Database::insert(const dht::Key & key)
{ {
DBItemList* dbl = items.tqfind(key); DBItemList* dbl = items.find(key);
if (!dbl) if (!dbl)
{ {
dbl = new DBItemList(); dbl = new DBItemList();

@ -118,7 +118,7 @@ namespace dht
bool checkToken(const dht::Key & token,bt::Uint32 ip,bt::Uint16 port); bool checkToken(const dht::Key & token,bt::Uint32 ip,bt::Uint16 port);
/// Test wether or not the DB contains a key /// Test wether or not the DB contains a key
bool tqcontains(const dht::Key & key) const; bool contains(const dht::Key & key) const;
/// Insert an empty item (only if it isn't already in the DB) /// Insert an empty item (only if it isn't already in the DB)
void insert(const dht::Key & key); void insert(const dht::Key & key);

@ -264,7 +264,7 @@ namespace dht
AnnounceTask* at = new AnnounceTask(db,srv,node,info_hash,port); AnnounceTask* at = new AnnounceTask(db,srv,node,info_hash,port);
at->start(kns,!canStartTask()); at->start(kns,!canStartTask());
tman->addTask(at); tman->addTask(at);
if (!db->tqcontains(info_hash)) if (!db->contains(info_hash))
db->insert(info_hash); db->insert(info_hash);
return at; return at;
} }

@ -119,7 +119,7 @@ namespace dht
void KBucket::insert(const KBucketEntry & entry) void KBucket::insert(const KBucketEntry & entry)
{ {
TQValueList<KBucketEntry>::iterator i = entries.tqfind(entry); TQValueList<KBucketEntry>::iterator i = entries.find(entry);
// If in the list, move it to the end // If in the list, move it to the end
if (i != entries.end()) if (i != entries.end())
@ -149,7 +149,7 @@ namespace dht
{ {
last_modified = bt::GetCurrentTime(); last_modified = bt::GetCurrentTime();
if (!pending_entries_busy_pinging.tqcontains(c)) if (!pending_entries_busy_pinging.contains(c))
return; return;
KBucketEntry entry = pending_entries_busy_pinging[c]; KBucketEntry entry = pending_entries_busy_pinging[c];
@ -166,7 +166,7 @@ namespace dht
void KBucket::onTimeout(RPCCall* c) void KBucket::onTimeout(RPCCall* c)
{ {
if (!pending_entries_busy_pinging.tqcontains(c)) if (!pending_entries_busy_pinging.contains(c))
return; return;
KBucketEntry entry = pending_entries_busy_pinging[c]; KBucketEntry entry = pending_entries_busy_pinging[c];
@ -244,9 +244,9 @@ namespace dht
return false; return false;
} }
bool KBucket::tqcontains(const KBucketEntry & entry) const bool KBucket::contains(const KBucketEntry & entry) const
{ {
return entries.tqcontains(entry); return entries.contains(entry);
} }
void KBucket::findKClosestNodes(KClosestNodesSearch & kns) void KBucket::findKClosestNodes(KClosestNodesSearch & kns)

@ -169,7 +169,7 @@ namespace dht
Uint32 getNumEntries() const {return entries.count();} Uint32 getNumEntries() const {return entries.count();}
/// See if this bucket contains an entry /// See if this bucket contains an entry
bool tqcontains(const KBucketEntry & entry) const; bool contains(const KBucketEntry & entry) const;
/** /**
* Find the K closest entries to a key and store them in the KClosestNodesSearch * Find the K closest entries to a key and store them in the KClosestNodesSearch

@ -37,7 +37,7 @@ namespace dht
/** /**
* @author Joris Guisson * @author Joris Guisson
* *
* A Node represents us in the kademlia network. It tqcontains * A Node represents us in the kademlia network. It contains
* our id and 160 KBucket's. * our id and 160 KBucket's.
* A KBucketEntry is in node i, when the difference between our id and * A KBucketEntry is in node i, when the difference between our id and
* the KBucketEntry's id is between 2 to the power i and 2 to the power i+1. * the KBucketEntry's id is between 2 to the power i and 2 to the power i+1.

@ -56,7 +56,7 @@ namespace dht
// unpack an entry and add it to the todo list // unpack an entry and add it to the todo list
KBucketEntry e = UnpackBucketEntry(nodes,j*26); KBucketEntry e = UnpackBucketEntry(nodes,j*26);
// lets not talk to ourself // lets not talk to ourself
if (e.getID() != node->getOurID() && !todo.tqcontains(e) && !visited.tqcontains(e)) if (e.getID() != node->getOurID() && !todo.contains(e) && !visited.contains(e))
todo.append(e); todo.append(e);
} }
num_nodes_rsp++; num_nodes_rsp++;
@ -78,7 +78,7 @@ namespace dht
{ {
KBucketEntry e = todo.first(); KBucketEntry e = todo.first();
// only send a findNode if we haven't allrready visited the node // only send a findNode if we haven't allrready visited the node
if (!visited.tqcontains(e)) if (!visited.contains(e))
{ {
// send a findNode to the node // send a findNode to the node
FindNodeReq* fnr = new FindNodeReq(node->getOurID(),node_id); FindNodeReq* fnr = new FindNodeReq(node->getOurID(),node_id);

@ -134,10 +134,10 @@ namespace dht
msg->setOrigin(pck.address()); msg->setOrigin(pck.address());
msg->apply(dh_table); msg->apply(dh_table);
// erase an existing call // erase an existing call
if (msg->getType() == RSP_MSG && calls.tqcontains(msg->getMTID())) if (msg->getType() == RSP_MSG && calls.contains(msg->getMTID()))
{ {
// delete the call, but first notify it off the response // delete the call, but first notify it off the response
RPCCall* c = calls.tqfind(msg->getMTID()); RPCCall* c = calls.find(msg->getMTID());
c->response(msg); c->response(msg);
calls.erase(msg->getMTID()); calls.erase(msg->getMTID());
c->deleteLater(); c->deleteLater();
@ -165,7 +165,7 @@ namespace dht
RPCCall* RPCServer::doCall(MsgBase* msg) RPCCall* RPCServer::doCall(MsgBase* msg)
{ {
Uint8 start = next_mtid; Uint8 start = next_mtid;
while (calls.tqcontains(next_mtid)) while (calls.contains(next_mtid))
{ {
next_mtid++; next_mtid++;
if (next_mtid == start) // if this happens we cannot do any calls if (next_mtid == start) // if this happens we cannot do any calls
@ -197,7 +197,7 @@ namespace dht
void RPCServer::timedOut(Uint8 mtid) void RPCServer::timedOut(Uint8 mtid)
{ {
// delete the call // delete the call
RPCCall* c = calls.tqfind(mtid); RPCCall* c = calls.find(mtid);
if (c) if (c)
{ {
dh_table->timeout(c->getRequest()); dh_table->timeout(c->getRequest());
@ -214,7 +214,7 @@ namespace dht
RPCCall* c = call_queue.first(); RPCCall* c = call_queue.first();
call_queue.removeFirst(); call_queue.removeFirst();
while (calls.tqcontains(next_mtid)) while (calls.contains(next_mtid))
next_mtid++; next_mtid++;
MsgBase* msg = c->getRequest(); MsgBase* msg = c->getRequest();
@ -227,7 +227,7 @@ namespace dht
const RPCCall* RPCServer::findCall(Uint8 mtid) const const RPCCall* RPCServer::findCall(Uint8 mtid) const
{ {
return calls.tqfind(mtid); return calls.find(mtid);
} }
void RPCServer::ping(const dht::Key & our_id,const KNetwork::KSocketAddress & addr) void RPCServer::ping(const dht::Key & our_id,const KNetwork::KSocketAddress & addr)

@ -61,9 +61,9 @@ namespace net
{ {
// add to the correct group // add to the correct group
Uint32 gid = s->downloadGroupID(); Uint32 gid = s->downloadGroupID();
SocketGroup* g = groups.tqfind(gid); SocketGroup* g = groups.find(gid);
if (!g) if (!g)
g = groups.tqfind(0); g = groups.find(0);
g->add(s); g->add(s);
num_ready++; num_ready++;

@ -51,7 +51,7 @@ namespace net
void NetworkThread::addGroup(Uint32 gid,Uint32 limit) void NetworkThread::addGroup(Uint32 gid,Uint32 limit)
{ {
// if group already exists, just change the limit // if group already exists, just change the limit
SocketGroup* g = groups.tqfind(gid); SocketGroup* g = groups.find(gid);
if (g) if (g)
{ {
g->setLimit(limit); g->setLimit(limit);
@ -72,7 +72,7 @@ namespace net
void NetworkThread::setGroupLimit(Uint32 gid,Uint32 limit) void NetworkThread::setGroupLimit(Uint32 gid,Uint32 limit)
{ {
SocketGroup* g = groups.tqfind(gid); SocketGroup* g = groups.find(gid);
if (g) if (g)
{ {
g->setLimit(limit); g->setLimit(limit);

@ -58,7 +58,7 @@ namespace net
void PortList::removePort(bt::Uint16 number,Protocol proto) void PortList::removePort(bt::Uint16 number,Protocol proto)
{ {
PortList::iterator itr = tqfind(Port(number,proto,false)); PortList::iterator itr = find(Port(number,proto,false));
if (itr == end()) if (itr == end())
return; return;

@ -52,9 +52,9 @@ namespace net
BufferedSocket* s = *itr; BufferedSocket* s = *itr;
if (s && s->ok() && s->bytesReadyToWrite()) if (s && s->ok() && s->bytesReadyToWrite())
{ {
SocketGroup* g = groups.tqfind(s->uploadGroupID()); SocketGroup* g = groups.find(s->uploadGroupID());
if (!g) if (!g)
g = groups.tqfind(0); g = groups.find(0);
g->add(s); g->add(s);
num_ready++; num_ready++;

@ -80,7 +80,7 @@ namespace kt
} }
unloaded.insert(plugin->getName(),plugin); unloaded.insert(plugin->getName(),plugin);
if (pltoload.tqcontains(plugin->getName())) if (pltoload.contains(plugin->getName()))
load(plugin->getName()); load(plugin->getName());
} }
@ -95,7 +95,7 @@ namespace kt
void PluginManager::load(const TQString & name) void PluginManager::load(const TQString & name)
{ {
Plugin* p = unloaded.tqfind(name); Plugin* p = unloaded.find(name);
if (!p) if (!p)
return; return;
@ -114,7 +114,7 @@ namespace kt
void PluginManager::unload(const TQString & name) void PluginManager::unload(const TQString & name)
{ {
Plugin* p = plugins.tqfind(name); Plugin* p = plugins.find(name);
if (!p) if (!p)
return; return;
@ -236,7 +236,7 @@ namespace kt
bool PluginManager::isLoaded(const TQString & name) const bool PluginManager::isLoaded(const TQString & name) const
{ {
const Plugin* p = plugins.tqfind(name); const Plugin* p = plugins.find(name);
return p != 0; return p != 0;
} }

@ -234,7 +234,7 @@ namespace bt
while (i != start) while (i != start)
{ {
Peer* p = pman.getPeer(i); Peer* p = pman.getPeer(i);
if (p && p->isChoked() && p->isInterested() && !p->isSeeder() && ppl.tqcontains(p)) if (p && p->isChoked() && p->isInterested() && !p->isSeeder() && ppl.contains(p))
return p->getID(); return p->getID();
i = (i + 1) % num_peers; i = (i + 1) % num_peers;
} }

@ -87,7 +87,7 @@ namespace bt
bool AnnounceList::removeTracker(KURL url) bool AnnounceList::removeTracker(KURL url)
{ {
KURL::List::iterator i = custom_trackers.tqfind(url); KURL::List::iterator i = custom_trackers.find(url);
if(i != custom_trackers.end()) if(i != custom_trackers.end())
{ {
custom_trackers.remove(i); custom_trackers.remove(i);
@ -187,7 +187,7 @@ namespace bt
for (Uint32 i = 0;i < al->getNumTrackerURLs();i++) for (Uint32 i = 0;i < al->getNumTrackerURLs();i++)
{ {
KURL url = *al->trackers.at(i); KURL url = *al->trackers.at(i);
if (!trackers.tqcontains(url) && !custom_trackers.tqcontains(url)) if (!trackers.contains(url) && !custom_trackers.contains(url))
custom_trackers.append(url); custom_trackers.append(url);
} }
} }

@ -262,7 +262,7 @@ namespace bt
int ret = 0; int ret = 0;
TQMutexLocker lock(&mutex); TQMutexLocker lock(&mutex);
// see if it wasn't an offsetted mapping // see if it wasn't an offsetted mapping
if (mappings.tqcontains(ptr)) if (mappings.contains(ptr))
{ {
CacheFile::Entry & e = mappings[ptr]; CacheFile::Entry & e = mappings[ptr];
#if HAVE_MUNMAP64 #if HAVE_MUNMAP64

@ -59,7 +59,7 @@ namespace bt
erase(p); erase(p);
} }
bool tqcontains(Uint32 p) bool contains(Uint32 p)
{ {
return count(p) > 0; return count(p) > 0;
} }
@ -111,7 +111,7 @@ namespace bt
return false; return false;
DownloadtqStatus* ds = dstatus.tqfind(p.getPeer()); DownloadtqStatus* ds = dstatus.find(p.getPeer());
if (ds) if (ds)
ds->remove(pp); ds->remove(pp);
@ -164,7 +164,7 @@ namespace bt
bool ChunkDownload::assignPeer(PeerDownloader* pd) bool ChunkDownload::assignPeer(PeerDownloader* pd)
{ {
if (!pd || pdown.tqcontains(pd)) if (!pd || pdown.contains(pd))
return false; return false;
pd->grab(); pd->grab();
@ -179,7 +179,7 @@ namespace bt
void ChunkDownload::notDownloaded(const Request & r,bool reject) void ChunkDownload::notDownloaded(const Request & r,bool reject)
{ {
// find the peer // find the peer
DownloadtqStatus* ds = dstatus.tqfind(r.getPeer()); DownloadtqStatus* ds = dstatus.find(r.getPeer());
if (ds) if (ds)
{ {
// Out() << "ds != 0" << endl; // Out() << "ds != 0" << endl;
@ -216,7 +216,7 @@ namespace bt
void ChunkDownload::sendRequests(PeerDownloader* pd) void ChunkDownload::sendRequests(PeerDownloader* pd)
{ {
timer.update(); timer.update();
DownloadtqStatus* ds = dstatus.tqfind(pd->getPeer()->getID()); DownloadtqStatus* ds = dstatus.find(pd->getPeer()->getID());
if (!ds) if (!ds)
return; return;
@ -229,7 +229,7 @@ namespace bt
{ {
// get the first one in the queue // get the first one in the queue
Uint32 i = piece_queue.first(); Uint32 i = piece_queue.first();
if (!ds->tqcontains(i)) if (!ds->contains(i))
{ {
// send request // send request
pd->download( pd->download(
@ -262,7 +262,7 @@ namespace bt
void ChunkDownload::sendCancels(PeerDownloader* pd) void ChunkDownload::sendCancels(PeerDownloader* pd)
{ {
DownloadtqStatus* ds = dstatus.tqfind(pd->getPeer()->getID()); DownloadtqStatus* ds = dstatus.find(pd->getPeer()->getID());
if (!ds) if (!ds)
return; return;
@ -287,9 +287,9 @@ namespace bt
while (i != pdown.end()) while (i != pdown.end())
{ {
PeerDownloader* pd = *i; PeerDownloader* pd = *i;
DownloadtqStatus* ds = dstatus.tqfind(pd->getPeer()->getID()); DownloadtqStatus* ds = dstatus.find(pd->getPeer()->getID());
Uint32 pp = p.getOffset() / MAX_PIECE_LEN; Uint32 pp = p.getOffset() / MAX_PIECE_LEN;
if (ds && ds->tqcontains(pp)) if (ds && ds->contains(pp))
{ {
pd->cancel(Request(p)); pd->cancel(Request(p));
ds->remove(pp); ds->remove(pp);
@ -300,7 +300,7 @@ namespace bt
void ChunkDownload::peerKilled(PeerDownloader* pd) void ChunkDownload::peerKilled(PeerDownloader* pd)
{ {
if (!pdown.tqcontains(pd)) if (!pdown.contains(pd))
return; return;
dstatus.erase(pd->getPeer()->getID()); dstatus.erase(pd->getPeer()->getID());

@ -153,7 +153,7 @@ namespace bt
bool getOnlyDownloader(Uint32 & pid); bool getOnlyDownloader(Uint32 & pid);
/// See if a PeerDownloader is assigned to this chunk /// See if a PeerDownloader is assigned to this chunk
bool containsPeer(PeerDownloader *pd) {return pdown.tqcontains(pd);} bool containsPeer(PeerDownloader *pd) {return pdown.contains(pd);}
/// See if the download is choked (i.e. all downloaders are choked) /// See if the download is choked (i.e. all downloaders are choked)
bool isChoked() const; bool isChoked() const;

@ -354,7 +354,7 @@ namespace bt
bool Downloader::areWeDownloading(Uint32 chunk) const bool Downloader::areWeDownloading(Uint32 chunk) const
{ {
return current_chunks.tqfind(chunk) != 0; return current_chunks.find(chunk) != 0;
} }
void Downloader::onNewPeer(Peer* peer) void Downloader::onNewPeer(Peer* peer)
@ -531,7 +531,7 @@ namespace bt
return; return;
} }
if (!cman.getChunk(hdr.index) || current_chunks.tqcontains(hdr.index)) if (!cman.getChunk(hdr.index) || current_chunks.contains(hdr.index))
{ {
Out() << "Illegal chunk " << hdr.index << endl; Out() << "Illegal chunk " << hdr.index << endl;
return; return;
@ -628,7 +628,7 @@ namespace bt
{ {
for (Uint32 i = from;i <= to;i++) for (Uint32 i = from;i <= to;i++)
{ {
ChunkDownload* cd = current_chunks.tqfind(i); ChunkDownload* cd = current_chunks.find(i);
// let only seed chunks finish // let only seed chunks finish
if (!cd || cman.getChunk(i)->getPriority() == ONLY_SEED_PRIORITY) if (!cd || cman.getChunk(i)->getPriority() == ONLY_SEED_PRIORITY)
continue; continue;
@ -664,7 +664,7 @@ namespace bt
{ {
for (Uint32 i = 0;i < ok_chunks.getNumBits();i++) for (Uint32 i = 0;i < ok_chunks.getNumBits();i++)
{ {
ChunkDownload* cd = current_chunks.tqfind(i); ChunkDownload* cd = current_chunks.find(i);
if (ok_chunks.get(i) && cd) if (ok_chunks.get(i) && cd)
{ {
// we have a chunk and we are downloading it so kill it // we have a chunk and we are downloading it so kill it

@ -105,7 +105,7 @@ namespace bt
} }
KURL scrape_url = url; KURL scrape_url = url;
scrape_url.setFileName(url.fileName(false).tqreplace("announce","scrape")); scrape_url.setFileName(url.fileName(false).replace("announce","scrape"));
TQString epq = scrape_url.encodedPathAndQuery(); TQString epq = scrape_url.encodedPathAndQuery();
const SHA1Hash & info_hash = tor->getInfoHash(); const SHA1Hash & info_hash = tor->getInfoHash();

@ -147,7 +147,7 @@ namespace bt
{ {
// Out() << "Blocked range: " << key.m_ip << " - " << key.m_tqmask << endl; // Out() << "Blocked range: " << key.m_ip << " - " << key.m_tqmask << endl;
TQMap<IPKey, int>::iterator it; TQMap<IPKey, int>::iterator it;
if ((it = m_peers.tqfind(key)) != m_peers.end()) if ((it = m_peers.find(key)) != m_peers.end())
{ {
if(it.key().m_tqmask != key.m_tqmask) if(it.key().m_tqmask != key.m_tqmask)
@ -224,7 +224,7 @@ namespace bt
IPKey key(addr, tqmask); IPKey key(addr, tqmask);
TQMap<IPKey, int>::iterator it = m_peers.tqfind(key); TQMap<IPKey, int>::iterator it = m_peers.find(key);
if (it == m_peers.end()) if (it == m_peers.end())
return; return;
@ -264,7 +264,7 @@ namespace bt
IPKey key(ipi); IPKey key(ipi);
TQMap<IPKey, int>::iterator it; TQMap<IPKey, int>::iterator it;
it = m_peers.tqfind(key); it = m_peers.find(key);
if (it==m_peers.end()) if (it==m_peers.end())
return false; return false;

@ -114,7 +114,7 @@ namespace bt
{ {
if (!tf.doNotDownload()) if (!tf.doNotDownload())
{ {
if (files.tqcontains(i)) if (files.contains(i))
files.erase(i); files.erase(i);
fd = new CacheFile(); fd = new CacheFile();
@ -123,7 +123,7 @@ namespace bt
} }
else else
{ {
if (dnd_files.tqcontains(i)) if (dnd_files.contains(i))
dnd_files.erase(i); dnd_files.erase(i);
dfd = new DNDFile(dnd_dir + tf.getPath() + ".dnd"); dfd = new DNDFile(dnd_dir + tf.getPath() + ".dnd");
@ -155,13 +155,13 @@ namespace bt
TorrentFile & tf = tor.getFile(i); TorrentFile & tf = tor.getFile(i);
if (tf.doNotDownload()) if (tf.doNotDownload())
{ {
DNDFile* dfd = dnd_files.tqfind(i); DNDFile* dfd = dnd_files.find(i);
if (dfd) if (dfd)
dfd->changePath(dnd_dir + tf.getPath() + ".dnd"); dfd->changePath(dnd_dir + tf.getPath() + ".dnd");
} }
else else
{ {
CacheFile* fd = files.tqfind(i); CacheFile* fd = files.find(i);
if (fd) if (fd)
fd->changePath(cache_dir + tf.getPath()); fd->changePath(cache_dir + tf.getPath());
} }
@ -332,7 +332,7 @@ namespace bt
if (tflist.count() == 1) if (tflist.count() == 1)
{ {
const TorrentFile & f = tor.getFile(tflist.first()); const TorrentFile & f = tor.getFile(tflist.first());
CacheFile* fd = files.tqfind(tflist.first()); CacheFile* fd = files.find(tflist.first());
if (!fd) if (!fd)
return; return;
@ -357,8 +357,8 @@ namespace bt
for (Uint32 i = 0;i < tflist.count();i++) for (Uint32 i = 0;i < tflist.count();i++)
{ {
const TorrentFile & f = tor.getFile(tflist[i]); const TorrentFile & f = tor.getFile(tflist[i]);
CacheFile* fd = files.tqfind(tflist[i]); CacheFile* fd = files.find(tflist[i]);
DNDFile* dfd = dnd_files.tqfind(tflist[i]); DNDFile* dfd = dnd_files.find(tflist[i]);
// first calculate offset into file // first calculate offset into file
// only the first file can have an offset // only the first file can have an offset
@ -412,7 +412,7 @@ namespace bt
{ {
// in one so just mmap it // in one so just mmap it
Uint64 off = FileOffset(c,tor.getFile(tflist.first()),tor.getChunkSize()); Uint64 off = FileOffset(c,tor.getFile(tflist.first()),tor.getChunkSize());
CacheFile* fd = files.tqfind(tflist.first()); CacheFile* fd = files.find(tflist.first());
Uint8* buf = 0; Uint8* buf = 0;
if (fd && Cache::mappedModeAllowed() && mmap_failures < 3) if (fd && Cache::mappedModeAllowed() && mmap_failures < 3)
{ {
@ -449,7 +449,7 @@ namespace bt
if (c->gettqStatus() == Chunk::MMAPPED) if (c->gettqStatus() == Chunk::MMAPPED)
{ {
// mapped chunks are easy // mapped chunks are easy
CacheFile* fd = files.tqfind(tflist[0]); CacheFile* fd = files.find(tflist[0]);
if (!fd) if (!fd)
return; return;
@ -464,8 +464,8 @@ namespace bt
for (Uint32 i = 0;i < tflist.count();i++) for (Uint32 i = 0;i < tflist.count();i++)
{ {
const TorrentFile & f = tor.getFile(tflist[i]); const TorrentFile & f = tor.getFile(tflist[i]);
CacheFile* fd = files.tqfind(tflist[i]); CacheFile* fd = files.find(tflist[i]);
DNDFile* dfd = dnd_files.tqfind(tflist[i]); DNDFile* dfd = dnd_files.find(tflist[i]);
// first calculate offset into file // first calculate offset into file
// only the first file can have an offset // only the first file can have an offset
@ -828,7 +828,7 @@ namespace bt
try try
{ {
CacheFile* cf = files.tqfind(i); CacheFile* cf = files.find(i);
if (cf) if (cf)
{ {
sum += cf->diskUsage(); sum += cf->diskUsage();

@ -126,11 +126,11 @@ namespace bt
if (!peer) if (!peer)
return; return;
if (wait_queue.tqcontains(req)) if (wait_queue.contains(req))
{ {
wait_queue.remove(req); wait_queue.remove(req);
} }
else if (reqs.tqcontains(req)) else if (reqs.contains(req))
{ {
reqs.remove(req); reqs.remove(req);
peer->getPacketWriter().sendCancel(req); peer->getPacketWriter().sendCancel(req);
@ -144,7 +144,7 @@ namespace bt
// Out(SYS_CON|LOG_DEBUG) << "Rejected : " << req.getIndex() << " " // Out(SYS_CON|LOG_DEBUG) << "Rejected : " << req.getIndex() << " "
// << req.getOffset() << " " << req.getLength() << endl; // << req.getOffset() << " " << req.getLength() << endl;
if (reqs.tqcontains(req)) if (reqs.contains(req))
{ {
reqs.remove(req); reqs.remove(req);
rejected(req); rejected(req);
@ -171,9 +171,9 @@ namespace bt
void PeerDownloader::piece(const Piece & p) void PeerDownloader::piece(const Piece & p)
{ {
Request r(p); Request r(p);
if (wait_queue.tqcontains(r)) if (wait_queue.contains(r))
wait_queue.remove(r); wait_queue.remove(r);
else if (reqs.tqcontains(r)) else if (reqs.contains(r))
reqs.remove(r); reqs.remove(r);
downloaded(p); downloaded(p);

@ -206,7 +206,7 @@ namespace bt
peer_id.tqat(2).isLetter() ) //AZ style peer_id.tqat(2).isLetter() ) //AZ style
{ {
TQString ID(peer_id.mid(1,2)); TQString ID(peer_id.mid(1,2));
if (Map.tqcontains(ID)) if (Map.contains(ID))
name = Map[ID] + " " + peer_id.tqat(3) + "." + peer_id.tqat(4) + "." name = Map[ID] + " " + peer_id.tqat(3) + "." + peer_id.tqat(4) + "."
+ peer_id.tqat(5) + "." + peer_id.tqat(6); + peer_id.tqat(5) + "." + peer_id.tqat(6);
} }
@ -215,7 +215,7 @@ namespace bt
peer_id.tqat(2).isDigit() ) //Shadow's style peer_id.tqat(2).isDigit() ) //Shadow's style
{ {
TQString ID = TQString(peer_id.tqat(0)); TQString ID = TQString(peer_id.tqat(0));
if (Map.tqcontains(ID)) if (Map.contains(ID))
name = Map[ID] + " " + peer_id.tqat(1) + "." + name = Map[ID] + " " + peer_id.tqat(1) + "." +
peer_id.tqat(2) + "." + peer_id.tqat(3); peer_id.tqat(2) + "." + peer_id.tqat(3);
} }

@ -509,7 +509,7 @@ namespace bt
Peer* PeerManager::findPeer(Uint32 peer_id) Peer* PeerManager::findPeer(Uint32 peer_id)
{ {
return peer_map.tqfind(peer_id); return peer_map.find(peer_id);
} }
void PeerManager::onRerunChoker() void PeerManager::onRerunChoker()

@ -207,7 +207,7 @@ namespace bt
void PeerSourceManager::addTracker(KURL url, bool custom,int tier) void PeerSourceManager::addTracker(KURL url, bool custom,int tier)
{ {
if (trackers.tqcontains(url)) if (trackers.contains(url))
return; return;
Tracker* trk = 0; Tracker* trk = 0;
@ -227,11 +227,11 @@ namespace bt
bool PeerSourceManager::removeTracker(KURL url) bool PeerSourceManager::removeTracker(KURL url)
{ {
if (!custom_trackers.tqcontains(url)) if (!custom_trackers.contains(url))
return false; return false;
custom_trackers.remove(url); custom_trackers.remove(url);
Tracker* trk = trackers.tqfind(url); Tracker* trk = trackers.find(url);
if (curr == trk) if (curr == trk)
{ {
// do a timed delete on the tracker, so the stop signal // do a timed delete on the tracker, so the stop signal
@ -260,7 +260,7 @@ namespace bt
void PeerSourceManager::setTracker(KURL url) void PeerSourceManager::setTracker(KURL url)
{ {
Tracker* trk = trackers.tqfind(url); Tracker* trk = trackers.find(url);
if (!trk) if (!trk)
return; return;
@ -279,7 +279,7 @@ namespace bt
KURL::List::iterator i = custom_trackers.begin(); KURL::List::iterator i = custom_trackers.begin();
while (i != custom_trackers.end()) while (i != custom_trackers.end())
{ {
Tracker* t = trackers.tqfind(*i); Tracker* t = trackers.find(*i);
if (t) if (t)
{ {
if (curr == t) if (curr == t)

@ -68,7 +68,7 @@ namespace bt
{ {
paused_torrents.erase(tc); paused_torrents.erase(tc);
int index = downloads.tqfindRef(tc); int index = downloads.findRef(tc);
if (index != -1) if (index != -1)
downloads.remove(index); downloads.remove(index);

@ -65,7 +65,7 @@ namespace bt
{ {
bt::Delete(cache_file); bt::Delete(cache_file);
output_file = outputpath; output_file = outputpath;
datadir = output_file.left(output_file.tqfindRev(bt::DirSeparator())); datadir = output_file.left(output_file.findRev(bt::DirSeparator()));
bt::SymLink(output_file, cache_file); bt::SymLink(output_file, cache_file);
} }

@ -97,7 +97,7 @@ namespace bt
while (!in.atEnd()) while (!in.atEnd())
{ {
TQString line = in.readLine(); TQString line = in.readLine();
TQString tmp = line.left(line.tqfind('=')); TQString tmp = line.left(line.find('='));
m_values.insert(tmp, line.mid(tmp.length()+1)); m_values.insert(tmp, line.mid(tmp.length()+1));
} }
close(); close();

@ -78,7 +78,7 @@ namespace bt
* @param key The key * @param key The key
* @return true if key is in the stats file * @return true if key is in the stats file
*/ */
bool hasKey(const TQString & key) const {return m_values.tqcontains(key);} bool hasKey(const TQString & key) const {return m_values.contains(key);}
private: private:
TQString m_filename; TQString m_filename;

@ -444,6 +444,6 @@ namespace bt
bool Torrent::checkPathForDirectoryTraversal(const TQString & p) bool Torrent::checkPathForDirectoryTraversal(const TQString & p)
{ {
TQStringList sl = TQStringList::split(bt::DirSeparator(),p); TQStringList sl = TQStringList::split(bt::DirSeparator(),p);
return !sl.tqcontains(".."); return !sl.contains("..");
} }
} }

@ -785,7 +785,7 @@ namespace bt
bool TorrentControl::changeDataDir(const TQString & new_dir) bool TorrentControl::changeDataDir(const TQString & new_dir)
{ {
int pos = datadir.tqfindRev(bt::DirSeparator(),-2); int pos = datadir.findRev(bt::DirSeparator(),-2);
if (pos == -1) if (pos == -1)
{ {
Out(SYS_GEN|LOG_DEBUG) << "Could not find torX part in " << datadir << endl; Out(SYS_GEN|LOG_DEBUG) << "Could not find torX part in " << datadir << endl;
@ -833,7 +833,7 @@ namespace bt
TQString nd; TQString nd;
if (istats.custom_output_name) if (istats.custom_output_name)
{ {
int slash_pos = stats.output_path.tqfindRev(bt::DirSeparator(),-2); int slash_pos = stats.output_path.findRev(bt::DirSeparator(),-2);
nd = new_dir + stats.output_path.mid(slash_pos + 1); nd = new_dir + stats.output_path.mid(slash_pos + 1);
} }
else else
@ -1255,10 +1255,10 @@ namespace bt
{ {
// in case of error copy torX dir to migrate-failed-tor // in case of error copy torX dir to migrate-failed-tor
TQString dd = datadir; TQString dd = datadir;
int pos = dd.tqfindRev("tor"); int pos = dd.findRev("tor");
if (pos != - 1) if (pos != - 1)
{ {
dd = dd.tqreplace(pos,3,"migrate-failed-tor"); dd = dd.replace(pos,3,"migrate-failed-tor");
Out() << "Copying " << datadir << " to " << dd << endl; Out() << "Copying " << datadir << " to " << dd << endl;
bt::CopyDir(datadir,dd,true); bt::CopyDir(datadir,dd,true);
} }

@ -105,7 +105,7 @@ namespace bt
// Read the transaction_id and check it // Read the transaction_id and check it
Int32 tid = ReadInt32(buf,4); Int32 tid = ReadInt32(buf,4);
TQMap<Int32,Action>::iterator i = transactions.tqfind(tid); TQMap<Int32,Action>::iterator i = transactions.find(tid);
// if we can't find the transaction, just return // if we can't find the transaction, just return
if (i == transactions.end()) if (i == transactions.end())
{ {
@ -131,7 +131,7 @@ namespace bt
// Read the transaction_id and check it // Read the transaction_id and check it
Int32 tid = ReadInt32(buf,4); Int32 tid = ReadInt32(buf,4);
TQMap<Int32,Action>::iterator i = transactions.tqfind(tid); TQMap<Int32,Action>::iterator i = transactions.find(tid);
// if we can't find the transaction, just return // if we can't find the transaction, just return
if (i == transactions.end()) if (i == transactions.end())
return; return;
@ -154,7 +154,7 @@ namespace bt
const Uint8* buf = (const Uint8*)data.data(); const Uint8* buf = (const Uint8*)data.data();
// Read the transaction_id and check it // Read the transaction_id and check it
Int32 tid = ReadInt32(buf,4); Int32 tid = ReadInt32(buf,4);
TQMap<Int32,Action>::iterator it = transactions.tqfind(tid); TQMap<Int32,Action>::iterator it = transactions.find(tid);
// if we can't find the transaction, just return // if we can't find the transaction, just return
if (it == transactions.end()) if (it == transactions.end())
return; return;
@ -203,7 +203,7 @@ namespace bt
Int32 UDPTrackerSocket::newTransactionID() Int32 UDPTrackerSocket::newTransactionID()
{ {
Int32 transaction_id = rand() * time(0); Int32 transaction_id = rand() * time(0);
while (transactions.tqcontains(transaction_id)) while (transactions.contains(transaction_id))
transaction_id++; transaction_id++;
return transaction_id; return transaction_id;
} }

@ -55,8 +55,8 @@ namespace bt
void HTTPRequest::onConnect(const KResolverEntry&) void HTTPRequest::onConnect(const KResolverEntry&)
{ {
payload = payload.tqreplace("$LOCAL_IP",sock->localAddress().nodeName()); payload = payload.replace("$LOCAL_IP",sock->localAddress().nodeName());
hdr = hdr.tqreplace("$CONTENT_LENGTH",TQString::number(payload.length())); hdr = hdr.replace("$CONTENT_LENGTH",TQString::number(payload.length()));
TQString req = hdr + payload; TQString req = hdr + payload;
if (verbose) if (verbose)
@ -88,7 +88,7 @@ namespace bt
Out(SYS_PNP|LOG_DEBUG) << strdata << endl; Out(SYS_PNP|LOG_DEBUG) << strdata << endl;
} }
if (sl.first().tqcontains("HTTP") && sl.first().tqcontains("200")) if (sl.first().contains("HTTP") && sl.first().contains("200"))
{ {
// emit reply OK // emit reply OK
replyOK(this,sl.last()); replyOK(this,sl.last());

@ -129,7 +129,7 @@ namespace bt
* @param k The key * @param k The key
* @return The data of the key, 0 if the key isn't in the map * @return The data of the key, 0 if the key isn't in the map
*/ */
Data* tqfind(const Key & k) Data* find(const Key & k)
{ {
iterator i = pmap.find(k); iterator i = pmap.find(k);
return (i == pmap.end()) ? 0 : i->second; return (i == pmap.end()) ? 0 : i->second;
@ -140,7 +140,7 @@ namespace bt
* @param k The key * @param k The key
* @return The data of the key, 0 if the key isn't in the map * @return The data of the key, 0 if the key isn't in the map
*/ */
const Data* tqfind(const Key & k) const const Data* find(const Key & k) const
{ {
const_iterator i = pmap.find(k); const_iterator i = pmap.find(k);
return (i == pmap.end()) ? 0 : i->second; return (i == pmap.end()) ? 0 : i->second;
@ -151,7 +151,7 @@ namespace bt
* @param k The key * @param k The key
* @return true if it is part of the map * @return true if it is part of the map
*/ */
bool tqcontains(const Key & k) const bool contains(const Key & k) const
{ {
const_iterator i = pmap.find(k); const_iterator i = pmap.find(k);
return i != pmap.end(); return i != pmap.end();

@ -95,7 +95,7 @@ namespace kt
void ChunkDownloadView::removeDownload(kt::ChunkDownloadInterface* cd) void ChunkDownloadView::removeDownload(kt::ChunkDownloadInterface* cd)
{ {
if (!items.tqcontains(cd)) if (!items.contains(cd))
return; return;
ChunkDownloadViewItem* it = items[cd]; ChunkDownloadViewItem* it = items[cd];

@ -92,7 +92,7 @@ bool kt::FlagDB::isFlagAvailable(const TQString& country)
const TQPixmap& kt::FlagDB::getFlag(const TQString& country) const TQPixmap& kt::FlagDB::getFlag(const TQString& country)
{ {
const TQString& c = country.lower(); const TQString& c = country.lower();
if (!db.tqcontains(c)) { if (!db.contains(c)) {
TQImage img; TQImage img;
TQPixmap pixmap; TQPixmap pixmap;
for (TQValueList<FlagDBSource>::const_iterator it = sources.constBegin(); it != sources.constEnd(); it++) { for (TQValueList<FlagDBSource>::const_iterator it = sources.constBegin(); it != sources.constEnd(); it++) {

@ -267,7 +267,7 @@ namespace kt
void PeerView::removePeer(kt::PeerInterface* peer) void PeerView::removePeer(kt::PeerInterface* peer)
{ {
TQMap<kt::PeerInterface*,PeerViewItem*>::iterator it = items.tqfind(peer); TQMap<kt::PeerInterface*,PeerViewItem*>::iterator it = items.find(peer);
if (it == items.end()) if (it == items.end())
{ {
return; return;

@ -146,7 +146,7 @@ namespace kt
TQString durl = data_url.path(); TQString durl = data_url.path();
if (durl.endsWith(bt::DirSeparator())) if (durl.endsWith(bt::DirSeparator()))
durl = durl.left(durl.length() - 1); durl = durl.left(durl.length() - 1);
int ds = durl.tqfindRev(bt::DirSeparator()); int ds = durl.findRev(bt::DirSeparator());
if (durl.mid(ds+1) == tor.getNameSuggestion()) if (durl.mid(ds+1) == tor.getNameSuggestion())
{ {
durl = durl.left(ds); durl = durl.left(ds);
@ -163,7 +163,7 @@ namespace kt
// single file, just symlink the data_url to tor_dir/cache // single file, just symlink the data_url to tor_dir/cache
bt::SymLink(data_url.path(),tor_dir + "cache"); bt::SymLink(data_url.path(),tor_dir + "cache");
TQString durl = data_url.path(); TQString durl = data_url.path();
int ds = durl.tqfindRev(bt::DirSeparator()); int ds = durl.findRev(bt::DirSeparator());
durl = durl.left(ds); durl = durl.left(ds);
saveStats(tor_dir + "stats",durl,imported,false); saveStats(tor_dir + "stats",durl,imported,false);
} }

@ -20,7 +20,7 @@ time_t RSS::parseISO8601Date(const TQString &s)
return 0; // error return 0; // error
// FIXME: imho this is done in KRFCDate::parseDateISO8601() automatically, so we could omit it? -fo // FIXME: imho this is done in KRFCDate::parseDateISO8601() automatically, so we could omit it? -fo
if (s.tqfind('T') != -1) if (s.find('T') != -1)
return KRFCDate::parseDateISO8601(s); return KRFCDate::parseDateISO8601(s);
else else
return KRFCDate::parseDateISO8601(s + "T12:00:00"); return KRFCDate::parseDateISO8601(s + "T12:00:00");
@ -35,10 +35,10 @@ TQString RSS::extractNode(const TQDomNode &tqparent, const TQString &elemName, b
TQString result = node.toElement().text(); TQString result = node.toElement().text();
bool hasPre = result.tqcontains("<pre>",false); bool hasPre = result.contains("<pre>",false);
bool hasHtml = hasPre || result.tqcontains("<"); // FIXME: test if we have html, should be more clever -> regexp bool hasHtml = hasPre || result.contains("<"); // FIXME: test if we have html, should be more clever -> regexp
if(!isInlined && !hasHtml) // perform nl2br if not a inline elt and it has no html elts if(!isInlined && !hasHtml) // perform nl2br if not a inline elt and it has no html elts
result = result = result.tqreplace(TQChar('\n'), "<br />"); result = result = result.replace(TQChar('\n'), "<br />");
if(!hasPre) // strip white spaces if no <pre> if(!hasPre) // strip white spaces if no <pre>
result = result.simplifyWhiteSpace(); result = result.simplifyWhiteSpace();

@ -182,7 +182,7 @@ namespace kt
{ {
TQDir directory; TQDir directory;
directory.mkdir(KGlobal::dirs()->saveLocation("data","ktorrent") + "rssfeeds"); directory.mkdir(KGlobal::dirs()->saveLocation("data","ktorrent") + "rssfeeds");
return KGlobal::dirs()->saveLocation("data","ktorrent") + "rssfeeds/" + m_feedUrl.prettyURL(-1).tqreplace("/", "_").tqreplace(":", "_") + ".ktr"; return KGlobal::dirs()->saveLocation("data","ktorrent") + "rssfeeds/" + m_feedUrl.prettyURL(-1).replace("/", "_").replace(":", "_") + ".ktr";
} }
@ -290,7 +290,7 @@ namespace kt
for (int i=doc.articles().count()-1; i>=0; i--) for (int i=doc.articles().count()-1; i>=0; i--)
{ {
curArticle = doc.articles()[i]; curArticle = doc.articles()[i];
if (curArticle.pubDate().daysTo(TQDateTime::tqcurrentDateTime()) < m_articleAge && !m_articles.tqcontains(curArticle)) if (curArticle.pubDate().daysTo(TQDateTime::tqcurrentDateTime()) < m_articleAge && !m_articles.contains(curArticle))
{ {
m_articles.prepend(curArticle); m_articles.prepend(curArticle);
emit scanRssArticle(curArticle); emit scanRssArticle(curArticle);

@ -138,7 +138,7 @@ namespace kt
void RssFeedManager::clearArticles() void RssFeedManager::clearArticles()
{ {
int pos = feeds.tqfind((RssFeed *)sender()); int pos = feeds.find((RssFeed *)sender());
if (pos >= 0) if (pos >= 0)
{ {
@ -606,7 +606,7 @@ namespace kt
if (item < 0) if (item < 0)
{ {
//let's check which one sent the signal - if we can't figure it all then update them all //let's check which one sent the signal - if we can't figure it all then update them all
int pos = feeds.tqfind((RssFeed *)sender()); int pos = feeds.find((RssFeed *)sender());
if (pos < 0) if (pos < 0)
{ {
@ -639,7 +639,7 @@ namespace kt
if (item < 0) if (item < 0)
{ {
//let's check which one sent the signal - if we can't figure it all then update them all //let's check which one sent the signal - if we can't figure it all then update them all
int pos = acceptFilters.tqfind((RssFilter *)sender()); int pos = acceptFilters.find((RssFilter *)sender());
if (pos < 0) if (pos < 0)
{ {
@ -672,7 +672,7 @@ namespace kt
if (item < 0) if (item < 0)
{ {
//let's check which one sent the signal - if we can't figure it all then update them all //let's check which one sent the signal - if we can't figure it all then update them all
int pos = rejectFilters.tqfind((RssFilter *)sender()); int pos = rejectFilters.find((RssFilter *)sender());
if (pos < 0) if (pos < 0)
{ {
@ -1254,7 +1254,7 @@ namespace kt
void RssFeedManager::rescanFilter() void RssFeedManager::rescanFilter()
{ {
int pos = acceptFilters.tqfind((RssFilter *)sender()); int pos = acceptFilters.find((RssFilter *)sender());
if (pos >= 0) if (pos >= 0)
{ {

@ -276,14 +276,14 @@ namespace kt
if (!invert) if (!invert)
{ {
if (!article.title().tqcontains(regEx) && !article.link().prettyURL().tqcontains(regEx) && !article.description().tqcontains(regEx) ) if (!article.title().contains(regEx) && !article.link().prettyURL().contains(regEx) && !article.description().contains(regEx) )
{ {
return false; return false;
} }
} }
else else
{ {
if (article.title().tqcontains(regEx) || article.link().prettyURL().tqcontains(regEx) || article.description().tqcontains(regEx) ) if (article.title().contains(regEx) || article.link().prettyURL().contains(regEx) || article.description().contains(regEx) )
{ {
return false; return false;
} }

@ -83,7 +83,7 @@ namespace kt
hrefTags.setMinimal(true); hrefTags.setMinimal(true);
int matchPos = 0; int matchPos = 0;
while (htmlline.tqfind(hrefTags, matchPos) >= 0) while (htmlline.find(hrefTags, matchPos) >= 0)
{ {
matchPos += hrefTags.matchedLength(); matchPos += hrefTags.matchedLength();
//we're found an <a href tag - let's check it if contains download //we're found an <a href tag - let's check it if contains download
@ -100,7 +100,7 @@ namespace kt
hrefText = TQString("HREF=\"?([^\">< ]*)[\" ]"); hrefText = TQString("HREF=\"?([^\">< ]*)[\" ]");
hrefText.setCaseSensitive(false); hrefText.setCaseSensitive(false);
hrefTags.tqcapturedTexts()[0].tqfind(hrefText); hrefTags.tqcapturedTexts()[0].find(hrefText);
//lets get the captured //lets get the captured
TQString hrefLink = hrefText.capturedTexts()[1]; TQString hrefLink = hrefText.capturedTexts()[1];
@ -110,7 +110,7 @@ namespace kt
} }
else if (!hrefLink.tqstartsWith("http://", false)) else if (!hrefLink.tqstartsWith("http://", false))
{ {
hrefLink = url.url().left(url.url().tqfindRev("/")+1) + hrefLink; hrefLink = url.url().left(url.url().findRev("/")+1) + hrefLink;
} }
subLinks.append(hrefLink); subLinks.append(hrefLink);

@ -132,7 +132,7 @@ namespace kt
return; return;
//search for entry //search for entry
TQValueList<KURL>::iterator it = m_pendingURLs.tqfind(url); TQValueList<KURL>::iterator it = m_pendingURLs.find(url);
//if no entry is found than this torrent was not started by this plugin so - quit //if no entry is found than this torrent was not started by this plugin so - quit
if(it == m_pendingURLs.end()) if(it == m_pendingURLs.end())

@ -51,9 +51,9 @@ namespace kt
// replace spaces by %20 // replace spaces by %20
TQString name = e.name; TQString name = e.name;
name = name.tqreplace(" ","%20"); name = name.replace(" ","%20");
TQString u = e.url.prettyURL(); TQString u = e.url.prettyURL();
u = u.tqreplace(" ","%20"); u = u.replace(" ","%20");
out << name << " " << u << ::endl; out << name << " " << u << ::endl;
i++; i++;
} }
@ -85,7 +85,7 @@ namespace kt
SearchEngine se; SearchEngine se;
se.name = tokens[0]; se.name = tokens[0];
se.name = se.name.tqreplace("%20"," "); se.name = se.name.replace("%20"," ");
se.url = KURL::fromPathOrURL(tokens[1]); se.url = KURL::fromPathOrURL(tokens[1]);
for(Uint32 i=2; i<tokens.count(); ++i) for(Uint32 i=2; i<tokens.count(); ++i)

@ -102,7 +102,7 @@ namespace kt
engine = 0; engine = 0;
TQString s_url = sl.getSearchURL(engine).prettyURL(); TQString s_url = sl.getSearchURL(engine).prettyURL();
s_url.tqreplace("FOOBAR", KURL::encode_string(text), true); s_url.replace("FOOBAR", KURL::encode_string(text), true);
KURL url = KURL::fromPathOrURL(s_url); KURL url = KURL::fromPathOrURL(s_url);
if(SearchPluginSettings::useDefaultBrowser()) if(SearchPluginSettings::useDefaultBrowser())
@ -141,7 +141,7 @@ namespace kt
void SearchPlugin::tabCloseRequest(kt::GUIInterface* gui,TQWidget* tab) void SearchPlugin::tabCloseRequest(kt::GUIInterface* gui,TQWidget* tab)
{ {
if (searches.tqcontains((SearchWidget*)tab)) if (searches.contains((SearchWidget*)tab))
{ {
searches.remove((SearchWidget*)tab); searches.remove((SearchWidget*)tab);
gui->removeTabPage(tab); gui->removeTabPage(tab);

@ -112,7 +112,7 @@ namespace kt
TQListViewItem* item = itr.current(); TQListViewItem* item = itr.current();
TQString u = item->text(1); TQString u = item->text(1);
TQString name = item->text(0); TQString name = item->text(0);
out << name.tqreplace(" ","%20") << " " << u.tqreplace(" ","%20") << endl; out << name.replace(" ","%20") << " " << u.replace(" ","%20") << endl;
itr++; itr++;
} }
} }
@ -123,7 +123,7 @@ namespace kt
{ {
KMessageBox::error(this, i18n("You must enter the search engine's name and URL")); KMessageBox::error(this, i18n("You must enter the search engine's name and URL"));
} }
else if ( m_engine_url->text().tqcontains("FOOBAR") ) else if ( m_engine_url->text().contains("FOOBAR") )
{ {
KURL url = KURL::fromPathOrURL(m_engine_url->text()); KURL url = KURL::fromPathOrURL(m_engine_url->text());
if ( !url.isValid() ) if ( !url.isValid() )
@ -132,7 +132,7 @@ namespace kt
return; return;
} }
if (m_engines->tqfindItem(m_engine_name->text(), 0)) if (m_engines->findItem(m_engine_name->text(), 0))
{ {
KMessageBox::error(this, i18n("A search engine with the same name already exists. Please use a different name.")); return; KMessageBox::error(this, i18n("A search engine with the same name already exists. Please use a different name.")); return;
} }
@ -217,7 +217,7 @@ namespace kt
TQStringList tokens = TQStringList::split(" ", line); TQStringList tokens = TQStringList::split(" ", line);
TQString name = tokens[0]; TQString name = tokens[0];
name = name.tqreplace("%20"," "); name = name.replace("%20"," ");
KURL url = KURL::fromPathOrURL(tokens[1]); KURL url = KURL::fromPathOrURL(tokens[1]);
for(Uint32 i=2; i<tokens.count(); ++i) for(Uint32 i=2; i<tokens.count(); ++i)
@ -229,7 +229,7 @@ namespace kt
TQMap<TQString,KURL>::iterator i = engines.begin(); TQMap<TQString,KURL>::iterator i = engines.begin();
while (i != engines.end()) while (i != engines.end())
{ {
TQListViewItem* item = m_engines->tqfindItem(i.key(),0); TQListViewItem* item = m_engines->findItem(i.key(),0);
// if we have found the item, replace it if not make a new one // if we have found the item, replace it if not make a new one
if (item) if (item)
item->setText(1, i.data().prettyURL()); item->setText(1, i.data().prettyURL());

@ -172,7 +172,7 @@ namespace kt
engine = sbar->m_search_engine->currentItem(); engine = sbar->m_search_engine->currentItem();
TQString s_url = sl.getSearchURL(engine).prettyURL(); TQString s_url = sl.getSearchURL(engine).prettyURL();
s_url.tqreplace("FOOBAR", KURL::encode_string(text), true); s_url.replace("FOOBAR", KURL::encode_string(text), true);
KURL url = KURL::fromPathOrURL(s_url); KURL url = KURL::fromPathOrURL(s_url);
statusBarMsg(i18n("Searching for %1...").tqarg(text)); statusBarMsg(i18n("Searching for %1...").tqarg(text));

@ -433,8 +433,8 @@ void ChartDrawer::MakeLegendTooltip()
img[i].setPixel(15, px, 0); //r img[i].setPixel(15, px, 0); //r
} }
factory->setImage(mEls[i].GetName().tqreplace(' ', '_') + "-" + TQString::number(i), img[i]); factory->setImage(mEls[i].GetName().replace(' ', '_') + "-" + TQString::number(i), img[i]);
helpstr += TQString("<img src='%1'>&nbsp;&nbsp;-&nbsp;&nbsp;%2<br>").tqarg(mEls[i].GetName().tqreplace(" ", "_") + "-" + TQString::number(i)).tqarg( mEls[i].GetName() ); helpstr += TQString("<img src='%1'>&nbsp;&nbsp;-&nbsp;&nbsp;%2<br>").tqarg(mEls[i].GetName().replace(" ", "_") + "-" + TQString::number(i)).tqarg( mEls[i].GetName() );
} }
TQToolTip::add(this, helpstr); TQToolTip::add(this, helpstr);

@ -43,7 +43,7 @@ void PeerMonitor::peerRemoved (kt::PeerInterface *peer)
TQMutexLocker lock(&mtx); TQMutexLocker lock(&mtx);
data_t::iterator it = std::tqfind(mPeers.begin(), mPeers.end(), peer); data_t::iterator it = std::find(mPeers.begin(), mPeers.end(), peer);
if(it != mPeers.end()) if(it != mPeers.end())
{ {
@ -73,7 +73,7 @@ void PeerMonitor::stopped ()
void PeerMonitor::destroyed () void PeerMonitor::destroyed ()
{ {
if(pmPeerMMgr -> tqfind(pmTorIface -> getInfoHash()) != pmPeerMMgr -> end() ) if(pmPeerMMgr -> find(pmTorIface -> getInfoHash()) != pmPeerMMgr -> end() )
{ {
pmTorIface -> setMonitor(0); pmTorIface -> setMonitor(0);
pmPeerMMgr -> erase(pmTorIface -> getInfoHash()); pmPeerMMgr -> erase(pmTorIface -> getInfoHash());

@ -103,7 +103,7 @@ namespace kt
else else
{ {
// add it to the list and emit the signal // add it to the list and emit the signal
if (!routers.tqcontains(r->getServer())) if (!routers.contains(r->getServer()))
{ {
routers.insert(r->getServer(),r); routers.insert(r->getServer(),r);
discovered(r); discovered(r);
@ -164,13 +164,13 @@ namespace kt
// first read first line and see if contains a HTTP 200 OK message // first read first line and see if contains a HTTP 200 OK message
TQString line = lines.first(); TQString line = lines.first();
if (!line.tqcontains("HTTP")) if (!line.contains("HTTP"))
{ {
// it is either a 200 OK or a NOTIFY // it is either a 200 OK or a NOTIFY
if (!line.tqcontains("NOTIFY") && !line.tqcontains("200")) if (!line.contains("NOTIFY") && !line.contains("200"))
return 0; return 0;
} }
else if (line.tqcontains("M-SEARCH")) // ignore M-SEARCH else if (line.contains("M-SEARCH")) // ignore M-SEARCH
return 0; return 0;
// quick check that the response being parsed is valid // quick check that the response being parsed is valid
@ -178,7 +178,7 @@ namespace kt
for (Uint32 idx = 0;idx < lines.count() && !validDevice; idx++) for (Uint32 idx = 0;idx < lines.count() && !validDevice; idx++)
{ {
line = lines[idx]; line = lines[idx];
if ((line.tqcontains("ST:") || line.tqcontains("NT:")) && line.tqcontains("InternetGatewayDevice")) if ((line.contains("ST:") || line.contains("NT:")) && line.contains("InternetGatewayDevice"))
{ {
validDevice = true; validDevice = true;
} }
@ -195,20 +195,20 @@ namespace kt
line = lines[i]; line = lines[i];
if (line.startsWith("Location") || line.startsWith("LOCATION") || line.startsWith("location")) if (line.startsWith("Location") || line.startsWith("LOCATION") || line.startsWith("location"))
{ {
location = line.mid(line.tqfind(':') + 1).stripWhiteSpace(); location = line.mid(line.find(':') + 1).stripWhiteSpace();
if (!location.isValid()) if (!location.isValid())
return 0; return 0;
} }
else if (line.startsWith("Server") || line.startsWith("server") || line.startsWith("SERVER")) else if (line.startsWith("Server") || line.startsWith("server") || line.startsWith("SERVER"))
{ {
server = line.mid(line.tqfind(':') + 1).stripWhiteSpace(); server = line.mid(line.find(':') + 1).stripWhiteSpace();
if (server.length() == 0) if (server.length() == 0)
return 0; return 0;
} }
} }
if (routers.tqcontains(server)) if (routers.contains(server))
{ {
return 0; return 0;
} }
@ -265,7 +265,7 @@ namespace kt
TQString server, location; TQString server, location;
server = fin.readLine(); server = fin.readLine();
location = fin.readLine(); location = fin.readLine();
if (!routers.tqcontains(server)) if (!routers.contains(server))
{ {
UPnPRouter* r = new UPnPRouter(server,location); UPnPRouter* r = new UPnPRouter(server,location);
// download it's xml file // download it's xml file

@ -49,7 +49,7 @@ namespace kt
Uint32 getNumDevicesDiscovered() const {return routers.count();} Uint32 getNumDevicesDiscovered() const {return routers.count();}
/// Find a router using it's server name /// Find a router using it's server name
UPnPRouter* findDevice(const TQString & name) {return routers.tqfind(name);} UPnPRouter* findDevice(const TQString & name) {return routers.find(name);}
/// Save all routers to a file (for convenience at startup) /// Save all routers to a file (for convenience at startup)
void saveRouters(const TQString & file); void saveRouters(const TQString & file);

@ -201,7 +201,7 @@ namespace kt
msg += TQString::number(f.port.number) + " ("; msg += TQString::number(f.port.number) + " (";
TQString prot = (f.port.proto == net::UDP ? "UDP" : "TCP"); TQString prot = (f.port.proto == net::UDP ? "UDP" : "TCP");
msg += prot + ")"; msg += prot + ")";
if (f.service->servicetype.tqcontains("WANPPPConnection")) if (f.service->servicetype.contains("WANPPPConnection"))
services += "PPP"; services += "PPP";
else else
services += "IP"; services += "IP";

@ -88,7 +88,7 @@ namespace kt
void HttpServer::slotSocketReadyToRead() void HttpServer::slotSocketReadyToRead()
{ {
TQSocket* client = (TQSocket*)sender(); TQSocket* client = (TQSocket*)sender();
HttpClientHandler* handler = clients.tqfind(client); HttpClientHandler* handler = clients.find(client);
if (!handler) if (!handler)
{ {
client->deleteLater(); client->deleteLater();
@ -112,7 +112,7 @@ namespace kt
Uint8 h = (a.latin1() - (a.isNumber() ? '0' : 'a')) << 4; Uint8 h = (a.latin1() - (a.isNumber() ? '0' : 'a')) << 4;
Uint8 l = (b.latin1() - (b.isNumber() ? '0' : 'a')); Uint8 l = (b.latin1() - (b.isNumber() ? '0' : 'a'));
char r = (char) h | l; // combine them and cast to a char char r = (char) h | l; // combine them and cast to a char
password.tqreplace(idx,3,r); password.replace(idx,3,r);
return idx + 1; return idx + 1;
} }
@ -134,7 +134,7 @@ namespace kt
// check for passwords with url encoded stuff in them and decode them if necessary // check for passwords with url encoded stuff in them and decode them if necessary
int idx = 0; int idx = 0;
while ((idx = password.tqfind('%',idx)) > 0) while ((idx = password.find('%',idx)) > 0)
{ {
if (idx + 2 < password.length()) if (idx + 2 < password.length())
{ {
@ -170,7 +170,7 @@ namespace kt
if (hdr.hasKey("Cookie")) if (hdr.hasKey("Cookie"))
{ {
TQString cookie = hdr.value("Cookie"); TQString cookie = hdr.value("Cookie");
int idx = cookie.tqfind("KT_SESSID="); int idx = cookie.find("KT_SESSID=");
if (idx == -1) if (idx == -1)
return false; return false;
@ -432,7 +432,7 @@ namespace kt
{ {
const char* ptr = data.data(); const char* ptr = data.data();
Uint32 len = data.size(); Uint32 len = data.size();
int pos = TQString(data).tqfind("\r\n\r\n"); int pos = TQString(data).find("\r\n\r\n");
if (pos == -1 || pos + 4 >= len || ptr[pos + 4] != 'd') if (pos == -1 || pos + 4 >= len || ptr[pos + 4] != 'd')
{ {
@ -540,7 +540,7 @@ namespace kt
bt::MMapFile* HttpServer::cacheLookup(const TQString & name) bt::MMapFile* HttpServer::cacheLookup(const TQString & name)
{ {
return cache.tqfind(name); return cache.find(name);
} }
void HttpServer::insertIntoCache(const TQString & name,bt::MMapFile* file) void HttpServer::insertIntoCache(const TQString & name,bt::MMapFile* file)

@ -48,7 +48,7 @@ namespace kt
bool PhpHandler::executeScript(const TQString & path,const TQMap<TQString,TQString> & args) bool PhpHandler::executeScript(const TQString & path,const TQMap<TQString,TQString> & args)
{ {
TQByteArray php_s; TQByteArray php_s;
if (!scripts.tqcontains(path)) if (!scripts.contains(path))
{ {
TQFile fptr(path); TQFile fptr(path);
if (!fptr.open(IO_ReadOnly)) if (!fptr.open(IO_ReadOnly))
@ -66,7 +66,7 @@ namespace kt
output.resize(0); output.resize(0);
int firstphptag = TQCString(php_s).tqfind("<?php"); int firstphptag = TQCString(php_s).find("<?php");
if (firstphptag == -1) if (firstphptag == -1)
return false; return false;

@ -114,13 +114,13 @@ namespace kt
out << TQString("\"leechers_connected_to\" => %1,\n").tqarg(stats.leechers_connected_to); out << TQString("\"leechers_connected_to\" => %1,\n").tqarg(stats.leechers_connected_to);
out << TQString("\"status\" => %1,\n").tqarg(stats.status); out << TQString("\"status\" => %1,\n").tqarg(stats.status);
out << TQString("\"running\" => %1,\n").tqarg(stats.running); out << TQString("\"running\" => %1,\n").tqarg(stats.running);
out << TQString("\"trackerstatus\" => \"%1\",\n").tqarg(stats.trackerstatus.tqreplace("\\", "\\\\").tqreplace("\"", "\\\"").tqreplace("$", "\\$")); out << TQString("\"trackerstatus\" => \"%1\",\n").tqarg(stats.trackerstatus.replace("\\", "\\\\").replace("\"", "\\\"").replace("$", "\\$"));
out << TQString("\"session_bytes_downloaded\" => %1,\n").tqarg(stats.session_bytes_downloaded); out << TQString("\"session_bytes_downloaded\" => %1,\n").tqarg(stats.session_bytes_downloaded);
out << TQString("\"session_bytes_uploaded\" => %1,\n").tqarg(stats.session_bytes_uploaded); out << TQString("\"session_bytes_uploaded\" => %1,\n").tqarg(stats.session_bytes_uploaded);
out << TQString("\"trk_bytes_downloaded\" => %1,\n").tqarg(stats.trk_bytes_downloaded); out << TQString("\"trk_bytes_downloaded\" => %1,\n").tqarg(stats.trk_bytes_downloaded);
out << TQString("\"trk_bytes_uploaded\" => %1,\n").tqarg(stats.trk_bytes_uploaded); out << TQString("\"trk_bytes_uploaded\" => %1,\n").tqarg(stats.trk_bytes_uploaded);
out << TQString("\"torrent_name\" => \"%1\",\n").tqarg(stats.torrent_name.tqreplace("\\", "\\\\").tqreplace("\"", "\\\"").tqreplace("$", "\\$")); out << TQString("\"torrent_name\" => \"%1\",\n").tqarg(stats.torrent_name.replace("\\", "\\\\").replace("\"", "\\\"").replace("$", "\\$"));
out << TQString("\"output_path\" => \"%1\",\n").tqarg(stats.output_path.tqreplace("\\", "\\\\").tqreplace("\"", "\\\"").tqreplace("$", "\\$")); out << TQString("\"output_path\" => \"%1\",\n").tqarg(stats.output_path.replace("\\", "\\\\").replace("\"", "\\\"").replace("$", "\\$"));
out << TQString("\"stopped_by_error\" => \"%1\",\n").tqarg(stats.stopped_by_error); out << TQString("\"stopped_by_error\" => \"%1\",\n").tqarg(stats.stopped_by_error);
out << TQString("\"completed\" => \"%1\",\n").tqarg(stats.completed); out << TQString("\"completed\" => \"%1\",\n").tqarg(stats.completed);
out << TQString("\"user_controlled\" => \"%1\",\n").tqarg(stats.user_controlled); out << TQString("\"user_controlled\" => \"%1\",\n").tqarg(stats.user_controlled);
@ -263,7 +263,7 @@ namespace kt
break; break;
case 'f': case 'f':
//parse argument into torrent number and file number //parse argument into torrent number and file number
separator_loc=it.data().tqfind('-'); separator_loc=it.data().find('-');
parse=it.data(); parse=it.data();
torrent_num.append(parse.left(separator_loc)); torrent_num.append(parse.left(separator_loc));
file_num.append(parse.right(parse.length()-(separator_loc+1))); file_num.append(parse.right(parse.length()-(separator_loc+1)));

@ -174,7 +174,7 @@ class RestInterface {
// Truncate long torrent name, and HTML escape it. // Truncate long torrent name, and HTML escape it.
// This is a helper function for download_status. // This is a helper function for download_status.
private function _clean_name($name) { private function _clean_name($name) {
$name = str_tqreplace("'", "\'", $name); $name = str_replace("'", "\'", $name);
if (strlen($name) > 30) { if (strlen($name) > 30) {
$name = substr($name, 0, 27); $name = substr($name, 0, 27);
$name .= "..."; $name .= "...";

@ -118,7 +118,7 @@ function generate_button_code($img, $alt, $href='')
foreach ($stats as $torrent) { foreach ($stats as $torrent) {
echo "\t\t".'<tr>'."\n\t\t\t"; echo "\t\t".'<tr>'."\n\t\t\t";
$torrent_name = str_tqreplace("'", "\'", $torrent['torrent_name']); $torrent_name = str_replace("'", "\'", $torrent['torrent_name']);
if($torrent['total_bytes_to_download']!=0) $perc = round(100.0 - ($torrent['bytes_left_to_download'] / $torrent['total_bytes_to_download']) * 100.0, 2); if($torrent['total_bytes_to_download']!=0) $perc = round(100.0 - ($torrent['bytes_left_to_download'] / $torrent['total_bytes_to_download']) * 100.0, 2);
else $perc = 0; else $perc = 0;
if(strlen($torrent['torrent_name'])>30) $display_name=substr($torrent['torrent_name'], 0, 30)." ..."; if(strlen($torrent['torrent_name'])>30) $display_name=substr($torrent['torrent_name'], 0, 30)." ...";

@ -84,7 +84,7 @@ namespace kt
void ZeroConfPlugin::torrentAdded(kt::TorrentInterface* tc) void ZeroConfPlugin::torrentAdded(kt::TorrentInterface* tc)
{ {
if (services.tqcontains(tc)) if (services.contains(tc))
return; return;
bt::Uint16 port = bt::Globals::instance().getServer().getPortInUse(); bt::Uint16 port = bt::Globals::instance().getServer().getPortInUse();
@ -100,7 +100,7 @@ namespace kt
void ZeroConfPlugin::torrentRemoved(kt::TorrentInterface* tc) void ZeroConfPlugin::torrentRemoved(kt::TorrentInterface* tc)
{ {
AvahiService* av = services.tqfind(tc); AvahiService* av = services.find(tc);
if (!av) if (!av)
return; return;
Out(SYS_ZCO|LOG_NOTICE) << "ZeroConf service removed for " Out(SYS_ZCO|LOG_NOTICE) << "ZeroConf service removed for "

Loading…
Cancel
Save