From: Claudio Cambra Date: Sat, 1 Oct 2022 09:35:26 +0000 (+0200) Subject: Remove default cases in switches, rely on compiler warnings for missed cases X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~11^2~169^2~16 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=121ab3817710bc9c94d1e92feea2d8c8dbdb8fee;p=nextcloud-desktop.git Remove default cases in switches, rely on compiler warnings for missed cases Signed-off-by: Claudio Cambra --- diff --git a/src/gui/filedetails/shareemodel.cpp b/src/gui/filedetails/shareemodel.cpp index c4be699a7..6f4fd97a6 100644 --- a/src/gui/filedetails/shareemodel.cpp +++ b/src/gui/filedetails/shareemodel.cpp @@ -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 --------------------------- // diff --git a/src/gui/filedetails/sharemodel.cpp b/src/gui/filedetails/sharemodel.cpp index cb511f038..7eb3c0c0a 100644 --- a/src/gui/filedetails/sharemodel.cpp +++ b/src/gui/filedetails/sharemodel.cpp @@ -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()) { @@ -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 ---------------------- //