diff options
author | Felix Rohrbach <fxrh@gmx.de> | 2016-05-08 18:59:11 +0200 |
---|---|---|
committer | Felix Rohrbach <fxrh@gmx.de> | 2016-05-08 18:59:11 +0200 |
commit | 1cd8802c73ee3c0cc0095f8be30a9bbf3442c3ca (patch) | |
tree | fa0f4aded71f27974c9922bd587ba78774ade46c /connectionprivate.cpp | |
parent | fc95edb7a63bcacb02418c55e15a1aa21ac080cd (diff) | |
parent | 5a0e6080a6245aa2c68f254d7105f19629a5a654 (diff) | |
download | libquotient-1cd8802c73ee3c0cc0095f8be30a9bbf3442c3ca.tar.gz libquotient-1cd8802c73ee3c0cc0095f8be30a9bbf3442c3ca.zip |
Merge pull request #5 from KitsuneRal/basejob-improvement
Basejob improvement
Diffstat (limited to 'connectionprivate.cpp')
-rw-r--r-- | connectionprivate.cpp | 122 |
1 files changed, 61 insertions, 61 deletions
diff --git a/connectionprivate.cpp b/connectionprivate.cpp index 851e3d58..bcca8744 100644 --- a/connectionprivate.cpp +++ b/connectionprivate.cpp @@ -116,67 +116,67 @@ Room* ConnectionPrivate::provideRoom(QString id) return room; } -void ConnectionPrivate::connectDone(KJob* job) -{ - PasswordLogin* realJob = static_cast<PasswordLogin*>(job); - if( !realJob->error() ) - { - isConnected = true; - userId = realJob->id(); - qDebug() << "Our user ID: " << userId; - emit q->connected(); - } - else { - emit q->loginError( job->errorString() ); - } -} - -void ConnectionPrivate::reconnectDone(KJob* job) -{ - PasswordLogin* realJob = static_cast<PasswordLogin*>(job); - if( !realJob->error() ) - { - userId = realJob->id(); - emit q->reconnected(); - } - else { - emit q->loginError( job->errorString() ); - isConnected = false; - } -} - -void ConnectionPrivate::syncDone(KJob* job) -{ - SyncJob* syncJob = static_cast<SyncJob*>(job); - if( !syncJob->error() ) - { - data->setLastEvent(syncJob->nextBatch()); - processRooms(syncJob->roomData()); - emit q->syncDone(); - } - else { - if( syncJob->error() == BaseJob::NetworkError ) - emit q->connectionError( syncJob->errorString() ); - else - qDebug() << "syncJob failed, error:" << syncJob->error(); - } -} - -void ConnectionPrivate::gotJoinRoom(KJob* job) -{ - qDebug() << "gotJoinRoom"; - JoinRoomJob* joinJob = static_cast<JoinRoomJob*>(job); - if( !joinJob->error() ) - { - if ( Room* r = provideRoom(joinJob->roomId()) ) - emit q->joinedRoom(r); - } - else - { - if( joinJob->error() == BaseJob::NetworkError ) - emit q->connectionError( joinJob->errorString() ); - } -} +//void ConnectionPrivate::connectDone(KJob* job) +//{ +// PasswordLogin* realJob = static_cast<PasswordLogin*>(job); +// if( !realJob->error() ) +// { +// isConnected = true; +// userId = realJob->id(); +// qDebug() << "Our user ID: " << userId; +// emit q->connected(); +// } +// else { +// emit q->loginError( job->errorString() ); +// } +//} + +//void ConnectionPrivate::reconnectDone(KJob* job) +//{ +// PasswordLogin* realJob = static_cast<PasswordLogin*>(job); +// if( !realJob->error() ) +// { +// userId = realJob->id(); +// emit q->reconnected(); +// } +// else { +// emit q->loginError( job->errorString() ); +// isConnected = false; +// } +//} + +//void ConnectionPrivate::syncDone(KJob* job) +//{ +// SyncJob* syncJob = static_cast<SyncJob*>(job); +// if( !syncJob->error() ) +// { +// data->setLastEvent(syncJob->nextBatch()); +// processRooms(syncJob->roomData()); +// emit q->syncDone(); +// } +// else { +// if( syncJob->error() == BaseJob::NetworkError ) +// emit q->connectionError( syncJob->errorString() ); +// else +// qDebug() << "syncJob failed, error:" << syncJob->error(); +// } +//} + +//void ConnectionPrivate::gotJoinRoom(KJob* job) +//{ +// qDebug() << "gotJoinRoom"; +// JoinRoomJob* joinJob = static_cast<JoinRoomJob*>(job); +// if( !joinJob->error() ) +// { +// if ( Room* r = provideRoom(joinJob->roomId()) ) +// emit q->joinedRoom(r); +// } +// else +// { +// if( joinJob->error() == BaseJob::NetworkError ) +// emit q->connectionError( joinJob->errorString() ); +// } +//} void ConnectionPrivate::gotRoomMembers(KJob* job) { |