start timer with invokeMethod

rectSaveTimer is used to event compress the save and sync of the
configuration file that is used as a cache of the rectangles of
svg items (in order to avoid svg renderers creation when possible)
there is exactly one situation where it seems to not work: during
creation of svgitems/framesvgitems, insertintorectcache ends up
being called by another thread than the Theme's qobject thread,
and that is not allowed.

with invokeMethod the timer will be started by the correct thread
REVIEW:122915

Change-Id: I3ff4a4ebd1dfdba4b9b830fe6c08feece19b903e
This commit is contained in:
Marco Martin 2015-03-12 15:15:45 +01:00
parent 082ee9aad3
commit 80d5a6fdda

View File

@ -28,6 +28,7 @@
#include <QPair>
#include <QStringBuilder>
#include <QTimer>
#include <QThread>
#include "config-plasma.h"
@ -417,7 +418,7 @@ void Theme::insertIntoRectsCache(const QString &image, const QString &element, c
}
}
d->rectSaveTimer->start();
QMetaObject::invokeMethod(d->rectSaveTimer, "start");
}
void Theme::invalidateRectsCache(const QString &image)