forked from qt-creator/qt-creator
Android: Simplify AndroidExtraLibraryListModel::data()
This was triggered by a warning on a empty expression statement, but it turns out that QDir::cleanPath calls can be avoided, too. Change-Id: I930cbb1272294f57794c29e0cd48e3c0ba8c6fdf Reviewed-by: BogDan Vatra <bogdan@kdab.com>
This commit is contained in:
@@ -76,11 +76,9 @@ int AndroidExtraLibraryListModel::columnCount(const QModelIndex &) const
|
||||
QVariant AndroidExtraLibraryListModel::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
Q_ASSERT(index.row() >= 0 && index.row() < m_entries.size());
|
||||
const QString &entry = QDir::cleanPath(m_entries.at(index.row()));
|
||||
switch (role) {
|
||||
case Qt::DisplayRole: return entry;
|
||||
default: return QVariant();
|
||||
};
|
||||
if (role == Qt::DisplayRole)
|
||||
return QDir::cleanPath(m_entries.at(index.row()));
|
||||
return {};
|
||||
}
|
||||
|
||||
void AndroidExtraLibraryListModel::updateModel()
|
||||
|
Reference in New Issue
Block a user