Known size, reserve.
This commit is contained in:
parent
b7bb8d94c5
commit
f41883f2f3
2 changed files with 5 additions and 2 deletions
|
@ -306,6 +306,7 @@ bool Device::isTrusted() const
|
|||
QStringList Device::availableLinks() const
|
||||
{
|
||||
QStringList sl;
|
||||
sl.reserve(m_deviceLinks.size());
|
||||
Q_FOREACH(DeviceLink* dl, m_deviceLinks) {
|
||||
sl.append(dl->provider()->name());
|
||||
}
|
||||
|
|
|
@ -109,8 +109,10 @@ void SendNotificationsConfig::save()
|
|||
config()->set(QStringLiteral("generalUrgency"), m_ui->spin_urgency->value());
|
||||
|
||||
QVariantList list;
|
||||
for (const auto& a: appModel->apps())
|
||||
list << QVariant::fromValue<NotifyingApplication>(a);
|
||||
list.reserve(appModel->apps().size());
|
||||
for (const auto& a: appModel->apps()) {
|
||||
list.append(QVariant::fromValue<NotifyingApplication>(a));
|
||||
}
|
||||
config()->setList(QStringLiteral("applications"), list);
|
||||
KCModule::save();
|
||||
Q_EMIT changed(false);
|
||||
|
|
Loading…
Reference in a new issue