filemanager/src/filemanager/src/fmmainwindow.cpp
changeset 37 15bc28c9dd51
parent 14 1957042d8c7e
child 46 d58987eac7e8
equal deleted inserted replaced
16:ada7962b4308 37:15bc28c9dd51
    15  * Description:
    15  * Description:
    16  *     The source file of File Manager main window
    16  *     The source file of File Manager main window
    17  */
    17  */
    18 
    18 
    19 #include "fmmainwindow.h"
    19 #include "fmmainwindow.h"
       
    20 #include "fmcommon.h"
    20 
    21 
    21 #include <hbaction.h>
    22 #include <hbaction.h>
    22 
    23 
    23 FmMainWindow::FmMainWindow()
    24 FmMainWindow::FmMainWindow() : mViewManager( 0 ), mFirstViewLoaded( false )
    24 {
    25 {
       
    26    // connect(this, SIGNAL(viewReady()), this, SLOT(delayedLoading()));
    25     init();
    27     init();
    26 	QMetaObject::connectSlotsByName( this );
       
    27 }
    28 }
    28 
    29 
    29 FmMainWindow::~FmMainWindow()
    30 FmMainWindow::~FmMainWindow()
    30 {
    31 {
       
    32    //save file manager activity to activity manager.
       
    33     mViewManager->saveActivity();   
    31     FmViewManager::RemoveViewManager();
    34     FmViewManager::RemoveViewManager();
    32 }
    35 }
    33 
    36 
    34 void FmMainWindow::onOrientationChanged( Qt::Orientation orientation )
    37 void FmMainWindow::onOrientationChanged( Qt::Orientation orientation )
    35 {
    38 {
    43 	*/
    46 	*/
    44 }
    47 }
    45 
    48 
    46 void FmMainWindow::init()
    49 void FmMainWindow::init()
    47 {
    50 {
       
    51     FM_LOG("FmMainWindow::init start");
    48     mViewManager = FmViewManager::CreateViewManager( this );
    52     mViewManager = FmViewManager::CreateViewManager( this );
    49     
       
    50     mViewManager->createDriverView();
    53     mViewManager->createDriverView();
    51     
    54     connect(this, SIGNAL(aboutToChangeView(HbView *, HbView *)), 
       
    55             mViewManager, SLOT(onAboutToChangeView(HbView *, HbView *)));
    52     connect( this, SIGNAL( orientationChanged( Qt::Orientation ) ),
    56     connect( this, SIGNAL( orientationChanged( Qt::Orientation ) ),
    53              this, SLOT( onOrientationChanged( Qt::Orientation ) ) );
    57              this, SLOT( onOrientationChanged( Qt::Orientation ) ) );
    54     
    58     
       
    59     FM_LOG("FmMainWindow::init end");
    55 //    if ( orientation() == Qt::Vertical ) {
    60 //    if ( orientation() == Qt::Vertical ) {
    56 //        createDriverView();
    61 //        createDriverView();
    57 //    } else {
    62 //    } else {
    58 //        createSplitView();
    63 //        createSplitView();
    59 //    }
    64 //    }
    60 }
    65 }
    61 
    66 
       
    67 void FmMainWindow::delayedLoading()
       
    68 {
       
    69     FM_LOG("FmMainWindow::delayedLoading start");
       
    70     if( mFirstViewLoaded ) {
       
    71         return;
       
    72     }
       
    73     init();
       
    74     mFirstViewLoaded = true;
       
    75     FM_LOG("FmMainWindow::delayedLoading end");
       
    76 }
       
    77