| 231 | } |
| 232 | |
| 233 | void CFavoriteView::EnableAction(const QModelIndex &index) |
| 234 | { |
| 235 | if(!m_pModel) return; |
| 236 | if(index.isValid()) { |
| 237 | CFavoriteDatabase::Item item = |
| 238 | m_pModel->data(index, CFavoriteModel::RoleItem) |
| 239 | .value<CFavoriteDatabase::Item>(); |
| 240 | if(item.isFavorite()) { |
| 241 | m_pStartAction->setEnabled(true); |
| 242 | m_pEidtStartAction->setEnabled(true); |
| 243 | } else { |
| 244 | m_pStartAction->setEnabled(false); |
| 245 | m_pEidtStartAction->setEnabled(false); |
| 246 | } |
| 247 | m_pEditAction->setEnabled(true); |
| 248 | m_pDeleteAction->setEnabled(true); |
| 249 | return; |
| 250 | } |
| 251 | |
| 252 | if(m_pStartAction) |
| 253 | m_pStartAction->setEnabled(false); |
| 254 | if(m_pEidtStartAction) |
| 255 | m_pEidtStartAction->setEnabled(false); |
| 256 | if(m_pEditAction) |
| 257 | m_pEditAction->setEnabled(false); |
| 258 | if(m_pDeleteAction) |
| 259 | m_pDeleteAction->setEnabled(false); |
| 260 | } |
| 261 | |
| 262 | void CFavoriteView::slotAddToFavorite(const QString &file, |
| 263 | const QString &szName, |
nothing calls this directly
no test coverage detected