diff --git a/kmmainwidget.cpp b/kmmainwidget.cpp index b82d75b9b..df40bda1c 100644 --- a/kmmainwidget.cpp +++ b/kmmainwidget.cpp @@ -2987,7 +2987,6 @@ void KMMainWidget::slotDelayedMessagePopup( KJob *job ) const Akonadi::Item msg = job->property( "msg" ).value(); const QPoint aPoint = job->property( "point" ).toPoint(); const KUrl iUrl = job->property("imageUrl").value(); - qDebug()<<" iUrl "<addSeparator(); menu->addAction( mMsgView->copyImageLocation()); + QAction *downloadImageToDisk = mMsgView->downloadImageToDiskAction(); + if(downloadImageToDisk){ + menu->addAction(downloadImageToDisk); + } } } diff --git a/kmreadermainwin.cpp b/kmreadermainwin.cpp index 5be6da3db..52c0cc889 100644 --- a/kmreadermainwin.cpp +++ b/kmreadermainwin.cpp @@ -414,6 +414,7 @@ void KMReaderMainWin::slotMessagePopup(const Akonadi::Item&aMsg , const KUrl&aUr job->setLimit( 1 ); job->setQuery( Akonadi::ContactSearchJob::Email, email, Akonadi::ContactSearchJob::ExactMatch ); job->setProperty( "point", aPoint ); + job->setProperty( "imageUrl", imageUrl ); connect( job, SIGNAL(result(KJob*)), SLOT(slotDelayedMessagePopup(KJob*)) ); } @@ -423,6 +424,8 @@ void KMReaderMainWin::slotDelayedMessagePopup( KJob *job ) const bool contactAlreadyExists = !searchJob->contacts().isEmpty(); const QPoint aPoint = job->property( "point" ).toPoint(); + const KUrl iUrl = job->property("imageUrl").value(); + KMenu *menu = new KMenu; bool urlMenuAdded = false; @@ -451,6 +454,14 @@ void KMReaderMainWin::slotDelayedMessagePopup( KJob *job ) menu->addAction( mReaderWin->addBookmarksAction() ); menu->addAction( mReaderWin->urlSaveAsAction() ); menu->addAction( mReaderWin->copyURLAction() ); + if(!iUrl.isEmpty()) { + menu->addSeparator(); + menu->addAction( mReaderWin->copyImageLocation()); + QAction *downloadImageToDisk = mReaderWin->downloadImageToDiskAction(); + if(downloadImageToDisk){ + menu->addAction(downloadImageToDisk); + } + } } urlMenuAdded = true; } diff --git a/kmreaderwin.cpp b/kmreaderwin.cpp index a1892a0e9..8416aab2a 100644 --- a/kmreaderwin.cpp +++ b/kmreaderwin.cpp @@ -569,6 +569,11 @@ KAction* KMReaderWin::speakTextAction() return mViewer->speakTextAction(); } +QAction* KMReaderWin::downloadImageToDiskAction() const +{ + return mViewer->downloadImageToDiskAction(); +} + void KMReaderWin::clear(bool force ) { mViewer->clear( force ? Viewer::Force : Viewer::Delayed ); diff --git a/kmreaderwin.h b/kmreaderwin.h index bb3f0b710..ea9f4c8d0 100644 --- a/kmreaderwin.h +++ b/kmreaderwin.h @@ -141,6 +141,7 @@ public: KAction *addBookmarksAction() { return mAddBookmarksAction;} KAction *toggleMimePartTreeAction(); KAction *speakTextAction(); + QAction* downloadImageToDiskAction() const; Akonadi::Item message() const;