author | skyhusker <skyhusker> | 2005-01-23 21:10:39 (UTC) |
---|---|---|
committer | skyhusker <skyhusker> | 2005-01-23 21:10:39 (UTC) |
commit | d3d14d324442d05a8f135590c70237657ef1bab0 (patch) (unidiff) | |
tree | 9e8ec698557a9ef7387df064a17055af5590333c /noncore | |
parent | be26adf324ea0b723cabcd735b0833e16410ceea (diff) | |
download | opie-d3d14d324442d05a8f135590c70237657ef1bab0.zip opie-d3d14d324442d05a8f135590c70237657ef1bab0.tar.gz opie-d3d14d324442d05a8f135590c70237657ef1bab0.tar.bz2 |
Removed some unnecesary castings, changed printf() to odebug
-rw-r--r-- | noncore/net/opieirc/ircmessage.cpp | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/noncore/net/opieirc/ircmessage.cpp b/noncore/net/opieirc/ircmessage.cpp index 41386ee..d19e9e6 100644 --- a/noncore/net/opieirc/ircmessage.cpp +++ b/noncore/net/opieirc/ircmessage.cpp | |||
@@ -1,3 +1,8 @@ | |||
1 | #include <opie2/odebug.h> | ||
2 | |||
3 | using namespace Opie::Core; | ||
4 | |||
5 | |||
1 | #include <qtextstream.h> | 6 | #include <qtextstream.h> |
2 | #include <qstring.h> | 7 | #include <qstring.h> |
3 | #include <qstringlist.h> | 8 | #include <qstringlist.h> |
@@ -69,20 +74,17 @@ IRCMessage::IRCMessage(QString line) { | |||
69 | } | 74 | } |
70 | 75 | ||
71 | 76 | ||
72 | //-- Uncomment to debug -- | 77 | odebug << "Parsed: " << line << oendl; |
73 | /* | 78 | odebug << "Prefix: " << m_prefix << oendl; |
74 | printf("Parsed : '%s'\n", line.ascii()); | 79 | odebug << "Command: " << m_command << oendl; |
75 | printf("Prefix : '%s'\n", m_prefix.ascii()); | 80 | odebug << "Allparameters: " << m_allParameters << oendl; |
76 | printf("Command : '%s'\n", m_command.ascii()); | ||
77 | printf("Allparameters : '%s'\n", m_allParameters.ascii()); | ||
78 | for (unsigned int i=0; i<m_parameters.count(); i++) { | 81 | for (unsigned int i=0; i<m_parameters.count(); i++) { |
79 | printf("Parameter %i : '%s'\n", i, m_parameters[i].ascii()); | 82 | odebug << "Parameter " << i << ":" << m_parameters[i] << oendl; |
80 | } | 83 | } |
81 | printf("CTCP Command : '%s'\n", m_ctcpCommand.latin1()); | 84 | odebug << "CTCP Command: " << m_ctcpCommand << oendl; |
82 | printf("CTCP Destination : '%s'\n", m_ctcpDestination.latin1()); | 85 | odebug << "CTCP Destination: " << m_ctcpDestination << oendl; |
83 | printf("CTCP param count is : '%i'\n", m_parameters.count()); | 86 | odebug << "CTCP param count is: " << m_parameters.count() << oendl; |
84 | */ | 87 | |
85 | |||
86 | } | 88 | } |
87 | 89 | ||
88 | QString IRCMessage::param(int param) { | 90 | QString IRCMessage::param(int param) { |
@@ -97,15 +99,15 @@ QStringList IRCMessage::params(const QString ¶mstring) const { | |||
97 | for (QStringList::Iterator it = params.begin(); it != end; ++it) { | 99 | for (QStringList::Iterator it = params.begin(); it != end; ++it) { |
98 | int pos = (*it).find(':'); | 100 | int pos = (*it).find(':'); |
99 | if(pos < 0) { | 101 | if(pos < 0) { |
100 | if(static_cast<unsigned int>((*it).toInt()) < m_parameters.count()) | 102 | if((*it).toUInt() < m_parameters.count()) |
101 | retvalue << m_parameters[(*it).toInt()]; | 103 | retvalue << m_parameters[(*it).toUInt()]; |
102 | } | 104 | } |
103 | 105 | ||
104 | else { | 106 | else { |
105 | int start, end; | 107 | unsigned int start, end; |
106 | start = (*it).left(pos).toInt(); | 108 | start = (*it).left(pos).toUInt(); |
107 | end = (*it).mid(pos+1).toInt(); | 109 | end = (*it).mid(pos+1).toUInt(); |
108 | for (int i=start;i<=end && i < static_cast<int>(m_parameters.count()) ;++i) { | 110 | for (unsigned int i=start;i<=end && i < m_parameters.count() ;++i) { |
109 | retvalue << m_parameters[i]; | 111 | retvalue << m_parameters[i]; |
110 | } | 112 | } |
111 | } | 113 | } |