[kde-doc-english] [trojita] src/Gui: GUI: cleanup: Remove the MessageView argument to the LoadablePartWidget

Jan Kundrát jkt at flaska.net
Wed Aug 13 19:13:30 UTC 2014


Git commit bed8ef752b5128e0e4af880856672e630ae76814 by Jan Kundrát.
Committed on 13/08/2014 at 18:19.
Pushed by jkt into branch 'master'.

GUI: cleanup: Remove the MessageView argument to the LoadablePartWidget

This is not needed since 1b4a23fe5f9df90779a04670c4c07135aefbc390 which moved
actual widget creation and wrapping to the PartWidgetFactory.

REVIEW: 119771

M  +2    -2    src/Gui/LoadablePartWidget.cpp
M  +1    -3    src/Gui/LoadablePartWidget.h
M  +3    -3    src/Gui/PartWidgetFactory.cpp

http://commits.kde.org/trojita/bed8ef752b5128e0e4af880856672e630ae76814

diff --git a/src/Gui/LoadablePartWidget.cpp b/src/Gui/LoadablePartWidget.cpp
index 05a59f5..f5a250a 100644
--- a/src/Gui/LoadablePartWidget.cpp
+++ b/src/Gui/LoadablePartWidget.cpp
@@ -30,9 +30,9 @@ namespace Gui
 {
 
 LoadablePartWidget::LoadablePartWidget(QWidget *parent, Imap::Network::MsgPartNetAccessManager *manager, const QModelIndex &part,
-                                       MessageView *messageView, PartWidgetFactory *factory, int recursionDepth,
+                                       PartWidgetFactory *factory, int recursionDepth,
                                        const PartWidgetFactory::PartLoadingOptions loadingMode):
-    QStackedWidget(parent), manager(manager), partIndex(part), m_messageView(messageView), m_factory(factory),
+    QStackedWidget(parent), manager(manager), partIndex(part), m_factory(factory),
     m_recursionDepth(recursionDepth), m_loadingMode(loadingMode), realPart(0), loadButton(0), m_loadOnShow(false)
 {
     Q_ASSERT(partIndex.isValid());
diff --git a/src/Gui/LoadablePartWidget.h b/src/Gui/LoadablePartWidget.h
index b3839f0..f305c9a 100644
--- a/src/Gui/LoadablePartWidget.h
+++ b/src/Gui/LoadablePartWidget.h
@@ -46,8 +46,7 @@ class LoadablePartWidget : public QStackedWidget, public AbstractPartWidget
 {
     Q_OBJECT
 public:
-    LoadablePartWidget(QWidget *parent, Imap::Network::MsgPartNetAccessManager *manager, const QModelIndex &part,
-                       MessageView *messageView, PartWidgetFactory *factory, int recursionDepth,
+    LoadablePartWidget(QWidget *parent, Imap::Network::MsgPartNetAccessManager *manager, const QModelIndex &part, PartWidgetFactory *factory, int recursionDepth,
                        const PartWidgetFactory::PartLoadingOptions loadingMode);
     QString quoteMe() const;
     virtual void reloadContents();
@@ -58,7 +57,6 @@ private slots:
 private:
     Imap::Network::MsgPartNetAccessManager *manager;
     QPersistentModelIndex partIndex;
-    MessageView *m_messageView;
     PartWidgetFactory *m_factory;
     int m_recursionDepth;
     PartWidgetFactory::PartLoadingOptions m_loadingMode;
diff --git a/src/Gui/PartWidgetFactory.cpp b/src/Gui/PartWidgetFactory.cpp
index a6bca54..565d9d7 100644
--- a/src/Gui/PartWidgetFactory.cpp
+++ b/src/Gui/PartWidgetFactory.cpp
@@ -69,7 +69,7 @@ QWidget *PartWidgetFactory::create(const QModelIndex &partIndex, int recursionDe
     bool isCompoundMimeType = mimeType.startsWith(QLatin1String("multipart/")) || isMessageRfc822;
 
     if (loadingMode & PART_IS_HIDDEN) {
-        return new LoadablePartWidget(0, manager, partIndex, m_messageView, this, recursionDepth + 1,
+        return new LoadablePartWidget(0, manager, partIndex, this, recursionDepth + 1,
                                       loadingMode | PART_IGNORE_CLICKTHROUGH);
     }
 
@@ -132,7 +132,7 @@ QWidget *PartWidgetFactory::create(const QModelIndex &partIndex, int recursionDe
                 // This is to prevent a clickthrough when offline
                 options |= PART_IGNORE_CLICKTHROUGH;
             }
-            contentWidget = new LoadablePartWidget(0, manager, partIndex, m_messageView, this, recursionDepth + 1, options);
+            contentWidget = new LoadablePartWidget(0, manager, partIndex, this, recursionDepth + 1, options);
             if (!isInline) {
                 contentWidget->hide();
             }
@@ -210,7 +210,7 @@ QWidget *PartWidgetFactory::create(const QModelIndex &partIndex, int recursionDe
             // Show it directly without any fancy wrapping
             return new SimplePartWidget(0, manager, partIndex, m_messageView);
         } else {
-            return new LoadablePartWidget(0, manager, partIndex, m_messageView, this, recursionDepth + 1,
+            return new LoadablePartWidget(0, manager, partIndex, this, recursionDepth + 1,
                                           (m_netWatcher && m_netWatcher->effectiveNetworkPolicy() != Imap::Mailbox::NETWORK_OFFLINE) ?
                                           loadingMode : loadingMode | PART_IGNORE_CLICKTHROUGH);
         }


More information about the kde-doc-english mailing list