summaryrefslogtreecommitdiffstats
path: root/kbugbuster/backend/bugdetailsjob.cpp
blob: 70e0cad54e45da0a581c02447964b00386fd0ab6 (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

#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 TQByteArray &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"