Changeset View
Changeset View
Standalone View
Standalone View
krusader/Panel/krpreviewjob.cpp
Show All 36 Lines | |||||
37 | // view becomes unresponsive during load if set too high | 37 | // view becomes unresponsive during load if set too high | ||
38 | #define MAX_CHUNK_SIZE 50 | 38 | #define MAX_CHUNK_SIZE 50 | ||
39 | 39 | | |||
40 | 40 | | |||
41 | KrPreviewJob::KrPreviewJob(KrPreviews *parent) : _job(0), _parent(parent) | 41 | KrPreviewJob::KrPreviewJob(KrPreviews *parent) : _job(0), _parent(parent) | ||
42 | { | 42 | { | ||
43 | _timer.setSingleShot(true); | 43 | _timer.setSingleShot(true); | ||
44 | _timer.setInterval(0); | 44 | _timer.setInterval(0); | ||
45 | connect(&_timer, SIGNAL(timeout()), SLOT(slotStartJob())); | 45 | connect(&_timer, &QTimer::timeout, this, &KrPreviewJob::slotStartJob); | ||
46 | } | 46 | } | ||
47 | 47 | | |||
48 | KrPreviewJob::~KrPreviewJob() | 48 | KrPreviewJob::~KrPreviewJob() | ||
49 | { | 49 | { | ||
50 | doKill(); | 50 | doKill(); | ||
51 | } | 51 | } | ||
52 | 52 | | |||
53 | void KrPreviewJob::scheduleItem(KrViewItem *item) | 53 | void KrPreviewJob::scheduleItem(KrViewItem *item) | ||
▲ Show 20 Lines • Show All 54 Lines • ▼ Show 20 Line(s) | 106 | for(int i = 0; i < _scheduled.count() && i < MAX_CHUNK_SIZE; i++) { | |||
108 | list.append(fi); | 108 | list.append(fi); | ||
109 | _hash.insert(fi, _scheduled[i]); | 109 | _hash.insert(fi, _scheduled[i]); | ||
110 | } | 110 | } | ||
111 | QStringList allPlugins = KIO::PreviewJob::availablePlugins(); | 111 | QStringList allPlugins = KIO::PreviewJob::availablePlugins(); | ||
112 | _job = new KIO::PreviewJob(list, QSize(size, size), &allPlugins); | 112 | _job = new KIO::PreviewJob(list, QSize(size, size), &allPlugins); | ||
113 | _job->setOverlayIconAlpha(0); | 113 | _job->setOverlayIconAlpha(0); | ||
114 | _job->setOverlayIconSize(0); | 114 | _job->setOverlayIconSize(0); | ||
115 | _job->setScaleType(KIO::PreviewJob::ScaledAndCached); | 115 | _job->setScaleType(KIO::PreviewJob::ScaledAndCached); | ||
116 | connect(_job, SIGNAL(gotPreview(KFileItem,QPixmap)), SLOT(slotGotPreview(KFileItem,QPixmap))); | 116 | connect(_job, &KIO::PreviewJob::gotPreview, this, &KrPreviewJob::slotGotPreview); | ||
117 | connect(_job, SIGNAL(failed(KFileItem)), SLOT(slotFailed(KFileItem))); | 117 | connect(_job, &KIO::PreviewJob::failed, this, &KrPreviewJob::slotFailed); | ||
118 | connect(_job, SIGNAL(result(KJob*)), SLOT(slotJobResult(KJob*))); | 118 | connect(_job, &KIO::PreviewJob::result, this, &KrPreviewJob::slotJobResult); | ||
119 | } | 119 | } | ||
120 | 120 | | |||
121 | void KrPreviewJob::slotJobResult(KJob *job) | 121 | void KrPreviewJob::slotJobResult(KJob *job) | ||
122 | { | 122 | { | ||
123 | (void) job; | 123 | (void) job; | ||
124 | 124 | | |||
125 | if(!disconnect(_job, 0, this, 0)) | 125 | if(!disconnect(_job, 0, this, 0)) | ||
126 | abort(); | 126 | abort(); | ||
Show All 36 Lines |