+ int connectionId = _nextConnectionId++;
+
+ Connection *connection = new Connection(QLatin1String(QString("quassel_connection_%1").arg(connectionId).toLatin1()));
+ connection->moveToThread(currentThread);
+ connect(this, SIGNAL(destroyed()), connection, SLOT(deleteLater()));
+ connect(currentThread, SIGNAL(destroyed()), connection, SLOT(deleteLater()));
+ connect(connection, SIGNAL(destroyed()), this, SLOT(connectionDestroyed()));
+ _connectionPool[currentThread] = connection;
+
+ QSqlDatabase db = QSqlDatabase::addDatabase(driverName(), connection->name());