const auto date = enable ? _linkShare->getExpireDate() : QDate::currentDate().addDays(1);
_ui->calendar->setDate(date);
- _ui->calendar->setMinimumDate(date);
+ _ui->calendar->setMinimumDate(QDate::currentDate().addDays(1));
+ _ui->calendar->setMaximumDate(
+ QDate::currentDate().addDays(_account->capabilities().sharePublicLinkExpireDateDays()));
_ui->calendar->setFocus();
if (!enable && _linkShare && _linkShare->getExpireDate().isValid()) {
job->deleteShare(getId());
}
-bool Share::isUserGroupShare(const ShareType type)
+bool Share::isShareTypeUserGroupEmailRoomOrRemote(const ShareType type)
{
return (type == Share::TypeUser || type == Share::TypeGroup || type == Share::TypeEmail || type == Share::TypeRoom
|| type == Share::TypeRemote);
, _note(note)
, _expireDate(expireDate)
{
- Q_ASSERT(Share::isUserGroupShare(shareType));
+ Q_ASSERT(Share::isShareTypeUserGroupEmailRoomOrRemote(shareType));
Q_ASSERT(shareWith);
}
if (shareType == Share::TypeLink) {
newShare = parseLinkShare(data);
- } else if (Share::isUserGroupShare(static_cast <Share::ShareType>(shareType))) {
+ } else if (Share::isShareTypeUserGroupEmailRoomOrRemote(static_cast <Share::ShareType>(shareType))) {
newShare = parseUserGroupShare(data);
} else {
newShare = parseShare(data);
/*
* Is it a share with a user or group (local or remote)
*/
- static bool isUserGroupShare(const ShareType type);
+ static bool isShareTypeUserGroupEmailRoomOrRemote(const ShareType type);
signals:
void permissionsSet();
}
- Q_ASSERT(Share::isUserGroupShare(share->getShareType()));
+ Q_ASSERT(Share::isShareTypeUserGroupEmailRoomOrRemote(share->getShareType()));
auto userGroupShare = qSharedPointerDynamicCast<UserGroupShare>(share);
auto *s = new ShareUserLine(_account, userGroupShare, _maxSharingPermissions, _isFile, _parentScrollArea);
connect(s, &ShareUserLine::resizeRequested, this, &ShareUserGroupWidget::slotAdjustScrollWidgetSize);
return _account->capabilities().shareRemoteEnforceExpireDate();
} else if (type == Share::ShareType::TypeEmail) {
return _account->capabilities().sharePublicLinkEnforceExpireDate();
- } else {
- return _account->capabilities().shareInternalEnforceExpireDate();
}
+
+ return _account->capabilities().shareInternalEnforceExpireDate();
}
void ShareUserLine::setPasswordConfirmed()