summaryrefslogtreecommitdiffstats
path: root/kalarm/kamail.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-02-16 20:17:18 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-02-16 20:17:18 +0000
commitf4fae92b6768541e2952173c3d4b09040f95bf7e (patch)
treed8c5d93232235cd635f3310b4d95490df181ba2d /kalarm/kamail.cpp
parent125c0a08265b75a133644d3b55f47e37c919f45d (diff)
downloadtdepim-f4fae92b6768541e2952173c3d4b09040f95bf7e.tar.gz
tdepim-f4fae92b6768541e2952173c3d4b09040f95bf7e.zip
Moved kpilot from kdepim to applications, as the core Trinity libraries should not contain hardware-dependent software
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1221127 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kalarm/kamail.cpp')
-rw-r--r--kalarm/kamail.cpp70
1 files changed, 35 insertions, 35 deletions
diff --git a/kalarm/kamail.cpp b/kalarm/kamail.cpp
index 18bb03945..ab4747e34 100644
--- a/kalarm/kamail.cpp
+++ b/kalarm/kamail.cpp
@@ -100,7 +100,7 @@ KPIM::IdentityManager* KAMail::identityManager()
/******************************************************************************
* Send the email message specified in an event.
* Reply = true if the message was sent - 'errmsgs' may contain copy error messages.
-* = false if the message was not sent - 'errmsgs' contains the error messages.
+* = false if the message was not sent - 'errmsgs' tqcontains the error messages.
*/
bool KAMail::send(const KAEvent& event, TQStringList& errmsgs, bool allowNotify)
{
@@ -153,30 +153,30 @@ bool KAMail::send(const KAEvent& event, TQStringList& errmsgs, bool allowNotify)
{
// Use sendmail to send the message
TQString textComplete;
- TQString command = KStandardDirs::findExe(TQString::fromLatin1("sendmail"),
- TQString::fromLatin1("/sbin:/usr/sbin:/usr/lib"));
+ TQString command = KStandardDirs::findExe(TQString::tqfromLatin1("sendmail"),
+ TQString::tqfromLatin1("/sbin:/usr/sbin:/usr/lib"));
if (!command.isNull())
{
- command += TQString::fromLatin1(" -f ");
+ command += TQString::tqfromLatin1(" -f ");
command += KPIM::getEmailAddress(from);
- command += TQString::fromLatin1(" -oi -t ");
+ command += TQString::tqfromLatin1(" -oi -t ");
textComplete = initHeaders(data, false);
}
else
{
- command = KStandardDirs::findExe(TQString::fromLatin1("mail"));
+ command = KStandardDirs::findExe(TQString::tqfromLatin1("mail"));
if (command.isNull())
{
- errmsgs = errors(i18n("%1 not found").arg(TQString::fromLatin1("sendmail"))); // give up
+ errmsgs = errors(i18n("%1 not found").arg(TQString::tqfromLatin1("sendmail"))); // give up
return false;
}
- command += TQString::fromLatin1(" -s ");
+ command += TQString::tqfromLatin1(" -s ");
command += KShellProcess::quote(event.emailSubject());
if (!data.bcc.isEmpty())
{
- command += TQString::fromLatin1(" -b ");
+ command += TQString::tqfromLatin1(" -b ");
command += KShellProcess::quote(data.bcc);
}
@@ -249,7 +249,7 @@ TQString KAMail::sendKMail(const KAMailData& data)
if (func.left(5) == "bool ")
{
func = func.mid(5);
- func.replace(TQRegExp(" [0-9A-Za-z_:]+"), "");
+ func.tqreplace(TQRegExp(" [0-9A-Za-z_:]+"), "");
useSend = (func == sendFunction);
}
}
@@ -321,7 +321,7 @@ TQString KAMail::addToKMailFolder(const KAMailData& data, const char* folder, bo
// Notify KMail of the message in the temporary file
TQByteArray callData;
TQDataStream arg(callData, IO_WriteOnly);
- arg << TQString::fromLatin1(folder) << tmpFile.name();
+ arg << TQString::tqfromLatin1(folder) << tmpFile.name();
if (callKMail(callData, "KMailIface", "dcopAddMessage(TQString,TQString)", "int"))
return TQString::null;
err = i18n("Error calling KMail");
@@ -341,13 +341,13 @@ bool KAMail::callKMail(const TQByteArray& callData, const TQCString& iface, cons
|| replyType != funcType)
{
TQCString funcname = function;
- funcname.replace(TQRegExp("(.+$"), "()");
+ funcname.tqreplace(TQRegExp("(.+$"), "()");
kdError(5950) << "KAMail::callKMail(): kmail " << funcname << " call failed\n";;
return false;
}
TQDataStream replyStream(replyData, IO_ReadOnly);
TQCString funcname = function;
- funcname.replace(TQRegExp("(.+$"), "()");
+ funcname.tqreplace(TQRegExp("(.+$"), "()");
if (replyType == "int")
{
int result;
@@ -385,16 +385,16 @@ TQString KAMail::initHeaders(const KAMailData& data, bool dateId)
char buff[64];
strftime(buff, sizeof(buff), "Date: %a, %d %b %Y %H:%M:%S %z", localtime(&timenow));
TQString from = data.from;
- from.replace(TQRegExp("^.*<"), TQString::null).replace(TQRegExp(">.*$"), TQString::null);
- message = TQString::fromLatin1(buff);
- message += TQString::fromLatin1("\nMessage-Id: <%1.%2.%3>\n").arg(timenow).arg(tod.tv_usec).arg(from);
+ from.tqreplace(TQRegExp("^.*<"), TQString::null).tqreplace(TQRegExp(">.*$"), TQString::null);
+ message = TQString::tqfromLatin1(buff);
+ message += TQString::tqfromLatin1("\nMessage-Id: <%1.%2.%3>\n").arg(timenow).arg(tod.tv_usec).arg(from);
}
- message += TQString::fromLatin1("From: ") + data.from;
- message += TQString::fromLatin1("\nTo: ") + data.event.emailAddresses(", ");
+ message += TQString::tqfromLatin1("From: ") + data.from;
+ message += TQString::tqfromLatin1("\nTo: ") + data.event.emailAddresses(", ");
if (!data.bcc.isEmpty())
- message += TQString::fromLatin1("\nBcc: ") + data.bcc;
- message += TQString::fromLatin1("\nSubject: ") + data.event.emailSubject();
- message += TQString::fromLatin1("\nX-Mailer: %1/" KALARM_VERSION).arg(kapp->aboutData()->programName());
+ message += TQString::tqfromLatin1("\nBcc: ") + data.bcc;
+ message += TQString::tqfromLatin1("\nSubject: ") + data.event.emailSubject();
+ message += TQString::tqfromLatin1("\nX-Mailer: %1/" KALARM_VERSION).arg(kapp->aboutData()->programName());
return message;
}
@@ -426,13 +426,13 @@ TQString KAMail::appendBodyAttachments(TQString& message, const KAEvent& event)
time(&timenow);
TQCString boundary;
boundary.sprintf("------------_%lu_-%lx=", 2*timenow, timenow);
- message += TQString::fromLatin1("\nMIME-Version: 1.0");
- message += TQString::fromLatin1("\nContent-Type: multipart/mixed;\n boundary=\"%1\"\n").arg(boundary);
+ message += TQString::tqfromLatin1("\nMIME-Version: 1.0");
+ message += TQString::tqfromLatin1("\nContent-Type: multipart/mixed;\n boundary=\"%1\"\n").arg(boundary);
if (!event.message().isEmpty())
{
// There is a message body
- message += TQString::fromLatin1("\n--%1\nContent-Type: text/plain\nContent-Transfer-Encoding: 8bit\n\n").arg(boundary);
+ message += TQString::tqfromLatin1("\n--%1\nContent-Type: text/plain\nContent-Transfer-Encoding: 8bit\n\n").arg(boundary);
message += event.message();
}
@@ -463,10 +463,10 @@ TQString KAMail::appendBodyAttachments(TQString& message, const KAEvent& event)
text = (mimeType == textMimeTypes[i]);
}
- message += TQString::fromLatin1("\n--%1").arg(boundary);
- message += TQString::fromLatin1("\nContent-Type: %2; name=\"%3\"").arg(mimeType).arg(fi.text());
- message += TQString::fromLatin1("\nContent-Transfer-Encoding: %1").arg(TQString::fromLatin1(text ? "8bit" : "BASE64"));
- message += TQString::fromLatin1("\nContent-Disposition: attachment; filename=\"%4\"\n\n").arg(fi.text());
+ message += TQString::tqfromLatin1("\n--%1").arg(boundary);
+ message += TQString::tqfromLatin1("\nContent-Type: %2; name=\"%3\"").arg(mimeType).arg(fi.text());
+ message += TQString::tqfromLatin1("\nContent-Transfer-Encoding: %1").arg(TQString::tqfromLatin1(text ? "8bit" : "BASE64"));
+ message += TQString::tqfromLatin1("\nContent-Disposition: attachment; filename=\"%4\"\n\n").arg(fi.text());
// Read the file contents
TQString tmpFile;
@@ -481,7 +481,7 @@ TQString KAMail::appendBodyAttachments(TQString& message, const KAEvent& event)
}
TQIODevice::Offset size = file.size();
char* contents = new char [size + 1];
- Q_LONG bytes = file.readBlock(contents, size);
+ TQ_LONG bytes = file.readBlock(contents, size);
file.close();
contents[size] = 0;
bool atterror = false;
@@ -504,14 +504,14 @@ TQString KAMail::appendBodyAttachments(TQString& message, const KAEvent& event)
atterror = true;
}
else
- message += TQString::fromLatin1(base64, base64Size);
+ message += TQString::tqfromLatin1(base64, base64Size);
delete[] base64;
}
delete[] contents;
if (atterror)
return attachError.arg(attachment);
}
- message += TQString::fromLatin1("\n--%1--\n.\n").arg(boundary);
+ message += TQString::tqfromLatin1("\n--%1--\n.\n").arg(boundary);
}
return TQString::null;
}
@@ -523,7 +523,7 @@ TQString KAMail::appendBodyAttachments(TQString& message, const KAEvent& event)
void KAMail::notifyQueued(const KAEvent& event)
{
KMime::Types::Address addr;
- TQString localhost = TQString::fromLatin1("localhost");
+ TQString localhost = TQString::tqfromLatin1("localhost");
TQString hostname = getHostName();
const EmailAddressList& addresses = event.emailAddresses();
for (TQValueList<KCal::Person>::ConstIterator it = addresses.begin(); it != addresses.end(); ++it)
@@ -925,7 +925,7 @@ TQStringList KAMail::errors(const TQString& err, bool sendfail)
: i18n("Error copying sent email to KMail %1 folder").arg(i18n_sent_mail());
if (err.isEmpty())
return TQStringList(error1);
- TQStringList errs(TQString::fromLatin1("%1:").arg(error1));
+ TQStringList errs(TQString::tqfromLatin1("%1:").arg(error1));
errs += err;
return errs;
}
@@ -933,7 +933,7 @@ TQStringList KAMail::errors(const TQString& err, bool sendfail)
/******************************************************************************
* Get the body of an email, given its serial number.
*/
-TQString KAMail::getMailBody(Q_UINT32 serialNumber)
+TQString KAMail::getMailBody(TQ_UINT32 serialNumber)
{
// Get the body of the email from KMail
TQCString replyType;
@@ -943,7 +943,7 @@ TQString KAMail::getMailBody(Q_UINT32 serialNumber)
arg << serialNumber;
arg << (int)0;
TQString body;
- if (kapp->dcopClient()->call("kmail", "KMailIface", "getDecodedBodyPart(Q_UINT32,int)", data, replyType, replyData)
+ if (kapp->dcopClient()->call("kmail", "KMailIface", "getDecodedBodyPart(TQ_UINT32,int)", data, replyType, replyData)
&& replyType == "TQString")
{
TQDataStream reply_stream(replyData, IO_ReadOnly);