aboutsummaryrefslogtreecommitdiff
path: root/jobs
AgeCommit message (Collapse)Author
2016-08-23Merge pull request #15 from Fxrh/kitsune-dropped-kcoreaddonsKitsuneRal
Upon discussion with @Fxrh in #quaternion, this now comes in master,
2016-07-28CleanupKitsune Ral
Removed unused #includes, fixed incorrect #endif comment.
2016-07-28Fixed double-emission of signal(s) on job timeout + general cleanupKitsune Ral
2016-07-27Introduce Status class + BaseJob::{checkReply,parseReply,parseJson} now ↵Kitsune Ral
return it This better fixes the contract for derived job classes and simplifies error reporting. Methods error() and errorString() are kept for back-compatibility; status() returns a combination of them, conveniently packed into a Status object. For a quick status check, Status::good() is provided.
2016-07-26Split BaseJob::gotReply into checkReply and parseReply + internal tweaks to ↵Kitsune Ral
BaseJob 1. The externally (for derived classes) visible additions are checkReply() and parseReply() virtual methods, with gotReply becoming a mere dispatcher (and therefore a private method). Splitting gotReply() in that way allowed to remove boilerplate code from MediaThumbnailJob. 2. The internal tweak is using QScopedPointer<> to store pointers both to the Private object and to a QNetworkReply (with a special deleter that aborts the reply before destructing the object). This allows to remove desperate attempts to call reply->abort() wherever it's no more needed (and not aborting the in-flight replies seems to be a/the culprit of Quaternion after-exit hangs).
2016-07-26Rewritten BaseJob to not depend on KJob.Kitsune Ral
Some parts of the code were copied from the KCoreAddons sources - surprisingly few, in fact, mostly API with comments. With this commit, libqmatrixclient doesn't depend on KCoreAddons.
2016-07-26Added a missing #include.Kitsune Ral
2016-07-26Log creation/deletion of jobs (especially SyncJob)Kitsune Ral
Due to signal-slot processing it's not obvious when exactly each job object is deleted.
2016-07-22Introduced LogoutJobKitsune Ral
The job calls the /logout endpoint of CS API that invalidates the passed access_token; a respective Connection::logout() method and Connection::loggedOut() signal are added for use in clients.
2016-07-22Separate errors of access denial kind to a different BaseJob error code as ↵Kitsune Ral
well + stability fixes 1. Introduce ContentAccessDenied error code to BaseJob to allow clients to treat access denial errors differently from other network errors. 2. Since parseJson() overrides are responsible for calling emitResult(), the "default" BaseJob::parseJson() should call emitResult() as well. 3. Make sure BaseJob::fail() doesn't crash in absence of QNetworkReply.
2016-07-22Removed unneeded Q_OBJECT macros (slots don't require Q_OBJECT to work).Kitsune Ral
2016-06-02Merge pull request #10 from ilpianista/masterKitsuneRal
Relax the Qt requirements down to 5.2.0
2016-05-30Require Qt 5.2.0Andrea Scarpino
2016-05-27Use 'override' keyword throughout job classes; constify apiPath(), query(), ↵Kitsune Ral
data() Thanks to CLang model.
2016-05-27Set the object name for each job, to make it clear which job has failedKitsune Ral
And we don't need two log lines for timeouts.
2016-05-27Use nullptrKitsune Ral
2016-05-27Don't assign the token twiceKitsune Ral
In a case when authentication doesn't even happen, PasswordLogin job won't run. The better place to assign (and log) the token is in Connection::connectWithToken(), therefore.
2016-05-26Load a different set of event lists depending on the join state (and ↵Kitsune Ral
actually introduce EventList class) This makes loading of room events more compliant with the spec, not trying to load from keys that are not supposed to be there. As a result of refactoring along the way, a dedicated QList<Event*> subclass is made that remembers the JSON key it should load from and actually load itself from a QJsonArray.
2016-05-26Introducing EventList class + minor fixKitsune Ral
Now you can parse a JSON array into a list of events with a one-liner. Also, fromMSecsSinceEpoch accepts a qint64, not quint64 - fixed the respective cast.
2016-05-06Enhanced logging of job failuresKitsune Ral
2016-05-06Make sure the QNetworkReply object is aborted at any failure and even silent ↵Kitsune Ral
destruction of the job
2016-05-06Add separate success() and failure() signals to BaseJobKitsune Ral
This is to facilitate processing of job results (see further commits).
2016-04-12Merge remote-tracking branch 'upstream/master'David A Roberts
2016-04-12Resolve Matrix SRV records.David A Roberts
2016-04-11Minor fixes and cleanupKitsune Ral
1. Remove accidental trailing \ 2. Show the contents of NetworkError in logs
2016-04-05Imported the current source tree from Quaternion/lib.Kitsune Ral