1 | /* -*- C++ -*- |
---|---|
2 | This file is part of ThreadWeaver. |
3 | |
4 | SPDX-FileCopyrightText: 2005-2014 Mirko Boehm <mirko@kde.org> |
5 | |
6 | SPDX-License-Identifier: LGPL-2.0-or-later |
7 | */ |
8 | |
9 | #include <QMutexLocker> |
10 | |
11 | #include <ThreadWeaver/ResourceRestrictionPolicy> |
12 | |
13 | #include "ComputeThumbNailJob.h" |
14 | #include "Image.h" |
15 | |
16 | using namespace ThreadWeaver; |
17 | |
18 | ComputeThumbNailJob::ComputeThumbNailJob(Image *image, ThreadWeaver::ResourceRestrictionPolicy *throttle) |
19 | : m_image(image) |
20 | { |
21 | QMutexLocker l(mutex()); |
22 | assignQueuePolicy(throttle); |
23 | } |
24 | |
25 | int ComputeThumbNailJob::priority() const |
26 | { |
27 | return Image::Step_ComputeThumbNail; |
28 | } |
29 | |
30 | void ComputeThumbNailJob::run(JobPointer, Thread *) |
31 | { |
32 | Q_ASSERT(m_image); |
33 | m_image->computeThumbNail(); |
34 | } |
35 |