Remove default cases in switches, rely on compiler warnings for missed cases

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2022-10-01 11:35:26 +02:00
parent 31afb02c84
commit 121ab38177
No known key found for this signature in database
GPG Key ID: C839200C384636B0
2 changed files with 8 additions and 12 deletions

View File

@ -72,10 +72,10 @@ QVariant ShareeModel::data(const QModelIndex &index, const int role) const
return QString(sharee->displayName() + " (" + sharee->shareWith() + ")");
case ShareeRole:
return QVariant::fromValue(sharee);
default:
qCWarning(lcShareeModel) << "Got unknown role -- returning null value.";
return {};
}
qCWarning(lcShareeModel) << "Got unknown role" << role << "returning null value.";
return {};
}
// --------------------------- QPROPERTY methods --------------------------- //

View File

@ -115,8 +115,6 @@ QVariant ShareModel::data(const QModelIndex &index, const int role) const
const auto startOfExpireDayUTC = linkShare->getExpireDate().startOfDay(QTimeZone::utc());
return startOfExpireDayUTC.toMSecsSinceEpoch();
}
default:
break;
}
} else if (const auto userGroupShare = share.objectCast<UserGroupShare>()) {
@ -132,8 +130,6 @@ QVariant ShareModel::data(const QModelIndex &index, const int role) const
const auto startOfExpireDayUTC = userGroupShare->getExpireDate().startOfDay(QTimeZone::utc());
return startOfExpireDayUTC.toMSecsSinceEpoch();
}
default:
break;
}
}
@ -178,12 +174,12 @@ QVariant ShareModel::data(const QModelIndex &index, const int role) const
case NoteRole:
case ExpireDateRole:
return {};
default:
qCWarning(lcShareModel) << "Got unknown role" << role
<< "for share of type" << share->getShareType()
<< "so returning null value.";
return {};
}
qCWarning(lcShareModel) << "Got unknown role" << role
<< "for share of type" << share->getShareType()
<< "so returning null value.";
return {};
}
// ---------------------- Internal model data methods ---------------------- //