<table><tr><td style="">sitter updated this revision to Diff 53953.<br />sitter added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D19612">View Revision</a></tr></table><br /><div><div><p>competing api design on commentsclient::getfrombug2</p>
<p>this has some more cruft but looks nicer from a usage POV IMO</p>
<p>it's basically lambda chaining originating in a signal...<br />
instead of return a kjob the getter returns an APIReply.<br />
APIReply is a templated, not-moc'd QObject which wraps an APIJob.<br />
it's a QObject so we can easily place it as a chield under the "context"<br />
object (i.e. the bugzillamanager instance).<br />
the api getter sets a constructor function which knows how to marshal<br />
kjob data into the intended return type, returns the reply to the<br />
consumer and the consumer sets a handler which will get the marshalled<br />
concrete data from the constructor.<br />
the APIReply then connects to the kjob as per usual.<br />
when the job finishes an internal lambda is called which calls the<br />
constructor to get the concrete type and then calls the handler with that</p>
<p>while that looks lovely I am not sure this actually is going to work.<br />
specifically with how exception handling works this would currently issue<br />
the exception in the slot and that is not safe to do AFAIK</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R871 DrKonqi</div></div></div><br /><div><strong>CHANGES SINCE LAST UPDATE</strong><div><a href="https://phabricator.kde.org/D19612?vs=53889&id=53953">https://phabricator.kde.org/D19612?vs=53889&id=53953</a></div></div><br /><div><strong>BRANCH</strong><div><div>webservice</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D19612">https://phabricator.kde.org/D19612</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>CMakeLists.txt<br />
src/CMakeLists.txt<br />
src/bugzillaintegration/bugzillalib.cpp<br />
src/bugzillaintegration/bugzillalib.h<br />
src/bugzillaintegration/duplicatefinderjob.cpp<br />
src/bugzillaintegration/duplicatefinderjob.h<br />
src/bugzillaintegration/libbugzilla/CMakeLists.txt<br />
src/bugzillaintegration/libbugzilla/attachment.cpp<br />
src/bugzillaintegration/libbugzilla/attachment.h<br />
src/bugzillaintegration/libbugzilla/autotests/CMakeLists.txt<br />
src/bugzillaintegration/libbugzilla/autotests/bugtest.cpp<br />
src/bugzillaintegration/libbugzilla/autotests/bugzillatest.cpp<br />
src/bugzillaintegration/libbugzilla/autotests/connectiontest.cpp<br />
src/bugzillaintegration/libbugzilla/autotests/data/bugs.dragonplayer.json<br />
src/bugzillaintegration/libbugzilla/autotests/data/error.http<br />
src/bugzillaintegration/libbugzilla/autotests/data/hi.http<br />
src/bugzillaintegration/libbugzilla/autotests/data/product.dragonplayer.json<br />
src/bugzillaintegration/libbugzilla/autotests/data/put.http<br />
src/bugzillaintegration/libbugzilla/autotests/producttest.cpp<br />
src/bugzillaintegration/libbugzilla/bug.cpp<br />
src/bugzillaintegration/libbugzilla/bug.h<br />
src/bugzillaintegration/libbugzilla/bugzilla.cpp<br />
src/bugzillaintegration/libbugzilla/bugzilla.h<br />
src/bugzillaintegration/libbugzilla/comment.cpp<br />
src/bugzillaintegration/libbugzilla/comment.h<br />
src/bugzillaintegration/libbugzilla/connection.cpp<br />
src/bugzillaintegration/libbugzilla/connection.h<br />
src/bugzillaintegration/libbugzilla/product.cpp<br />
src/bugzillaintegration/libbugzilla/product.h<br />
src/bugzillaintegration/parsebugbacktraces.cpp<br />
src/bugzillaintegration/parsebugbacktraces.h<br />
src/bugzillaintegration/productmapping.cpp<br />
src/bugzillaintegration/productmapping.h<br />
src/bugzillaintegration/reportassistantpages_base.cpp<br />
src/bugzillaintegration/reportassistantpages_bugzilla.cpp<br />
src/bugzillaintegration/reportassistantpages_bugzilla.h<br />
src/bugzillaintegration/reportassistantpages_bugzilla_duplicates.cpp<br />
src/bugzillaintegration/reportassistantpages_bugzilla_duplicates.h<br />
src/bugzillaintegration/reportinterface.cpp<br />
src/bugzillaintegration/reportinterface.h<br />
src/drkonqi.cpp</div></div></div><br /><div><strong>To: </strong>sitter<br /><strong>Cc: </strong>plasma-devel, jraleigh, GB_2, ragreen, Pitel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart<br /></div>