rename the following methods:

tqfind find
tqreplace replace
tqcontains contains


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/abakus@1246075 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 13 years ago
parent 1b7882c63e
commit 551fb6d0d8

@ -596,7 +596,7 @@ void Editor::autoCalc()
// If we're using set for a function don't try.
TQRegExp setFn("\\s*set.*\\(.*=");
if( str.tqfind(setFn) != -1 )
if( str.find(setFn) != -1 )
return;
// strip off assignment operator, e.g. "x=1+2" becomes "1+2" only

@ -89,8 +89,8 @@ bool FunctionManager::addFunction(const TQString &name, function_t fn, const TQS
newFn->description = desc;
newFn->fn = fn;
newFn->userDefined = false;
newFn->returnsTrig = fnName.tqcontains(returnTrigRE);
newFn->needsTrig = fnName.tqcontains(needsTrigRE);
newFn->returnsTrig = fnName.contains(returnTrigRE);
newFn->needsTrig = fnName.contains(needsTrigRE);
m_dict.insert(name, newFn);
@ -179,10 +179,10 @@ bool FunctionManager::addFunction(BaseFunction *fn, const TQString &dependantVar
fnTabEntry->needsTrig = false;
fnTabEntry->userDefined = true;
if(m_dict.tqfind(fn->name()))
if(m_dict.find(fn->name()))
emit signalFunctionRemoved(fn->name());
m_dict.tqreplace(fn->name(), fnTabEntry);
m_dict.replace(fn->name(), fnTabEntry);
emit signalFunctionAdded(fn->name());
return true;

@ -224,7 +224,7 @@ static bc_num h_div( bc_num n1, bc_num n2 )
return r;
}
// tqfind 10 raise to num
// find 10 raise to num
// e.g.: when num is 5, it results 100000
static bc_num h_raise10( int n )
{

@ -193,7 +193,7 @@ void MainWindow::slotReturnPressed()
{
TQString text = m_edit->text();
text.tqreplace("\n", "");
text.replace("\n", "");
m_edit->appendHistory(text);
@ -301,7 +301,7 @@ void MainWindow::slotTextChanged()
if(inRPNMode())
return;
if(str.tqfind(TQRegExp("^[-+*/^]")) != -1) {
if(str.find(TQRegExp("^[-+*/^]")) != -1) {
m_edit->setText("ans " + str + " ");
m_edit->moveCursor(TQTextEdit::MoveEnd, false);
}
@ -643,7 +643,7 @@ void MainWindow::slotRemoveFunction(const TQString &name)
TQString fnName = TQString("%1(%2)").tqarg(name, userFn->varName);
TQListViewItem *item = 0;
while((item = m_fnList->tqfindItem(fnName, 0)) != 0)
while((item = m_fnList->findItem(fnName, 0)) != 0)
delete item;
}
@ -654,7 +654,7 @@ void MainWindow::slotNewValue(const TQString &name, Abakus::number_t value)
void MainWindow::slotChangeValue(const TQString &name, Abakus::number_t value)
{
ValueListViewItem *item = static_cast<ValueListViewItem *>(m_varList->tqfindItem(name, 0));
ValueListViewItem *item = static_cast<ValueListViewItem *>(m_varList->findItem(name, 0));
if(item)
item->valueChanged(value);
@ -662,7 +662,7 @@ void MainWindow::slotChangeValue(const TQString &name, Abakus::number_t value)
void MainWindow::slotRemoveValue(const TQString &name)
{
delete m_varList->tqfindItem(name, 0);
delete m_varList->findItem(name, 0);
}
void MainWindow::slotToggleCompactMode()
@ -718,7 +718,7 @@ TQString MainWindow::interpolateExpression(const TQString &text, ResultListViewT
return TQString();
}
str.tqreplace(pos, stackStr.length(), value.toString());
str.replace(pos, stackStr.length(), value.toString());
}
return str;

@ -72,7 +72,7 @@ TQString convertToString(const mpfr_ptr &number)
// Remove trailing zeroes.
if(Abakus::m_prec < 0)
r.tqreplace(zeroKiller, "");
r.replace(zeroKiller, "");
// But don't display numbers like 2.e10 either.
if(r.isEmpty())
@ -124,7 +124,7 @@ TQString convertToString(const mpfr_ptr &number)
}
// Remove trailing zeroes.
r.tqreplace(zeroKiller, "");
r.replace(zeroKiller, "");
// Don't display numbers of the form .23
if(l.isEmpty())
@ -176,7 +176,7 @@ TQString convertToString(const HNumber &num)
{
TQString str = HMath::formatGenString(num, m_prec);
TQString decimalSymbol = KGlobal::locale()->decimalSymbol();
str.tqreplace('.', decimalSymbol);
str.replace('.', decimalSymbol);
TQStringList parts = TQStringList::split("e", str);
TQRegExp zeroKiller("(" + TQRegExp::escape(decimalSymbol) +
@ -184,8 +184,8 @@ TQString convertToString(const HNumber &num)
TQRegExp zeroKiller2("(" + TQRegExp::escape(decimalSymbol) + ")0*$");
str = parts[0];
str.tqreplace(zeroKiller, "\\1");
str.tqreplace(zeroKiller2, "\\1");
str.replace(zeroKiller, "\\1");
str.replace(zeroKiller2, "\\1");
if(str.endsWith(decimalSymbol))
str.truncate(str.length() - 1); // Remove trailing period.

@ -48,29 +48,29 @@ Abakus::number_t ValueManager::value(const TQString &name) const
bool ValueManager::isValueSet(const TQString &name) const
{
return m_values.tqcontains(name);
return m_values.contains(name);
}
bool ValueManager::isValueReadOnly(const TQString &name) const
{
TQRegExp readOnlyValues("^(ans|pi|e|stackCount)$");
return name.tqfind(readOnlyValues) != -1;
return name.find(readOnlyValues) != -1;
}
void ValueManager::setValue(const TQString &name, const Abakus::number_t value)
{
if(m_values.tqcontains(name) && this->value(name) != value)
if(m_values.contains(name) && this->value(name) != value)
emit signalValueChanged(name, value);
else if(!m_values.tqcontains(name))
else if(!m_values.contains(name))
emit signalValueAdded(name, value);
m_values.tqreplace(name, value);
m_values.replace(name, value);
}
void ValueManager::removeValue(const TQString &name)
{
if(m_values.tqcontains(name))
if(m_values.contains(name))
emit signalValueRemoved(name);
m_values.remove(name);

Loading…
Cancel
Save