bluetoothengine/btui/btcpplugin/btcpuisettingitem.cpp
changeset 31 a0ea99b6fa53
parent 29 48ae3789ce00
child 40 997690c3397a
child 42 b72428996822
equal deleted inserted replaced
30:df7a93ede42e 31:a0ea99b6fa53
    38 
    38 
    39 }
    39 }
    40 
    40 
    41 void BtCpUiSettingItem::onLaunchView()
    41 void BtCpUiSettingItem::onLaunchView()
    42 {
    42 {
    43     mModel = new BtuiModel();
    43     mSettingModel = new BtSettingModel(this);
       
    44     mDeviceModel = new BtDeviceModel(this);
    44     
    45     
    45     mMainWindow = hbInstance->allMainWindows().first();
    46     mMainWindow = hbInstance->allMainWindows().first();
    46     
    47     
    47     mBtMainView = new BtCpUiMainView(*mModel);
    48     mBtMainView = new BtCpUiMainView(*mSettingModel, *mDeviceModel);
    48     
    49     
    49     mCpView = mMainWindow->currentView();
    50     mCpView = mMainWindow->currentView();
    50     
    51     
    51     mMainWindow->addView(mBtMainView);
    52     mMainWindow->addView(mBtMainView);
    52     mMainWindow->setCurrentView(mBtMainView);
    53     mMainWindow->setCurrentView(mBtMainView);
    57 
    58 
    58 void BtCpUiSettingItem::handleCloseView()
    59 void BtCpUiSettingItem::handleCloseView()
    59 {
    60 {
    60     mBtMainView->deactivateView();
    61     mBtMainView->deactivateView();
    61     mMainWindow->setCurrentView(mCpView);
    62     mMainWindow->setCurrentView(mCpView);
    62     delete mBtMainView;
       
    63     delete mModel;
       
    64 }
    63 }
    65 
    64 
    66 
    65 
    67 CpBaseSettingView *BtCpUiSettingItem::createSettingView() const
    66 CpBaseSettingView *BtCpUiSettingItem::createSettingView() const
    68 {
    67 {