1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "libraryinitthread.h"
#include "library.h"
LibraryInitThread::LibraryInitThread(Library& library, BaseConfig &config, QThread* libraryThread, QObject *parent) :
QThread(parent),
library(library),
config(config),
libraryThread(libraryThread)
{
}
// this is some fucked up boilerplate.
void LibraryInitThread::run() {
library.readAll(false);
QList<TvShow*> shows = library.filter().all();
for (TvShow* show : shows) {
show->moveToThread(libraryThread);
show->setParent(this);
}
emit(library.initDone());
}