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

Method data

Plugins/FileTransfer/RemoteFileSystemModel.cpp:416–437  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

414}
415
416QVariant 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
439QModelIndex CRemoteFileSystemModel::index(const QString& szPath) const
440{

Callers

nothing calls this directly

Calls 5

isValidMethod · 0.80
GetPathMethod · 0.80
GetTypeMethod · 0.45
IconMethod · 0.45
DataMethod · 0.45

Tested by

no test coverage detected