| 414 | } |
| 415 | |
| 416 | QVariant CRemoteFileSystemModel::data(const QModelIndex &index, int role) const |
| 417 | { |
| 418 | /* |
| 419 | qDebug(log) << Q_FUNC_INFO << index << role;//*/ |
| 420 | if (!index.isValid()) |
| 421 | return QVariant(); |
| 422 | if (role != Qt::DisplayRole && role != Qt::DecorationRole) |
| 423 | return QVariant(); |
| 424 | //qDebug(log) << Q_FUNC_INFO << index; |
| 425 | CRemoteFileSystem* pItem = GetRemoteFileSystemFromIndex(index); |
| 426 | if(!pItem) |
| 427 | return QVariant(); |
| 428 | if(!(pItem->GetType() & m_Filter)) |
| 429 | return QVariant(); |
| 430 | if(Qt::DecorationRole == role && index.column() == 0) |
| 431 | return pItem->Icon(); |
| 432 | if(Qt::DisplayRole == role || Qt::EditRole == role) |
| 433 | return pItem->Data(index.column()); |
| 434 | if(Qt::ToolTipRole == role) |
| 435 | return pItem->GetPath(); |
| 436 | return QVariant(); |
| 437 | } |
| 438 | |
| 439 | QModelIndex CRemoteFileSystemModel::index(const QString& szPath) const |
| 440 | { |