Changeset View
Changeset View
Standalone View
Standalone View
src/aboutdialog/libattica-ocsclient/knowledgebasejob.cpp
Show All 37 Lines | |||||
38 | 38 | | |||
39 | void KnowledgeBaseJob::setUrl( const QUrl &url ) | 39 | void KnowledgeBaseJob::setUrl( const QUrl &url ) | ||
40 | { | 40 | { | ||
41 | m_url = url; | 41 | m_url = url; | ||
42 | } | 42 | } | ||
43 | 43 | | |||
44 | void KnowledgeBaseJob::start() | 44 | void KnowledgeBaseJob::start() | ||
45 | { | 45 | { | ||
46 | QTimer::singleShot( 0, this, SLOT(doWork()) ); | 46 | QTimer::singleShot( 0, this, &KnowledgeBaseJob::doWork ); | ||
47 | } | 47 | } | ||
48 | 48 | | |||
49 | KnowledgeBase KnowledgeBaseJob::knowledgeBase() const | 49 | KnowledgeBase KnowledgeBaseJob::knowledgeBase() const | ||
50 | { | 50 | { | ||
51 | return m_knowledgeBase; | 51 | return m_knowledgeBase; | ||
52 | } | 52 | } | ||
53 | 53 | | |||
54 | KnowledgeBase::Metadata KnowledgeBaseJob::metadata() const | 54 | KnowledgeBase::Metadata KnowledgeBaseJob::metadata() const | ||
55 | { | 55 | { | ||
56 | return m_metadata; | 56 | return m_metadata; | ||
57 | } | 57 | } | ||
58 | 58 | | |||
59 | void KnowledgeBaseJob::doWork() | 59 | void KnowledgeBaseJob::doWork() | ||
60 | { | 60 | { | ||
61 | qDebug() << m_url; | 61 | qDebug() << m_url; | ||
62 | 62 | | |||
63 | m_job = KIO::get( m_url, KIO::NoReload, KIO::HideProgressInfo ); | 63 | auto job = KIO::get( m_url, KIO::NoReload, KIO::HideProgressInfo ); | ||
64 | connect( m_job, SIGNAL(result(KJob*)), | 64 | connect( job, &KIO::TransferJob::result, | ||
65 | SLOT(slotJobResult(KJob*)) ); | 65 | this, &KnowledgeBaseJob::slotJobResult ); | ||
66 | connect( m_job, SIGNAL(data(KIO::Job*,QByteArray)), | 66 | connect( job, &KIO::TransferJob::data, | ||
67 | SLOT(slotJobData(KIO::Job*,QByteArray)) ); | 67 | this, &KnowledgeBaseJob::slotJobData ); | ||
68 | | ||||
69 | m_job = job; | ||||
68 | } | 70 | } | ||
69 | 71 | | |||
70 | void KnowledgeBaseJob::slotJobResult( KJob *job ) | 72 | void KnowledgeBaseJob::slotJobResult( KJob *job ) | ||
71 | { | 73 | { | ||
72 | m_job = 0; | 74 | m_job = 0; | ||
73 | 75 | | |||
74 | if ( job->error() ) { | 76 | if ( job->error() ) { | ||
75 | setError( job->error() ); | 77 | setError( job->error() ); | ||
Show All 16 Lines |