Changes in SqlQueryMaker.cpp

Aroonav Mishra aroonav11 at gmail.com
Thu Oct 29 18:57:35 UTC 2015


Hello all,

KF5::ThreadWeaver is not very well documented and the docs available for
it's porting is inadequate. And due to this, porting this part was tricky &
took up quite a bit of my time.

I will be explaining all the changes that I made in here
<https://quickgit.kde.org/?p=amarok.git&a=blobdiff&h=15c1b0b28d8865a56b37da04e919e6e803a3454d&hp=b4427f2db1126f05bb10b57216a47070f14acfe3&f=src%2Fcore-impl%2Fcollections%2Fdb%2Fsql%2FSqlQueryMaker.cpp&hb=adee016bdeb5ea747e45f88beb42c58f4521d492>.
(which also includes some of the changes that I have mentioned here
<https://mail.kde.org/pipermail/amarok-devel/2015-July/013486.html>)

In the constructor call,ThreadWeaver::Job no longer inherits QObject in
KF5. Hence it only seemed logical to add QObject into the inheritance
hierarchy(and subsequently the constructor call too).

The pure virtual function ThreadWeaver::Job::run() prototype has changed
and hence 2 new formal parameters have been added in the SqlWorkerThread. I
had set a default value to each of these 2 new parameters. I neither saw a
benefit nor a way of using these new parameters. The first default
parameter is QSharedPointer<TheradWeaver::Job>() which returns a
QSharedPointer pointing to null. The second default parameter is
self-explanatory. The Q_UNUSED has been added to suppress the warnings of
non-usage of these parameters.

defaultBegin(), defaultEnd() and the signals(started, done, failed) have
been removed in KF5::ThreadWeaver::Job and these have been moved into
QObjectDecorator class. QObjectDecorator is a wrapper class that wraps
around the Job object. I faced problems in using QObjectDecorator & hence I
had directly added these(the functions and the signals) into the
SqlWorkerThread class itself.

d->worker->deleteLater(); This is one part which I hadn't paid much
attention before until now. Rishabh has identified the issue in the recent
review request #125872 <https://git.reviewboard.kde.org/r/125872/> to be
here. I have suggested the modifications in the comments.

Thank you,
Aroonav Mishra.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/amarok-devel/attachments/20151030/bd9287b1/attachment.html>


More information about the Amarok-devel mailing list