MCPcopy Create free account
hub / github.com/KangLin/RabbitRemoteControl / EnableAction

Method EnableAction

App/Client/Favorite/FavoriteView.cpp:233–260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

231}
232
233void 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
262void CFavoriteView::slotAddToFavorite(const QString &file,
263 const QString &szName,

Callers

nothing calls this directly

Calls 3

isValidMethod · 0.80
isFavoriteMethod · 0.80
dataMethod · 0.45

Tested by

no test coverage detected