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

source code of threadweaver/examples/ThumbNailer/FileLoaderJob.cpp