return;
}
+ auto theme = Theme::instance();
bool autoShare = true;
// We only do user/group sharing from 8.2.0
- if (account->serverVersionInt() >= ((8 << 16) + (2 << 8))) {
+ if (theme->userGroupSharing() && account->serverVersionInt() >= ((8 << 16) + (2 << 8))) {
_userGroupWidget = new ShareUserGroupWidget(account, sharePath, localPath, resharingAllowed, this);
_ui->shareWidgetsLayout->addWidget(_userGroupWidget);
autoShare = false;
}
- _linkWidget = new ShareLinkWidget(account, sharePath, localPath, resharingAllowed, autoShare, this);
- _linkWidget->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred);
- _ui->shareWidgetsLayout->addWidget(_linkWidget);
+ if (theme->linkSharing()) {
+ _linkWidget = new ShareLinkWidget(account, sharePath, localPath, resharingAllowed, autoShare, this);
+ _linkWidget->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred);
+ _ui->shareWidgetsLayout->addWidget(_linkWidget);
+ }
}
ShareDialog::~ShareDialog()
qDebug() << Q_FUNC_INFO << localFile;
+ auto theme = Theme::instance();
+
Folder *shareFolder = FolderMan::instance()->folderForPath(localFile);
if (!shareFolder) {
const QString message = QLatin1String("SHARE:NOP:")+QDir::toNativeSeparators(localFile);
const QString message = QLatin1String("SHARE:NOTCONNECTED:")+QDir::toNativeSeparators(localFile);
// if the folder isn't connected, don't open the share dialog
sendMessage(socket, message);
+ } else if (!theme->linkSharing() && (
+ !theme->userGroupSharing() ||
+ shareFolder->accountState()->account()->serverVersionInt() < ((8 << 16) + (2 << 8)))) {
+ const QString message = QLatin1String("SHARE:NOP:")+QDir::toNativeSeparators(localFile);
+ sendMessage(socket, message);
} else {
const QString localFileClean = QDir::cleanPath(localFile);
const QString file = localFileClean.mid(shareFolder->cleanPath().length()+1);
const QString message = QLatin1String("SHARE_STATUS:DISABLED:")+QDir::toNativeSeparators(localFile);
sendMessage(socket, message);
} else {
- QString available = "USER,GROUP";
+ auto theme = Theme::instance();
+ QString available;
- if (capabilities.sharePublicLink()) {
- available += ",LINK";
+ if (theme->userGroupSharing()) {
+ available = "USER,GROUP";
}
- const QString message = QLatin1String("SHARE_STATUS:") + available + ":" + QDir::toNativeSeparators(localFile);
- sendMessage(socket, message);
+ if (theme->linkSharing() && capabilities.sharePublicLink()) {
+ if (available.isEmpty()) {
+ available = "LINK";
+ } else {
+ available += ",LINK";
+ }
+ }
+
+ if (available.isEmpty()) {
+ const QString message = QLatin1String("SHARE_STATUS:DISABLED") + ":" + QDir::toNativeSeparators(localFile);
+ sendMessage(socket, message);
+ } else {
+ const QString message = QLatin1String("SHARE_STATUS:") + available + ":" + QDir::toNativeSeparators(localFile);
+ sendMessage(socket, message);
+ }
}
}
}
virtual QString webDavPath() const;
virtual QString webDavPathNonShib() const;
+ /**
+ * @brief Sharing options
+ *
+ * Allow link sharing and or user/group sharing
+ */
+ virtual bool linkSharing() const;
+ virtual bool userGroupSharing() const;
+
protected:
#ifndef TOKEN_AUTH_ONLY
QIcon themeIcon(const QString& name, bool sysTray = false) const;