summaryrefslogtreecommitdiffstats
path: root/kopete/protocols/irc/libkirc
diff options
context:
space:
mode:
Diffstat (limited to 'kopete/protocols/irc/libkirc')
-rw-r--r--kopete/protocols/irc/libkirc/kircengine.cpp52
-rw-r--r--kopete/protocols/irc/libkirc/kircengine.h71
-rw-r--r--kopete/protocols/irc/libkirc/kircengine_commands.cpp26
-rw-r--r--kopete/protocols/irc/libkirc/kircengine_ctcp.cpp66
-rw-r--r--kopete/protocols/irc/libkirc/kircengine_numericreplies.cpp2
-rw-r--r--kopete/protocols/irc/libkirc/kircentity.cpp8
-rw-r--r--kopete/protocols/irc/libkirc/kircentity.h3
-rw-r--r--kopete/protocols/irc/libkirc/kircmessage.cpp48
-rw-r--r--kopete/protocols/irc/libkirc/kircmessage.h4
-rw-r--r--kopete/protocols/irc/libkirc/kircmessageredirector.cpp6
-rw-r--r--kopete/protocols/irc/libkirc/kircmessageredirector.h5
-rw-r--r--kopete/protocols/irc/libkirc/kirctransfer.cpp34
-rw-r--r--kopete/protocols/irc/libkirc/kirctransfer.h63
-rw-r--r--kopete/protocols/irc/libkirc/kirctransferhandler.cpp8
-rw-r--r--kopete/protocols/irc/libkirc/kirctransferhandler.h11
-rw-r--r--kopete/protocols/irc/libkirc/kirctransferserver.cpp16
-rw-r--r--kopete/protocols/irc/libkirc/kirctransferserver.h21
-rw-r--r--kopete/protocols/irc/libkirc/ksslsocket.cpp22
-rw-r--r--kopete/protocols/irc/libkirc/ksslsocket.h9
19 files changed, 245 insertions, 230 deletions
diff --git a/kopete/protocols/irc/libkirc/kircengine.cpp b/kopete/protocols/irc/libkirc/kircengine.cpp
index 03936d5f..167d7a22 100644
--- a/kopete/protocols/irc/libkirc/kircengine.cpp
+++ b/kopete/protocols/irc/libkirc/kircengine.cpp
@@ -51,10 +51,10 @@ using namespace KIRC;
/* Please note that the regular expression "[\\r\\n]*$" is used in a TQString::replace statement many times.
* This gets rid of trailing \r\n, \r, \n, and \n\r characters.
*/
-const TQRegExp Engine::m_RemoveLinefeeds( TQString::fromLatin1("[\\r\\n]*$") );
+const TQRegExp Engine::m_RemoveLinefeeds( TQString::tqfromLatin1("[\\r\\n]*$") );
-Engine::Engine(TQObject *parent, const char *name)
- : TQObject(parent, TQString::fromLatin1("[KIRC::Engine]%1").arg(name).latin1()),
+Engine::Engine(TQObject *tqparent, const char *name)
+ : TQObject(tqparent, TQString::tqfromLatin1("[KIRC::Engine]%1").tqarg(name).latin1()),
m_status(Idle),
m_FailedNickOnLogin(false),
m_useSSL(false),
@@ -64,7 +64,7 @@ Engine::Engine(TQObject *parent, const char *name)
m_ctcpReplies(17, false),
codecs(577,false)
{
- setUserName(TQString::null);
+ setUserName(TQString());
m_commands.setAutoDelete(true);
m_ctcpQueries.setAutoDelete(true);
@@ -74,9 +74,9 @@ Engine::Engine(TQObject *parent, const char *name)
bindNumericReplies();
bindCtcp();
- m_VersionString = TQString::fromLatin1("Anonymous client using the KIRC engine.");
- m_UserString = TQString::fromLatin1("Response not supplied by user.");
- m_SourceString = TQString::fromLatin1("Unknown client, known source.");
+ m_VersionString = TQString::tqfromLatin1("Anonymous client using the KIRC engine.");
+ m_UserString = TQString::tqfromLatin1("Response not supplied by user.");
+ m_SourceString = TQString::tqfromLatin1("Unknown client, known source.");
defaultCodec = TQTextCodec::codecForMib(106); // UTF8 mib is 106
kdDebug(14120) << "Setting default engine codec, " << defaultCodec->name() << endl;
@@ -133,14 +133,14 @@ void Engine::setUseSSL( bool useSSL )
}
}
-void Engine::setStatus(Engine::Status status)
+void Engine::settqStatus(Engine::tqStatus status)
{
kdDebug(14120) << k_funcinfo << status << endl;
if (m_status == status)
return;
-// Engine::Status oldStatus = m_status;
+// Engine::tqStatus oldtqStatus = m_status;
m_status = status;
emit statusChanged(status);
@@ -169,21 +169,21 @@ void Engine::setStatus(Engine::Status status)
case Closing:
m_sock->close();
m_sock->reset();
- setStatus(Idle);
+ settqStatus(Idle);
break;
case AuthentifyingFailed:
- setStatus(Closing);
+ settqStatus(Closing);
break;
case Timeout:
- setStatus(Closing);
+ settqStatus(Closing);
break;
case Disconnected:
- setStatus(Closing);
+ settqStatus(Closing);
break;
}
}
-void Engine::connectToServer(const TQString &host, Q_UINT16 port, const TQString &nickname, bool useSSL )
+void Engine::connectToServer(const TQString &host, TQ_UINT16 port, const TQString &nickname, bool useSSL )
{
setUseSSL(useSSL);
@@ -195,28 +195,28 @@ void Engine::connectToServer(const TQString &host, Q_UINT16 port, const TQString
kdDebug(14120) << "Sock status: " << m_sock->socketStatus() << endl;
if( !m_sock->setAddress(m_Host, m_Port) )
- kdDebug(14120) << k_funcinfo << "setAddress failed. Status: " << m_sock->socketStatus() << endl;
+ kdDebug(14120) << k_funcinfo << "setAddress failed. tqStatus: " << m_sock->socketStatus() << endl;
if( m_sock->startAsyncConnect() == 0 )
{
- kdDebug(14120) << k_funcinfo << "Success!. Status: " << m_sock->socketStatus() << endl;
- setStatus(Connecting);
+ kdDebug(14120) << k_funcinfo << "Success!. tqStatus: " << m_sock->socketStatus() << endl;
+ settqStatus(Connecting);
}
else
{
- kdDebug(14120) << k_funcinfo << "Failed. Status: " << m_sock->socketStatus() << endl;
- setStatus(Disconnected);
+ kdDebug(14120) << k_funcinfo << "Failed. tqStatus: " << m_sock->socketStatus() << endl;
+ settqStatus(Disconnected);
}
}
void Engine::slotConnected()
{
- setStatus(Authentifying);
+ settqStatus(Authentifying);
}
void Engine::slotConnectionClosed()
{
- setStatus(Disconnected);
+ settqStatus(Disconnected);
}
void Engine::error(int errCode)
@@ -225,7 +225,7 @@ void Engine::error(int errCode)
if (m_sock->socketStatus () != KExtendedSocket::connecting)
{
// Connection in progress.. This is a signal fired wrong
- setStatus(Disconnected);
+ settqStatus(Disconnected);
}
}
@@ -250,7 +250,7 @@ void Engine::setSourceString(const TQString &newString)
void Engine::setUserName(const TQString &newName)
{
if(newName.isEmpty())
- m_Username = TQString::fromLatin1(getpwuid(getuid())->pw_name);
+ m_Username = TQString::tqfromLatin1(getpwuid(getuid())->pw_name);
else
m_Username = newName;
m_Username.remove(m_RemoveLinefeeds);
@@ -259,7 +259,7 @@ void Engine::setUserName(const TQString &newName)
void Engine::setRealName(const TQString &newName)
{
if(newName.isEmpty())
- m_realName = TQString::fromLatin1(getpwuid(getuid())->pw_gecos);
+ m_realName = TQString::tqfromLatin1(getpwuid(getuid())->pw_gecos);
else
m_realName = newName;
m_realName.remove(m_RemoveLinefeeds);
@@ -277,7 +277,7 @@ bool Engine::_bind(TQDict<KIRC::MessageRedirector> &dict,
if (!mr)
{
mr = new MessageRedirector(this, minArgs, maxArgs, helpMessage);
- dict.replace(command, mr);
+ dict.tqreplace(command, mr);
}
return mr->connect(object, member);
@@ -443,7 +443,7 @@ bool Engine::invokeCtcpCommandOfMessage(const TQDict<MessageRedirector> &map, Me
kdDebug(14120) << "Method error for line:" << ctcpMsg.raw() << endl;
writeCtcpErrorMessage(msg.prefix(), msg.ctcpRaw(),
- TQString::fromLatin1("%1 internal error(s)").arg(errors.size()));
+ TQString::tqfromLatin1("%1 internal error(s)").tqarg(errors.size()));
}
else
{
diff --git a/kopete/protocols/irc/libkirc/kircengine.h b/kopete/protocols/irc/libkirc/kircengine.h
index c39bbe6e..e086afc1 100644
--- a/kopete/protocols/irc/libkirc/kircengine.h
+++ b/kopete/protocols/irc/libkirc/kircengine.h
@@ -51,27 +51,28 @@ namespace KIRC
* @author Jason Keirstead <jason@keirstead.org>
*/
class Engine
- : public QObject
+ : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
-// Q_PROPERTY(TQUrl serverURL READ serverURL WRITE setServerURL)
+// TQ_PROPERTY(TQUrl serverURL READ serverURL WRITE setServerURL)
// Extracted from the base of the serverURL.
-// Q_PROPERTY(bool useSSL);
-// Q_PROPERTY(TQString user READ user);
-// Q_PROPERTY(TQString password);
-// Q_PROPERTY(TQString host READ host);
-// Q_PROPERTY(int port READ host);
+// TQ_PROPERTY(bool useSSL);
+// TQ_PROPERTY(TQString user READ user);
+// TQ_PROPERTY(TQString password);
+// TQ_PROPERTY(TQString host READ host);
+// TQ_PROPERTY(int port READ host);
// Extracted from the query of the serverURL.
-// Q_PROPERTY(bool reqsPasswd);
-// Q_PROPERTY(TQString name); // real name
-// Q_PROPERTY(TQStringList nickList READ nickList WRITE setNickList)
-// Q_PROPERTY(TQString nick READ nick)
-// Q_PROPERTY(TQStringList portList)
+// TQ_PROPERTY(bool reqsPasswd);
+// TQ_PROPERTY(TQString name); // real name
+// TQ_PROPERTY(TQStringList nickList READ nickList WRITE setNickList)
+// TQ_PROPERTY(TQString nick READ nick)
+// TQ_PROPERTY(TQStringList portList)
- Q_ENUMS(Status)
+ Q_ENUMS(tqStatus)
public:
enum Error
@@ -83,7 +84,7 @@ public:
MethodFailed
};
- enum Status
+ enum tqStatus
{
Idle,
Connecting,
@@ -105,7 +106,7 @@ public:
MessageOfTheDayCondensedMessage
};
- Engine( TQObject *parent = 0, const char* name = 0 );
+ Engine( TQObject *tqparent = 0, const char* name = 0 );
~Engine();
// TQString nick() const;
@@ -118,7 +119,7 @@ public:
inline const TQString &currentHost() const
{ return m_Host; };
- inline Q_UINT16 currentPort()
+ inline TQ_UINT16 currentPort()
{ return m_Port; }
inline const TQString &nickName() const
@@ -159,12 +160,12 @@ public:
void setVersionString(const TQString &versionString);
void setUserString(const TQString &userString);
void setSourceString(const TQString &sourceString);
- void connectToServer(const TQString &host, Q_UINT16 port, const TQString &nickname, bool useSSL = false);
+ void connectToServer(const TQString &host, TQ_UINT16 port, const TQString &nickname, bool useSSL = false);
KExtendedSocket *socket()
{ return m_sock; };
- inline KIRC::Engine::Status status() const
+ inline KIRC::Engine::tqStatus status() const
{ return m_status; }
inline bool isDisconnected() const
@@ -174,7 +175,7 @@ public:
{ return m_status == Connected; }
inline void setCodec( const TQString &nick, const TQTextCodec *codec )
- { codecs.replace( nick, codec ); }
+ { codecs.tqreplace( nick, codec ); }
/* Custom CTCP replies handling */
inline TQString &customCtcp( const TQString &s )
@@ -191,16 +192,16 @@ public slots:
void writeMessage(const TQString &message, const TQTextCodec *codec = 0 );
void writeMessage(const TQString &command, const TQStringList &args,
- const TQString &suffix = TQString::null, const TQTextCodec *codec = 0);
+ const TQString &suffix = TQString(), const TQTextCodec *codec = 0);
void writeCtcpMessage(const TQString &command, const TQString &to, const TQString &ctcpMessage);
void writeCtcpMessage(const TQString &command, const TQString &to, const TQString &suffix,
- const TQString &ctcpCommand, const TQStringList &ctcpArgs, const TQString &ctcpSuffix = TQString::null,
+ const TQString &ctcpCommand, const TQStringList &ctcpArgs, const TQString &ctcpSuffix = TQString(),
bool emitRepliedCtcp = true);
inline void writeCtcpQueryMessage(const TQString &to, const TQString &suffix,
- const TQString &ctcpCommand, const TQStringList &ctcpArgs = TQStringList(), const TQString &ctcpSuffix = TQString::null,
+ const TQString &ctcpCommand, const TQStringList &ctcpArgs = TQStringList(), const TQString &ctcpSuffix = TQString(),
bool emitRepliedCtcp = true)
{ return writeCtcpMessage("PRIVMSG", to, suffix, ctcpCommand, ctcpArgs, ctcpSuffix, emitRepliedCtcp); }
@@ -208,42 +209,42 @@ public slots:
{ writeCtcpMessage("NOTICE", to, ctcpMessage); }
inline void writeCtcpReplyMessage(const TQString &to, const TQString &suffix,
- const TQString &ctcpCommand, const TQStringList &ctcpArgs = TQStringList(), const TQString &ctcpSuffix = TQString::null,
+ const TQString &ctcpCommand, const TQStringList &ctcpArgs = TQStringList(), const TQString &ctcpSuffix = TQString(),
bool emitRepliedCtcp = true)
{ return writeCtcpMessage("NOTICE", to, suffix, ctcpCommand, ctcpArgs, ctcpSuffix, emitRepliedCtcp); }
inline void writeCtcpErrorMessage(const TQString &to, const TQString &ctcpLine, const TQString &errorMsg,
bool emitRepliedCtcp=true)
- { return writeCtcpReplyMessage(to, TQString::null, "ERRMSG", ctcpLine, errorMsg, emitRepliedCtcp); }
+ { return writeCtcpReplyMessage(to, TQString(), "ERRMSG", ctcpLine, errorMsg, emitRepliedCtcp); }
bool bind(const TQString &command, TQObject *object, const char *member,
int minArgs = KIRC::MessageRedirector::Unknown,
int maxArgs = KIRC::MessageRedirector::Unknown,
- const TQString &helpMessage = TQString::null);
+ const TQString &helpMessage = TQString());
bool bind(int id, TQObject *object, const char *member,
int minArgs = KIRC::MessageRedirector::Unknown,
int maxArgs = KIRC::MessageRedirector::Unknown,
- const TQString &helpMessage = TQString::null);
+ const TQString &helpMessage = TQString());
bool bindCtcpQuery(const TQString &command, TQObject *object, const char *member,
int minArgs = KIRC::MessageRedirector::Unknown,
int maxArgs = KIRC::MessageRedirector::Unknown,
- const TQString &helpMessage = TQString::null);
+ const TQString &helpMessage = TQString());
bool bindCtcpReply(const TQString &command, TQObject *object, const char *member,
int minArgs = KIRC::MessageRedirector::Unknown,
int maxArgs = KIRC::MessageRedirector::Unknown,
- const TQString &helpMessage = TQString::null);
+ const TQString &helpMessage = TQString());
- void away(bool isAway, const TQString &awayMessage = TQString::null);
+ void away(bool isAway, const TQString &awayMessage = TQString());
void ison(const TQStringList &nickList);
void join(const TQString &name, const TQString &key);
void kick(const TQString &user, const TQString &channel, const TQString &reason);
void list();
void mode(const TQString &target, const TQString &mode);
- void motd(const TQString &server = TQString::null);
+ void motd(const TQString &server = TQString());
void nick(const TQString &newNickname);
void notice(const TQString &target, const TQString &message);
void part(const TQString &name, const TQString &reason);
@@ -259,7 +260,7 @@ public slots:
void topic(const TQString &channel, const TQString &topic);
void user(const TQString &newUsername, const TQString &hostname, const TQString &newRealname);
- void user(const TQString &newUsername, Q_UINT8 mode, const TQString &newRealname);
+ void user(const TQString &newUsername, TQ_UINT8 mode, const TQString &newRealname);
void whois(const TQString &user);
@@ -274,7 +275,7 @@ public slots:
void showInfoDialog();
signals:
- void statusChanged(KIRC::Engine::Status newStatus);
+ void statusChanged(KIRC::Engine::tqStatus newtqStatus);
void internalError(KIRC::Engine::Error, KIRC::Message &);
void receivedMessage(KIRC::Message &);
@@ -478,7 +479,7 @@ private:
void bindNumericReplies();
void bindCtcp();
- void setStatus(KIRC::Engine::Status status);
+ void settqStatus(KIRC::Engine::tqStatus status);
bool invokeCtcpCommandOfMessage(const TQDict<KIRC::MessageRedirector> &map, KIRC::Message &message);
/*
@@ -492,9 +493,9 @@ private:
//Static regexes
static const TQRegExp m_RemoveLinefeeds;
- KIRC::Engine::Status m_status;
+ KIRC::Engine::tqStatus m_status;
TQString m_Host;
- Q_UINT16 m_Port;
+ TQ_UINT16 m_Port;
// TQUrl serverURL;
// TQUrl currentServerURL;
diff --git a/kopete/protocols/irc/libkirc/kircengine_commands.cpp b/kopete/protocols/irc/libkirc/kircengine_commands.cpp
index 21a90676..f8c3dcca 100644
--- a/kopete/protocols/irc/libkirc/kircengine_commands.cpp
+++ b/kopete/protocols/irc/libkirc/kircengine_commands.cpp
@@ -37,8 +37,8 @@ void Engine::bindCommands()
bind("PING", this, TQT_SLOT(ping(KIRC::Message &)), 0, 0);
bind("PONG", this, TQT_SLOT(pong(KIRC::Message &)), 0, 0);
bind("PRIVMSG", this, TQT_SLOT(privmsg(KIRC::Message &)), 1, 1);
- bind("QUIT", this, TQT_SLOT(quit(KIRC::Message &)), 0, 0);
-// bind("SQUIT", this, TQT_SLOT(squit(KIRC::Message &)), 1, 1);
+ bind("TQUIT", this, TQT_SLOT(quit(KIRC::Message &)), 0, 0);
+// bind("STQUIT", this, TQT_SLOT(squit(KIRC::Message &)), 1, 1);
bind("TOPIC", this, TQT_SLOT(topic(KIRC::Message &)), 1, 1);
}
@@ -46,30 +46,30 @@ void Engine::away(bool isAway, const TQString &awayMessage)
{
if(isAway)
if( !awayMessage.isEmpty() )
- writeMessage("AWAY", TQString::null, awayMessage);
+ writeMessage("AWAY", TQString(), awayMessage);
else
- writeMessage("AWAY", TQString::null, TQString::fromLatin1("I'm away."));
+ writeMessage("AWAY", TQString(), TQString::tqfromLatin1("I'm away."));
else
- writeMessage("AWAY", TQString::null);
+ writeMessage("AWAY", TQString());
}
// FIXME: Really handle this message
void Engine::error(Message &)
{
- setStatus(Closing);
+ settqStatus(Closing);
}
void Engine::ison(const TQStringList &nickList)
{
if (!nickList.isEmpty())
{
- TQString statement = TQString::fromLatin1("ISON");
+ TQString statement = TQString::tqfromLatin1("ISON");
for (TQStringList::ConstIterator it = nickList.begin(); it != nickList.end(); ++it)
{
if ((statement.length()+(*it).length())>509) // 512(max buf)-2("\r\n")-1(<space separator>)
{
writeMessage(statement);
- statement = TQString::fromLatin1("ISON ") + (*it);
+ statement = TQString::tqfromLatin1("ISON ") + (*it);
}
else
statement.append(TQChar(' ') + (*it));
@@ -199,9 +199,9 @@ void Engine::quit(const TQString &reason, bool /*now*/)
return;
if (isConnected())
- writeMessage("QUIT", TQString::null, reason);
+ writeMessage("TQUIT", TQString(), reason);
- setStatus(Closing);
+ settqStatus(Closing);
}
void Engine::quit(Message &msg)
@@ -224,10 +224,10 @@ void Engine::user(const TQString &newUserName, const TQString &hostname, const T
writeMessage("USER", TQStringList(m_Username) << hostname << m_Host, m_realName);
}
-void Engine::user(const TQString &newUserName, Q_UINT8 mode, const TQString &newRealName)
+void Engine::user(const TQString &newUserName, TQ_UINT8 mode, const TQString &newRealName)
{
/* RFC2812: "<user> <mode> <unused> <realname>"
- * mode is a numeric value (from a bit mask).
+ * mode is a numeric value (from a bit tqmask).
* 0x00 normal
* 0x04 request +w
* 0x08 request +i */
@@ -252,7 +252,7 @@ void Engine::topic(Message &msg)
void Engine::list()
{
- writeMessage("LIST", TQString::null);
+ writeMessage("LIST", TQString());
}
void Engine::motd(const TQString &server)
diff --git a/kopete/protocols/irc/libkirc/kircengine_ctcp.cpp b/kopete/protocols/irc/libkirc/kircengine_ctcp.cpp
index 7216dea7..83a4257c 100644
--- a/kopete/protocols/irc/libkirc/kircengine_ctcp.cpp
+++ b/kopete/protocols/irc/libkirc/kircengine_ctcp.cpp
@@ -72,7 +72,7 @@ void Engine::CtcpRequestCommand(const TQString &contact, const TQString &command
{
if(m_status == Connected)
{
- writeCtcpQueryMessage(contact, TQString::null, command);
+ writeCtcpQueryMessage(contact, TQString(), command);
// emit ctcpCommandMessage( contact, command );
}
}
@@ -81,7 +81,7 @@ void Engine::CtcpRequest_action(const TQString &contact, const TQString &message
{
if(m_status == Connected)
{
- writeCtcpQueryMessage(contact, TQString::null, "ACTION", message);
+ writeCtcpQueryMessage(contact, TQString(), "ACTION", message);
if( Entity::isChannel(contact) )
emit incomingAction(Kopete::Message::unescape(contact), Kopete::Message::unescape(m_Nickname), message);
@@ -109,15 +109,15 @@ bool Engine::CtcpReply_action(Message &msg)
// FIXME: the API can now answer to help commands.
void Engine::CtcpQuery_clientinfo(Message &msg)
{
- TQString clientinfo = customCtcpMap[ TQString::fromLatin1("clientinfo") ];
+ TQString clientinfo = customCtcpMap[ TQString::tqfromLatin1("clientinfo") ];
if (clientinfo.isNull())
- clientinfo = TQString::fromLatin1("The following commands are supported, but "
+ clientinfo = TQString::tqfromLatin1("The following commands are supported, but "
"without sub-command help: VERSION, CLIENTINFO, USERINFO, TIME, SOURCE, PING,"
"ACTION.");
- writeCtcpReplyMessage( msg.nickFromPrefix(), TQString::null,
- msg.ctcpMessage().command(), TQString::null, clientinfo);
+ writeCtcpReplyMessage( msg.nickFromPrefix(), TQString(),
+ msg.ctcpMessage().command(), TQString(), clientinfo);
}
void Engine::CtcpRequest_dcc(const TQString &nickname, const TQString &fileName, uint port, Transfer::Type type)
@@ -131,9 +131,9 @@ void Engine::CtcpRequest_dcc(const TQString &nickname, const TQString &fileName,
{
case Transfer::Chat:
{
- writeCtcpQueryMessage(nickname, TQString::null,
- TQString::fromLatin1("DCC"),
- TQStringList(TQString::fromLatin1("CHAT")) << TQString::fromLatin1("chat") <<
+ writeCtcpQueryMessage(nickname, TQString(),
+ TQString::tqfromLatin1("DCC"),
+ TQStringList(TQString::tqfromLatin1("CHAT")) << TQString::tqfromLatin1("chat") <<
m_sock->localAddress()->nodeName() << TQString::number(port)
);
break;
@@ -143,8 +143,8 @@ void Engine::CtcpRequest_dcc(const TQString &nickname, const TQString &fileName,
{
TQFileInfo file(fileName);
TQString noWhiteSpace = file.fileName();
- if (noWhiteSpace.contains(' ') > 0)
- noWhiteSpace.replace(TQRegExp("\\s+"), "_");
+ if (noWhiteSpace.tqcontains(' ') > 0)
+ noWhiteSpace.tqreplace(TQRegExp("\\s+"), "_");
TransferServer *server = TransferHandler::self()->createServer(this, nickname, type, fileName, file.size());
@@ -153,9 +153,9 @@ void Engine::CtcpRequest_dcc(const TQString &nickname, const TQString &fileName,
kdDebug(14120) << "Starting DCC file outgoing transfer." << endl;
- writeCtcpQueryMessage(nickname, TQString::null,
- TQString::fromLatin1("DCC"),
- TQStringList(TQString::fromLatin1("SEND")) << noWhiteSpace << ipNumber <<
+ writeCtcpQueryMessage(nickname, TQString(),
+ TQString::tqfromLatin1("DCC"),
+ TQStringList(TQString::tqfromLatin1("SEND")) << noWhiteSpace << ipNumber <<
TQString::number(server->port()) << TQString::number(file.size())
);
break;
@@ -173,7 +173,7 @@ void Engine::CtcpQuery_dcc(Message &msg)
Message &ctcpMsg = msg.ctcpMessage();
TQString dccCommand = ctcpMsg.arg(0).upper();
- if (dccCommand == TQString::fromLatin1("CHAT"))
+ if (dccCommand == TQString::tqfromLatin1("CHAT"))
{
// if(ctcpMsg.argsSize()!=4) return false;
@@ -196,7 +196,7 @@ void Engine::CtcpQuery_dcc(Message &msg)
Transfer::Chat );
}
}
- else if (dccCommand == TQString::fromLatin1("SEND"))
+ else if (dccCommand == TQString::tqfromLatin1("SEND"))
{
// if(ctcpMsg.argsSize()!=5) return false;
@@ -253,11 +253,11 @@ void Engine::CtcpRequest_ping(const TQString &target)
TQString timeReply;
if( Entity::isChannel(target) )
- timeReply = TQString::fromLatin1("%1.%2").arg(time.tv_sec).arg(time.tv_usec);
+ timeReply = TQString::tqfromLatin1("%1.%2").arg(time.tv_sec).arg(time.tv_usec);
else
timeReply = TQString::number( time.tv_sec );
- writeCtcpQueryMessage( target, TQString::null, "PING", timeReply);
+ writeCtcpQueryMessage( target, TQString(), "PING", timeReply);
}
// else
// ((MessageRedirector *)sender())->error("failed to get current time");
@@ -265,7 +265,7 @@ void Engine::CtcpRequest_ping(const TQString &target)
void Engine::CtcpQuery_ping(Message &msg)
{
- writeCtcpReplyMessage( msg.nickFromPrefix(), TQString::null,
+ writeCtcpReplyMessage( msg.nickFromPrefix(), TQString(),
msg.ctcpMessage().command(), msg.ctcpMessage().arg(0));
}
@@ -275,7 +275,7 @@ void Engine::CtcpReply_ping(Message &msg)
if (gettimeofday(&time, 0) == 0)
{
// FIXME: the time code is wrong for usec
- TQString timeReply = TQString::fromLatin1("%1.%2").arg(time.tv_sec).arg(time.tv_usec);
+ TQString timeReply = TQString::tqfromLatin1("%1.%2").arg(time.tv_sec).arg(time.tv_usec);
double newTime = timeReply.toDouble();
double oldTime = msg.suffix().section(' ',0, 0).toDouble();
double difference = newTime - oldTime;
@@ -284,7 +284,7 @@ void Engine::CtcpReply_ping(Message &msg)
if (difference < 1)
{
diffString = TQString::number(difference);
- diffString.remove((diffString.find('.') -1), 2);
+ diffString.remove((diffString.tqfind('.') -1), 2);
diffString.truncate(3);
diffString.append("milliseconds");
}
@@ -293,12 +293,12 @@ void Engine::CtcpReply_ping(Message &msg)
diffString = TQString::number(difference);
TQString seconds = diffString.section('.', 0, 0);
TQString millSec = diffString.section('.', 1, 1);
- millSec.remove(millSec.find('.'), 1);
+ millSec.remove(millSec.tqfind('.'), 1);
millSec.truncate(3);
- diffString = TQString::fromLatin1("%1 seconds, %2 milliseconds").arg(seconds).arg(millSec);
+ diffString = TQString::tqfromLatin1("%1 seconds, %2 milliseconds").arg(seconds).arg(millSec);
}
- emit incomingCtcpReply(TQString::fromLatin1("PING"), msg.nickFromPrefix(), diffString);
+ emit incomingCtcpReply(TQString::tqfromLatin1("PING"), msg.nickFromPrefix(), diffString);
}
// else
// ((MessageRedirector *)sender())->error("failed to get current time");
@@ -306,36 +306,36 @@ void Engine::CtcpReply_ping(Message &msg)
void Engine::CtcpQuery_source(Message &msg)
{
- writeCtcpReplyMessage(msg.nickFromPrefix(), TQString::null,
+ writeCtcpReplyMessage(msg.nickFromPrefix(), TQString(),
msg.ctcpMessage().command(), m_SourceString);
}
void Engine::CtcpQuery_time(Message &msg)
{
- writeCtcpReplyMessage(msg.nickFromPrefix(), TQString::null,
- msg.ctcpMessage().command(), TQDateTime::currentDateTime().toString(),
- TQString::null, false);
+ writeCtcpReplyMessage(msg.nickFromPrefix(), TQString(),
+ msg.ctcpMessage().command(), TQDateTime::tqcurrentDateTime().toString(),
+ TQString(), false);
}
void Engine::CtcpQuery_userinfo(Message &msg)
{
- TQString userinfo = customCtcpMap[ TQString::fromLatin1("userinfo") ];
+ TQString userinfo = customCtcpMap[ TQString::tqfromLatin1("userinfo") ];
if (userinfo.isNull())
userinfo = m_UserString;
- writeCtcpReplyMessage(msg.nickFromPrefix(), TQString::null,
- msg.ctcpMessage().command(), TQString::null, userinfo);
+ writeCtcpReplyMessage(msg.nickFromPrefix(), TQString(),
+ msg.ctcpMessage().command(), TQString(), userinfo);
}
void Engine::CtcpRequest_version(const TQString &target)
{
- writeCtcpQueryMessage(target, TQString::null, "VERSION");
+ writeCtcpQueryMessage(target, TQString(), "VERSION");
}
void Engine::CtcpQuery_version(Message &msg)
{
- TQString response = customCtcpMap[ TQString::fromLatin1("version") ];
+ TQString response = customCtcpMap[ TQString::tqfromLatin1("version") ];
kdDebug(14120) << "Version check: " << response << endl;
if (response.isNull())
diff --git a/kopete/protocols/irc/libkirc/kircengine_numericreplies.cpp b/kopete/protocols/irc/libkirc/kircengine_numericreplies.cpp
index 67d3a842..3d7b896b 100644
--- a/kopete/protocols/irc/libkirc/kircengine_numericreplies.cpp
+++ b/kopete/protocols/irc/libkirc/kircengine_numericreplies.cpp
@@ -117,7 +117,7 @@ void Engine::numericReply_001(Message &msg)
*/
emitSuffix(msg);
- setStatus(Connected);
+ settqStatus(Connected);
}
/* 002: ":Your host is <servername>, running version <ver>"
diff --git a/kopete/protocols/irc/libkirc/kircentity.cpp b/kopete/protocols/irc/libkirc/kircentity.cpp
index ded35fe5..2086ab9d 100644
--- a/kopete/protocols/irc/libkirc/kircentity.cpp
+++ b/kopete/protocols/irc/libkirc/kircentity.cpp
@@ -29,16 +29,16 @@ using namespace KNetwork;
* where user and host are optionnal.
* NOTE: If changes are done to the regexp string, update also the sm_userStrictRegExp regexp string.
*/
-const TQRegExp Entity::sm_userRegExp(TQString::fromLatin1("^([^\\s,:!@]+)(?:(?:!([^\\s,:!@]+))?(?:@([^\\s,!@]+)))?$"));
+const TQRegExp Entity::sm_userRegExp(TQString::tqfromLatin1("^([^\\s,:!@]+)(?:(?:!([^\\s,:!@]+))?(?:@([^\\s,!@]+)))?$"));
/**
* Regexp to match strictly the complete user definition:
* nick!user@host
* NOTE: If changes are done to the regexp string, update also the sm_userRegExp regexp string.
*/
-const TQRegExp Entity::sm_userStrictRegExp(TQString::fromLatin1("^([^\\s,:!@]+)!([^\\s,:!@]+)@([^\\s,:!@]+)$"));
+const TQRegExp Entity::sm_userStrictRegExp(TQString::tqfromLatin1("^([^\\s,:!@]+)!([^\\s,:!@]+)@([^\\s,:!@]+)$"));
-const TQRegExp Entity::sm_channelRegExp( TQString::fromLatin1("^[#!+&][^\\s,]+$") );
+const TQRegExp Entity::sm_channelRegExp( TQString::tqfromLatin1("^[#!+&][^\\s,]+$") );
Entity::Entity(const TQString &, const Type type)
: TQObject(0, "KIRC::Entity"),
@@ -70,7 +70,7 @@ TQString Entity::host() const
return userHost();
default:
kdDebug(14121) << k_funcinfo << "No host defined for type:" << m_type;
- return TQString::null;
+ return TQString();
}
}
diff --git a/kopete/protocols/irc/libkirc/kircentity.h b/kopete/protocols/irc/libkirc/kircentity.h
index 1878a406..a8dc8fff 100644
--- a/kopete/protocols/irc/libkirc/kircentity.h
+++ b/kopete/protocols/irc/libkirc/kircentity.h
@@ -37,6 +37,7 @@ class Entity
public KShared
{
Q_OBJECT
+ TQ_OBJECT
public:
enum Type
@@ -87,7 +88,7 @@ private:
static const TQRegExp sm_channelRegExp;
KIRC::Entity::Type m_type;
- QString m_name;
+ TQString m_name;
// peer ip address if the entity is a User.
TQString m_address;
diff --git a/kopete/protocols/irc/libkirc/kircmessage.cpp b/kopete/protocols/irc/libkirc/kircmessage.cpp
index 73a1e53f..0c1d3ef0 100644
--- a/kopete/protocols/irc/libkirc/kircmessage.cpp
+++ b/kopete/protocols/irc/libkirc/kircmessage.cpp
@@ -34,7 +34,7 @@ TQRegExp Message::m_IRCNumericCommand("^\\d{1,3}$");
// TODO: This regexp parsing is no good. It's slower than it needs to be, and
// is not codec-safe since TQString requires a codec. NEed to parse this with
-// our own parsing class that operates on the raw QCStrings
+// our own parsing class that operates on the raw TQCStrings
TQRegExp Message::m_IRCCommandType1(
"^(?::([^ ]+) )?([A-Za-z]+|\\d{1,3})((?: [^ :][^ ]*)*) ?(?: :(.*))?$");
// Extra end arg space check -------------------------^
@@ -99,14 +99,14 @@ void Message::writeRawMessage(Engine *engine, const TQTextCodec *codec, const TQ
return;
}
- TQString txt = str + TQString::fromLatin1("\r\n");
+ TQString txt = str + TQString::tqfromLatin1("\r\n");
TQCString s(codec->fromUnicode(txt));
kdDebug(14120) << "Message is " << s.length() << " chars" << endl;
// FIXME: Should check the amount of data really writen.
int wrote = engine->socket()->writeBlock(s.data(), s.length());
- kdDebug(14121) << TQString::fromLatin1("(%1 bytes) >> %2").arg(wrote).arg(str) << endl;
+ kdDebug(14121) << TQString::tqfromLatin1("(%1 bytes) >> %2").tqarg(wrote).tqarg(str) << endl;
}
void Message::writeMessage(Engine *engine, const TQTextCodec *codec, const TQString &message)
@@ -123,7 +123,7 @@ void Message::writeMessage(Engine *engine, const TQTextCodec *codec,
msg += TQChar(' ') + args.join(TQChar(' ')).stripWhiteSpace(); // some extra check should be done here
if (!suffix.isNull())
- msg = msg.stripWhiteSpace() + TQString::fromLatin1(" :") + suffix;
+ msg = msg.stripWhiteSpace() + TQString::tqfromLatin1(" :") + suffix;
writeMessage(engine, codec, msg);
}
@@ -145,7 +145,7 @@ void Message::writeCtcpMessage(Engine *engine, const TQTextCodec *codec,
ctcpMsg += TQChar(' ') + ctcpArgs.join(TQChar(' ')).stripWhiteSpace(); // some extra check should be done here
if (!ctcpSuffix.isNull())
- ctcpMsg += TQString::fromLatin1(" :") + ctcpSuffix;
+ ctcpMsg += TQString::tqfromLatin1(" :") + ctcpSuffix;
writeMessage(engine, codec, command, to, suffix + TQChar(0x01) + ctcpQuote(ctcpMsg) + TQChar(0x01));
}
@@ -158,7 +158,7 @@ Message Message::parse(Engine *engine, const TQTextCodec *codec, bool *parseSucc
if (engine->socket()->canReadLine())
{
TQCString raw(engine->socket()->bytesAvailable()+1);
- Q_LONG length = engine->socket()->readLine(raw.data(), raw.count());
+ TQ_LONG length = engine->socket()->readLine(raw.data(), raw.count());
if( length > -1 )
{
@@ -169,10 +169,10 @@ Message Message::parse(Engine *engine, const TQTextCodec *codec, bool *parseSucc
// Some servers send '\n' instead of '\r\n' that the RFCs say they should be sending.
if (length > 1 && raw.at(length-2) == '\n') {
- raw.at(length-2) = '\0';
+ raw.tqat(length-2) = '\0';
}
if (length > 2 && raw.at(length-3) == '\r') {
- raw.at(length-3) = '\0';
+ raw.tqat(length-3) = '\0';
}
kdDebug(14121) << "<< " << raw << endl;
@@ -201,10 +201,10 @@ TQString Message::quote(const TQString &str)
{
TQString tmp = str;
TQChar q('\020');
- tmp.replace(q, q+TQString(q));
- tmp.replace(TQChar('\r'), q+TQString::fromLatin1("r"));
- tmp.replace(TQChar('\n'), q+TQString::fromLatin1("n"));
- tmp.replace(TQChar('\0'), q+TQString::fromLatin1("0"));
+ tmp.tqreplace(q, q+TQString(q));
+ tmp.tqreplace(TQChar('\r'), q+TQString::tqfromLatin1("r"));
+ tmp.tqreplace(TQChar('\n'), q+TQString::tqfromLatin1("n"));
+ tmp.tqreplace(TQChar('\0'), q+TQString::tqfromLatin1("0"));
return tmp;
}
@@ -216,13 +216,13 @@ TQString Message::unquote(const TQString &str)
char b[3] = { 020, 020, '\0' };
const char b2[2] = { 020, '\0' };
- tmp.replace( b, b2 );
+ tmp.tqreplace( b, b2 );
b[1] = 'r';
- tmp.replace( b, "\r");
+ tmp.tqreplace( b, "\r");
b[1] = 'n';
- tmp.replace( b, "\n");
+ tmp.tqreplace( b, "\n");
b[1] = '0';
- tmp.replace( b, "\0");
+ tmp.tqreplace( b, "\0");
return tmp;
}
@@ -230,16 +230,16 @@ TQString Message::unquote(const TQString &str)
TQString Message::ctcpQuote(const TQString &str)
{
TQString tmp = str;
- tmp.replace( TQChar('\\'), TQString::fromLatin1("\\\\"));
- tmp.replace( (char)1, TQString::fromLatin1("\\1"));
+ tmp.tqreplace( TQChar('\\'), TQString::tqfromLatin1("\\\\"));
+ tmp.tqreplace( (char)1, TQString::tqfromLatin1("\\1"));
return tmp;
}
TQString Message::ctcpUnquote(const TQString &str)
{
TQString tmp = str;
- tmp.replace("\\\\", "\\");
- tmp.replace("\\1", "\1" );
+ tmp.tqreplace("\\\\", "\\");
+ tmp.tqreplace("\\1", "\1" );
return tmp;
}
@@ -276,7 +276,7 @@ bool Message::matchForIRCRegExp(TQRegExp &regexp, const TQTextCodec *codec, cons
msg.m_ctcpMessage = new Message();
msg.m_ctcpMessage->m_raw = codec->fromUnicode(ctcpUnquote(msg.m_ctcpRaw));
- int space = ctcpRaw.find(' ');
+ int space = ctcpRaw.tqfind(' ');
if (!matchForIRCRegExp(msg.m_ctcpMessage->m_raw, codec, *msg.m_ctcpMessage))
{
TQCString command;
@@ -296,7 +296,7 @@ bool Message::matchForIRCRegExp(TQRegExp &regexp, const TQTextCodec *codec, cons
msg.m_suffix = Kopete::Message::decodeString( KSParser::parse(suffix), codec );
}
else
- msg.m_suffix = TQString::null;
+ msg.m_suffix = TQString();
return true;
}
return false;
@@ -311,13 +311,13 @@ void Message::decodeAgain( const TQTextCodec *codec )
TQString Message::toString() const
{
if( !isValid() )
- return TQString::null;
+ return TQString();
TQString msg = m_command;
for (TQStringList::ConstIterator it = m_args.begin(); it != m_args.end(); ++it)
msg += TQChar(' ') + *it;
if (!m_suffix.isNull())
- msg += TQString::fromLatin1(" :") + m_suffix;
+ msg += TQString::tqfromLatin1(" :") + m_suffix;
return msg;
}
diff --git a/kopete/protocols/irc/libkirc/kircmessage.h b/kopete/protocols/irc/libkirc/kircmessage.h
index 02631bbf..80dcfa79 100644
--- a/kopete/protocols/irc/libkirc/kircmessage.h
+++ b/kopete/protocols/irc/libkirc/kircmessage.h
@@ -57,7 +57,7 @@ public:
static void writeCtcpMessage(KIRC::Engine *engine, const TQTextCodec *codec,
const TQString &command, const TQString &to, const TQString &suffix,
- const TQString &ctcpCommand, const TQStringList &ctcpArgs = TQStringList(), const TQString &ctcpSuffix = TQString::null );
+ const TQString &ctcpCommand, const TQStringList &ctcpArgs = TQStringList(), const TQString &ctcpSuffix = TQString() );
Message();
Message(const KIRC::Message &obj);
@@ -112,7 +112,7 @@ public:
inline const TQString &command() const
{ return m_command; }
- /** \brief The number of command arguments this message contains.
+ /** \brief The number of command arguments this message tqcontains.
*/
inline size_t argsSize() const
{ return m_args.size(); }
diff --git a/kopete/protocols/irc/libkirc/kircmessageredirector.cpp b/kopete/protocols/irc/libkirc/kircmessageredirector.cpp
index 2e1d0b4c..ae9854f1 100644
--- a/kopete/protocols/irc/libkirc/kircmessageredirector.cpp
+++ b/kopete/protocols/irc/libkirc/kircmessageredirector.cpp
@@ -80,9 +80,9 @@ bool MessageRedirector::checkValidity(const Message &msg)
/*
if ( msg.isNumeric() &&
( msg.argsSize() > 0 && (
- msg.arg(0) == m_Nickname ||
- msg.arg(0) == m_PendingNick ||
- msg.arg(0) == TQString::fromLatin1("*")
+ msg.tqarg(0) == m_Nickname ||
+ msg.tqarg(0) == m_PendingNick ||
+ msg.tqarg(0) == TQString::tqfromLatin1("*")
)
)
)
diff --git a/kopete/protocols/irc/libkirc/kircmessageredirector.h b/kopete/protocols/irc/libkirc/kircmessageredirector.h
index 24a2f9af..e6fbda80 100644
--- a/kopete/protocols/irc/libkirc/kircmessageredirector.h
+++ b/kopete/protocols/irc/libkirc/kircmessageredirector.h
@@ -29,9 +29,10 @@ class Engine;
class Message;
class MessageRedirector
- : public QObject
+ : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
enum {
@@ -42,7 +43,7 @@ public:
MessageRedirector(KIRC::Engine *engine,
int argsSize_min = KIRC::MessageRedirector::Unknown,
int argsSize_max = KIRC::MessageRedirector::Unknown,
- const TQString &helpMessage = TQString::null);
+ const TQString &helpMessage = TQString());
/**
* Connects the given object member signal/slot to this message redirector.
diff --git a/kopete/protocols/irc/libkirc/kirctransfer.cpp b/kopete/protocols/irc/libkirc/kirctransfer.cpp
index af7d8948..198009a3 100644
--- a/kopete/protocols/irc/libkirc/kirctransfer.cpp
+++ b/kopete/protocols/irc/libkirc/kirctransfer.cpp
@@ -28,21 +28,21 @@ using namespace KIRC;
Transfer::Transfer( Engine *engine, TQString nick,// TQString nick_peer_adress
Type type,
- TQObject *parent, const char *name )
- : TQObject( parent, name ),
+ TQObject *tqparent, const char *name )
+ : TQObject( tqparent, name ),
m_engine(engine), m_nick(nick),
m_type(type), m_socket(0),
m_initiated(false),
- m_file(0), m_fileName(TQString::null), m_fileSize(0), m_fileSizeCur(0), m_fileSizeAck(0),
+ m_file(0), m_fileName(TQString()), m_fileSize(0), m_fileSizeCur(0), m_fileSizeAck(0),
m_receivedBytes(0), m_receivedBytesLimit(0), m_sentBytes(0), m_sentBytesLimit(0)
{
}
Transfer::Transfer( Engine *engine, TQString nick,// TQString nick_peer_adress
Transfer::Type type,
- TQString fileName, Q_UINT32 fileSize, // put this in a TQVariant ?
- TQObject *parent, const char *name )
- : TQObject( parent, name ),
+ TQString fileName, TQ_UINT32 fileSize, // put this in a TQVariant ?
+ TQObject *tqparent, const char *name )
+ : TQObject( tqparent, name ),
m_engine(engine), m_nick(nick),
m_type(type), m_socket(0),
m_initiated(false),
@@ -52,11 +52,11 @@ Transfer::Transfer( Engine *engine, TQString nick,// TQString nick_peer_adress
}
Transfer::Transfer( Engine *engine, TQString nick,// TQString nick_peer_adress
- TQHostAddress hostAdress, Q_UINT16 port, // put this in a TQVariant ?
+ TQHostAddress hostAdress, TQ_UINT16 port, // put this in a TQVariant ?
Transfer::Type type,
- TQString fileName, Q_UINT32 fileSize, // put this in a TQVariant ?
- TQObject *parent, const char *name )
- : TQObject( parent, name ),
+ TQString fileName, TQ_UINT32 fileSize, // put this in a TQVariant ?
+ TQObject *tqparent, const char *name )
+ : TQObject( tqparent, name ),
m_engine(engine), m_nick(nick),
m_type(type), m_socket(0),
m_initiated(false),
@@ -68,8 +68,8 @@ Transfer::Transfer( Engine *engine, TQString nick,// TQString nick_peer_adress
/*
Transfer::Transfer( Engine *engine, TQString nick,// TQString nick_peer_adress
Transfer::Type type, TQVariant properties,
- TQObject *parent, const char *name )
- : TQObject( parent, name ),
+ TQObject *tqparent, const char *name )
+ : TQObject( tqparent, name ),
m_engine(engine), m_nick(nick),
m_type(type), m_socket(properties[socket]),
m_initiated(false),
@@ -94,11 +94,11 @@ Transfer::~Transfer()
// m_file is automatically closed on destroy.
}
-Transfer::Status Transfer::status() const
+Transfer::tqStatus Transfer::status() const
{
if(m_socket)
{
-// return (Transfer::Status)m_socket->socketStatus();
+// return (Transfer::tqStatus)m_socket->socketStatus();
return Connected;
}
return Error_NoSocket;
@@ -310,7 +310,7 @@ void Transfer::readyReadFileOutgoing()
kdDebug(14121) << k_funcinfo << "Available bytes:" << m_socket->bytesAvailable() << endl;
bool hadData = false;
- Q_UINT32 fileSizeAck = 0;
+ TQ_UINT32 fileSizeAck = 0;
// if (m_socket->bytesAvailable() >= sizeof(fileSizeAck)) // BUGGY: bytesAvailable() that allways return 0 on unbuffered sockets.
{
@@ -334,7 +334,7 @@ void Transfer::writeFileOutgoing()
m_bufferLength = m_file.readBlock(m_buffer, sizeof(m_buffer));
if (m_bufferLength > 0)
{
- Q_UINT32 read = m_socket->writeBlock(m_buffer, m_bufferLength); // should check written == read
+ TQ_UINT32 read = m_socket->writeBlock(m_buffer, m_bufferLength); // should check written == read
// if(read != m_buffer_length)
// buffer is not cleared still
@@ -348,7 +348,7 @@ void Transfer::writeFileOutgoing()
}
}
-void Transfer::checkFileTransferEnd(Q_UINT32 fileSizeAck)
+void Transfer::checkFileTransferEnd(TQ_UINT32 fileSizeAck)
{
kdDebug(14121) << k_funcinfo << "Acknowledged:" << fileSizeAck << endl;
diff --git a/kopete/protocols/irc/libkirc/kirctransfer.h b/kopete/protocols/irc/libkirc/kirctransfer.h
index 36d8de32..3794e744 100644
--- a/kopete/protocols/irc/libkirc/kirctransfer.h
+++ b/kopete/protocols/irc/libkirc/kirctransfer.h
@@ -34,9 +34,10 @@ namespace KIRC
class Engine;
class Transfer
- : public QObject
+ : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
enum Type {
@@ -46,7 +47,7 @@ public:
FileIncoming
};
- enum Status {
+ enum tqStatus {
Error_NoSocket = -2,
Error = -1,
Idle = 0,
@@ -58,39 +59,39 @@ public:
public:
Transfer( KIRC::Engine *engine, TQString nick,// TQString nick_peer_adress
Type type = Unknown,
- TQObject *parent = 0L, const char *name = 0L );
+ TQObject *tqparent = 0L, const char *name = 0L );
Transfer( KIRC::Engine *engine, TQString nick,// TQString nick_peer_adress,
- TQHostAddress peer_address, Q_UINT16 peer_port,
+ TQHostAddress peer_address, TQ_UINT16 peer_port,
Transfer::Type type,
- TQObject *parent = 0L, const char *name = 0L );
+ TQObject *tqparent = 0L, const char *name = 0L );
Transfer( KIRC::Engine *engine, TQString nick,// TQString nick_peer_adress,
Transfer::Type type,
- TQString fileName, Q_UINT32 fileSize,
- TQObject *parent = 0L, const char *name = 0L );
+ TQString fileName, TQ_UINT32 fileSize,
+ TQObject *tqparent = 0L, const char *name = 0L );
Transfer( KIRC::Engine *engine, TQString nick,// TQString nick_peer_adress,
- TQHostAddress peer_address, Q_UINT16 peer_port,
+ TQHostAddress peer_address, TQ_UINT16 peer_port,
Transfer::Type type,
- TQString fileName, Q_UINT32 fileSize,
- TQObject *parent = 0L, const char *name = 0L );
+ TQString fileName, TQ_UINT32 fileSize,
+ TQObject *tqparent = 0L, const char *name = 0L );
/*
For a file transfer properties are:
KExntendedSocket *socket
or
- QHostAddress peerAddress
- Q_UINT16 peerPort
+ TQHostAddress peerAddress
+ TQ_UINT16 peerPort
for determining the socket.
- QString fileName
- Q_UINT32 fileSize
+ TQString fileName
+ TQ_UINT32 fileSize
for detemining the file propeties.
*//*
Transfer( KIRC *engine, TQString nick,// TQString nick_peer_adress,
Transfer::Type type, TQVariant properties,
- TQObject *parent = 0L, const char *name = 0L );
+ TQObject *tqparent = 0L, const char *name = 0L );
*/
~Transfer();
@@ -100,7 +101,7 @@ public:
{ return m_nick; }
Type type() const
{ return m_type; }
- Status status() const;
+ tqStatus status() const;
/* Start the transfer.
* If not connected connect to client.
@@ -133,8 +134,8 @@ signals:
void fileSizeCurrent( unsigned int );
void fileSizeAcknowledge( unsigned int );
-// void received(Q_UINT32);
-// void sent(Q_UINT32);
+// void received(TQ_UINT32);
+// void sent(TQ_UINT32);
void abort(TQString);
@@ -155,35 +156,35 @@ protected slots:
protected:
// void emitSignals();
- void checkFileTransferEnd( Q_UINT32 fileSizeAck );
+ void checkFileTransferEnd( TQ_UINT32 fileSizeAck );
KIRC::Engine * m_engine;
- QString m_nick;
+ TQString m_nick;
Type m_type;
KExtendedSocket *m_socket;
bool m_initiated;
// Text member data
- QTextStream m_socket_textStream;
+ TQTextStream m_socket_textStream;
// TQTextCodec * m_socket_codec;
// File member data
- QFile m_file;
- QString m_fileName;
- Q_UINT32 m_fileSize;
- Q_UINT32 /*usize_t*/ m_fileSizeCur;
- Q_UINT32 /*usize_t*/ m_fileSizeAck;
- QDataStream m_socketDataStream;
+ TQFile m_file;
+ TQString m_fileName;
+ TQ_UINT32 m_fileSize;
+ TQ_UINT32 /*usize_t*/ m_fileSizeCur;
+ TQ_UINT32 /*usize_t*/ m_fileSizeAck;
+ TQDataStream m_socketDataStream;
char m_buffer[1024];
int m_bufferLength;
// Data transfer measures
- Q_UINT32 m_receivedBytes;
- Q_UINT32 m_receivedBytesLimit;
+ TQ_UINT32 m_receivedBytes;
+ TQ_UINT32 m_receivedBytesLimit;
- Q_UINT32 m_sentBytes;
- Q_UINT32 m_sentBytesLimit;
+ TQ_UINT32 m_sentBytes;
+ TQ_UINT32 m_sentBytesLimit;
};
}
diff --git a/kopete/protocols/irc/libkirc/kirctransferhandler.cpp b/kopete/protocols/irc/libkirc/kirctransferhandler.cpp
index c6c2185e..3a5ef27c 100644
--- a/kopete/protocols/irc/libkirc/kirctransferhandler.cpp
+++ b/kopete/protocols/irc/libkirc/kirctransferhandler.cpp
@@ -43,7 +43,7 @@ TransferServer *TransferHandler::server()
return m_server;
}
-TransferServer *TransferHandler::server( Q_UINT16 port, int backlog )
+TransferServer *TransferHandler::server( TQ_UINT16 port, int backlog )
{
// if( m_server )
// m_server->terminate();
@@ -56,7 +56,7 @@ TransferServer *TransferHandler::server( Q_UINT16 port, int backlog )
TransferServer *TransferHandler::createServer(Engine *engine, TQString m_userName,
Transfer::Type type,
- TQString fileName, Q_UINT32 fileSize)
+ TQString fileName, TQ_UINT32 fileSize)
{
TransferServer *server = new TransferServer(engine, m_userName, type, fileName, fileSize, this);
transferServerCreated(server);
@@ -65,9 +65,9 @@ TransferServer *TransferHandler::createServer(Engine *engine, TQString m_userNam
Transfer *TransferHandler::createClient(
Engine *engine, TQString nick,// TQString nick_peer_adress,
- TQHostAddress peer_address, Q_UINT16 peer_port,
+ TQHostAddress peer_address, TQ_UINT16 peer_port,
Transfer::Type type,
- TQString fileName, Q_UINT32 fileSize )
+ TQString fileName, TQ_UINT32 fileSize )
{
Transfer *client = new Transfer(
engine, nick,// TQString nick_peer_adress,
diff --git a/kopete/protocols/irc/libkirc/kirctransferhandler.h b/kopete/protocols/irc/libkirc/kirctransferhandler.h
index dc02754c..34516f15 100644
--- a/kopete/protocols/irc/libkirc/kirctransferhandler.h
+++ b/kopete/protocols/irc/libkirc/kirctransferhandler.h
@@ -32,25 +32,26 @@ namespace KIRC
{
class TransferHandler
- : public QObject
+ : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
static TransferHandler *self();
TransferServer *server();
- TransferServer *server( Q_UINT16 port, int backlog = 1 );
+ TransferServer *server( TQ_UINT16 port, int backlog = 1 );
TransferServer *createServer(KIRC::Engine *engine, TQString m_userName,
Transfer::Type type,
- TQString fileName, Q_UINT32 fileSize);
+ TQString fileName, TQ_UINT32 fileSize);
Transfer *createClient(
KIRC::Engine *engine, TQString nick,// TQString nick_peer_adress,
- TQHostAddress peer_address, Q_UINT16 peer_port,
+ TQHostAddress peer_address, TQ_UINT16 peer_port,
Transfer::Type type,
- TQString file = TQString::null, Q_UINT32 fileSize = 0 );
+ TQString file = TQString(), TQ_UINT32 fileSize = 0 );
// void registerServer( DCCServer * );
// TQPtrList<DCCServer> getRegisteredServers();
diff --git a/kopete/protocols/irc/libkirc/kirctransferserver.cpp b/kopete/protocols/irc/libkirc/kirctransferserver.cpp
index 1fbe1629..ee9e38c1 100644
--- a/kopete/protocols/irc/libkirc/kirctransferserver.cpp
+++ b/kopete/protocols/irc/libkirc/kirctransferserver.cpp
@@ -25,16 +25,16 @@
using namespace KIRC;
/*
-TransferServer::TransferServer( TQObject *parent, const char *name )
- : TQObject( parent, name ),
+TransferServer::TransferServer( TQObject *tqparent, const char *name )
+ : TQObject( tqparent, name ),
m_socket( 0 ),
m_port( 0 ),
m_backlog( 1 )
{
}
*/
-TransferServer::TransferServer(Q_UINT16 port, int backlog, TQObject *parent, const char *name)
- : TQObject( parent, name ),
+TransferServer::TransferServer(TQ_UINT16 port, int backlog, TQObject *tqparent, const char *name)
+ : TQObject( tqparent, name ),
m_socket( 0 ),
m_port( port ),
m_backlog( backlog )
@@ -43,9 +43,9 @@ TransferServer::TransferServer(Q_UINT16 port, int backlog, TQObject *parent, con
TransferServer::TransferServer(Engine *engine, TQString nick,// TQString nick_peer_adress,
Transfer::Type type,
- TQString fileName, Q_UINT32 fileSize,
- TQObject *parent, const char *name)
- : TQObject( parent, name ),
+ TQString fileName, TQ_UINT32 fileSize,
+ TQObject *tqparent, const char *name)
+ : TQObject( tqparent, name ),
m_socket(0),
m_port(0),
m_backlog(1),
@@ -104,7 +104,7 @@ bool TransferServer::initServer()
return (m_socket->socketStatus() != KExtendedSocket::error);
}
-bool TransferServer::initServer( Q_UINT16 port, int backlog )
+bool TransferServer::initServer( TQ_UINT16 port, int backlog )
{
if (m_socket)
{
diff --git a/kopete/protocols/irc/libkirc/kirctransferserver.h b/kopete/protocols/irc/libkirc/kirctransferserver.h
index 80031859..a84000e2 100644
--- a/kopete/protocols/irc/libkirc/kirctransferserver.h
+++ b/kopete/protocols/irc/libkirc/kirctransferserver.h
@@ -31,17 +31,18 @@ namespace KIRC
{
class TransferServer
- : public QObject
+ : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
-// TransferServer(TQObject *parent = 0, const char *name = 0);
- TransferServer(Q_UINT16 port, int backlog = 1, TQObject *parent = 0, const char *name = 0);
+// TransferServer(TQObject *tqparent = 0, const char *name = 0);
+ TransferServer(TQ_UINT16 port, int backlog = 1, TQObject *tqparent = 0, const char *name = 0);
TransferServer(KIRC::Engine *engine, TQString nick,// TQString nick_peer_adress,
Transfer::Type type,
- TQString fileName, Q_UINT32 fileSize,
- TQObject *parent = 0, const char *name = 0);
+ TQString fileName, TQ_UINT32 fileSize,
+ TQObject *tqparent = 0, const char *name = 0);
~TransferServer();
@@ -50,7 +51,7 @@ public:
protected:
bool initServer();
- bool initServer( Q_UINT16 port, int backlog = 1 );
+ bool initServer( TQ_UINT16 port, int backlog = 1 );
signals:
void incomingNewTransfer(Transfer *transfer);
@@ -61,15 +62,15 @@ protected slots:
private:
KExtendedSocket * m_socket;
- Q_UINT16 m_port;
+ TQ_UINT16 m_port;
int m_backlog;
// The following will be deprecated ...
KIRC::Engine * m_engine;
- QString m_nick;
+ TQString m_nick;
Transfer::Type m_type;
- QString m_fileName;
- Q_UINT32 m_fileSize;
+ TQString m_fileName;
+ TQ_UINT32 m_fileSize;
// by
// TQPtrList<Transfer> m_pendingTransfers;
// TQPtrList<Transfer> m_activeTransfers;
diff --git a/kopete/protocols/irc/libkirc/ksslsocket.cpp b/kopete/protocols/irc/libkirc/ksslsocket.cpp
index afe78fed..f14f1a3e 100644
--- a/kopete/protocols/irc/libkirc/ksslsocket.cpp
+++ b/kopete/protocols/irc/libkirc/ksslsocket.cpp
@@ -73,10 +73,10 @@ KSSLSocket::~KSSLSocket()
delete d;
}
-Q_LONG KSSLSocket::readBlock( char* data, Q_ULONG maxLen )
+TQ_LONG KSSLSocket::readBlock( char* data, TQ_ULONG maxLen )
{
//Re-implemented because KExtSocket doesn't use this when not in buffered mode
- Q_LONG retval = consumeReadBuffer(maxLen, data);
+ TQ_LONG retval = consumeReadBuffer(maxLen, data);
if( retval == 0 )
{
@@ -101,12 +101,16 @@ int KSSLSocket::peekBlock( char* data, uint maxLen )
return consumeReadBuffer(maxLen, data, false);
}
-Q_LONG KSSLSocket::writeBlock( const char* data, Q_ULONG len )
+TQ_LONG KSSLSocket::writeBlock( const char* data, TQ_ULONG len )
{
return d->kssl->write( data, len );
}
+#ifdef USE_QT4
+qint64 KSSLSocket::bytesAvailable() const
+#else // USE_QT4
int KSSLSocket::bytesAvailable() const
+#endif // USE_QT4
{
if( socketStatus() < connected )
return -2;
@@ -202,14 +206,14 @@ void KSSLSocket::setMetaData( const TQString &key, const TQVariant &data )
bool KSSLSocket::hasMetaData( const TQString &key )
{
- return d->metaData.contains(key);
+ return d->metaData.tqcontains(key);
}
TQString KSSLSocket::metaData( const TQString &key )
{
- if( d->metaData.contains(key) )
+ if( d->metaData.tqcontains(key) )
return d->metaData[key];
- return TQString::null;
+ return TQString();
}
/*
@@ -322,7 +326,7 @@ int KSSLSocket::verifyCertificate()
setMetaData("ssl_action", "accept");
}
- // Since we're the parent, we need to teach the child.
+ // Since we're the tqparent, we need to teach the child.
setMetaData("ssl_parent_ip", ourIp );
setMetaData("ssl_parent_cert", pc.toString());
@@ -368,7 +372,7 @@ int KSSLSocket::verifyCertificate()
"does not match the one the "
"certificate was issued to.");
result = messageBox( KIO::SlaveBase::WarningYesNoCancel,
- msg.arg(ourHost),
+ msg.tqarg(ourHost),
i18n("Server Authentication"),
i18n("&Details"),
i18n("Co&ntinue") );
@@ -378,7 +382,7 @@ int KSSLSocket::verifyCertificate()
TQString msg = i18n("The server certificate failed the "
"authenticity test (%1).");
result = messageBox( KIO::SlaveBase::WarningYesNoCancel,
- msg.arg(ourHost),
+ msg.tqarg(ourHost),
i18n("Server Authentication"),
i18n("&Details"),
i18n("Co&ntinue") );
diff --git a/kopete/protocols/irc/libkirc/ksslsocket.h b/kopete/protocols/irc/libkirc/ksslsocket.h
index 79e3b70b..795941cc 100644
--- a/kopete/protocols/irc/libkirc/ksslsocket.h
+++ b/kopete/protocols/irc/libkirc/ksslsocket.h
@@ -29,15 +29,20 @@ class KSSLSocketPrivate;
class KSSLSocket : public KExtendedSocket
{
Q_OBJECT
+ TQ_OBJECT
public:
KSSLSocket();
~KSSLSocket();
- Q_LONG readBlock( char* data, Q_ULONG maxLen );
- Q_LONG writeBlock( const char* data, Q_ULONG len );
+ TQ_LONG readBlock( char* data, TQ_ULONG maxLen );
+ TQ_LONG writeBlock( const char* data, TQ_ULONG len );
int peekBlock( char *data, uint maxLen );
+#ifdef USE_QT4
+ qint64 bytesAvailable() const;
+#else // USE_QT4
int bytesAvailable() const;
+#endif // USE_QT4
void showInfoDialog();