Commit c7d4ed52 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix clazy warning

parent a5efb6e1
Pipeline #23103 passed with stage
in 8 minutes and 32 seconds
......@@ -115,7 +115,7 @@ KParts::Part *KAddressBookPlugin::createPart()
// disable the Ctrl+N shortcut, as it is used by Kontact already
if (part->action("akonadi_contact_create")) {
QAction *newAction = qobject_cast<QAction *>(part->action("akonadi_contact_create"));
QAction *newAction = part->action("akonadi_contact_create");
if (newAction) {
newAction->setShortcut(QKeySequence());
}
......
......@@ -42,6 +42,7 @@ void ModelColumnManager::load()
{
const QList<int> settingsColumns = Settings::contactModelColumns();
Akonadi::ContactsTreeModel::Columns columns;
columns.reserve(settingsColumns.count());
for (int column : settingsColumns) {
columns.append(static_cast<Akonadi::ContactsTreeModel::Column>(column));
......@@ -54,6 +55,7 @@ void ModelColumnManager::store()
{
const Akonadi::ContactsTreeModel::Columns columns = mModel->columns();
QList<int> settingsColumns;
settingsColumns.reserve(columns.count());
for (int column : columns) {
settingsColumns.append(static_cast<int>(column));
......
......@@ -68,7 +68,9 @@ QString contactsToHtml(const KContacts::Addressee::List &contacts, const ColorSe
content += QLatin1String(" </style>\n");
content += QLatin1String(" </head>\n");
content += QLatin1String(" <body>\n");
ContactBlock::List blocks;
for (const KContacts::Addressee &contact : contacts) {
blocks.clear();
QString name = contact.realName();
if (!contact.title().isEmpty() || !contact.role().isEmpty()) {
QStringList contentAddress;
......@@ -83,7 +85,6 @@ QString contactsToHtml(const KContacts::Addressee::List &contacts, const ColorSe
const QString birthday = QLocale().toString(contact.birthday().date(), QLocale::ShortFormat);
ContactBlock::List blocks;
if (!contact.organization().isEmpty()) {
ContactBlock block;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment