From 551fb6d0d8c5d2ed90363a1017816d252b03d9bd Mon Sep 17 00:00:00 2001 From: tpearson Date: Wed, 10 Aug 2011 06:08:18 +0000 Subject: [PATCH] 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 --- src/editor.cpp | 2 +- src/function.cpp | 8 ++++---- src/hmath.cpp | 2 +- src/mainwindow.cpp | 12 ++++++------ src/numerictypes.cpp | 10 +++++----- src/valuemanager.cpp | 12 ++++++------ 6 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/editor.cpp b/src/editor.cpp index ec83878..caadb5e 100644 --- a/src/editor.cpp +++ b/src/editor.cpp @@ -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 diff --git a/src/function.cpp b/src/function.cpp index a61b8f9..9cab08a 100644 --- a/src/function.cpp +++ b/src/function.cpp @@ -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; diff --git a/src/hmath.cpp b/src/hmath.cpp index 736b241..893d7b3 100644 --- a/src/hmath.cpp +++ b/src/hmath.cpp @@ -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 ) { diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 8ae3fc4..764c2aa 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -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(m_varList->tqfindItem(name, 0)); + ValueListViewItem *item = static_cast(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; diff --git a/src/numerictypes.cpp b/src/numerictypes.cpp index c75268e..b7d607d 100644 --- a/src/numerictypes.cpp +++ b/src/numerictypes.cpp @@ -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. diff --git a/src/valuemanager.cpp b/src/valuemanager.cpp index afb72dd..8dcae90 100644 --- a/src/valuemanager.cpp +++ b/src/valuemanager.cpp @@ -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);