[Kde-pim] Re: Review Request: Prevent the editing of an attachment when it is an encsulated message
Thomas McGuire
mcguire at kde.org
Tue Jan 4 01:02:36 GMT 2011
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/100288/#review723
-----------------------------------------------------------
Nice, thank you! I've added some further comments below, please have a look.
kmail/attachmentcontroller.cpp
<http://git.reviewboard.kde.org/r/100288/#comment541>
Why is the QModelIndex as parameter needed here?
I thought you can get the selected attachment with selectedParts.first(), like AttachmentControllerBase::Private::editSelectedAttachment() does, can't you?
Other than that, a little style thing: Put the opening brace in its own line, but only for function definitions here. For other opening braces, like with ifs, they should be in the same line, as you did correctly.
kmail/attachmentcontroller.cpp
<http://git.reviewboard.kde.org/r/100288/#comment543>
This if condition appears twice in the code, once here, once further below.
How about adding a new function to AttachmentPart, like isMessage(), and using that instead? Should avoid code duplication.
kmail/attachmentcontroller.cpp
<http://git.reviewboard.kde.org/r/100288/#comment542>
Coding style: whitespace within parenthesis, i.e. change to "viewAttachment( part );
messagecomposer/attachmentcontrollerbase.cpp
<http://git.reviewboard.kde.org/r/100288/#comment540>
There is a way to use less code here:
const bool attachmentIsMessage = part->mimeTpye() != ...;
d->editContextAction->setEnabled( attachmentIsMessage );
d->editWithContextAction->setEnabled( attachmentIsMessage );
- Thomas
On 2011-01-03 15:06:29, George Metaxas wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/100288/
> -----------------------------------------------------------
>
> (Updated 2011-01-03 15:06:29)
>
>
> Review request for KDEPIM.
>
>
> Summary
> -------
>
> When the user attempts to forward a message that contains an encapsulated message, they are shown the attachment and can edit it, by double clicking on it. However, in this case, it doesn't make sense to edit the attachment. If the user is allowed to edit the attachment, they get an error in a message box. This patch detects if the user has double clicked on an encapsulated message and proceeds to open the attachment for viewing only.
>
>
> This addresses bug 232782.
> http://bugs.kde.org/show_bug.cgi?id=232782
>
>
> Diffs
> -----
>
> kmail/attachmentcontroller.h a634ce9
> kmail/attachmentcontroller.cpp 11157d0
> messagecomposer/attachmentcontrollerbase.cpp 1361426
>
> Diff: http://git.reviewboard.kde.org/r/100288/diff
>
>
> Testing
> -------
>
>
> Thanks,
>
> George
>
>
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/
More information about the kde-pim
mailing list