Changeset View
Changeset View
Standalone View
Standalone View
src/core/imageloader.cpp
- This file was moved from src/ui/imageloader.cpp.
Context not available. | |||||
18 | 18 | | |||
---|---|---|---|---|---|
19 | #include "imageloader_p.h" | 19 | #include "imageloader_p.h" | ||
20 | 20 | | |||
21 | #include <kio/job.h> | | |||
22 | #include <kio/scheduler.h> | | |||
23 | | ||||
24 | #include <QtCore/QFile> | 21 | #include <QtCore/QFile> | ||
25 | 22 | | |||
26 | using namespace KNS3; | 23 | using namespace KNSCore; | ||
27 | 24 | | |||
28 | ImageLoader::ImageLoader(const EntryInternal &entry, EntryInternal::PreviewType type, QObject *parent) | 25 | ImageLoader::ImageLoader(const EntryInternal &entry, EntryInternal::PreviewType type, QObject *parent) | ||
29 | : QObject(parent) | 26 | : QObject(parent) | ||
Context not available. | |||||
36 | { | 33 | { | ||
37 | QUrl url(m_entry.previewUrl(m_previewType)); | 34 | QUrl url(m_entry.previewUrl(m_previewType)); | ||
38 | if (!url.isEmpty()) { | 35 | if (!url.isEmpty()) { | ||
39 | m_job = KIO::get(url, KIO::NoReload, KIO::HideProgressInfo); | 36 | m_job = HTTPJob::get(url, NoReload, JobFlag::HideProgressInfo); | ||
40 | connect(m_job, &KJob::result, this, &ImageLoader::slotDownload); | 37 | connect(m_job, &KJob::result, this, &ImageLoader::slotDownload); | ||
41 | connect(m_job, &KIO::TransferJob::data, this, &ImageLoader::slotData); | 38 | connect(m_job, &HTTPJob::data, this, &ImageLoader::slotData); | ||
42 | KIO::Scheduler::setJobPriority(m_job, 1); | | |||
43 | } | 39 | } | ||
44 | } | 40 | } | ||
45 | 41 | | |||
Context not available. | |||||
48 | return m_job; | 44 | return m_job; | ||
49 | } | 45 | } | ||
50 | 46 | | |||
51 | void ImageLoader::slotData(KIO::Job *job, const QByteArray &buf) | 47 | void ImageLoader::slotData(KJob *job, const QByteArray &buf) | ||
52 | { | 48 | { | ||
53 | Q_UNUSED(job) | 49 | Q_UNUSED(job) | ||
54 | m_buffer.append(buf); | 50 | m_buffer.append(buf); | ||
Context not available. |