summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore 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 @@
1#include "ircperson.h" 1#include "ircperson.h"
2 2
3IRCPerson::IRCPerson() { 3IRCPerson::IRCPerson() {
4 m_nick = ""; 4 m_nick = "";
5 m_user = ""; 5 m_user = "";
6 m_host = ""; 6 m_host = "";
7} 7}
8 8
9IRCPerson::IRCPerson(const IRCPerson &person) { 9IRCPerson::IRCPerson(const IRCPerson &person) {
10 m_nick = person.m_nick; 10 m_nick = person.m_nick;
11 m_user = person.m_user; 11 m_user = person.m_user;
12 m_host = person.m_host; 12 m_host = person.m_host;
13} 13}
14 14
15IRCPerson::IRCPerson(QString mask) { 15IRCPerson::IRCPerson(const QString &mask) {
16 IRCPerson(); 16 IRCPerson();
17 fromMask(mask); 17 fromMask(mask);
18} 18}
19 19
20void IRCPerson::fromMask(QString mask) { 20void IRCPerson::fromMask(const QString &mask) {
21 int sep1 = mask.find("!"); 21 int sep1 = mask.find("!");
22 int sep2 = mask.find("@"); 22 int sep2 = mask.find("@");
23 23
24 m_nick = mask.left(sep1); 24 m_nick = mask.left(sep1);
25 m_user = mask.mid(sep1+1, sep2-sep1-1); 25 m_user = mask.mid(sep1+1, sep2-sep1-1);
26 m_host = mask.right(mask.length()-sep2-1); 26 m_host = mask.right(mask.length()-sep2-1);
27} 27}
28 28
29QString IRCPerson::toMask() { 29QString IRCPerson::toMask() {
30 return m_nick + "!" + m_user + "@" + m_host; 30 return m_nick + "!" + m_user + "@" + m_host;
31} 31}
32 32
33void IRCPerson::setNick(QString nick) { 33void IRCPerson::setNick(const QString &nick) {
34 m_nick = nick; 34 m_nick = nick;
35} 35}
36 36
37void IRCPerson::setUser(QString user) { 37void IRCPerson::setUser(const QString &user) {
38 m_user = user; 38 m_user = user;
39} 39}
40 40
41void IRCPerson::setHost(QString host) { 41void IRCPerson::setHost(const QString &host) {
42 m_host = host; 42 m_host = host;
43} 43}
44 // -- GETTER FUNCS -- 44 // -- GETTER FUNCS --
45QString IRCPerson::nick() { 45QString IRCPerson::nick() {
46 return m_nick; 46 return m_nick;
47} 47}
48 48
49QString IRCPerson::user() { 49QString IRCPerson::user() {
50 return m_user; 50 return m_user;
51} 51}
52 52
53QString IRCPerson::host() { 53QString IRCPerson::host() {
54 return m_host; 54 return m_host;
55} 55}
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 @@
3 Copyright (C) 2002 Wenzel Jakob 3 Copyright (C) 2002 Wenzel Jakob
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18
19*/ 19*/
20 20
21#ifndef __IRCPERSON 21#ifndef __IRCPERSON
22#define __IRCPERSON 22#define __IRCPERSON
23 23
24#include <qstring.h> 24#include <qstring.h>
25 25
26/* This class requires all required information relating to a person 26/* This class requires all required information relating to a person
27 on the IRC network. This class can be used as an input mask for 27 on the IRC network. This class can be used as an input mask for
28 IRCMessage-prefixes too 28 IRCMessage-prefixes too
29*/ 29*/
30 30
31class IRCPerson { 31class IRCPerson {
32public: 32public:
33 IRCPerson(); 33 IRCPerson();
34 /* Create an IRCPerson from an IRC style description (nick!user@host) */ 34 /* Create an IRCPerson from an IRC style description (nick!user@host) */
35 IRCPerson(QString mask); 35 IRCPerson(const QString &mask);
36 /* Copy constructor */ 36 /* Copy constructor */
37 IRCPerson(const IRCPerson &person); 37 IRCPerson(const IRCPerson &person);
38 38
39 void fromMask(QString mask); 39 void fromMask(const QString &mask);
40 void setNick(QString name); 40 void setNick(const QString &name);
41 void setUser(QString user); 41 void setUser(const QString &user);
42 void setHost(QString host); 42 void setHost(const QString &host);
43 QString toMask(); 43 QString toMask();
44 QString nick(); 44 QString nick();
45 QString user(); 45 QString user();
46 QString host(); 46 QString host();
47protected: 47protected:
48 QString m_nick; 48 QString m_nick;
49 QString m_user; 49 QString m_user;
50 QString m_host; 50 QString m_host;
51}; 51};
52 52
53#endif /* __IRCPERSON */ 53#endif /* __IRCPERSON */