Changeset View
Changeset View
Standalone View
Standalone View
src/ui/itemsviewdelegate.cpp
Show First 20 Lines • Show All 154 Lines • ▼ Show 20 Line(s) | 109 | if (installButton) { | |||
---|---|---|---|---|---|
155 | } | 155 | } | ||
156 | installButton->setText(text); | 156 | installButton->setText(text); | ||
157 | installButton->setEnabled(enabled); | 157 | installButton->setEnabled(enabled); | ||
158 | installButton->setIcon(icon); | 158 | installButton->setIcon(icon); | ||
159 | installButton->setPopupMode(QToolButton::InstantPopup); | 159 | installButton->setPopupMode(QToolButton::InstantPopup); | ||
160 | 160 | | |||
161 | if (installable && entry.downloadLinkCount() > 1) { | 161 | if (installable && entry.downloadLinkCount() > 1) { | ||
162 | QMenu *installMenu = new QMenu(installButton); | 162 | QMenu *installMenu = new QMenu(installButton); | ||
163 | foreach (const KNSCore::EntryInternal::DownloadLinkInformation &info, entry.downloadLinkInformationList()) { | 163 | const auto lst = entry.downloadLinkInformationList(); | ||
164 | for (const KNSCore::EntryInternal::DownloadLinkInformation &info : lst) { | ||||
164 | QString text = info.name; | 165 | QString text = info.name; | ||
165 | if (!info.distributionType.trimmed().isEmpty()) { | 166 | if (!info.distributionType.trimmed().isEmpty()) { | ||
166 | text += QStringLiteral(" (") + info.distributionType.trimmed() + QLatin1Char(')'); | 167 | text += QStringLiteral(" (") + info.distributionType.trimmed() + QLatin1Char(')'); | ||
167 | } | 168 | } | ||
168 | QAction *installAction = installMenu->addAction(m_iconInstall, text); | 169 | QAction *installAction = installMenu->addAction(m_iconInstall, text); | ||
169 | installAction->setData(QPoint(index.row(), info.id)); | 170 | installAction->setData(QPoint(index.row(), info.id)); | ||
170 | } | 171 | } | ||
171 | installButton->setMenu(installMenu); | 172 | installButton->setMenu(installMenu); | ||
▲ Show 20 Lines • Show All 182 Lines • Show Last 20 Lines |