1 | /* |
---|---|
2 | This file is part of the KDE libraries |
3 | SPDX-FileCopyrightText: 2013 David Faure <faure@kde.org> |
4 | SPDX-FileCopyrightText: 2022 Harald Sitter <sitter@kde.org> |
5 | |
6 | SPDX-License-Identifier: LGPL-2.0-or-later |
7 | */ |
8 | |
9 | #include <jobuidelegatefactory.h> |
10 | |
11 | using namespace KIO; |
12 | |
13 | JobUiDelegateFactory::JobUiDelegateFactory() |
14 | : d(nullptr) |
15 | { |
16 | } |
17 | |
18 | JobUiDelegateFactory::~JobUiDelegateFactory() = default; |
19 | |
20 | static JobUiDelegateFactory *s_factory = nullptr; |
21 | |
22 | KJobUiDelegate *KIO::createDefaultJobUiDelegate() |
23 | { |
24 | return s_factory ? s_factory->createDelegate() : nullptr; |
25 | } |
26 | |
27 | KJobUiDelegate *KIO::createDefaultJobUiDelegate(KJobUiDelegate::Flags flags, QWidget *window) |
28 | { |
29 | return s_factory ? s_factory->createDelegate(flags, window) : nullptr; |
30 | } |
31 | |
32 | JobUiDelegateFactory *KIO::defaultJobUiDelegateFactory() |
33 | { |
34 | return s_factory; |
35 | } |
36 | |
37 | void KIO::setDefaultJobUiDelegateFactory(JobUiDelegateFactory *factory) |
38 | { |
39 | s_factory = factory; |
40 | } |
41 |