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 "Image.h" |
14 | #include "ImageLoaderJob.h" |
15 | |
16 | using namespace ThreadWeaver; |
17 | |
18 | ImageLoaderJob::ImageLoaderJob(Image *image, ThreadWeaver::ResourceRestrictionPolicy *throttle) |
19 | : m_image(image) |
20 | { |
21 | QMutexLocker l(mutex()); |
22 | assignQueuePolicy(throttle); |
23 | } |
24 | |
25 | int ImageLoaderJob::priority() const |
26 | { |
27 | return Image::Step_LoadImage; |
28 | } |
29 | |
30 | void ImageLoaderJob::run(JobPointer, Thread *) |
31 | { |
32 | Q_ASSERT(m_image); |
33 | m_image->loadImage(); |
34 | } |
35 |