summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2003-05-24 01:20:33 (UTC)
committer llornkcor <llornkcor>2003-05-24 01:20:33 (UTC)
commit62d2ddfb5cd77e2637cdf7fe16d76aac04975984 (patch) (side-by-side diff)
tree2157d57bab2d6e491226f5bc8468a4c2527e1456
parent0c4b5288ccd4bcd1668816a0c4e12ce0a76b4e6e (diff)
downloadopie-62d2ddfb5cd77e2637cdf7fe16d76aac04975984.zip
opie-62d2ddfb5cd77e2637cdf7fe16d76aac04975984.tar.gz
opie-62d2ddfb5cd77e2637cdf7fe16d76aac04975984.tar.bz2
QString to const QString
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/mailit/addresslist.cpp16
-rw-r--r--noncore/net/mailit/addresslist.h16
-rw-r--r--noncore/net/mailit/emailclient.cpp7
-rw-r--r--noncore/net/mailit/emailclient.h2
-rw-r--r--noncore/net/mailit/emailhandler.cpp4
-rw-r--r--noncore/net/mailit/emailhandler.h4
-rw-r--r--noncore/net/mailit/emaillistitem.cpp0
-rw-r--r--noncore/net/mailit/popclient.cpp4
-rw-r--r--noncore/net/mailit/popclient.h4
-rw-r--r--noncore/net/mailit/smtpclient.cpp4
-rw-r--r--noncore/net/mailit/smtpclient.h4
-rw-r--r--noncore/net/mailit/textparser.cpp14
-rw-r--r--noncore/net/mailit/textparser.h6
-rw-r--r--noncore/unsupported/mailit/addresslist.cpp16
-rw-r--r--noncore/unsupported/mailit/addresslist.h16
-rw-r--r--noncore/unsupported/mailit/emailclient.cpp7
-rw-r--r--noncore/unsupported/mailit/emailclient.h2
-rw-r--r--noncore/unsupported/mailit/emailhandler.cpp4
-rw-r--r--noncore/unsupported/mailit/emailhandler.h4
-rw-r--r--noncore/unsupported/mailit/emaillistitem.cpp0
-rw-r--r--noncore/unsupported/mailit/popclient.cpp4
-rw-r--r--noncore/unsupported/mailit/popclient.h4
-rw-r--r--noncore/unsupported/mailit/smtpclient.cpp4
-rw-r--r--noncore/unsupported/mailit/smtpclient.h4
-rw-r--r--noncore/unsupported/mailit/textparser.cpp14
-rw-r--r--noncore/unsupported/mailit/textparser.h6
26 files changed, 86 insertions, 84 deletions
diff --git a/noncore/net/mailit/addresslist.cpp b/noncore/net/mailit/addresslist.cpp
index 7d60ebf..18d14bc 100644
--- a/noncore/net/mailit/addresslist.cpp
+++ b/noncore/net/mailit/addresslist.cpp
@@ -36,7 +36,7 @@ AddressList::~AddressList()
addresses.clear();
}
-void AddressList::addContact(QString email, QString name)
+void AddressList::addContact(const QString &email, const QString &name)
{
//skip if not a valid email address,
if (email.find( '@') == -1)
@@ -51,17 +51,17 @@ void AddressList::addContact(QString email, QString name)
}
}
-bool AddressList::containsEmail(QString email)
+bool AddressList::containsEmail(const QString &email)
{
return ( getEmailRef(email) != -1 );
}
-bool AddressList::containsName(QString name)
+bool AddressList::containsName(const QString &name)
{
return ( getNameRef(name) != -1 );
}
-QString AddressList::getNameByEmail(QString email)
+QString AddressList::getNameByEmail(const QString &email)
{
int pos = getEmailRef(email);
if (pos != -1) {
@@ -72,7 +72,7 @@ QString AddressList::getNameByEmail(QString email)
return NULL;
}
-QString AddressList::getEmailByName(QString name)
+QString AddressList::getEmailByName(const QString &name)
{
int pos = getNameRef(name);
if (pos != -1) {
@@ -83,7 +83,7 @@ QString AddressList::getEmailByName(QString name)
return NULL;
}
-int AddressList::getEmailRef(QString email)
+int AddressList::getEmailRef(const QString &email)
{
int pos = 0;
Contact *ptr;
@@ -96,7 +96,7 @@ int AddressList::getEmailRef(QString email)
return -1;
}
-int AddressList::getNameRef(QString name)
+int AddressList::getNameRef(const QString &name)
{
int pos = 0;
Contact *ptr;
@@ -148,7 +148,7 @@ void AddressList::read()
f.close();*/
}
-QString AddressList::getRightString(QString in)
+QString AddressList::getRightString(const QString &in)
{
QString out = "";
diff --git a/noncore/net/mailit/addresslist.h b/noncore/net/mailit/addresslist.h
index 99cef9a..b46d467 100644
--- a/noncore/net/mailit/addresslist.h
+++ b/noncore/net/mailit/addresslist.h
@@ -36,17 +36,17 @@ class AddressList : public QObject
public:
AddressList();
~AddressList();
- void addContact(QString email, QString name);
- bool containsEmail(QString email);
- bool containsName(QString name);
- QString getNameByEmail(QString email);
- QString getEmailByName(QString name);
+ void addContact(const QString &email, const QString &name);
+ bool containsEmail(const QString &email);
+ bool containsName(const QString &name);
+ QString getNameByEmail(const QString &email);
+ QString getEmailByName(const QString &name);
QList<Contact>* getContactList();
private:
- int getEmailRef(QString email);
- int getNameRef(QString name);
- QString getRightString(QString in);
+ int getEmailRef(const QString &email);
+ int getNameRef(const QString &name);
+ QString getRightString(const QString &in);
void read();
private:
diff --git a/noncore/net/mailit/emailclient.cpp b/noncore/net/mailit/emailclient.cpp
index b039cc4..2102ba7 100644
--- a/noncore/net/mailit/emailclient.cpp
+++ b/noncore/net/mailit/emailclient.cpp
@@ -466,8 +466,9 @@ void EmailClient::mailArrived(const Email &mail, bool fromDisk)
item = (EmailListItem *) item->nextSibling();
}
}
- if ((!found)||(fromDisk)) item = new EmailListItem(inboxView, newMail, TRUE);
-
+ if ((!found)||(fromDisk)) {
+ item = new EmailListItem(inboxView, newMail, TRUE);
+ }
if (item->getMail()->files.count()>0)
{
item->setPixmap(0, Resource::loadPixmap("mailit/attach"));
@@ -642,7 +643,7 @@ void EmailClient::readMail()
}
}
-void EmailClient::saveMail(QString fileName, QListView *view)
+void EmailClient::saveMail(const QString &fileName, QListView *view)
{
QFile f(fileName);
Email *mail;
diff --git a/noncore/net/mailit/emailclient.h b/noncore/net/mailit/emailclient.h
index 994fec5..c98cfce 100644
--- a/noncore/net/mailit/emailclient.h
+++ b/noncore/net/mailit/emailclient.h
@@ -106,7 +106,7 @@ public slots:
void inboxItemReleased();
void mailArrived(const Email &mail, bool fromDisk);
void allMailArrived(int);
- void saveMail(QString fileName, QListView *view);
+ void saveMail(const QString &fileName, QListView *view);
void selectAccount(int);
void editAccount(int);
void updateAccounts();
diff --git a/noncore/net/mailit/emailhandler.cpp b/noncore/net/mailit/emailhandler.cpp
index 62fa64f..59ccd90 100644
--- a/noncore/net/mailit/emailhandler.cpp
+++ b/noncore/net/mailit/emailhandler.cpp
@@ -148,7 +148,7 @@ void EmailHandler::messageArrived(const QString &message, int id, uint size, boo
emit mailArrived(mail, FALSE);
}
-bool EmailHandler::parse(QString in, QString lineShift, Email *mail)
+bool EmailHandler::parse(const QString &in, const QString &lineShift, Email *mail)
{
QString temp, boundary;
int pos;
@@ -510,7 +510,7 @@ int EmailHandler::encodeMime(Email *mail)
return 0;
}
-int EmailHandler::encodeFile(QString fileName, QString *toBody)
+int EmailHandler::encodeFile(const QString &fileName, QString *toBody)
{
char *fileData;
char *dataPtr;
diff --git a/noncore/net/mailit/emailhandler.h b/noncore/net/mailit/emailhandler.h
index 5b59f65..e4e7f46 100644
--- a/noncore/net/mailit/emailhandler.h
+++ b/noncore/net/mailit/emailhandler.h
@@ -117,11 +117,11 @@ public:
void getMail();
void getMailHeaders();
void getMailByList(MailList *mailList);
- bool parse(QString in, QString lineShift, Email *mail);
+ bool parse(const QString &in, const QString &lineShift, Email *mail);
bool getEnclosure(Enclosure *ePtr);
int parse64base(char *src, char *dest);
int encodeMime(Email *mail);
- int encodeFile(QString fileName, QString *toBody);
+ int encodeFile(const QString &fileName, QString *toBody);
void encode64base(char *src, QString *dest, int len);
void cancel();
diff --git a/noncore/net/mailit/emaillistitem.cpp b/noncore/net/mailit/emaillistitem.cpp
index b925a1c..fc9f766 100644
--- a/noncore/net/mailit/emaillistitem.cpp
+++ b/noncore/net/mailit/emaillistitem.cpp
diff --git a/noncore/net/mailit/popclient.cpp b/noncore/net/mailit/popclient.cpp
index fedc4e2..dc0116d 100644
--- a/noncore/net/mailit/popclient.cpp
+++ b/noncore/net/mailit/popclient.cpp
@@ -50,7 +50,7 @@ PopClient::~PopClient()
delete stream;
}
-void PopClient::newConnection(QString target, int port)
+void PopClient::newConnection(const QString &target, int port)
{
if (receiving) {
qWarning("socket in use, connection refused");
@@ -66,7 +66,7 @@ void PopClient::newConnection(QString target, int port)
emit updateStatus("DNS lookup");
}
-void PopClient::setAccount(QString popUser, QString popPasswd)
+void PopClient::setAccount(const QString &popUser, const QString &popPasswd)
{
popUserName = popUser;
popPassword = popPasswd;
diff --git a/noncore/net/mailit/popclient.h b/noncore/net/mailit/popclient.h
index 10b71ab..c58bc48 100644
--- a/noncore/net/mailit/popclient.h
+++ b/noncore/net/mailit/popclient.h
@@ -35,8 +35,8 @@ class PopClient: public QObject
public:
PopClient();
~PopClient();
- void newConnection(QString target, int port);
- void setAccount(QString popUser, QString popPasswd);
+ void newConnection(const QString &target, int port);
+ void setAccount(const QString &popUser, const QString &popPasswd);
void setSynchronize(int lastCount);
void removeSynchronize();
void headersOnly(bool headers, int limit);
diff --git a/noncore/net/mailit/smtpclient.cpp b/noncore/net/mailit/smtpclient.cpp
index 8a51a5b..2916f45 100644
--- a/noncore/net/mailit/smtpclient.cpp
+++ b/noncore/net/mailit/smtpclient.cpp
@@ -39,7 +39,7 @@ SmtpClient::~SmtpClient()
delete stream;
}
-void SmtpClient::newConnection(QString target, int port)
+void SmtpClient::newConnection(const QString &target, int port)
{
if (sending) {
qWarning("socket in use, connection refused");
@@ -53,7 +53,7 @@ void SmtpClient::newConnection(QString target, int port)
emit updateStatus(tr("DNS lookup"));
}
-void SmtpClient::addMail(QString from, QString subject, QStringList to, QString body)
+void SmtpClient::addMail(const QString &from, const QString &subject, const QStringList &to, const QString &body)
{
RawEmail *mail = new RawEmail;
diff --git a/noncore/net/mailit/smtpclient.h b/noncore/net/mailit/smtpclient.h
index ca65af4..45c0703 100644
--- a/noncore/net/mailit/smtpclient.h
+++ b/noncore/net/mailit/smtpclient.h
@@ -43,8 +43,8 @@ class SmtpClient: public QObject
public:
SmtpClient();
~SmtpClient();
- void newConnection(QString target, int port);
- void addMail(QString from, QString subject, QStringList to, QString body);
+ void newConnection(const QString &target, int port);
+ void addMail(const QString &from, const QString &subject, const QStringList &to, const QString &body);
signals:
void errorOccurred(int);
diff --git a/noncore/net/mailit/textparser.cpp b/noncore/net/mailit/textparser.cpp
index 3fa5f6e..e5c9f7c 100644
--- a/noncore/net/mailit/textparser.cpp
+++ b/noncore/net/mailit/textparser.cpp
@@ -19,7 +19,7 @@
**********************************************************************/
#include "textparser.h"
-TextParser::TextParser(QString in, QString lineBreak)
+TextParser::TextParser(const QString &in, const QString &lineBreak)
{
data = in;
lineSep = lineBreak;
@@ -29,7 +29,7 @@ TextParser::TextParser(QString in, QString lineBreak)
split();
}
-TextParser::TextParser(QString in, QString lineBreak, QString sep)
+TextParser::TextParser(const QString &in, const QString &lineBreak, const QString &sep)
{
data = in;
lineSep = lineBreak;
@@ -60,12 +60,12 @@ void TextParser::createSeparators()
}
/* Returns pos of given search criteria, -1 if not found */
-int TextParser::find(QString target, QChar sep, int pos, bool upperCase)
+int TextParser::find(const QString &target, QChar sep, int pos, bool upperCase)
{
t_splitElm parsstr;
- QString pString;
-
+ QString pString, pTarget;
+ pTarget = target;
int atLine = 0, atPosElm = 0;
getLineReference(pos,&atLine,&atPosElm);
@@ -77,13 +77,13 @@ int TextParser::find(QString target, QChar sep, int pos, bool upperCase)
if (upperCase)
{
pString=parsstr.str.upper();
- target=target.upper();
+ pTarget=pTarget.upper();
}
else
{
pString=parsstr.str;
}
- if ((pString == target) && (parsstr.separator == sep))
+ if ((pString == pTarget) && (parsstr.separator == sep))
{
return x;
}
diff --git a/noncore/net/mailit/textparser.h b/noncore/net/mailit/textparser.h
index c5e88a0..03bb6d5 100644
--- a/noncore/net/mailit/textparser.h
+++ b/noncore/net/mailit/textparser.h
@@ -49,9 +49,9 @@ class TextParser: public QObject
Q_OBJECT
public:
- TextParser(QString in, QString lineBreak);
- TextParser(QString in, QString lineBreak, QString sep);
- int find(QString target, QChar sep, int pos, bool upperCase);
+ TextParser(const QString &in, const QString &lineBreak);
+ TextParser(const QString &in, const QString &lineBreak, const QString &sep);
+ int find(const QString &target, QChar sep, int pos, bool upperCase);
int elmCount();
QChar separatorAt(int pos);
QChar nextSeparator();
diff --git a/noncore/unsupported/mailit/addresslist.cpp b/noncore/unsupported/mailit/addresslist.cpp
index 7d60ebf..18d14bc 100644
--- a/noncore/unsupported/mailit/addresslist.cpp
+++ b/noncore/unsupported/mailit/addresslist.cpp
@@ -36,7 +36,7 @@ AddressList::~AddressList()
addresses.clear();
}
-void AddressList::addContact(QString email, QString name)
+void AddressList::addContact(const QString &email, const QString &name)
{
//skip if not a valid email address,
if (email.find( '@') == -1)
@@ -51,17 +51,17 @@ void AddressList::addContact(QString email, QString name)
}
}
-bool AddressList::containsEmail(QString email)
+bool AddressList::containsEmail(const QString &email)
{
return ( getEmailRef(email) != -1 );
}
-bool AddressList::containsName(QString name)
+bool AddressList::containsName(const QString &name)
{
return ( getNameRef(name) != -1 );
}
-QString AddressList::getNameByEmail(QString email)
+QString AddressList::getNameByEmail(const QString &email)
{
int pos = getEmailRef(email);
if (pos != -1) {
@@ -72,7 +72,7 @@ QString AddressList::getNameByEmail(QString email)
return NULL;
}
-QString AddressList::getEmailByName(QString name)
+QString AddressList::getEmailByName(const QString &name)
{
int pos = getNameRef(name);
if (pos != -1) {
@@ -83,7 +83,7 @@ QString AddressList::getEmailByName(QString name)
return NULL;
}
-int AddressList::getEmailRef(QString email)
+int AddressList::getEmailRef(const QString &email)
{
int pos = 0;
Contact *ptr;
@@ -96,7 +96,7 @@ int AddressList::getEmailRef(QString email)
return -1;
}
-int AddressList::getNameRef(QString name)
+int AddressList::getNameRef(const QString &name)
{
int pos = 0;
Contact *ptr;
@@ -148,7 +148,7 @@ void AddressList::read()
f.close();*/
}
-QString AddressList::getRightString(QString in)
+QString AddressList::getRightString(const QString &in)
{
QString out = "";
diff --git a/noncore/unsupported/mailit/addresslist.h b/noncore/unsupported/mailit/addresslist.h
index 99cef9a..b46d467 100644
--- a/noncore/unsupported/mailit/addresslist.h
+++ b/noncore/unsupported/mailit/addresslist.h
@@ -36,17 +36,17 @@ class AddressList : public QObject
public:
AddressList();
~AddressList();
- void addContact(QString email, QString name);
- bool containsEmail(QString email);
- bool containsName(QString name);
- QString getNameByEmail(QString email);
- QString getEmailByName(QString name);
+ void addContact(const QString &email, const QString &name);
+ bool containsEmail(const QString &email);
+ bool containsName(const QString &name);
+ QString getNameByEmail(const QString &email);
+ QString getEmailByName(const QString &name);
QList<Contact>* getContactList();
private:
- int getEmailRef(QString email);
- int getNameRef(QString name);
- QString getRightString(QString in);
+ int getEmailRef(const QString &email);
+ int getNameRef(const QString &name);
+ QString getRightString(const QString &in);
void read();
private:
diff --git a/noncore/unsupported/mailit/emailclient.cpp b/noncore/unsupported/mailit/emailclient.cpp
index b039cc4..2102ba7 100644
--- a/noncore/unsupported/mailit/emailclient.cpp
+++ b/noncore/unsupported/mailit/emailclient.cpp
@@ -466,8 +466,9 @@ void EmailClient::mailArrived(const Email &mail, bool fromDisk)
item = (EmailListItem *) item->nextSibling();
}
}
- if ((!found)||(fromDisk)) item = new EmailListItem(inboxView, newMail, TRUE);
-
+ if ((!found)||(fromDisk)) {
+ item = new EmailListItem(inboxView, newMail, TRUE);
+ }
if (item->getMail()->files.count()>0)
{
item->setPixmap(0, Resource::loadPixmap("mailit/attach"));
@@ -642,7 +643,7 @@ void EmailClient::readMail()
}
}
-void EmailClient::saveMail(QString fileName, QListView *view)
+void EmailClient::saveMail(const QString &fileName, QListView *view)
{
QFile f(fileName);
Email *mail;
diff --git a/noncore/unsupported/mailit/emailclient.h b/noncore/unsupported/mailit/emailclient.h
index 994fec5..c98cfce 100644
--- a/noncore/unsupported/mailit/emailclient.h
+++ b/noncore/unsupported/mailit/emailclient.h
@@ -106,7 +106,7 @@ public slots:
void inboxItemReleased();
void mailArrived(const Email &mail, bool fromDisk);
void allMailArrived(int);
- void saveMail(QString fileName, QListView *view);
+ void saveMail(const QString &fileName, QListView *view);
void selectAccount(int);
void editAccount(int);
void updateAccounts();
diff --git a/noncore/unsupported/mailit/emailhandler.cpp b/noncore/unsupported/mailit/emailhandler.cpp
index 62fa64f..59ccd90 100644
--- a/noncore/unsupported/mailit/emailhandler.cpp
+++ b/noncore/unsupported/mailit/emailhandler.cpp
@@ -148,7 +148,7 @@ void EmailHandler::messageArrived(const QString &message, int id, uint size, boo
emit mailArrived(mail, FALSE);
}
-bool EmailHandler::parse(QString in, QString lineShift, Email *mail)
+bool EmailHandler::parse(const QString &in, const QString &lineShift, Email *mail)
{
QString temp, boundary;
int pos;
@@ -510,7 +510,7 @@ int EmailHandler::encodeMime(Email *mail)
return 0;
}
-int EmailHandler::encodeFile(QString fileName, QString *toBody)
+int EmailHandler::encodeFile(const QString &fileName, QString *toBody)
{
char *fileData;
char *dataPtr;
diff --git a/noncore/unsupported/mailit/emailhandler.h b/noncore/unsupported/mailit/emailhandler.h
index 5b59f65..e4e7f46 100644
--- a/noncore/unsupported/mailit/emailhandler.h
+++ b/noncore/unsupported/mailit/emailhandler.h
@@ -117,11 +117,11 @@ public:
void getMail();
void getMailHeaders();
void getMailByList(MailList *mailList);
- bool parse(QString in, QString lineShift, Email *mail);
+ bool parse(const QString &in, const QString &lineShift, Email *mail);
bool getEnclosure(Enclosure *ePtr);
int parse64base(char *src, char *dest);
int encodeMime(Email *mail);
- int encodeFile(QString fileName, QString *toBody);
+ int encodeFile(const QString &fileName, QString *toBody);
void encode64base(char *src, QString *dest, int len);
void cancel();
diff --git a/noncore/unsupported/mailit/emaillistitem.cpp b/noncore/unsupported/mailit/emaillistitem.cpp
index b925a1c..fc9f766 100644
--- a/noncore/unsupported/mailit/emaillistitem.cpp
+++ b/noncore/unsupported/mailit/emaillistitem.cpp
diff --git a/noncore/unsupported/mailit/popclient.cpp b/noncore/unsupported/mailit/popclient.cpp
index fedc4e2..dc0116d 100644
--- a/noncore/unsupported/mailit/popclient.cpp
+++ b/noncore/unsupported/mailit/popclient.cpp
@@ -50,7 +50,7 @@ PopClient::~PopClient()
delete stream;
}
-void PopClient::newConnection(QString target, int port)
+void PopClient::newConnection(const QString &target, int port)
{
if (receiving) {
qWarning("socket in use, connection refused");
@@ -66,7 +66,7 @@ void PopClient::newConnection(QString target, int port)
emit updateStatus("DNS lookup");
}
-void PopClient::setAccount(QString popUser, QString popPasswd)
+void PopClient::setAccount(const QString &popUser, const QString &popPasswd)
{
popUserName = popUser;
popPassword = popPasswd;
diff --git a/noncore/unsupported/mailit/popclient.h b/noncore/unsupported/mailit/popclient.h
index 10b71ab..c58bc48 100644
--- a/noncore/unsupported/mailit/popclient.h
+++ b/noncore/unsupported/mailit/popclient.h
@@ -35,8 +35,8 @@ class PopClient: public QObject
public:
PopClient();
~PopClient();
- void newConnection(QString target, int port);
- void setAccount(QString popUser, QString popPasswd);
+ void newConnection(const QString &target, int port);
+ void setAccount(const QString &popUser, const QString &popPasswd);
void setSynchronize(int lastCount);
void removeSynchronize();
void headersOnly(bool headers, int limit);
diff --git a/noncore/unsupported/mailit/smtpclient.cpp b/noncore/unsupported/mailit/smtpclient.cpp
index 8a51a5b..2916f45 100644
--- a/noncore/unsupported/mailit/smtpclient.cpp
+++ b/noncore/unsupported/mailit/smtpclient.cpp
@@ -39,7 +39,7 @@ SmtpClient::~SmtpClient()
delete stream;
}
-void SmtpClient::newConnection(QString target, int port)
+void SmtpClient::newConnection(const QString &target, int port)
{
if (sending) {
qWarning("socket in use, connection refused");
@@ -53,7 +53,7 @@ void SmtpClient::newConnection(QString target, int port)
emit updateStatus(tr("DNS lookup"));
}
-void SmtpClient::addMail(QString from, QString subject, QStringList to, QString body)
+void SmtpClient::addMail(const QString &from, const QString &subject, const QStringList &to, const QString &body)
{
RawEmail *mail = new RawEmail;
diff --git a/noncore/unsupported/mailit/smtpclient.h b/noncore/unsupported/mailit/smtpclient.h
index ca65af4..45c0703 100644
--- a/noncore/unsupported/mailit/smtpclient.h
+++ b/noncore/unsupported/mailit/smtpclient.h
@@ -43,8 +43,8 @@ class SmtpClient: public QObject
public:
SmtpClient();
~SmtpClient();
- void newConnection(QString target, int port);
- void addMail(QString from, QString subject, QStringList to, QString body);
+ void newConnection(const QString &target, int port);
+ void addMail(const QString &from, const QString &subject, const QStringList &to, const QString &body);
signals:
void errorOccurred(int);
diff --git a/noncore/unsupported/mailit/textparser.cpp b/noncore/unsupported/mailit/textparser.cpp
index 3fa5f6e..e5c9f7c 100644
--- a/noncore/unsupported/mailit/textparser.cpp
+++ b/noncore/unsupported/mailit/textparser.cpp
@@ -19,7 +19,7 @@
**********************************************************************/
#include "textparser.h"
-TextParser::TextParser(QString in, QString lineBreak)
+TextParser::TextParser(const QString &in, const QString &lineBreak)
{
data = in;
lineSep = lineBreak;
@@ -29,7 +29,7 @@ TextParser::TextParser(QString in, QString lineBreak)
split();
}
-TextParser::TextParser(QString in, QString lineBreak, QString sep)
+TextParser::TextParser(const QString &in, const QString &lineBreak, const QString &sep)
{
data = in;
lineSep = lineBreak;
@@ -60,12 +60,12 @@ void TextParser::createSeparators()
}
/* Returns pos of given search criteria, -1 if not found */
-int TextParser::find(QString target, QChar sep, int pos, bool upperCase)
+int TextParser::find(const QString &target, QChar sep, int pos, bool upperCase)
{
t_splitElm parsstr;
- QString pString;
-
+ QString pString, pTarget;
+ pTarget = target;
int atLine = 0, atPosElm = 0;
getLineReference(pos,&atLine,&atPosElm);
@@ -77,13 +77,13 @@ int TextParser::find(QString target, QChar sep, int pos, bool upperCase)
if (upperCase)
{
pString=parsstr.str.upper();
- target=target.upper();
+ pTarget=pTarget.upper();
}
else
{
pString=parsstr.str;
}
- if ((pString == target) && (parsstr.separator == sep))
+ if ((pString == pTarget) && (parsstr.separator == sep))
{
return x;
}
diff --git a/noncore/unsupported/mailit/textparser.h b/noncore/unsupported/mailit/textparser.h
index c5e88a0..03bb6d5 100644
--- a/noncore/unsupported/mailit/textparser.h
+++ b/noncore/unsupported/mailit/textparser.h
@@ -49,9 +49,9 @@ class TextParser: public QObject
Q_OBJECT
public:
- TextParser(QString in, QString lineBreak);
- TextParser(QString in, QString lineBreak, QString sep);
- int find(QString target, QChar sep, int pos, bool upperCase);
+ TextParser(const QString &in, const QString &lineBreak);
+ TextParser(const QString &in, const QString &lineBreak, const QString &sep);
+ int find(const QString &target, QChar sep, int pos, bool upperCase);
int elmCount();
QChar separatorAt(int pos);
QChar nextSeparator();