emailuis/nmailui/src/nmmessagesearchlistview.cpp
changeset 68 83cc6bae1de8
parent 66 084b5b1f02a7
--- a/emailuis/nmailui/src/nmmessagesearchlistview.cpp	Fri Sep 03 17:52:02 2010 +0300
+++ b/emailuis/nmailui/src/nmmessagesearchlistview.cpp	Wed Sep 15 12:09:55 2010 +0300
@@ -29,6 +29,9 @@
 static const QString NmSearchListViewSpinnerAnimation("qtg_anim_mono_loading");
 static const QString NmSearchListViewSpinnerImage("qtg_anim_mono_loading_1");
 
+static const QString NmSearchListViewPortrait("portrait");
+static const QString NmSearchListViewLandscape("landscape");
+
 
 /*!
     \class NmMessageSearchListView
@@ -147,8 +150,12 @@
 void NmMessageSearchListView::viewReady()
 {
     NM_FUNCTION;
+
+    // Load orientation specific sections.
+    loadOrientationSection();
     
     if (!mViewReady){
+
         // Set the mailbox name to the title pane.
         setViewTitle();
 
@@ -788,6 +795,9 @@
 void NmMessageSearchListView::orientationChanged()
 {
     NM_FUNCTION;
+
+    loadOrientationSection();
+
     if (mSelectTextAfterOrientationChange) {
         mLineEdit->selectAll();
         mSelectTextAfterOrientationChange = false;
@@ -835,4 +845,17 @@
     showItems(Hb::ToolBarItem);
 }
 
+/*!
+    Loads orientation specific sections from docml.
+*/
+void NmMessageSearchListView::loadOrientationSection()
+{
+    QString sectionName(NmSearchListViewPortrait);
+    if (mApplication.mainWindow()->orientation() == Qt::Horizontal) {
+        sectionName = NmSearchListViewLandscape;
+    }
+
+    mDocumentLoader->load(NMUI_MESSAGE_SEARCH_VIEW_XML, sectionName);
+}
+
 // End of file.