diff --git a/kmmainwidget.cpp b/kmmainwidget.cpp index 20c67dc02..5a8afc623 100644 --- a/kmmainwidget.cpp +++ b/kmmainwidget.cpp @@ -2077,10 +2077,10 @@ void KMMainWidget::slotMsgPopup(KMMessage&, const KURL &aUrl, const QPoint& aPoi KPopupMenu * menu = new KPopupMenu; updateMessageMenu(); mUrlCurrent = aUrl; - if(mMsgView && !mMsgView->copyText().isEmpty()) { - mMsgView->copyAction()->plug( menu ); - mMsgView->selectAllAction()->plug( menu ); - } else if (!aUrl.isEmpty()) + + bool urlMenuAdded = false; + + if (!aUrl.isEmpty()) { if (aUrl.protocol() == "mailto") { @@ -2110,9 +2110,18 @@ void KMMainWidget::slotMsgPopup(KMMessage&, const KURL &aUrl, const QPoint& aPoi // only be present if it is. mMsgView->startImChatAction()->plug( menu ); } + + urlMenuAdded=true; kdDebug( 0 ) << k_funcinfo << " URL is: " << aUrl << endl; } - else + + + if(mMsgView && !mMsgView->copyText().isEmpty()) { + if ( urlMenuAdded ) + menu->insertSeparator(); + mMsgView->copyAction()->plug( menu ); + mMsgView->selectAllAction()->plug( menu ); + } else if ( !urlMenuAdded ) { // popup somewhere else (i.e., not a URL) on the message diff --git a/kmreadermainwin.cpp b/kmreadermainwin.cpp index e5f76aace..9221d7f24 100644 --- a/kmreadermainwin.cpp +++ b/kmreadermainwin.cpp @@ -33,7 +33,7 @@ #include #include #include - +#include #include "kmcommands.h" #include "kmenubar.h" #include "kpopupmenu.h" @@ -311,11 +311,10 @@ void KMReaderMainWin::slotMsgPopup(KMMessage &aMsg, const KURL &aUrl, const QPoi KPopupMenu * menu = new KPopupMenu; mUrl = aUrl; mMsg = &aMsg; - - if(mReaderWin && !mReaderWin->copyText().isEmpty()) { - mReaderWin->copyAction()->plug( menu ); - mReaderWin->selectAllAction()->plug( menu ); - } else if (!aUrl.isEmpty()) { + bool urlMenuAdded=false; + + if (!aUrl.isEmpty()) + { if (aUrl.protocol() == "mailto") { // popup on a mailto URL mReaderWin->mailToComposeAction()->plug( menu ); @@ -334,7 +333,15 @@ void KMReaderMainWin::slotMsgPopup(KMMessage &aMsg, const KURL &aUrl, const QPoi mReaderWin->copyURLAction()->plug( menu ); mReaderWin->addBookmarksAction()->plug( menu ); } - } else { + urlMenuAdded=true; + } + if(mReaderWin && !mReaderWin->copyText().isEmpty()) { + if ( urlMenuAdded ) + menu->insertSeparator(); + mReaderWin->copyAction()->plug( menu ); + mReaderWin->selectAllAction()->plug( menu ); + } else if ( !urlMenuAdded ) + { // popup somewhere else (i.e., not a URL) on the message if (!mMsg) // no message