mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
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:
parent
31afb02c84
commit
121ab38177
@ -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 --------------------------- //
|
||||
|
||||
@ -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 ---------------------- //
|
||||
|
||||
Loading…
Reference in New Issue
Block a user