kded: check if timer is active instead of using member as re-creation guard

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2022-05-26 13:18:02 +03:00
parent 84afe0c4a9
commit 5968bc3c46
2 changed files with 4 additions and 8 deletions

View file

@ -88,7 +88,6 @@ Kded::Kded(QObject *parent)
: QObject(parent),
m_pDirWatch(nullptr),
m_pTimer(nullptr),
m_recreateBusy(false),
m_serviceWatcher(nullptr)
{
_self = this;
@ -453,19 +452,18 @@ void Kded::updateResourceList()
void Kded::recreate()
{
m_recreateBusy = true;
updateDirWatch(); // this would search all the directories
runBuildSycoca();
updateResourceList();
m_recreateBusy = false;
initModules();
}
void Kded::update(const QString& )
void Kded::update(const QString& path)
{
if (!m_recreateBusy) {
m_pTimer->start(10000);
Q_UNUSED(path);
if (!m_pTimer->isActive()) {
m_pTimer->start(5000);
}
}

View file

@ -178,8 +178,6 @@ private:
*/
QTimer* m_pTimer;
bool m_recreateBusy;
QHash<QString,KDEDModule *> m_modules;
//QHash<QString,QLibrary *> m_libs;
QHash<QString,QObject *> m_dontLoad;