[kde-doc-english] [trojita] src/Gui: GUI: support direct-quoting from visible attachments

Jan Kundrát jkt at flaska.net
Fri Aug 9 16:30:13 UTC 2013


Git commit 7b25ba180b751da001bbf5875a91c7ee51a31ba6 by Jan Kundrát.
Committed on 08/08/2013 at 11:37.
Pushed by jkt into branch 'master'.

GUI: support direct-quoting from visible attachments

M  +11   -0    src/Gui/AttachmentView.cpp
M  +4    -2    src/Gui/AttachmentView.h

http://commits.kde.org/trojita/7b25ba180b751da001bbf5875a91c7ee51a31ba6

diff --git a/src/Gui/AttachmentView.cpp b/src/Gui/AttachmentView.cpp
index 4189eb4..7bd8006 100644
--- a/src/Gui/AttachmentView.cpp
+++ b/src/Gui/AttachmentView.cpp
@@ -218,6 +218,17 @@ void AttachmentView::mousePressEvent(QMouseEvent *event)
     drag->exec(Qt::CopyAction, Qt::CopyAction);
 }
 
+QString AttachmentView::quoteMe() const
+{
+    const AbstractPartWidget *widget = dynamic_cast<const AbstractPartWidget *>(m_contentWidget);
+    return widget && !m_contentWidget->isHidden() ? widget->quoteMe() : QString();
+}
+
+void AttachmentView::reloadContents()
+{
+    if (AbstractPartWidget *w = dynamic_cast<AbstractPartWidget*>(m_contentWidget))
+        w->reloadContents();
+}
 
 }
 
diff --git a/src/Gui/AttachmentView.h b/src/Gui/AttachmentView.h
index b84aa61..8c0dbe9 100644
--- a/src/Gui/AttachmentView.h
+++ b/src/Gui/AttachmentView.h
@@ -24,7 +24,7 @@
 
 #include <QModelIndex>
 #include <QWidget>
-
+#include "Gui/AbstractPartWidget.h"
 
 class QNetworkReply;
 class QPushButton;
@@ -50,12 +50,14 @@ namespace Gui
   type of the body part and the download button.  It also includes code for
   handling the actual download.
 */
-class AttachmentView : public QWidget
+class AttachmentView : public QWidget, public AbstractPartWidget
 {
     Q_OBJECT
 public:
     AttachmentView(QWidget *parent, Imap::Network::MsgPartNetAccessManager *manager, const QModelIndex &m_partIndex,
                    QWidget *contentWidget);
+    virtual QString quoteMe() const;
+    virtual void reloadContents();
 protected:
     virtual void mousePressEvent(QMouseEvent *event);
 private slots:



More information about the kde-doc-english mailing list