summaryrefslogtreecommitdiffstats
path: root/src/valuemanager.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-09 19:45:27 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-09 19:45:27 +0000
commitf4f8ac034fa04404e2fcd5029ba050c537c07d7a (patch)
tree0daa81b0533ce203c33d5571dcb842257dba4cd0 /src/valuemanager.cpp
parent4488b6112c4e22493ed88c68035b980a5b42228d (diff)
downloadabakus-f4f8ac034fa04404e2fcd5029ba050c537c07d7a.tar.gz
abakus-f4f8ac034fa04404e2fcd5029ba050c537c07d7a.zip
TQt4 port Abakus
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/abakus@1231045 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/valuemanager.cpp')
-rw-r--r--src/valuemanager.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/valuemanager.cpp b/src/valuemanager.cpp
index 93cfa77..afb72dd 100644
--- a/src/valuemanager.cpp
+++ b/src/valuemanager.cpp
@@ -19,7 +19,7 @@
#include <kdebug.h>
#include <klocale.h>
-#include <qregexp.h>
+#include <tqregexp.h>
#include "numerictypes.h"
#include "valuemanager.h"
@@ -34,43 +34,43 @@ ValueManager *ValueManager::instance()
return m_manager;
}
-ValueManager::ValueManager(QObject *parent, const char *name) :
- QObject(parent, name)
+ValueManager::ValueManager(TQObject *tqparent, const char *name) :
+ TQObject(tqparent, name)
{
m_values.insert("pi", Abakus::number_t::PI);
m_values.insert("e", Abakus::number_t::E);
}
-Abakus::number_t ValueManager::value(const QString &name) const
+Abakus::number_t ValueManager::value(const TQString &name) const
{
return m_values[name];
}
-bool ValueManager::isValueSet(const QString &name) const
+bool ValueManager::isValueSet(const TQString &name) const
{
- return m_values.contains(name);
+ return m_values.tqcontains(name);
}
-bool ValueManager::isValueReadOnly(const QString &name) const
+bool ValueManager::isValueReadOnly(const TQString &name) const
{
- QRegExp readOnlyValues("^(ans|pi|e|stackCount)$");
+ TQRegExp readOnlyValues("^(ans|pi|e|stackCount)$");
- return name.find(readOnlyValues) != -1;
+ return name.tqfind(readOnlyValues) != -1;
}
-void ValueManager::setValue(const QString &name, const Abakus::number_t value)
+void ValueManager::setValue(const TQString &name, const Abakus::number_t value)
{
- if(m_values.contains(name) && this->value(name) != value)
+ if(m_values.tqcontains(name) && this->value(name) != value)
emit signalValueChanged(name, value);
- else if(!m_values.contains(name))
+ else if(!m_values.tqcontains(name))
emit signalValueAdded(name, value);
- m_values.replace(name, value);
+ m_values.tqreplace(name, value);
}
-void ValueManager::removeValue(const QString &name)
+void ValueManager::removeValue(const TQString &name)
{
- if(m_values.contains(name))
+ if(m_values.tqcontains(name))
emit signalValueRemoved(name);
m_values.remove(name);
@@ -78,26 +78,26 @@ void ValueManager::removeValue(const QString &name)
void ValueManager::slotRemoveUserVariables()
{
- QStringList vars = valueNames();
+ TQStringList vars = valueNames();
- for(QStringList::ConstIterator var = vars.constBegin(); var != vars.constEnd(); ++var)
+ for(TQStringList::ConstIterator var = vars.constBegin(); var != vars.constEnd(); ++var)
if(!isValueReadOnly(*var))
removeValue(*var);
}
-QStringList ValueManager::valueNames() const
+TQStringList ValueManager::valueNames() const
{
return m_values.keys();
}
-QString ValueManager::description(const QString &valueName)
+TQString ValueManager::description(const TQString &valueName)
{
if(valueName == "e")
return i18n("Natural exponential base - 2.7182818");
if(valueName == "pi")
return i18n("pi (π) - 3.1415926");
- return QString();
+ return TQString();
}
#include "valuemanager.moc"