summaryrefslogtreecommitdiffstats
path: root/kbugbuster/backend/bugdetailsjob.cpp
blob: 83599c1d095c9dd3736e21adfdd358c6604ba5af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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
 */