summaryrefslogtreecommitdiff
authorskyhusker <skyhusker>2005-01-26 22:22:55 (UTC)
committer skyhusker <skyhusker>2005-01-26 22:22:55 (UTC)
commit1752010f14bb7806bae6f83b349c9896a3005c75 (patch) (side-by-side diff)
treea43902f058fef91ed136622bb4f9964f1aa5441f
parentd3ca4c7807c7a22837e481c1016c9814a68e00fb (diff)
downloadopie-1752010f14bb7806bae6f83b349c9896a3005c75.zip
opie-1752010f14bb7806bae6f83b349c9896a3005c75.tar.gz
opie-1752010f14bb7806bae6f83b349c9896a3005c75.tar.bz2
Changed argument passing from value to const reference
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/opieirc/ircperson.cpp10
-rw-r--r--noncore/net/opieirc/ircperson.h10
2 files changed, 10 insertions, 10 deletions
diff --git a/noncore/net/opieirc/ircperson.cpp b/noncore/net/opieirc/ircperson.cpp
index 1dd2679..f673dee 100644
--- a/noncore/net/opieirc/ircperson.cpp
+++ b/noncore/net/opieirc/ircperson.cpp
@@ -1,55 +1,55 @@
#include "ircperson.h"
IRCPerson::IRCPerson() {
m_nick = "";
m_user = "";
m_host = "";
}
IRCPerson::IRCPerson(const IRCPerson &person) {
m_nick = person.m_nick;
m_user = person.m_user;
m_host = person.m_host;
}
-IRCPerson::IRCPerson(QString mask) {
+IRCPerson::IRCPerson(const QString &mask) {
IRCPerson();
fromMask(mask);
}
-void IRCPerson::fromMask(QString mask) {
+void IRCPerson::fromMask(const QString &mask) {
int sep1 = mask.find("!");
int sep2 = mask.find("@");
m_nick = mask.left(sep1);
m_user = mask.mid(sep1+1, sep2-sep1-1);
m_host = mask.right(mask.length()-sep2-1);
}
QString IRCPerson::toMask() {
return m_nick + "!" + m_user + "@" + m_host;
}
-void IRCPerson::setNick(QString nick) {
+void IRCPerson::setNick(const QString &nick) {
m_nick = nick;
}
-void IRCPerson::setUser(QString user) {
+void IRCPerson::setUser(const QString &user) {
m_user = user;
}
-void IRCPerson::setHost(QString host) {
+void IRCPerson::setHost(const QString &host) {
m_host = host;
}
// -- GETTER FUNCS --
QString IRCPerson::nick() {
return m_nick;
}
QString IRCPerson::user() {
return m_user;
}
QString IRCPerson::host() {
return m_host;
}
diff --git a/noncore/net/opieirc/ircperson.h b/noncore/net/opieirc/ircperson.h
index 38732c4..9854f95 100644
--- a/noncore/net/opieirc/ircperson.h
+++ b/noncore/net/opieirc/ircperson.h
@@ -3,51 +3,51 @@
Copyright (C) 2002 Wenzel Jakob
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __IRCPERSON
#define __IRCPERSON
#include <qstring.h>
/* This class requires all required information relating to a person
on the IRC network. This class can be used as an input mask for
IRCMessage-prefixes too
*/
class IRCPerson {
public:
IRCPerson();
/* Create an IRCPerson from an IRC style description (nick!user@host) */
- IRCPerson(QString mask);
+ IRCPerson(const QString &mask);
/* Copy constructor */
IRCPerson(const IRCPerson &person);
- void fromMask(QString mask);
- void setNick(QString name);
- void setUser(QString user);
- void setHost(QString host);
+ void fromMask(const QString &mask);
+ void setNick(const QString &name);
+ void setUser(const QString &user);
+ void setHost(const QString &host);
QString toMask();
QString nick();
QString user();
QString host();
protected:
QString m_nick;
QString m_user;
QString m_host;
};
#endif /* __IRCPERSON */