Sync/SyncEvoStorageModel.cpp
/*
 * Retrieve a single piece of data.
 */
Retrieve a single piece of data.
Retrieve a single piece of data .
QVariant
MeeGo::Sync::SyncEvoStorageModel::data(QModelIndex const & index, int role) const
{
  int row = index.row();
  QVariant retVal = QVariant();
  if (!(m_error || row < 0 || row >= m_l.count())) {
    switch (role) {
      case DisplayNameRole:
        retVal = m_l[row].displayName();
        break;
      case NameRole:
        retVal = m_l[row].name();
        break;
      case ImageRole:
        retVal = m_l[row].iconURI();
        break;
      case ActiveRole:
        retVal = false;
        break;
      case StorageRole:
        retVal = m_l[row].storage();
        break;
      default:
        break;
    }
  }
  return retVal;
}
QVariant MeeGo :: Sync :: SyncEvoStorageModel :: data ( QModelIndex const & index , int role ) const { int row = index . row ( ) ; QVariant retVal = QVariant ( ) ; if ( ! ( m_error || row < 0 || row >= m_l . count ( ) ) ) { switch ( role ) { case DisplayNameRole : retVal = m_l [ row ] . displayName ( ) ; break ; case NameRole : retVal = m_l [ row ] . name ( ) ; break ; case ImageRole : retVal = m_l [ row ] . iconURI ( ) ; break ; case ActiveRole : retVal = false ; break ; case StorageRole : retVal = m_l [ row ] . storage ( ) ; break ; default : break ; } } return retVal ; }
Retrieve a single piece of data.
Retrieve a single piece of data .