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

Fix clazy warning

parent f7ce8711
......@@ -122,7 +122,8 @@ QString StandardContactFormatter::toHtml(HtmlForm form) const
// Phone Numbers
int counter = 0;
for (const KContacts::PhoneNumber &number : rawContact.phoneNumbers()) {
const auto phoneNumbers = rawContact.phoneNumbers();
for (const KContacts::PhoneNumber &number : phoneNumbers) {
QString dispLabel = number.typeLabel().replace(QLatin1Char(' '), QStringLiteral(" "));
QString dispValue = QStringLiteral("<a href=\"phone:?index=%1\">%2</a>").arg(counter).arg(number.number().toHtmlEscaped());
if (number.type() & KContacts::PhoneNumber::Cell) {
......@@ -130,13 +131,10 @@ QString StandardContactFormatter::toHtml(HtmlForm form) const
.arg(counter)
.arg(i18nc("@info:tooltip", "Send SMS"));
dynamicPart += rowFmtStr2
.arg(dispLabel)
.arg(dispValue)
.arg(dispIcon);
.arg(dispLabel, dispValue, dispIcon);
} else {
dynamicPart += rowFmtStr1
.arg(dispLabel)
.arg(dispValue);
.arg(dispLabel, dispValue);
}
++counter;
......@@ -161,7 +159,7 @@ QString StandardContactFormatter::toHtml(HtmlForm form) const
}
url = KStringHandler::tagUrls(url.toHtmlEscaped());
dynamicPart += rowFmtStr1.arg(i18n("Homepage")).arg(url);
dynamicPart += rowFmtStr1.arg(i18n("Homepage"), url);
}
// Blog Feed
......@@ -172,7 +170,8 @@ QString StandardContactFormatter::toHtml(HtmlForm form) const
// Addresses
counter = 0;
for (const KContacts::Address &address : rawContact.addresses()) {
const auto addresses = rawContact.addresses();
for (const KContacts::Address &address : addresses) {
QString formattedAddress;
if (address.label().isEmpty()) {
......@@ -292,7 +291,7 @@ QString StandardContactFormatter::toHtml(HtmlForm form) const
if (needToEscape) {
value = value.toHtmlEscaped();
}
customData += rowFmtStr1.arg(key).arg(value);
customData += rowFmtStr1.arg(key, value);
}
}
}
......
......@@ -28,7 +28,9 @@ int main(int argc, char **argv)
Akonadi::EmailAddressSelectionDialog dlg;
if (dlg.exec()) {
for (const Akonadi::EmailAddressSelection &selection : dlg.selectedAddresses()) {
const auto selectedAddress = dlg.selectedAddresses();
for (const Akonadi::EmailAddressSelection &selection : selectedAddress) {
qDebug("%s: %s", qPrintable(selection.name()), qPrintable(selection.email()));
}
}
......
......@@ -60,7 +60,8 @@ void MainWidget::showSelection()
mInfo->append(QStringLiteral("===========================\n"));
mInfo->append(QStringLiteral("Current selection:\n"));
for (const Akonadi::EmailAddressSelection &selection : mAddressesWidget->selectedAddresses()) {
const auto selectedAddress = mAddressesWidget->selectedAddresses();
for (const Akonadi::EmailAddressSelection &selection : selectedAddress) {
mInfo->append(QStringLiteral("%1: %2\n").arg(selection.name(), selection.email()));
}
}
......
......@@ -44,9 +44,9 @@ public:
void setPreferred(bool b);
void setReadOnly(bool readOnly);
Q_SIGNALS:
void addWidget(MailWidget *);
void removeWidget(MailWidget *);
void preferredChanged(MailWidget *);
void addWidget(ContactEditor::MailWidget *);
void removeWidget(ContactEditor::MailWidget *);
void preferredChanged(ContactEditor::MailWidget *);
private:
void slotAddMail();
......
......@@ -50,9 +50,9 @@ public:
void clearWidget();
void setReadOnly(bool readOnly);
Q_SIGNALS:
void addWidget(MessagingWidget *);
void removeWidget(MessagingWidget *);
void preferredChanged(MessagingWidget *);
void addWidget(ContactEditor::MessagingWidget *);
void removeWidget(ContactEditor::MessagingWidget *);
void preferredChanged(ContactEditor::MessagingWidget *);
private:
void slotAddMessaging();
......
......@@ -47,9 +47,9 @@ public:
void setReadOnly(bool readOnly);
Q_SIGNALS:
void addWidget(WebWidget *);
void removeWidget(WebWidget *);
void preferredChanged(WebWidget *);
void addWidget(ContactEditor::WebWidget *);
void removeWidget(ContactEditor::WebWidget *);
void preferredChanged(ContactEditor::WebWidget *);
private:
void slotRemoveWeb();
......
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