MCPcopy Create free account
hub / github.com/KDE/gwenview / scheduleImageDownSampling

Method scheduleImageDownSampling

lib/document/document.cpp:97–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95}
96
97void DocumentPrivate::scheduleImageDownSampling(int invertedZoom)
98{
99 LOG("invertedZoom=" << invertedZoom);
100 auto job = qobject_cast<DownSamplingJob *>(mCurrentJob.data());
101 if (job && job->mInvertedZoom == invertedZoom) {
102 LOG("Current job is already doing it");
103 return;
104 }
105
106 // Remove any previously scheduled downsampling job
107 DocumentJobQueue::Iterator it;
108 for (it = mJobQueue.begin(); it != mJobQueue.end(); ++it) {
109 auto job = qobject_cast<DownSamplingJob *>(*it);
110 if (!job) {
111 continue;
112 }
113 if (job->mInvertedZoom == invertedZoom) {
114 // Already scheduled, nothing to do
115 LOG("Already scheduled");
116 return;
117 } else {
118 LOG("Removing downsampling job");
119 mJobQueue.erase(it);
120 delete job;
121 }
122 }
123 q->enqueueJob(new DownSamplingJob(invertedZoom));
124}
125
126void DocumentPrivate::downSampleImage(int invertedZoom)
127{

Callers 1

Calls 2

enqueueJobMethod · 0.80
dataMethod · 0.45

Tested by

no test coverage detected