diff --git a/kmkernel.cpp b/kmkernel.cpp index 27ad024b2..d377d21a6 100644 --- a/kmkernel.cpp +++ b/kmkernel.cpp @@ -400,7 +400,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")) @@ -1356,10 +1357,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())