[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: Patch: KApplication::invokeMailer()
From: Frerich Raabe <frerichraabe () gmx ! de>
Date: 2000-10-02 9:54:29
[Download RAW message or body]
Hello,
the attached fix makes an ugly hack in KApplication::invokeMailer()
obsolete. I'd be nice if somebody could review and/or commit this
before the repository get's read-only. :-}
- Frerich
["kapp.diff" (text/x-c)]
Index: kapp.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdecore/kapp.cpp,v
retrieving revision 1.384
diff -u -3 -p -r1.384 kapp.cpp
--- kapp.cpp 2000/09/19 14:12:00 1.384
+++ kapp.cpp 2000/09/22 21:45:14
@@ -54,7 +54,6 @@
#include <kdatastream.h>
#include <klibloader.h>
#include <kmimesourcefactory.h>
-#include <ktempfile.h>
#include <kstdaccel.h>
#include <kstyle.h>
@@ -1362,7 +1361,7 @@ void KApplication::invokeMailer(const KU
config.setGroup("ClientInfo");
QString command = config.readEntry("EmailClient");
if (command.isEmpty() || command == QString::fromLatin1("kmail"))
- command = QString::fromLatin1("kmail --composer -s %s -c %c -b %b %t");
+ command = QString::fromLatin1("kmail --composer -s %s -c %c -b %b --body %B %t");
// TODO: Take care of the preferred terminal app (instead of hardcoding
// Konsole), this will probably require a rewrite of the configurable
@@ -1412,26 +1411,12 @@ void KApplication::invokeMailer(const KU
if ((*it).find("%B") >= 0)
(*it).replace(QRegExp("%B"), body);
- KTempFile * tempFile = 0L;
- // Special case for passing message body to kmail
- if ( cmd == "kmail" && !body.isEmpty() )
- {
- tempFile = new KTempFile;
- // We can't delete the temp file, because kmail is launched async....
- //tempFile->setAutoDelete(true);
- (*tempFile->textStream()) << body;
- kdDebug() << "body=" << body << endl;
- cmdTokens.append("--msg");
- cmdTokens.append(tempFile->name());
- tempFile->close();
- }
QString error;
if (kdeinitExec(cmd, cmdTokens, &error))
{
qWarning("Could not launch mail client:\n%s\n", error.local8Bit().data());
}
- delete tempFile;
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic