summaryrefslogtreecommitdiffstats
path: root/libkdepim/kscoring.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:53:50 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:53:50 +0000
commit7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch)
tree8474f9b444b2756228600050f07a7ff25de532b2 /libkdepim/kscoring.cpp
parentf587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff)
downloadtdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz
tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libkdepim/kscoring.cpp')
-rw-r--r--libkdepim/kscoring.cpp248
1 files changed, 124 insertions, 124 deletions
diff --git a/libkdepim/kscoring.cpp b/libkdepim/kscoring.cpp
index 583133896..17dd1d439 100644
--- a/libkdepim/kscoring.cpp
+++ b/libkdepim/kscoring.cpp
@@ -22,12 +22,12 @@
#include <iostream>
-#include <qfile.h>
-#include <qdom.h>
-#include <qlayout.h>
-#include <qlabel.h>
-#include <qcheckbox.h>
-#include <qtextview.h>
+#include <tqfile.h>
+#include <tqdom.h>
+#include <tqlayout.h>
+#include <tqlabel.h>
+#include <tqcheckbox.h>
+#include <tqtextview.h>
#include <klocale.h>
#include <kstandarddirs.h>
@@ -40,9 +40,9 @@
//----------------------------------------------------------------------------
// a small function to encode attribute values, code stolen from QDom
-static QString toXml(const QString& str)
+static TQString toXml(const TQString& str)
{
- QString tmp(str);
+ TQString tmp(str);
uint len = tmp.length();
uint i = 0;
while ( i < len ) {
@@ -75,18 +75,18 @@ static QString toXml(const QString& str)
NotifyDialog* NotifyDialog::me = 0;
NotifyDialog::NotesMap NotifyDialog::dict;
-NotifyDialog::NotifyDialog(QWidget* p)
+NotifyDialog::NotifyDialog(TQWidget* p)
: KDialogBase(p,"notify action dialog",true,"Notify Message",Close,Close,true)
{
- QFrame *f = makeMainWidget();
- QVBoxLayout *topL = new QVBoxLayout(f);
- note = new QLabel(f);
+ TQFrame *f = makeMainWidget();
+ TQVBoxLayout *topL = new TQVBoxLayout(f);
+ note = new TQLabel(f);
note->setTextFormat(RichText);
topL->addWidget(note);
- QCheckBox *check = new QCheckBox(i18n("Do not show this message again"),f);
+ TQCheckBox *check = new TQCheckBox(i18n("Do not show this message again"),f);
check->setChecked(true);
topL->addWidget(check);
- connect(check,SIGNAL(toggled(bool)),SLOT(slotShowAgainToggled(bool)));
+ connect(check,TQT_SIGNAL(toggled(bool)),TQT_SLOT(slotShowAgainToggled(bool)));
}
void NotifyDialog::slotShowAgainToggled(bool flag)
@@ -95,7 +95,7 @@ void NotifyDialog::slotShowAgainToggled(bool flag)
kdDebug(5100) << "note \"" << note << "\" will popup again: " << flag << endl;
}
-void NotifyDialog::display(ScorableArticle& a, const QString& s)
+void NotifyDialog::display(ScorableArticle& a, const TQString& s)
{
kdDebug(5100) << "displaying message" << endl;
if (!me) me = new NotifyDialog();
@@ -103,7 +103,7 @@ void NotifyDialog::display(ScorableArticle& a, const QString& s)
NotesMap::Iterator i = dict.find(s);
if (i == dict.end() || i.data()) {
- QString msg = i18n("Article\n<b>%1</b><br><b>%2</b><br>caused the following"
+ TQString msg = i18n("Article\n<b>%1</b><br><b>%2</b><br>caused the following"
" note to appear:<br>%3").
arg(a.from()).
arg(a.subject()).
@@ -121,7 +121,7 @@ ScorableArticle::~ScorableArticle()
{
}
-void ScorableArticle::displayMessage(const QString& note)
+void ScorableArticle::displayMessage(const TQString& note)
{
NotifyDialog::display(*this,note);
}
@@ -143,9 +143,9 @@ ActionBase::~ActionBase()
}
-QStringList ActionBase::userNames()
+TQStringList ActionBase::userNames()
{
- QStringList l;
+ TQStringList l;
l << userName(SETSCORE);
l << userName(NOTIFY);
l << userName(COLOR);
@@ -153,7 +153,7 @@ QStringList ActionBase::userNames()
return l;
}
-ActionBase* ActionBase::factory(int type, const QString &value)
+ActionBase* ActionBase::factory(int type, const TQString &value)
{
switch (type) {
case SETSCORE: return new ActionSetScore(value);
@@ -166,7 +166,7 @@ ActionBase* ActionBase::factory(int type, const QString &value)
}
}
-QString ActionBase::userName(int type)
+TQString ActionBase::userName(int type)
{
switch (type) {
case SETSCORE: return i18n("Adjust Score");
@@ -179,7 +179,7 @@ QString ActionBase::userName(int type)
}
}
-int ActionBase::getTypeForName(const QString& name)
+int ActionBase::getTypeForName(const TQString& name)
{
if (name == "SETSCORE") return SETSCORE;
else if (name == "NOTIFY") return NOTIFY;
@@ -192,7 +192,7 @@ int ActionBase::getTypeForName(const QString& name)
}
}
-int ActionBase::getTypeForUserName(const QString& name)
+int ActionBase::getTypeForUserName(const TQString& name)
{
if (name == userName(SETSCORE)) return SETSCORE;
else if (name == userName(NOTIFY)) return NOTIFY;
@@ -211,7 +211,7 @@ ActionSetScore::ActionSetScore(short v)
{
}
-ActionSetScore::ActionSetScore(const QString& s)
+ActionSetScore::ActionSetScore(const TQString& s)
{
val = s.toShort();
}
@@ -226,10 +226,10 @@ ActionSetScore::~ActionSetScore()
{
}
-QString ActionSetScore::toString() const
+TQString ActionSetScore::toString() const
{
- QString a;
- a += "<Action type=\"SETSCORE\" value=\"" + QString::number(val) + "\" />";
+ TQString a;
+ a += "<Action type=\"SETSCORE\" value=\"" + TQString::number(val) + "\" />";
return a;
}
@@ -244,12 +244,12 @@ ActionSetScore* ActionSetScore::clone() const
}
// the color action
-ActionColor::ActionColor(const QColor& c)
+ActionColor::ActionColor(const TQColor& c)
: ActionBase(), color(c)
{
}
-ActionColor::ActionColor(const QString& s)
+ActionColor::ActionColor(const TQString& s)
: ActionBase()
{
setValue(s);
@@ -263,9 +263,9 @@ ActionColor::ActionColor(const ActionColor& a)
ActionColor::~ActionColor()
{}
-QString ActionColor::toString() const
+TQString ActionColor::toString() const
{
- QString a;
+ TQString a;
a += "<Action type=\"COLOR\" value=\"" + toXml(color.name()) + "\" />";
return a;
}
@@ -282,7 +282,7 @@ ActionColor* ActionColor::clone() const
// the notify action
-ActionNotify::ActionNotify(const QString& s)
+ActionNotify::ActionNotify(const TQString& s)
{
note = s;
}
@@ -293,7 +293,7 @@ ActionNotify::ActionNotify(const ActionNotify& an)
note = an.note;
}
-QString ActionNotify::toString() const
+TQString ActionNotify::toString() const
{
return "<Action type=\"NOTIFY\" value=\"" + toXml(note) + "\" />";
}
@@ -321,7 +321,7 @@ ActionMarkAsRead::ActionMarkAsRead( const ActionMarkAsRead &action ) :
Q_UNUSED( action );
}
-QString ActionMarkAsRead::toString() const
+TQString ActionMarkAsRead::toString() const
{
return "<Action type=\"MARKASREAD\"/>";
}
@@ -346,7 +346,7 @@ NotifyCollection::~NotifyCollection()
{
}
-void NotifyCollection::addNote(const ScorableArticle& a, const QString& note)
+void NotifyCollection::addNote(const ScorableArticle& a, const TQString& note)
{
article_list *l = notifyList.find(note);
if (!l) {
@@ -359,14 +359,14 @@ void NotifyCollection::addNote(const ScorableArticle& a, const QString& note)
l->append(i);
}
-QString NotifyCollection::collection() const
+TQString NotifyCollection::collection() const
{
- QString notifyCollection = i18n("<h1>List of collected notes</h1>");
+ TQString notifyCollection = i18n("<h1>List of collected notes</h1>");
notifyCollection += "<p><ul>";
// first look thru the notes and create one string
- QDictIterator<article_list> it(notifyList);
+ TQDictIterator<article_list> it(notifyList);
for(;it.current();++it) {
- const QString& note = it.currentKey();
+ const TQString& note = it.currentKey();
notifyCollection += "<li>" + note + "<ul>";
article_list* alist = it.current();
article_list::Iterator ait;
@@ -381,12 +381,12 @@ QString NotifyCollection::collection() const
return notifyCollection;
}
-void NotifyCollection::displayCollection(QWidget *p) const
+void NotifyCollection::displayCollection(TQWidget *p) const
{
//KMessageBox::information(p,collection(),i18n("Collected Notes"));
KDialogBase *dlg = new KDialogBase( p, 0, false, i18n("Collected Notes"),
KDialogBase::Close, KDialogBase::Close );
- QTextView *text = new QTextView(dlg);
+ TQTextView *text = new TQTextView(dlg);
text->setText(collection());
dlg->setMainWidget(text);
dlg->setMinimumWidth(300);
@@ -395,7 +395,7 @@ void NotifyCollection::displayCollection(QWidget *p) const
}
//----------------------------------------------------------------------------
-KScoringExpression::KScoringExpression(const QString& h, const QString& t, const QString& n, const QString& ng)
+KScoringExpression::KScoringExpression(const TQString& h, const TQString& t, const TQString& n, const TQString& ng)
: header(h), expr_str(n)
{
if (t == "MATCH" ) {
@@ -430,7 +430,7 @@ KScoringExpression::KScoringExpression(const QString& h, const QString& t, const
}
// static
-int KScoringExpression::getConditionForName(const QString& s)
+int KScoringExpression::getConditionForName(const TQString& s)
{
if (s == getNameForCondition(CONTAINS)) return CONTAINS;
else if (s == getNameForCondition(MATCH)) return MATCH;
@@ -446,7 +446,7 @@ int KScoringExpression::getConditionForName(const QString& s)
}
// static
-QString KScoringExpression::getNameForCondition(int cond)
+TQString KScoringExpression::getNameForCondition(int cond)
{
switch (cond) {
case CONTAINS: return i18n("Contains Substring");
@@ -463,9 +463,9 @@ QString KScoringExpression::getNameForCondition(int cond)
}
// static
-QStringList KScoringExpression::conditionNames()
+TQStringList KScoringExpression::conditionNames()
{
- QStringList l;
+ TQStringList l;
l << getNameForCondition(CONTAINS);
l << getNameForCondition(MATCH);
l << getNameForCondition(MATCHCS);
@@ -476,9 +476,9 @@ QStringList KScoringExpression::conditionNames()
}
// static
-QStringList KScoringExpression::headerNames()
+TQStringList KScoringExpression::headerNames()
{
- QStringList l;
+ TQStringList l;
l.append("From");
l.append("Message-ID");
l.append("Subject");
@@ -499,7 +499,7 @@ bool KScoringExpression::match(ScorableArticle& a) const
{
//kdDebug(5100) << "matching against header " << c_header << endl;
bool res = true;
- QString head;
+ TQString head;
if (header == "From")
head = a.from();
@@ -536,20 +536,20 @@ bool KScoringExpression::match(ScorableArticle& a) const
return (neg)?!res:res;
}
-void KScoringExpression::write(QTextStream& st) const
+void KScoringExpression::write(TQTextStream& st) const
{
st << toString();
}
-QString KScoringExpression::toString() const
+TQString KScoringExpression::toString() const
{
// kdDebug(5100) << "KScoringExpression::toString() starts" << endl;
// kdDebug(5100) << "header is " << header << endl;
// kdDebug(5100) << "expr is " << expr_str << endl;
// kdDebug(5100) << "neg is " << neg << endl;
// kdDebug(5100) << "type is " << getType() << endl;
- QString e;
- e += "<Expression neg=\"" + QString::number(neg?1:0)
+ TQString e;
+ e += "<Expression neg=\"" + TQString::number(neg?1:0)
+ "\" header=\"" + header
+ "\" type=\"" + getTypeString()
+ "\" expr=\"" + toXml(expr_str)
@@ -558,12 +558,12 @@ QString KScoringExpression::toString() const
return e;
}
-QString KScoringExpression::getTypeString() const
+TQString KScoringExpression::getTypeString() const
{
return KScoringExpression::getTypeString(cond);
}
-QString KScoringExpression::getTypeString(int cond)
+TQString KScoringExpression::getTypeString(int cond)
{
switch (cond) {
case CONTAINS: return "CONTAINS";
@@ -584,7 +584,7 @@ int KScoringExpression::getType() const
}
//----------------------------------------------------------------------------
-KScoringRule::KScoringRule(const QString& n )
+KScoringRule::KScoringRule(const TQString& n )
: name(n), link(AND)
{
expressions.setAutoDelete(true);
@@ -600,7 +600,7 @@ KScoringRule::KScoringRule(const KScoringRule& r)
// copy expressions
expressions.clear();
const ScoreExprList& rexpr = r.expressions;
- QPtrListIterator<KScoringExpression> it(rexpr);
+ TQPtrListIterator<KScoringExpression> it(rexpr);
for ( ; it.current(); ++it ) {
KScoringExpression *t = new KScoringExpression(**it);
expressions.append(t);
@@ -608,7 +608,7 @@ KScoringRule::KScoringRule(const KScoringRule& r)
// copy actions
actions.clear();
const ActionList& ract = r.actions;
- QPtrListIterator<ActionBase> ait(ract);
+ TQPtrListIterator<ActionBase> ait(ract);
for ( ; ait.current(); ++ait ) {
ActionBase *t = *ait;
actions.append(t->clone());
@@ -643,7 +643,7 @@ void KScoringRule::addExpression( KScoringExpression* expr)
expressions.append(expr);
}
-void KScoringRule::addAction(int type, const QString& val)
+void KScoringRule::addAction(int type, const TQString& val)
{
ActionBase *action = ActionBase::factory(type,val);
addAction(action);
@@ -655,16 +655,16 @@ void KScoringRule::addAction(ActionBase* a)
actions.append(a);
}
-void KScoringRule::setLinkMode(const QString& l)
+void KScoringRule::setLinkMode(const TQString& l)
{
if (l == "OR") link = OR;
else link = AND;
}
-void KScoringRule::setExpire(const QString& e)
+void KScoringRule::setExpire(const TQString& e)
{
if (e != "never") {
- QStringList l = QStringList::split("-",e);
+ TQStringList l = TQStringList::split("-",e);
Q_ASSERT( l.count() == 3 );
expires.setYMD( (*(l.at(0))).toInt(),
(*(l.at(1))).toInt(),
@@ -673,10 +673,10 @@ void KScoringRule::setExpire(const QString& e)
kdDebug(5100) << "Rule " << getName() << " expires at " << getExpireDateString() << endl;
}
-bool KScoringRule::matchGroup(const QString& group) const
+bool KScoringRule::matchGroup(const TQString& group) const
{
for(GroupList::ConstIterator i=groups.begin(); i!=groups.end();++i) {
- QRegExp e(*i);
+ TQRegExp e(*i);
if (e.search(group, 0) != -1 &&
(uint)e.matchedLength() == group.length())
return true;
@@ -686,7 +686,7 @@ bool KScoringRule::matchGroup(const QString& group) const
void KScoringRule::applyAction(ScorableArticle& a) const
{
- QPtrListIterator<ActionBase> it(actions);
+ TQPtrListIterator<ActionBase> it(actions);
for(; it.current(); ++it) {
it.current()->apply(a);
}
@@ -700,7 +700,7 @@ void KScoringRule::applyRule(ScorableArticle& a) const
// << endl;
bool oper_and = (link == AND);
bool res = true;
- QPtrListIterator<KScoringExpression> it(expressions);
+ TQPtrListIterator<KScoringExpression> it(expressions);
//kdDebug(5100) << "checking " << expressions.count() << " expressions" << endl;
for (; it.current(); ++it) {
Q_ASSERT( it.current() );
@@ -711,26 +711,26 @@ void KScoringRule::applyRule(ScorableArticle& a) const
if (res) applyAction(a);
}
-void KScoringRule::applyRule(ScorableArticle& a /*, const QString& s*/, const QString& g) const
+void KScoringRule::applyRule(ScorableArticle& a /*, const TQString& s*/, const TQString& g) const
{
// check if one of the groups match
- for (QStringList::ConstIterator i = groups.begin(); i != groups.end(); ++i) {
- if (QRegExp(*i).search(g) != -1) {
+ for (TQStringList::ConstIterator i = groups.begin(); i != groups.end(); ++i) {
+ if (TQRegExp(*i).search(g) != -1) {
applyRule(a);
return;
}
}
}
-void KScoringRule::write(QTextStream& s) const
+void KScoringRule::write(TQTextStream& s) const
{
s << toString();
}
-QString KScoringRule::toString() const
+TQString KScoringRule::toString() const
{
//kdDebug(5100) << "KScoringRule::toString() starts" << endl;
- QString r;
+ TQString r;
r += "<Rule name=\"" + toXml(name) + "\" linkmode=\"" + getLinkModeName();
r += "\" expires=\"" + getExpireDateString() + "\">";
//kdDebug(5100) << "building grouplist..." << endl;
@@ -738,12 +738,12 @@ QString KScoringRule::toString() const
r += "<Group name=\"" + toXml(*i) + "\" />";
}
//kdDebug(5100) << "building expressionlist..." << endl;
- QPtrListIterator<KScoringExpression> eit(expressions);
+ TQPtrListIterator<KScoringExpression> eit(expressions);
for (; eit.current(); ++eit) {
r += eit.current()->toString();
}
//kdDebug(5100) << "building actionlist..." << endl;
- QPtrListIterator<ActionBase> ait(actions);
+ TQPtrListIterator<ActionBase> ait(actions);
for (; ait.current(); ++ait) {
r += ait.current()->toString();
}
@@ -752,7 +752,7 @@ QString KScoringRule::toString() const
return r;
}
-QString KScoringRule::getLinkModeName() const
+TQString KScoringRule::getLinkModeName() const
{
switch (link) {
case AND: return "AND";
@@ -761,25 +761,25 @@ QString KScoringRule::getLinkModeName() const
}
}
-QString KScoringRule::getExpireDateString() const
+TQString KScoringRule::getExpireDateString() const
{
if (expires.isNull()) return "never";
else {
- return QString::number(expires.year()) + QString("-")
- + QString::number(expires.month()) + QString("-")
- + QString::number(expires.day());
+ return TQString::number(expires.year()) + TQString("-")
+ + TQString::number(expires.month()) + TQString("-")
+ + TQString::number(expires.day());
}
}
bool KScoringRule::isExpired() const
{
- return (expires.isValid() && (expires < QDate::currentDate()));
+ return (expires.isValid() && (expires < TQDate::currentDate()));
}
//----------------------------------------------------------------------------
-KScoringManager::KScoringManager(const QString& appName)
+KScoringManager::KScoringManager(const TQString& appName)
: cacheValid(false)//, _s(0)
{
allRules.setAutoDelete(true);
@@ -799,8 +799,8 @@ KScoringManager::~KScoringManager()
void KScoringManager::load()
{
- QDomDocument sdoc("Scorefile");
- QFile f( mFilename );
+ TQDomDocument sdoc("Scorefile");
+ TQFile f( mFilename );
if ( !f.open( IO_ReadOnly ) )
return;
if ( !sdoc.setContent( &f ) ) {
@@ -819,22 +819,22 @@ void KScoringManager::load()
void KScoringManager::save()
{
kdDebug(5100) << "KScoringManager::save() starts" << endl;
- QFile f( mFilename );
+ TQFile f( mFilename );
if ( !f.open( IO_WriteOnly ) )
return;
- QTextStream stream(&f);
- stream.setEncoding(QTextStream::Unicode);
+ TQTextStream stream(&f);
+ stream.setEncoding(TQTextStream::Unicode);
kdDebug(5100) << "KScoringManager::save() creating xml" << endl;
createXMLfromInternal().save(stream,2);
kdDebug(5100) << "KScoringManager::save() finished" << endl;
}
-QDomDocument KScoringManager::createXMLfromInternal()
+TQDomDocument KScoringManager::createXMLfromInternal()
{
- // I was'nt able to create a QDomDocument in memory:(
+ // I was'nt able to create a TQDomDocument in memory:(
// so I write the content into a string, which is really stupid
- QDomDocument sdoc("Scorefile");
- QString ss; // scorestring
+ TQDomDocument sdoc("Scorefile");
+ TQString ss; // scorestring
ss += "<?xml version = '1.0'?><!DOCTYPE Scorefile >";
ss += toString();
ss += "</Scorefile>\n";
@@ -843,11 +843,11 @@ QDomDocument KScoringManager::createXMLfromInternal()
return sdoc;
}
-QString KScoringManager::toString() const
+TQString KScoringManager::toString() const
{
- QString s;
+ TQString s;
s += "<Scorefile>\n";
- QPtrListIterator<KScoringRule> it(allRules);
+ TQPtrListIterator<KScoringRule> it(allRules);
for( ; it.current(); ++it) {
s += it.current()->toString();
}
@@ -864,7 +864,7 @@ void KScoringManager::expireRules()
}
}
-void KScoringManager::createInternalFromXML(QDomNode n)
+void KScoringManager::createInternalFromXML(TQDomNode n)
{
static KScoringRule *cR = 0; // the currentRule
// the XML file was parsed and now we simply traverse the resulting tree
@@ -873,16 +873,16 @@ void KScoringManager::createInternalFromXML(QDomNode n)
<< " named " << n.toElement().tagName() << endl;
switch (n.nodeType()) {
- case QDomNode::DocumentNode: {
+ case TQDomNode::DocumentNode: {
// the document itself
break;
}
- case QDomNode::ElementNode: {
+ case TQDomNode::ElementNode: {
// Server, Newsgroup, Rule, Expression, Action
- QDomElement e = n.toElement();
+ TQDomElement e = n.toElement();
//kdDebug(5100) << "The name of the element is "
//<< e.tagName().latin1() << endl;
- QString s = e.tagName();
+ TQString s = e.tagName();
if (s == "Rule") {
cR = new KScoringRule(e.attribute("name"));
cR->setLinkMode(e.attribute("linkmode"));
@@ -909,7 +909,7 @@ void KScoringManager::createInternalFromXML(QDomNode n)
default: // kdDebug(5100) << "unknown DomNode::type" << endl;
;
}
- QDomNodeList nodelist = n.childNodes();
+ TQDomNodeList nodelist = n.childNodes();
unsigned cnt = nodelist.count();
//kdDebug(5100) << "recursive checking " << cnt << " nodes" << endl;
for (unsigned i=0;i<cnt;++i)
@@ -917,7 +917,7 @@ void KScoringManager::createInternalFromXML(QDomNode n)
}
}
-KScoringRule* KScoringManager::addRule(const ScorableArticle& a, QString group, short score)
+KScoringRule* KScoringManager::addRule(const ScorableArticle& a, TQString group, short score)
{
KScoringRule *rule = new KScoringRule(findUniqueName());
rule->addGroup( group );
@@ -925,7 +925,7 @@ KScoringRule* KScoringManager::addRule(const ScorableArticle& a, QString group,
new KScoringExpression("From","CONTAINS",
a.from(),"0"));
if (score) rule->addAction(new ActionSetScore(score));
- rule->setExpireDate(QDate::currentDate().addDays(30));
+ rule->setExpireDate(TQDate::currentDate().addDays(30));
addRule(rule);
KScoringEditor *edit = KScoringEditor::createEditor(this);
edit->setRule(rule);
@@ -975,14 +975,14 @@ void KScoringManager::cancelNewRule(KScoringRule *r)
}
}
-void KScoringManager::setRuleName(KScoringRule *r, const QString& s)
+void KScoringManager::setRuleName(KScoringRule *r, const TQString& s)
{
bool cont = true;
- QString text = s;
- QString oldName = r->getName();
+ TQString text = s;
+ TQString oldName = r->getName();
while (cont) {
cont = false;
- QPtrListIterator<KScoringRule> it(allRules);
+ TQPtrListIterator<KScoringRule> it(allRules);
for (; it.current(); ++it) {
if ( it.current() != r && it.current()->getName() == text ) {
kdDebug(5100) << "rule name " << text << " is not unique" << endl;
@@ -1009,7 +1009,7 @@ void KScoringManager::deleteRule(KScoringRule *r)
}
}
-void KScoringManager::editRule(KScoringRule *e, QWidget *w)
+void KScoringManager::editRule(KScoringRule *e, TQWidget *w)
{
KScoringEditor *edit = KScoringEditor::createEditor(this, w);
edit->setRule(e);
@@ -1061,7 +1061,7 @@ void KScoringManager::applyRules(ScorableGroup* )
kdWarning(5100) << "KScoringManager::applyRules(ScorableGroup* ) isn't implemented" << endl;
}
-void KScoringManager::applyRules(ScorableArticle& article, const QString& group)
+void KScoringManager::applyRules(ScorableArticle& article, const TQString& group)
{
setGroup(group);
applyRules(article);
@@ -1069,17 +1069,17 @@ void KScoringManager::applyRules(ScorableArticle& article, const QString& group)
void KScoringManager::applyRules(ScorableArticle& a)
{
- QPtrListIterator<KScoringRule> it(isCacheValid()? ruleList : allRules);
+ TQPtrListIterator<KScoringRule> it(isCacheValid()? ruleList : allRules);
for( ; it.current(); ++it) {
it.current()->applyRule(a);
}
}
-void KScoringManager::initCache(const QString& g)
+void KScoringManager::initCache(const TQString& g)
{
group = g;
ruleList.clear();
- QPtrListIterator<KScoringRule> it(allRules);
+ TQPtrListIterator<KScoringRule> it(allRules);
for (; it.current(); ++it) {
if ( it.current()->matchGroup(group) ) {
ruleList.append(it.current());
@@ -1090,7 +1090,7 @@ void KScoringManager::initCache(const QString& g)
setCacheValid(true);
}
-void KScoringManager::setGroup(const QString& g)
+void KScoringManager::setGroup(const TQString& g)
{
if (group != g) initCache(g);
}
@@ -1101,19 +1101,19 @@ bool KScoringManager::hasRulesForCurrentGroup()
}
-QStringList KScoringManager::getRuleNames()
+TQStringList KScoringManager::getRuleNames()
{
- QStringList l;
- QPtrListIterator<KScoringRule> it(allRules);
+ TQStringList l;
+ TQPtrListIterator<KScoringRule> it(allRules);
for( ; it.current(); ++it) {
l << it.current()->getName();
}
return l;
}
-KScoringRule* KScoringManager::findRule(const QString& ruleName)
+KScoringRule* KScoringManager::findRule(const TQString& ruleName)
{
- QPtrListIterator<KScoringRule> it(allRules);
+ TQPtrListIterator<KScoringRule> it(allRules);
for (; it.current(); ++it) {
if ( it.current()->getName() == ruleName ) {
return it;
@@ -1129,10 +1129,10 @@ bool KScoringManager::setCacheValid(bool v)
return res;
}
-QString KScoringManager::findUniqueName() const
+TQString KScoringManager::findUniqueName() const
{
int nr = 0;
- QString ret;
+ TQString ret;
bool duplicated=false;
while (nr < 99999999) {
@@ -1140,7 +1140,7 @@ QString KScoringManager::findUniqueName() const
ret = i18n("rule %1").arg(nr);
duplicated=false;
- QPtrListIterator<KScoringRule> it(allRules);
+ TQPtrListIterator<KScoringRule> it(allRules);
for( ; it.current(); ++it) {
if (it.current()->getName() == ret) {
duplicated = true;
@@ -1166,9 +1166,9 @@ bool KScoringManager::hasFeature(int p)
}
}
-QStringList KScoringManager::getDefaultHeaders() const
+TQStringList KScoringManager::getDefaultHeaders() const
{
- QStringList l;
+ TQStringList l;
l.append("Subject");
l.append("From");
l.append("Date");
@@ -1198,7 +1198,7 @@ RuleStack::RuleStack()
RuleStack::~RuleStack()
{}
-void RuleStack::push(QPtrList<KScoringRule>& l)
+void RuleStack::push(TQPtrList<KScoringRule>& l)
{
kdDebug(5100) << "RuleStack::push pushing list with " << l.count() << " rules" << endl;
KScoringManager::ScoringRuleList *l1 = new KScoringManager::ScoringRuleList;
@@ -1209,7 +1209,7 @@ void RuleStack::push(QPtrList<KScoringRule>& l)
kdDebug(5100) << "now there are " << stack.count() << " lists on the stack" << endl;
}
-void RuleStack::pop(QPtrList<KScoringRule>& l)
+void RuleStack::pop(TQPtrList<KScoringRule>& l)
{
top(l);
drop();
@@ -1217,7 +1217,7 @@ void RuleStack::pop(QPtrList<KScoringRule>& l)
kdDebug(5100) << "now there are " << stack.count() << " lists on the stack" << endl;
}
-void RuleStack::top(QPtrList<KScoringRule>& l)
+void RuleStack::top(TQPtrList<KScoringRule>& l)
{
l.clear();
KScoringManager::ScoringRuleList *l1 = stack.top();