Commit 9214fcb6 authored by Laurent Montel's avatar Laurent Montel 😁

merge 2 methods

parent 10c7cfb2
......@@ -551,7 +551,7 @@ void KMComposeWin::addAttachmentsAndSend( const KUrl::List &urls, const QString
kDebug() << "addAttachment and sending!";
const int nbUrl = urls.count();
for ( int i =0; i < nbUrl; ++i ) {
mComposerBase->addAttachmentUrlSync( urls[i], comment );
mComposerBase->addAttachment( urls[i], comment, true );
}
send( how );
......@@ -560,7 +560,7 @@ void KMComposeWin::addAttachmentsAndSend( const KUrl::List &urls, const QString
void KMComposeWin::addAttachment( const KUrl &url, const QString &comment )
{
mComposerBase->addAttachment( url, comment );
mComposerBase->addAttachment( url, comment, false );
}
......
......@@ -1119,7 +1119,7 @@ void MessageComposer::ComposerViewBase::saveMessage( KMime::Message::Ptr message
}
Akonadi::ItemCreateJob *create = new Akonadi::ItemCreateJob( item, target, this );
connect( create, SIGNAL(result(KJob*)), this, SLOT(slotCreateItemResult(KJob*)) );
m_pendingQueueJobs++;
++m_pendingQueueJobs;
}
}
......@@ -1138,7 +1138,7 @@ void MessageComposer::ComposerViewBase::slotSaveMessage( KJob* job )
}
Akonadi::ItemCreateJob *create = new Akonadi::ItemCreateJob( item, target, this );
connect( create, SIGNAL(result(KJob*)), this, SLOT(slotCreateItemResult(KJob*)) );
m_pendingQueueJobs++;
++m_pendingQueueJobs;
}
Akonadi::Collection MessageComposer::ComposerViewBase::defaultSpecialTarget() const
......@@ -1154,7 +1154,7 @@ Akonadi::Collection MessageComposer::ComposerViewBase::defaultSpecialTarget() co
void MessageComposer::ComposerViewBase::slotCreateItemResult( KJob *job )
{
m_pendingQueueJobs--;
--m_pendingQueueJobs;
kDebug() << "mPendingCreateItemJobs" << m_pendingQueueJobs;
Q_ASSERT( m_pendingQueueJobs >= 0 );
......@@ -1180,21 +1180,17 @@ void MessageComposer::ComposerViewBase::slotCreateItemResult( KJob *job )
}
}
void MessageComposer::ComposerViewBase::addAttachment ( const KUrl& url, const QString& comment )
{
Q_UNUSED( comment );
kDebug() << "adding attachment with url:" << url;
m_attachmentController->addAttachment( url );
}
void MessageComposer::ComposerViewBase::addAttachmentUrlSync ( const KUrl& url, const QString& comment )
void MessageComposer::ComposerViewBase::addAttachment ( const KUrl& url, const QString& comment, bool sync )
{
Q_UNUSED( comment );
kDebug() << "adding attachment with url:" << url;
m_attachmentController->addAttachmentUrlSync( url );
if (sync) {
m_attachmentController->addAttachmentUrlSync( url );
} else {
m_attachmentController->addAttachment( url );
}
}
void MessageComposer::ComposerViewBase::addAttachment ( const QString& name, const QString& filename, const QString& charset, const QByteArray& data, const QByteArray& mimeType )
{
MessageCore::AttachmentPart::Ptr attachment = MessageCore::AttachmentPart::Ptr( new MessageCore::AttachmentPart() );
......
......@@ -105,8 +105,7 @@ public:
/**
* Add the given attachment to the message.
*/
void addAttachment( const KUrl &url, const QString &comment );
void addAttachmentUrlSync ( const KUrl& url, const QString& comment );
void addAttachment( const KUrl &url, const QString &comment, bool sync );
void addAttachment ( const QString& name, const QString& filename, const QString& charset, const QByteArray& data, const QByteArray& mimeType );
void addAttachmentPart( KMime::Content* part );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment