summaryrefslogtreecommitdiffstats
path: root/kio/misc/ksendbugmail
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:46:43 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:46:43 +0000
commitffe8a83e053396df448e9413828527613ca3bd46 (patch)
treea73d4169e02df4a50f9a12cb165fcd0ab5bac7c6 /kio/misc/ksendbugmail
parent682bf3bfdcbcbb1fca85e8a36ed03e062e0555d5 (diff)
downloadtdelibs-ffe8a83e053396df448e9413828527613ca3bd46.tar.gz
tdelibs-ffe8a83e053396df448e9413828527613ca3bd46.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1157647 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kio/misc/ksendbugmail')
-rw-r--r--kio/misc/ksendbugmail/main.cpp30
-rw-r--r--kio/misc/ksendbugmail/main.h6
-rw-r--r--kio/misc/ksendbugmail/smtp.cpp46
-rw-r--r--kio/misc/ksendbugmail/smtp.h44
4 files changed, 63 insertions, 63 deletions
diff --git a/kio/misc/ksendbugmail/main.cpp b/kio/misc/ksendbugmail/main.cpp
index 0d12f9e93..d84e4c297 100644
--- a/kio/misc/ksendbugmail/main.cpp
+++ b/kio/misc/ksendbugmail/main.cpp
@@ -6,7 +6,7 @@
#include <stdlib.h>
#include <unistd.h>
-#include <qtextstream.h>
+#include <tqtextstream.h>
#include <kapplication.h>
#include <kemailsettings.h>
@@ -26,7 +26,7 @@ static KCmdLineOptions options[] = {
void BugMailer::slotError(int errornum) {
kdDebug() << "slotError\n";
- QString str, lstr;
+ TQString str, lstr;
switch(errornum) {
case SMTP::CONNECTERROR:
@@ -70,7 +70,7 @@ int main(int argc, char **argv) {
KApplication a(false, false);
- QCString recipient = args->getOption("recipient");
+ TQCString recipient = args->getOption("recipient");
if (recipient.isEmpty())
recipient = "submit@bugs.kde.org";
else {
@@ -80,15 +80,15 @@ int main(int argc, char **argv) {
}
kdDebug() << "recp \"" << recipient << "\"\n";
- QCString subject = args->getOption("subject");
+ TQCString subject = args->getOption("subject");
if (subject.isEmpty())
subject = "(no subject)";
else {
if (subject.at(0) == '\'')
subject = subject.mid(1).left(subject.length() - 2);
}
- QTextIStream input(stdin);
- QString text, line;
+ TQTextIStream input(stdin);
+ TQString text, line;
while (!input.eof()) {
line = input.readLine();
text += line + "\r\n";
@@ -97,15 +97,15 @@ int main(int argc, char **argv) {
KEMailSettings emailConfig;
emailConfig.setProfile(emailConfig.defaultProfileName());
- QString fromaddr = emailConfig.getSetting(KEMailSettings::EmailAddress);
+ TQString fromaddr = emailConfig.getSetting(KEMailSettings::EmailAddress);
if (!fromaddr.isEmpty()) {
- QString name = emailConfig.getSetting(KEMailSettings::RealName);
+ TQString name = emailConfig.getSetting(KEMailSettings::RealName);
if (!name.isEmpty())
- fromaddr = name + QString::fromLatin1(" <") + fromaddr + QString::fromLatin1(">");
+ fromaddr = name + TQString::fromLatin1(" <") + fromaddr + TQString::fromLatin1(">");
} else {
struct passwd *p;
p = getpwuid(getuid());
- fromaddr = QString::fromLatin1(p->pw_name);
+ fromaddr = TQString::fromLatin1(p->pw_name);
fromaddr += "@";
char buffer[256];
buffer[0] = '\0';
@@ -115,21 +115,21 @@ int main(int argc, char **argv) {
}
kdDebug() << "fromaddr \"" << fromaddr << "\"" << endl;
- QString server = emailConfig.getSetting(KEMailSettings::OutServer);
+ TQString server = emailConfig.getSetting(KEMailSettings::OutServer);
if (server.isEmpty())
- server=QString::fromLatin1("bugs.kde.org");
+ server=TQString::fromLatin1("bugs.kde.org");
SMTP *sm = new SMTP;
BugMailer bm(sm);
- QObject::connect(sm, SIGNAL(messageSent()), &bm, SLOT(slotSend()));
- QObject::connect(sm, SIGNAL(error(int)), &bm, SLOT(slotError(int)));
+ TQObject::connect(sm, TQT_SIGNAL(messageSent()), &bm, TQT_SLOT(slotSend()));
+ TQObject::connect(sm, TQT_SIGNAL(error(int)), &bm, TQT_SLOT(slotError(int)));
sm->setServerHost(server);
sm->setPort(25);
sm->setSenderAddress(fromaddr);
sm->setRecipientAddress(recipient);
sm->setMessageSubject(subject);
- sm->setMessageHeader(QString::fromLatin1("From: %1\r\nTo: %2\r\n").arg(fromaddr).arg(recipient));
+ sm->setMessageHeader(TQString::fromLatin1("From: %1\r\nTo: %2\r\n").arg(fromaddr).arg(recipient));
sm->setMessageBody(text);
sm->sendMessage();
diff --git a/kio/misc/ksendbugmail/main.h b/kio/misc/ksendbugmail/main.h
index cd7de398d..39d424bef 100644
--- a/kio/misc/ksendbugmail/main.h
+++ b/kio/misc/ksendbugmail/main.h
@@ -1,14 +1,14 @@
#ifndef BUG_MAILER_H
#define BUG_MAILER_H "$Id$"
-#include <qobject.h>
+#include <tqobject.h>
class SMTP;
-class BugMailer : public QObject {
+class BugMailer : public TQObject {
Q_OBJECT
public:
- BugMailer(SMTP* s) : QObject(0, "mailer"), sm(s) {}
+ BugMailer(SMTP* s) : TQObject(0, "mailer"), sm(s) {}
public slots:
void slotError(int);
diff --git a/kio/misc/ksendbugmail/smtp.cpp b/kio/misc/ksendbugmail/smtp.cpp
index fd8211281..36a417b88 100644
--- a/kio/misc/ksendbugmail/smtp.cpp
+++ b/kio/misc/ksendbugmail/smtp.cpp
@@ -38,12 +38,12 @@ SMTP::SMTP(char *serverhost, unsigned short int port, int timeout)
kdDebug() << "SMTP object created" << endl;
- connect(&connectTimer, SIGNAL(timeout()), this, SLOT(connectTimerTick()));
- connect(&timeOutTimer, SIGNAL(timeout()), this, SLOT(connectTimedOut()));
- connect(&interactTimer, SIGNAL(timeout()), this, SLOT(interactTimedOut()));
+ connect(&connectTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(connectTimerTick()));
+ connect(&timeOutTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(connectTimedOut()));
+ connect(&interactTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(interactTimedOut()));
// some sendmail will give 'duplicate helo' error, quick fix for now
- connect(this, SIGNAL(messageSent()), SLOT(closeConnection()));
+ connect(this, TQT_SIGNAL(messageSent()), TQT_SLOT(closeConnection()));
}
SMTP::~SMTP()
@@ -56,7 +56,7 @@ SMTP::~SMTP()
timeOutTimer.stop();
}
-void SMTP::setServerHost(const QString& serverhost)
+void SMTP::setServerHost(const TQString& serverhost)
{
serverHost = serverhost;
}
@@ -71,7 +71,7 @@ void SMTP::setTimeOut(int timeout)
timeOut = timeout;
}
-void SMTP::setSenderAddress(const QString& sender)
+void SMTP::setSenderAddress(const TQString& sender)
{
senderAddress = sender;
int index = senderAddress.find('<');
@@ -95,22 +95,22 @@ void SMTP::setSenderAddress(const QString& sender)
}
-void SMTP::setRecipientAddress(const QString& recipient)
+void SMTP::setRecipientAddress(const TQString& recipient)
{
recipientAddress = recipient;
}
-void SMTP::setMessageSubject(const QString& subject)
+void SMTP::setMessageSubject(const TQString& subject)
{
messageSubject = subject;
}
-void SMTP::setMessageBody(const QString& message)
+void SMTP::setMessageBody(const TQString& message)
{
messageBody = message;
}
-void SMTP::setMessageHeader(const QString &header)
+void SMTP::setMessageHeader(const TQString &header)
{
messageHeader = header;
}
@@ -134,7 +134,7 @@ void SMTP::sendMessage(void)
kdDebug() << "state was == FINISHED\n" << endl;
finished = false;
state = IN;
- writeString = QString::fromLatin1("helo %1\r\n").arg(domainName);
+ writeString = TQString::fromLatin1("helo %1\r\n").arg(domainName);
write(sock->socket(), writeString.ascii(), writeString.length());
}
if(connected){
@@ -173,8 +173,8 @@ void SMTP::connectTimerTick(void)
state = INIT;
serverState = NONE;
- connect(sock, SIGNAL(readEvent(KSocket *)), this, SLOT(socketRead(KSocket *)));
- connect(sock, SIGNAL(closeEvent(KSocket *)), this, SLOT(socketClose(KSocket *)));
+ connect(sock, TQT_SIGNAL(readEvent(KSocket *)), this, TQT_SLOT(socketRead(KSocket *)));
+ connect(sock, TQT_SIGNAL(closeEvent(KSocket *)), this, TQT_SLOT(socketClose(KSocket *)));
// sock->enableRead(true);
timeOutTimer.stop();
kdDebug() << "connected" << endl;
@@ -231,8 +231,8 @@ void SMTP::socketRead(KSocket *socket)
void SMTP::socketClose(KSocket *socket)
{
timeOutTimer.stop();
- disconnect(sock, SIGNAL(readEvent(KSocket *)), this, SLOT(socketRead(KSocket *)));
- disconnect(sock, SIGNAL(closeEvent(KSocket *)), this, SLOT(socketClose(KSocket *)));
+ disconnect(sock, TQT_SIGNAL(readEvent(KSocket *)), this, TQT_SLOT(socketRead(KSocket *)));
+ disconnect(sock, TQT_SIGNAL(closeEvent(KSocket *)), this, TQT_SLOT(socketClose(KSocket *)));
socket->enableRead(false);
kdDebug() << "connection terminated" << endl;
connected = false;
@@ -244,10 +244,10 @@ void SMTP::socketClose(KSocket *socket)
emit connectionClosed();
}
-void SMTP::processLine(QString *line)
+void SMTP::processLine(TQString *line)
{
int i, stat;
- QString tmpstr;
+ TQString tmpstr;
i = line->find(' ');
tmpstr = line->left(i);
@@ -262,7 +262,7 @@ void SMTP::processLine(QString *line)
switch(stat){
case GREET: //220
state = IN;
- writeString = QString::fromLatin1("helo %1\r\n").arg(domainName);
+ writeString = TQString::fromLatin1("helo %1\r\n").arg(domainName);
kdDebug() << "out: " << writeString << endl;
write(sock->socket(), writeString.ascii(), writeString.length());
break;
@@ -273,19 +273,19 @@ void SMTP::processLine(QString *line)
switch(state){
case IN:
state = READY;
- writeString = QString::fromLatin1("mail from: %1\r\n").arg(senderAddress);
+ writeString = TQString::fromLatin1("mail from: %1\r\n").arg(senderAddress);
kdDebug() << "out: " << writeString << endl;
write(sock->socket(), writeString.ascii(), writeString.length());
break;
case READY:
state = SENTFROM;
- writeString = QString::fromLatin1("rcpt to: %1\r\n").arg(recipientAddress);
+ writeString = TQString::fromLatin1("rcpt to: %1\r\n").arg(recipientAddress);
kdDebug() << "out: " << writeString << endl;
write(sock->socket(), writeString.ascii(), writeString.length());
break;
case SENTFROM:
state = SENTTO;
- writeString = QString::fromLatin1("data\r\n");
+ writeString = TQString::fromLatin1("data\r\n");
kdDebug() << "out: " << writeString << endl;
write(sock->socket(), writeString.ascii(), writeString.length());
break;
@@ -305,11 +305,11 @@ void SMTP::processLine(QString *line)
break;
case READYDATA: //354
state = DATA;
- writeString = QString::fromLatin1("Subject: %1\r\n").arg(messageSubject);
+ writeString = TQString::fromLatin1("Subject: %1\r\n").arg(messageSubject);
writeString += messageHeader;
writeString += "\r\n";
writeString += messageBody;
- writeString += QString::fromLatin1(".\r\n");
+ writeString += TQString::fromLatin1(".\r\n");
kdDebug() << "out: " << writeString;
write(sock->socket(), writeString.ascii(), writeString.length());
break;
diff --git a/kio/misc/ksendbugmail/smtp.h b/kio/misc/ksendbugmail/smtp.h
index 71a464e98..707d20ae4 100644
--- a/kio/misc/ksendbugmail/smtp.h
+++ b/kio/misc/ksendbugmail/smtp.h
@@ -3,8 +3,8 @@
#ifndef SMTP_H
#define SMTP_H
-#include <qobject.h>
-#include <qtimer.h>
+#include <tqobject.h>
+#include <tqtimer.h>
#include <ksock.h>
/*int SMTPServerStatus[] = {
@@ -44,19 +44,19 @@ public:
SMTP(char *serverhost = 0, unsigned short int port = 0, int timeout = DEFAULT_SMTP_TIMEOUT);
~SMTP();
- void setServerHost(const QString& serverhost);
+ void setServerHost(const TQString& serverhost);
void setPort(unsigned short int port);
void setTimeOut(int timeout);
bool isConnected(){return connected;};
bool isFinished(){return finished;};
- QString getLastLine(){return lastLine;};
+ TQString getLastLine(){return lastLine;};
- void setSenderAddress(const QString& sender);
- void setRecipientAddress(const QString& recipient);
- void setMessageSubject(const QString& subject);
- void setMessageBody(const QString& message);
- void setMessageHeader(const QString &header);
+ void setSenderAddress(const TQString& sender);
+ void setRecipientAddress(const TQString& recipient);
+ void setMessageSubject(const TQString& subject);
+ void setMessageBody(const TQString& message);
+ void setMessageHeader(const TQString &header);
typedef enum {
NONE = 0, // null
@@ -93,7 +93,7 @@ public:
}SMTPError;
protected:
- void processLine(QString *line);
+ void processLine(TQString *line);
public slots:
void openConnection();
@@ -113,32 +113,32 @@ signals:
void error(int);
private:
- QString serverHost;
+ TQString serverHost;
unsigned short int hostPort;
int timeOut;
bool connected;
bool finished;
- QString senderAddress;
- QString recipientAddress;
- QString messageSubject;
- QString messageBody, messageHeader;
+ TQString senderAddress;
+ TQString recipientAddress;
+ TQString messageSubject;
+ TQString messageBody, messageHeader;
SMTPClientStatus state;
SMTPClientStatus lastState;
SMTPServerStatus serverState;
- QString domainName;
+ TQString domainName;
KSocket *sock;
- QTimer connectTimer;
- QTimer timeOutTimer;
- QTimer interactTimer;
+ TQTimer connectTimer;
+ TQTimer timeOutTimer;
+ TQTimer interactTimer;
char readBuffer[SMTP_READ_BUFFER_SIZE];
- QString lineBuffer;
- QString lastLine;
- QString writeString;
+ TQString lineBuffer;
+ TQString lastLine;
+ TQString writeString;
};
#endif