summaryrefslogtreecommitdiffstats
path: root/kbugbuster/backend/bugdetailsjob.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kbugbuster/backend/bugdetailsjob.cpp')
-rw-r--r--kbugbuster/backend/bugdetailsjob.cpp50
1 files changed, 50 insertions, 0 deletions
diff --git a/kbugbuster/backend/bugdetailsjob.cpp b/kbugbuster/backend/bugdetailsjob.cpp
new file mode 100644
index 00000000..83599c1d
--- /dev/null
+++ b/kbugbuster/backend/bugdetailsjob.cpp
@@ -0,0 +1,50 @@
+
+#include "bugdetailsjob.h"
+#include "bug.h"
+#include "bugdetails.h"
+#include "bugdetailsimpl.h"
+#include "packageimpl.h"
+#include "bugserver.h"
+#include "processor.h"
+
+#include <kdebug.h>
+#include <assert.h>
+
+BugDetailsJob::BugDetailsJob( BugServer *server )
+ : BugJob( server )
+{
+}
+
+BugDetailsJob::~BugDetailsJob()
+{
+}
+
+void BugDetailsJob::start( const Bug &bug )
+{
+ m_bug = bug;
+
+ KURL bugUrl = server()->bugDetailsUrl( bug );
+
+ kdDebug() << "BugDetailsJob::start(): " << bugUrl.url() << endl;
+ BugJob::start( bugUrl );
+}
+
+void BugDetailsJob::process( const QByteArray &data )
+{
+ BugDetails bugDetails;
+
+ KBB::Error err = server()->processor()->parseBugDetails( data, bugDetails );
+
+ if ( err ) {
+ emit error( i18n("Bug %1: %2").arg( m_bug.number() )
+ .arg( err.message() ) );
+ } else {
+ emit bugDetailsAvailable( m_bug, bugDetails );
+ }
+}
+
+#include "bugdetailsjob.moc"
+
+/*
+ * vim:sw=4:ts=4:et
+ */