Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 2454b2b9 authored by Laurent Montel's avatar Laurent Montel 😁

Fix code

parent 30b9dcb7
<!DOCTYPE kpartgui>
<kpartgui name="kaddressbook" version="24">
<kpartgui name="kaddressbook" version="25">
<MenuBar>
<Menu name="file"><text>&amp;File</text>
......@@ -101,6 +101,8 @@
<Separator/>
<Action name="send_mail"/>
<Separator/>
<Action name="send_vcards"/>
<Separator/>
<Action name="akonadi_item_cut"/>
<Action name="akonadi_item_copy"/>
<Action name="akonadi_paste"/>
......
......@@ -34,6 +34,7 @@
#include "categoryfilterproxymodel.h"
#include "sendmail/mailsenderjob.h"
#include "sendvcards/sendvcardsjob.h"
#include "kaddressbookgrantlee/formatter/grantleecontactformatter.h"
#include "kaddressbookgrantlee/formatter/grantleecontactgroupformatter.h"
......@@ -709,6 +710,12 @@ void MainWidget::setupActions( KActionCollection *collection )
action->setIcon(KIconLoader::global()->loadIcon( QLatin1String( "mail-message-new"), KIconLoader::Small ));
connect( action, SIGNAL(triggered(bool)), this, SLOT(slotSendMail()));
#if 0 //Activate it for kf5
action = collection->addAction( QLatin1String("send_vcards") );
action->setText( QLatin1String( "Send vCards...") );
action->setIcon(KIconLoader::global()->loadIcon( QLatin1String( "mail-message-new"), KIconLoader::Small ));
connect( action, SIGNAL(triggered(bool)), this, SLOT(slotSendVcards()));
#endif
if (!qgetenv("KDEPIM_BALOO_DEBUG").isEmpty()) {
action = collection->addAction( QLatin1String("debug_baloo") );
......@@ -1009,6 +1016,15 @@ void MainWidget::slotCheckNewCalendar( const QModelIndex &parent, int begin, int
}
}
void MainWidget::slotSendVcards()
{
const Akonadi::Item::List lst = Utils::collectSelectedAllContactsItem(mItemView->selectionModel());
if (!lst.isEmpty()) {
KABSendVCards::SendVcardsJob *sendVcards = new KABSendVCards::SendVcardsJob(lst, this);
sendVcards->start();
}
}
void MainWidget::slotSendMail()
{
const Akonadi::Item::List lst = Utils::collectSelectedAllContactsItem(mItemView->selectionModel());
......
......@@ -106,6 +106,7 @@ private Q_SLOTS:
void slotSendMails(const QStringList &emails);
void slotDebugBaloo();
void slotSendVcards();
private:
void initGrantleeThemeName();
void setupGui();
......
......@@ -103,6 +103,7 @@ void SendVcardsJob::createTemporaryDir()
void SendVcardsJob::jobFinished()
{
const QStringList lstAttachment = mAttachmentTemporary->temporaryFiles();
qDebug()<<" lstAttachment *************"<<lstAttachment;
if (!lstAttachment.isEmpty()) {
KToolInvocation::invokeMailer( QString(), QString(), QString(), QString(), QString(), QString(), lstAttachment );
}
......
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