[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/work/akonadi-ports/kdepim/messagelist
From: Laurent Montel <montel () kde ! org>
Date: 2009-10-17 13:30:34
Message-ID: 1255786234.140606.9267.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 1036596 by mlaurent:
Return a message list from a thread
M +10 -0 pane.cpp
M +14 -0 pane.h
M +13 -0 widget.cpp
M +12 -0 widget.h
--- branches/work/akonadi-ports/kdepim/messagelist/pane.cpp #1036595:1036596
@@ -467,6 +467,16 @@
return w->selectionAsMessageItemList( includeCollapsedChildren );
}
+
+QList<Akonadi::Item> Pane::currentThreadAsMessageList() const
+{
+ Widget *w = static_cast<Widget*>( currentWidget() );
+ if ( w == 0 ) {
+ return QList<Akonadi::Item>();
+ }
+ return w->currentThreadAsMessageList();
+}
+
KPIM::MessageStatus Pane::currentFilterStatus() const
{
Widget *w = static_cast<Widget*>( currentWidget() );
--- branches/work/akonadi-ports/kdepim/messagelist/pane.h #1036595:1036596
@@ -119,7 +119,21 @@
* this set of messages at a later stage then take a look at createPersistentSet().
*/
QList<Akonadi::Item> selectionAsMessageItemList( bool includeCollapsedChildren = true ) const;
+
/**
+ * Returns the Akonadi::Item bound to the current StorageModel that
+ * are part of the current thread. The current thread is the thread
+ * that contains currentMessageItem().
+ * The list may be empty if there is no currentMessageItem() or no StorageModel.
+ *
+ * The returned list is guaranteed to be valid only until you return control
+ * to the main even loop. Don't store it for any longer. If you need to reference
+ * this set of messages at a later stage then take a look at createPersistentSet().
+ */
+ QList<Akonadi::Item> currentThreadAsMessageList() const;
+
+
+ /**
* Selects the next message item in the view.
*
* messageTypeFilter can be used to restrict the selection to only certain message types.
--- branches/work/akonadi-ports/kdepim/messagelist/widget.cpp #1036595:1036596
@@ -497,7 +497,20 @@
return lstMiPtr;
}
+QList<Akonadi::Item> Widget::currentThreadAsMessageList() const
+{
+ QList<Item> lstMiPtr;
+ QList<Core::MessageItem *> lstMi = view()->currentThreadAsMessageItemList();
+ if ( lstMiPtr.isEmpty() ) {
+ return lstMiPtr;
+ }
+ foreach( Core::MessageItem *it, lstMi ) {
+ lstMiPtr.append( d->itemForRow( it->currentModelIndexRow() ) );
+ }
+ return lstMiPtr;
+}
+
KPIM::MessageStatus Widget::currentFilterStatus() const
{
return view()->currentFilterStatus();
--- branches/work/akonadi-ports/kdepim/messagelist/widget.h #1036595:1036596
@@ -221,6 +221,18 @@
QList<Akonadi::Item> selectionAsMessageItemList( bool includeCollapsedChildren = true ) const;
/**
+ * Returns the Akonadi::Item bound to the current StorageModel that
+ * are part of the current thread. The current thread is the thread
+ * that contains currentMessageItem().
+ * The list may be empty if there is no currentMessageItem() or no StorageModel.
+ *
+ * The returned list is guaranteed to be valid only until you return control
+ * to the main even loop. Don't store it for any longer. If you need to reference
+ * this set of messages at a later stage then take a look at createPersistentSet().
+ */
+ QList<Akonadi::Item> currentThreadAsMessageList() const;
+
+ /**
* Returns the KPIM::MessageStatus in the current quicksearch field.
*/
KPIM::MessageStatus currentFilterStatus() const;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic