Bug 262046

Summary: Cannot show Mails from search result
Product: [Applications] KMail Mobile Reporter: Andreas Holzammer <andreas.holzammer>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: VERIFIED FIXED    
Severity: normal CC: aheinecke, tokoe
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Unlisted Binaries   
OS: Microsoft Windows CE   
Latest Commit: Version Fixed In:

Description Andreas Holzammer 2011-01-04 10:16:40 UTC
Version:           unspecified
OS:                Windows CE

When a search is done i cannot open a mail by clicking the search result.

Reproducible: Always

Steps to Reproduce:
1) open search for E-Mail
2) enter any keyword
3) hit search
4) click on a E-Mail from the search result

Actual Results:  
does nothing

Expected Results:  
The Mail should be opened in the Messageviewer if the Mail was selected.
Comment 1 Tobias Koenig 2011-01-06 10:04:02 UTC
commit d494cccc8fda878c4d7bc8cebe29d7b6453621c6
branch master
Author: Tobias Koenig <tokoe@kde.org>
Date:   Thu Jan 6 10:05:35 2011 +0100

    Open message viewer when selecting mail from search results
    
    The refactoring to ThreadModel/ThreadSelectorModel broke the
    connection in the SearchResultView
    
    BUG: 262046

diff --git a/mobile/mail/kmail-mobile.qml b/mobile/mail/kmail-mobile.qml
index 0a7b0c0..6c77807 100644
--- a/mobile/mail/kmail-mobile.qml
+++ b/mobile/mail/kmail-mobile.qml
@@ -524,6 +524,16 @@ KPIM.MainView {
       navigationModel : _itemNavigationModel
       anchors.fill : parent
     }
+    QML.Connections {
+      target : _itemNavigationModel
+      onCurrentRowChanged : {
+        if ( !application.isSingleMessage( _itemNavigationModel.currentRow ) )
+          return;
+
+        guiStateManager.pushUniqueState( KPIM.GuiStateManager.ViewSingleItemState );
+        _itemActionModel.select( _itemNavigationModel.currentRow, 3 );
+      }
+    }
 
     resultText: KDE.i18np( "One message found", "%1 messages found", searchMessageListView.count )
   }