emailuis/nmailui/src/nmmessagesearchlistview.cpp
changeset 75 47d84de1c893
parent 72 64e38f08e49c
--- a/emailuis/nmailui/src/nmmessagesearchlistview.cpp	Fri Sep 17 08:27:21 2010 +0300
+++ b/emailuis/nmailui/src/nmmessagesearchlistview.cpp	Mon Oct 04 00:05:37 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.