kded: Kded::updateDirWatch() optimization

KDirWatch already checks if the path is added and appends trailing slash
as neccessary

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2023-07-03 13:15:55 +03:00
parent 9916fcdce9
commit 3380664558

View file

@ -452,15 +452,7 @@ void Kded::updateDirWatch()
connect(m_pDirWatch, SIGNAL(dirty(QString)), this, SLOT(update(QString)));
foreach(const QString &it, m_allResourceDirs) {
QString path(it);
if (!path.endsWith('/')) {
path += '/';
}
// Already seen this one?
if (m_pDirWatch->contains(path)) {
continue;
}
m_pDirWatch->addDir(path, true);
m_pDirWatch->addDir(it, true);
}
}