Commit 75a8e2b5 authored by Laurent Montel's avatar Laurent Montel 😁

Merge remote-tracking branch 'origin/Applications/17.08'

parents e0a857bf d26ab7cf
......@@ -284,18 +284,15 @@ QString MessageItem::annotation() const
return QString();
}
void MessageItem::editAnnotation()
void MessageItem::editAnnotation(QWidget *parent)
{
Q_D(MessageItem);
if (d->mAnnotationDialog.data()) {
return;
}
d->mAnnotationDialog = new PimCommon::AnnotationEditDialog(d->mAkonadiItem);
d->mAnnotationDialog.data()->setAttribute(Qt::WA_DeleteOnClose);
QPointer<PimCommon::AnnotationEditDialog> mAnnotationDialog = new PimCommon::AnnotationEditDialog(d->mAkonadiItem, parent);
//FIXME make async
if (d->mAnnotationDialog.data()->exec()) {
if (mAnnotationDialog->exec()) {
// invalidate the cached mHasAnnotation value
}
delete mAnnotationDialog;
}
const MessageItem::Tag *MessageItemPrivate::findTagInternal(const QString &szTagId) const
......
......@@ -106,7 +106,7 @@ public:
QString annotation() const;
/// Shows a dialog to edit or delete the annotation
void editAnnotation();
void editAnnotation(QWidget *parent);
/**
* Returns Tag associated to this message that has the specified id or 0
......
......@@ -28,7 +28,7 @@
#include <Monitor>
#include <Tag>
#include <KJob>
#include <QWeakPointer>
#include <QPointer>
#include <QCache>
namespace MessageList
......@@ -72,7 +72,6 @@ public:
QByteArray mReferencesIdMD5; ///< set only if we're doing threading
QByteArray mStrippedSubjectMD5; ///< set only if we're doing threading
Akonadi::Item mAkonadiItem;
QWeakPointer<PimCommon::AnnotationEditDialog> mAnnotationDialog;
MessageItem::ThreadingStatus mThreadingStatus : 4;
MessageItem::EncryptionState mEncryptionState : 4;
MessageItem::SignatureState mSignatureState : 4;
......
......@@ -2074,7 +2074,7 @@ void View::mousePressEvent(QMouseEvent *e)
switch (d->mDelegate->hitContentItem()->type()) {
case Theme::ContentItem::AnnotationIcon:
static_cast< MessageItem * >(it)->editAnnotation();
static_cast< MessageItem * >(it)->editAnnotation(this);
return; // don't select the item
break;
case Theme::ContentItem::ActionItemStateIcon:
......
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