diff --git a/nepomuk/core/resourcedata.cpp b/nepomuk/core/resourcedata.cpp index abe55ea..e65e66e 100644 --- a/nepomuk/core/resourcedata.cpp +++ b/nepomuk/core/resourcedata.cpp @@ -175,7 +175,7 @@ void Nepomuk::ResourceData::resetAll( bool isDelete ) if( !m_uri.isEmpty() ) { m_rm->m_initializedData.remove( m_uri ); if( m_rm->m_watcher && m_addedToWatcher ) { - m_rm->m_watcher->removeResource(Resource::fromResourceUri(m_uri)); + QMetaObject::invokeMethod(m_rm->m_watcher, "removeResource", Qt::AutoConnection, Q_ARG(Nepomuk::Resource, Resource::fromResourceUri(m_uri))); m_addedToWatcher = false; } } @@ -394,15 +394,16 @@ bool Nepomuk::ResourceData::load() if(!m_rm->m_watcher) { m_rm->m_watcher = new ResourceWatcher(m_rm->m_manager); + m_rm->m_watcher->moveToThread(m_rm->m_manager->thread()); QObject::connect( m_rm->m_watcher, SIGNAL(propertyAdded(Nepomuk::Resource, Nepomuk::Types::Property, QVariant)), m_rm->m_manager, SLOT(slotPropertyAdded(Nepomuk::Resource, Nepomuk::Types::Property, QVariant)) ); QObject::connect( m_rm->m_watcher, SIGNAL(propertyRemoved(Nepomuk::Resource, Nepomuk::Types::Property, QVariant)), m_rm->m_manager, SLOT(slotPropertyRemoved(Nepomuk::Resource, Nepomuk::Types::Property, QVariant)) ); m_rm->m_watcher->addResource( Nepomuk::Resource::fromResourceUri(m_uri) ); - m_rm->m_watcher->start(); + QMetaObject::invokeMethod(m_rm->m_watcher, "start", Qt::AutoConnection); } else { - m_rm->m_watcher->addResource( Nepomuk::Resource::fromResourceUri(m_uri) ); + QMetaObject::invokeMethod(m_rm->m_watcher, "addResource", Qt::AutoConnection, Q_ARG(Nepomuk::Resource, Nepomuk::Resource::fromResourceUri(m_uri)) ); } m_addedToWatcher = true; diff --git a/nepomuk/core/resourcewatcher.h b/nepomuk/core/resourcewatcher.h index 06b9622..92b12f5 100644 --- a/nepomuk/core/resourcewatcher.h +++ b/nepomuk/core/resourcewatcher.h @@ -93,6 +93,7 @@ namespace Nepomuk { */ virtual ~ResourceWatcher(); + public Q_SLOTS: /** * \brief Add a type to be watched. * @@ -204,7 +205,6 @@ namespace Nepomuk { */ QList properties() const; - public Q_SLOTS: /** * \brief Start the signalling of changes. *