Continue to implement save image on disk

CCBUG:41738
wilder-work
Montel Laurent 14 years ago
parent 91d2717610
commit 9d6f6ab127
  1. 5
      kmmainwidget.cpp
  2. 11
      kmreadermainwin.cpp
  3. 5
      kmreaderwin.cpp
  4. 1
      kmreaderwin.h

@ -2987,7 +2987,6 @@ void KMMainWidget::slotDelayedMessagePopup( KJob *job )
const Akonadi::Item msg = job->property( "msg" ).value<Akonadi::Item>();
const QPoint aPoint = job->property( "point" ).toPoint();
const KUrl iUrl = job->property("imageUrl").value<KUrl>();
qDebug()<<" iUrl "<<iUrl;
KMenu *menu = new KMenu;
bool urlMenuAdded = false;
@ -3016,6 +3015,10 @@ void KMMainWidget::slotDelayedMessagePopup( KJob *job )
if(!iUrl.isEmpty()) {
menu->addSeparator();
menu->addAction( mMsgView->copyImageLocation());
QAction *downloadImageToDisk = mMsgView->downloadImageToDiskAction();
if(downloadImageToDisk){
menu->addAction(downloadImageToDisk);
}
}
}

@ -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<KUrl>();
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;
}

@ -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 );

@ -141,6 +141,7 @@ public:
KAction *addBookmarksAction() { return mAddBookmarksAction;}
KAction *toggleMimePartTreeAction();
KAction *speakTextAction();
QAction* downloadImageToDiskAction() const;
Akonadi::Item message() const;

Loading…
Cancel
Save