Database *MyList::database() const
{
- return db;
+ if (QThread::currentThread() == thread())
+ return db;
+ // FIXME figure work thread case
+ return workThread->database();
}
Settings *MyList::settings() const
request.fid = fid;
request.setMyWatched = true;
request.myWatched = when;
- db->addPendingMyListUpdate(request);
+ database()->addPendingMyListUpdate(request);
}
if (sourceHost == hostId())
return path;
- QList<PathMapping> mappings = db->getMappingsToHost(hostId());
+ QList<PathMapping> mappings = database()->getMappingsToHost(hostId());
foreach(const PathMapping &pm, mappings)
{
QString MyList::mapPathToSource(const QString &path, int *sourceHost)
{
- QList<PathMapping> mappings = db->getMappingsToHost(hostId());
+ QList<PathMapping> mappings = database()->getMappingsToHost(hostId());
foreach(const PathMapping &pm, mappings)
{