| 92 | } |
| 93 | |
| 94 | QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override |
| 95 | { |
| 96 | if (!index.isValid()) return QVariant(); |
| 97 | if (index.parent().isValid()) return QVariant(); |
| 98 | if (index.column() > 1) return QVariant(); |
| 99 | if (index.row() > m_paths.count()) return QVariant(); |
| 100 | if (role == Qt::DisplayRole || role == Qt::EditRole) { |
| 101 | if (index.row() == m_paths.count()) return QString(); |
| 102 | if (index.column() == 0) { |
| 103 | return m_paths[index.row()].remote.toDisplayString(QUrl::PreferLocalFile); |
| 104 | } else if (index.column() == 1) { |
| 105 | return m_paths[index.row()].local.toDisplayString(QUrl::PreferLocalFile); |
| 106 | } |
| 107 | } |
| 108 | return QVariant(); |
| 109 | } |
| 110 | |
| 111 | Qt::ItemFlags flags(const QModelIndex& index) const override |
| 112 | { |