mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
Fix generation of context menu activity links
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
9b5391bdc1
commit
e987fe88c5
@ -904,16 +904,16 @@ QVariant ActivityListModel::convertLinkToActionButton(const OCC::ActivityLink &a
|
||||
|
||||
QVariantList ActivityListModel::convertLinksToMenuEntries(const Activity &activity)
|
||||
{
|
||||
if (static_cast<quint32>(activity._links.size()) <= maxActionButtons()) {
|
||||
return {};
|
||||
}
|
||||
|
||||
QVariantList customList;
|
||||
|
||||
if (static_cast<quint32>(activity._links.size()) > maxActionButtons()) {
|
||||
for (int i = 0; i < activity._links.size(); ++i) {
|
||||
const auto &activityLink = activity._links[i];
|
||||
if (!activityLink._primary) {
|
||||
customList << QVariantMap{
|
||||
{QStringLiteral("actionIndex"), i}, {QStringLiteral("label"), activityLink._label}};
|
||||
}
|
||||
}
|
||||
for (int i = maxActionButtons(); i < activity._links.size(); ++i) {
|
||||
const auto activityLinkLabel = activity._links[i]._label;
|
||||
const auto menuEntry = QVariantMap{{"actionIndex", i}, {"label", activityLinkLabel}};
|
||||
customList << menuEntry;
|
||||
}
|
||||
|
||||
return customList;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user