From 7c48bf83e4f1bf9f6cf4b6d2118920dda336b92b Mon Sep 17 00:00:00 2001 From: Montel Laurent Date: Thu, 13 Sep 2012 12:42:29 +0200 Subject: [PATCH] Fix Bug 306700 - Command line option --msg does not work FIXED-IN: 4.9.2 BUG: 306700 --- kmkernel.cpp | 6 ++++-- main.cpp | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/kmkernel.cpp b/kmkernel.cpp index 47a892530..c937602fc 100644 --- a/kmkernel.cpp +++ b/kmkernel.cpp @@ -397,7 +397,8 @@ bool KMKernel::handleCommandLine( bool noArgsOpensReader ) if (args->isSet("msg")) { mailto = true; - messageFile.setPath( args->getOption("msg") ); + const QString file = args->getOption("msg"); + messageFile = makeAbsoluteUrl(file); } if (args->isSet("body")) @@ -1349,10 +1350,11 @@ void KMKernel::action( bool mailto, bool check, const QString &to, const KUrl::List &attachURLs, const QStringList &customHeaders ) { - if ( mailto ) + if ( mailto ) { openComposer( to, cc, bcc, subj, body, 0, messageFile.pathOrUrl(), attachURLs.toStringList(), customHeaders ); + } else openReader( check ); diff --git a/main.cpp b/main.cpp index 00b6f210b..94f382b0a 100644 --- a/main.cpp +++ b/main.cpp @@ -37,6 +37,8 @@ #include #endif +#include + //----------------------------------------------------------------------------- class KMailApplication : public KontactInterface::PimUniqueApplication @@ -105,6 +107,7 @@ int main(int argc, char *argv[]) #endif KMail::AboutData about; + KCmdLineArgs::setCwd(QDir::currentPath().toLocal8Bit()); KCmdLineArgs::init(argc, argv, &about); KCmdLineArgs::addCmdLineOptions( kmail_options() ); // Add kmail options if (!KMailApplication::start())