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 Device::availableLinks() const
|
||||||
{
|
{
|
||||||
QStringList sl;
|
QStringList sl;
|
||||||
|
sl.reserve(m_deviceLinks.size());
|
||||||
Q_FOREACH(DeviceLink* dl, m_deviceLinks) {
|
Q_FOREACH(DeviceLink* dl, m_deviceLinks) {
|
||||||
sl.append(dl->provider()->name());
|
sl.append(dl->provider()->name());
|
||||||
}
|
}
|
||||||
|
|
|
@ -109,8 +109,10 @@ void SendNotificationsConfig::save()
|
||||||
config()->set(QStringLiteral("generalUrgency"), m_ui->spin_urgency->value());
|
config()->set(QStringLiteral("generalUrgency"), m_ui->spin_urgency->value());
|
||||||
|
|
||||||
QVariantList list;
|
QVariantList list;
|
||||||
for (const auto& a: appModel->apps())
|
list.reserve(appModel->apps().size());
|
||||||
list << QVariant::fromValue<NotifyingApplication>(a);
|
for (const auto& a: appModel->apps()) {
|
||||||
|
list.append(QVariant::fromValue<NotifyingApplication>(a));
|
||||||
|
}
|
||||||
config()->setList(QStringLiteral("applications"), list);
|
config()->setList(QStringLiteral("applications"), list);
|
||||||
KCModule::save();
|
KCModule::save();
|
||||||
Q_EMIT changed(false);
|
Q_EMIT changed(false);
|
||||||
|
|
Loading…
Reference in a new issue