diff --git a/kmcommands.cpp b/kmcommands.cpp index c2a9e1aeb..0c1c605eb 100644 --- a/kmcommands.cpp +++ b/kmcommands.cpp @@ -170,7 +170,8 @@ KMCommand::KMCommand( QWidget *parent, KMMessage *msg ) : mProgressDialog( 0 ), mResult( Undefined ), mDeletesItself( false ), mEmitsCompletedItself( false ), mParent( parent ) { - mMsgList.append( &msg->toMsgBase() ); + if (msg) + mMsgList.append( &msg->toMsgBase() ); } KMCommand::~KMCommand() diff --git a/kmreadermainwin.cpp b/kmreadermainwin.cpp index aab2fa209..4b26166f9 100644 --- a/kmreadermainwin.cpp +++ b/kmreadermainwin.cpp @@ -89,6 +89,10 @@ void KMReaderMainWin::initKMReaderMainWin() { setupAccel(); setupGUI( ToolBar | Keys | StatusBar | Create, "kmreadermainwin.rc" ); applyMainWindowSettings( KMKernel::config(), "Separate Reader Window" ); + if ( ! mReaderWin->message() ) { + menuBar()->hide(); + toolBar( "mainToolBar" )->hide(); + } connect( kmkernel, SIGNAL( configChanged() ), this, SLOT( slotConfigChanged() ) ); @@ -113,6 +117,7 @@ void KMReaderMainWin::showMsg( const QString & encoding, KMMessage *msg ) mReaderWin->setMsg( msg, true ); setCaption( msg->subject() ); mMsg = msg; + menuBar()->show(); toolBar( "mainToolBar" )->show(); } @@ -162,7 +167,7 @@ void KMReaderMainWin::slotReplyListToMsg() void KMReaderMainWin::slotForwardMsg() { KMCommand *command = 0; - if ( mReaderWin->message()->parent() ) { + if ( mReaderWin->message() && mReaderWin->message()->parent() ) { command = new KMForwardCommand( this, mReaderWin->message(), mReaderWin->message()->parent()->identity() ); } else { @@ -175,7 +180,7 @@ void KMReaderMainWin::slotForwardMsg() void KMReaderMainWin::slotForwardAttachedMsg() { KMCommand *command = 0; - if ( mReaderWin->message()->parent() ) { + if ( mReaderWin->message() && mReaderWin->message()->parent() ) { command = new KMForwardAttachedCommand( this, mReaderWin->message(), mReaderWin->message()->parent()->identity() ); } else {