| 211 | } |
| 212 | |
| 213 | int CFavoriteView::Initial() |
| 214 | { |
| 215 | int nRet = 0; |
| 216 | m_pDatabase = new CFavoriteDatabase(this); |
| 217 | if(m_pDatabase) { |
| 218 | bool bRet = false; |
| 219 | //bRet = m_pDatabase->OpenDatabase(&m_pParaApp->GetGlobalParameters()->m_Database, "favorite_connect"); |
| 220 | auto pg = m_pParaApp->GetGlobalParameters(); |
| 221 | bRet = m_pDatabase->SetDatabase(&pg->m_DatabaseRemote); |
| 222 | if(!bRet) return -1; |
| 223 | } |
| 224 | if(m_pDatabase) { |
| 225 | m_pModel = new CFavoriteModel(m_pDatabase, this); |
| 226 | m_pTreeView->setModel(m_pModel); |
| 227 | } |
| 228 | |
| 229 | EnableAction(); |
| 230 | return nRet; |
| 231 | } |
| 232 | |
| 233 | void CFavoriteView::EnableAction(const QModelIndex &index) |
| 234 | { |
nothing calls this directly
no test coverage detected