const qreal x = option.padding * 3 + iconSize();
qreal y = qRound((widgetHeight - textLinesHeight) / 2);
const qreal maxWidth = size().width() - x - option.padding;
- for (const QByteArray &role : qAsConst(m_sortedVisibleRoles)) {
+ for (const QByteArray &role : std::as_const(m_sortedVisibleRoles)) {
- const QString text = roleText(role, values);
+ const QString text = escapeString(roleText(role, values));
TextInfo *textInfo = m_textInfo.value(role);
textInfo->staticText.setText(text);
QStringList enabledPlugins;
- const QAbstractItemModel *model = m_listView->model();
- for (int i = 0; i < model->rowCount(); ++i) {
- const QModelIndex index = model->index(i, 0);
- const QString service = model->data(index, ServiceModel::DesktopEntryNameRole).toString();
- const bool checked = model->data(index, Qt::CheckStateRole).value<Qt::CheckState>() == Qt::Checked;
+ for (int i = 0; i < m_serviceModel->rowCount(); ++i) {
+ const QModelIndex index = m_serviceModel->index(i, 0);
+ const QString service = m_serviceModel->data(index, ServiceModel::DesktopEntryNameRole).toString();
- const bool checked = m_serviceModel->data(index, Qt::CheckStateRole).toBool();
++ const bool checked = m_serviceModel->data(index, Qt::CheckStateRole).value<Qt::CheckState>() == Qt::Checked;
if (service.startsWith(VersionControlServicePrefix)) {
if (checked) {
const bool checked =
!service.startsWith(VersionControlServicePrefix) && service != QLatin1String(DeleteService) && service != QLatin1String(CopyToMoveToService);
- model->setData(index, checked ? Qt::Checked : Qt::Unchecked, Qt::CheckStateRole);
- m_serviceModel->setData(index, checked, Qt::CheckStateRole);
++ m_serviceModel->setData(index, checked ? Qt::Checked : Qt::Unchecked, Qt::CheckStateRole);
}
}