Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't show open in browser if the server does not provide private links #9964

Merged
merged 1 commit into from
Aug 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelog/unreleased/8998
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Enhancement: Don't query private links if disabled on the server

https://github.com/owncloud/client/issues/8998
https://github.com/owncloud/client/pull/9840
https://github.com/owncloud/client/pull/9964
20 changes: 11 additions & 9 deletions src/gui/accountsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,16 +294,18 @@ void AccountSettings::slotCustomContextMenuRequested(const QPoint &pos)
// Add an action to open the folder on the server in a webbrowser:

if (auto info = _model->infoForIndex(index)) {
QString path = info->_folder->remotePathTrailingSlash();
if (classification == FolderStatusModel::SubFolder) {
// Only add the path of subfolders, because the remote path is the path of the root folder.
path += info->_path;
}
menu->addAction(CommonStrings::showInWebBrowser(), [path, davUrl = info->_folder->webDavUrl(), this] {
fetchPrivateLinkUrl(_accountState->account(), davUrl, path, this, [](const QString &url) {
Utility::openBrowser(url, nullptr);
if (info->_folder->accountState()->account()->capabilities().privateLinkPropertyAvailable()) {
QString path = info->_folder->remotePathTrailingSlash();
if (classification == FolderStatusModel::SubFolder) {
// Only add the path of subfolders, because the remote path is the path of the root folder.
path += info->_path;
}
menu->addAction(CommonStrings::showInWebBrowser(), [path, davUrl = info->_folder->webDavUrl(), this] {
fetchPrivateLinkUrl(_accountState->account(), davUrl, path, this, [](const QString &url) {
Utility::openBrowser(url, nullptr);
});
});
});
}
}

// For sub-folders we're now done.
Expand Down