[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [messagelib] /: Port to new connect api
From:       Montel Laurent <null () kde ! org>
Date:       2017-10-31 21:31:41
Message-ID: E1e9e8L-0005qd-4I () code ! kde ! org
[Download RAW message or body]

Git commit f7e68361d27ea849f4b27538b7868fce319aba30 by Montel Laurent.
Committed on 31/10/2017 at 21:31.
Pushed by mlaurent into branch 'master'.

Port to new connect api

M  +6    -6    messagecomposer/src/attachment/attachmentcontrollerbase.cpp
M  +0    -2    messagecomposer/src/attachment/attachmentcontrollerbase.h
M  +2    -2    messagelist/src/pane.cpp

https://commits.kde.org/messagelib/f7e68361d27ea849f4b27538b7868fce319aba30

diff --git a/messagecomposer/src/attachment/attachmentcontrollerbase.cpp \
b/messagecomposer/src/attachment/attachmentcontrollerbase.cpp index \
                675147c7..f5fbd549 100644
--- a/messagecomposer/src/attachment/attachmentcontrollerbase.cpp
+++ b/messagecomposer/src/attachment/attachmentcontrollerbase.cpp
@@ -369,7 +369,7 @@ void AttachmentControllerBase::exportPublicKey(const QString \
&fingerprint)  }
 
     MessageComposer::AttachmentFromPublicKeyJob *ajob = new \
                MessageComposer::AttachmentFromPublicKeyJob(fingerprint, this);
-    connect(ajob, SIGNAL(result(KJob*)), this, \
SLOT(attachPublicKeyJobResult(KJob*))); +    connect(ajob, \
&AttachmentFromPublicKeyJob::result, this, [this](KJob *job) \
{d->attachPublicKeyJobResult(job); });  ajob->start();
 }
 
@@ -424,8 +424,8 @@ AttachmentControllerBase::AttachmentControllerBase(MessageComposer::AttachmentMo
  {
     d->model = model;
     connect(model, &MessageComposer::AttachmentModel::attachUrlsRequested, this, \
                &AttachmentControllerBase::addAttachments);
-    connect(model, SIGNAL(attachmentRemoved(MessageCore::AttachmentPart::Ptr)),
-            this, SLOT(attachmentRemoved(MessageCore::AttachmentPart::Ptr)));
+    connect(model, &MessageComposer::AttachmentModel::attachmentRemoved,
+            this, [this](const MessageCore::AttachmentPart::Ptr &attr) { \
d->attachmentRemoved(attr); });  connect(model, \
&AttachmentModel::attachmentCompressRequested,  this, \
                &AttachmentControllerBase::compressAttachment);
     connect(model, &MessageComposer::AttachmentModel::encryptEnabled, this, \
&AttachmentControllerBase::setEncryptEnabled); @@ -484,8 +484,8 @@ void \
AttachmentControllerBase::createActions()  
     d->removeAction = new QAction(QIcon::fromTheme(QStringLiteral("edit-delete")), \
                i18n("&Remove Attachment"), this);
     d->removeContextAction = new \
QAction(QIcon::fromTheme(QStringLiteral("edit-delete")), i18n("Remove"), this);     \
                // FIXME need two texts. is there a better way?
-    connect(d->removeAction, SIGNAL(triggered(bool)), this, \
                SLOT(removeSelectedAttachments()));
-    connect(d->removeContextAction, SIGNAL(triggered(bool)), this, \
SLOT(removeSelectedAttachments())); +    connect(d->removeAction, \
&QAction::triggered, this, [this]() { d->removeSelectedAttachments(); }); +    \
connect(d->removeContextAction, &QAction::triggered, this, [this]() { \
d->removeSelectedAttachments(); });  
     d->openContextAction = new QAction(i18nc("to open", "Open"), this);
     connect(d->openContextAction, SIGNAL(triggered(bool)), this, \
SLOT(openSelectedAttachments())); @@ -863,7 +863,7 @@ void \
                AttachmentControllerBase::showAttachVcard()
         const Akonadi::EmailAddressSelection::List selectedEmail = \
                dlg->selectedAddresses();
         for (const Akonadi::EmailAddressSelection &selected : selectedEmail) {
             MessageComposer::AttachmentVcardFromAddressBookJob *ajob = new \
                MessageComposer::AttachmentVcardFromAddressBookJob(selected.item(), \
                this);
-            connect(ajob, SIGNAL(result(KJob*)), this, \
SLOT(attachVcardFromAddressBook(KJob*))); +            connect(ajob, \
&AttachmentVcardFromAddressBookJob::result, this, [this](KJob *job) \
{d->attachVcardFromAddressBook(job);});  ajob->start();
         }
     }
diff --git a/messagecomposer/src/attachment/attachmentcontrollerbase.h \
b/messagecomposer/src/attachment/attachmentcontrollerbase.h index dbb4133f..63552361 \
                100644
--- a/messagecomposer/src/attachment/attachmentcontrollerbase.h
+++ b/messagecomposer/src/attachment/attachmentcontrollerbase.h
@@ -108,7 +108,6 @@ private:
     class Private;
     Private *const d;
 
-    Q_PRIVATE_SLOT(d, void attachmentRemoved(const MessageCore::AttachmentPart::Ptr \
&))  Q_PRIVATE_SLOT(d, void compressJobResult(KJob *))
     Q_PRIVATE_SLOT(d, void loadJobResult(KJob *))
     Q_PRIVATE_SLOT(d, void openSelectedAttachments())
@@ -119,7 +118,6 @@ private:
     Q_PRIVATE_SLOT(d, void saveSelectedAttachmentAs())
     Q_PRIVATE_SLOT(d, void selectedAttachmentProperties())
     Q_PRIVATE_SLOT(d, void editDone(MessageViewer::EditorWatcher *))
-    Q_PRIVATE_SLOT(d, void attachPublicKeyJobResult(KJob *))
     Q_PRIVATE_SLOT(d, void slotAttachmentContentCreated(KJob *))
     Q_PRIVATE_SLOT(d, void reloadAttachment())
     Q_PRIVATE_SLOT(d, void updateJobResult(KJob *))
diff --git a/messagelist/src/pane.cpp b/messagelist/src/pane.cpp
index 0542115e..b2052407 100644
--- a/messagelist/src/pane.cpp
+++ b/messagelist/src/pane.cpp
@@ -160,8 +160,8 @@ Pane::Pane(bool restoreSession, QAbstractItemModel *model, \
QItemSelectionModel *  d->mCloseTabButton->setAccessibleName(i18n("Close tab"));
 #endif
     setCornerWidget(d->mCloseTabButton, Qt::TopRightCorner);
-    connect(d->mCloseTabButton, SIGNAL(clicked()),
-            SLOT(onCloseTabClicked()));
+    connect(d->mCloseTabButton, &QToolButton::clicked,
+            this, [this]() {d->onCloseTabClicked(); });
 
     setTabsClosable(true);
     connect(this, SIGNAL(tabCloseRequested(int)), this, \
SLOT(slotTabCloseRequested(int)));


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic