summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-08-13 08:39:56 +0200
committerMontel Laurent <[email protected]>2017-08-13 08:39:56 +0200
commited63c18be0b2764ab0e06a56bc0b25c86f0b158f (patch)
treece01f4044c218edcb307819d2e26fa595b37f065
parent68b8b00c53722fcd91975b78bec5a001d628a66b (diff)
USe const'ref
-rw-r--r--messagecomposer/src/attachment/attachmentcontrollerbase.cpp18
-rw-r--r--messagecomposer/src/attachment/attachmentcontrollerbase.h16
2 files changed, 17 insertions, 17 deletions
diff --git a/messagecomposer/src/attachment/attachmentcontrollerbase.cpp b/messagecomposer/src/attachment/attachmentcontrollerbase.cpp
index 9de3c8f..a906fc6 100644
--- a/messagecomposer/src/attachment/attachmentcontrollerbase.cpp
+++ b/messagecomposer/src/attachment/attachmentcontrollerbase.cpp
@@ -87,7 +87,7 @@ public:
Private(AttachmentControllerBase *qq);
~Private();
- void attachmentRemoved(AttachmentPart::Ptr part); // slot
+ void attachmentRemoved(const AttachmentPart::Ptr &part); // slot
void compressJobResult(KJob *job); // slot
void loadJobResult(KJob *job); // slot
void openSelectedAttachments(); // slot
@@ -195,7 +195,7 @@ void AttachmentControllerBase::setSelectedParts(const AttachmentPart::List &sele
d->propertiesContextAction->setEnabled(selectedCount == 1);
}
-void AttachmentControllerBase::Private::attachmentRemoved(AttachmentPart::Ptr part)
+void AttachmentControllerBase::Private::attachmentRemoved(const AttachmentPart::Ptr &part)
{
uncompressedParts.remove(part);
}
@@ -579,7 +579,7 @@ void AttachmentControllerBase::setSignEnabled(bool enabled)
d->signEnabled = enabled;
}
-void AttachmentControllerBase::compressAttachment(AttachmentPart::Ptr part, bool compress)
+void AttachmentControllerBase::compressAttachment(const AttachmentPart::Ptr &part, bool compress)
{
if (compress) {
qCDebug(MESSAGECOMPOSER_LOG) << "Compressing part.";
@@ -704,7 +704,7 @@ void AttachmentControllerBase::openWith(const KService::Ptr &offer)
}
}
-void AttachmentControllerBase::openAttachment(AttachmentPart::Ptr part)
+void AttachmentControllerBase::openAttachment(const AttachmentPart::Ptr &part)
{
QTemporaryFile *tempFile = dumpAttachmentToTempFile(part);
if (!tempFile) {
@@ -738,7 +738,7 @@ void AttachmentControllerBase::openAttachment(AttachmentPart::Ptr part)
}
}
-void AttachmentControllerBase::viewAttachment(AttachmentPart::Ptr part)
+void AttachmentControllerBase::viewAttachment(const AttachmentPart::Ptr &part)
{
MessageComposer::Composer *composer = new MessageComposer::Composer;
composer->globalPart()->setFallbackCharsetEnabled(true);
@@ -803,12 +803,12 @@ void AttachmentControllerBase::editAttachment(AttachmentPart::Ptr part, MessageV
}
}
-void AttachmentControllerBase::editAttachmentWith(AttachmentPart::Ptr part)
+void AttachmentControllerBase::editAttachmentWith(const AttachmentPart::Ptr &part)
{
editAttachment(part, MessageViewer::EditorWatcher::OpenWithDialog);
}
-void AttachmentControllerBase::saveAttachmentAs(AttachmentPart::Ptr part)
+void AttachmentControllerBase::saveAttachmentAs(const AttachmentPart::Ptr &part)
{
QString pname = part->name();
if (pname.isEmpty()) {
@@ -849,7 +849,7 @@ void AttachmentControllerBase::slotPutResult(KJob *job)
}
}
-void AttachmentControllerBase::attachmentProperties(AttachmentPart::Ptr part)
+void AttachmentControllerBase::attachmentProperties(const AttachmentPart::Ptr &part)
{
QPointer<AttachmentPropertiesDialog> dialog = new AttachmentPropertiesDialog(
part, false, d->wParent);
@@ -936,7 +936,7 @@ void AttachmentControllerBase::showAddAttachmentFileDialog()
}
}
-void AttachmentControllerBase::addAttachment(AttachmentPart::Ptr part)
+void AttachmentControllerBase::addAttachment(const AttachmentPart::Ptr &part)
{
part->setEncrypted(d->model->isEncryptSelected());
part->setSigned(d->model->isSignSelected());
diff --git a/messagecomposer/src/attachment/attachmentcontrollerbase.h b/messagecomposer/src/attachment/attachmentcontrollerbase.h
index 852d123..8622246 100644
--- a/messagecomposer/src/attachment/attachmentcontrollerbase.h
+++ b/messagecomposer/src/attachment/attachmentcontrollerbase.h
@@ -62,18 +62,18 @@ public Q_SLOTS:
void setEncryptEnabled(bool enabled);
void setSignEnabled(bool enabled);
/// compression is async...
- void compressAttachment(MessageCore::AttachmentPart::Ptr part, bool compress);
+ void compressAttachment(const MessageCore::AttachmentPart::Ptr &part, bool compress);
void showContextMenu();
- void openAttachment(MessageCore::AttachmentPart::Ptr part);
- void viewAttachment(MessageCore::AttachmentPart::Ptr part);
+ void openAttachment(const MessageCore::AttachmentPart::Ptr &part);
+ void viewAttachment(const MessageCore::AttachmentPart::Ptr &part);
void editAttachment(MessageCore::AttachmentPart::Ptr part, MessageViewer::EditorWatcher::OpenWithOption option = MessageViewer::EditorWatcher::NoOpenWithDialog);
- void editAttachmentWith(MessageCore::AttachmentPart::Ptr part);
- void saveAttachmentAs(MessageCore::AttachmentPart::Ptr part);
- void attachmentProperties(MessageCore::AttachmentPart::Ptr part);
+ void editAttachmentWith(const MessageCore::AttachmentPart::Ptr &part);
+ void saveAttachmentAs(const MessageCore::AttachmentPart::Ptr &part);
+ void attachmentProperties(const MessageCore::AttachmentPart::Ptr &part);
void showAddAttachmentFileDialog();
void showAddAttachmentCompressedDirectoryDialog();
/// sets sign, encrypt, shows properties dialog if so configured
- void addAttachment(MessageCore::AttachmentPart::Ptr part);
+ void addAttachment(const MessageCore::AttachmentPart::Ptr &part);
void addAttachment(const QUrl &url);
void addAttachmentUrlSync(const QUrl &url);
void addAttachments(const QList<QUrl> &urls);
@@ -109,7 +109,7 @@ private:
class Private;
Private *const d;
- Q_PRIVATE_SLOT(d, void attachmentRemoved(MessageCore::AttachmentPart::Ptr))
+ 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())