File indexing completed on 2024-09-08 03:38:48
0001 /* 0002 This file is part of the KDE libraries 0003 SPDX-FileCopyrightText: 2013 David Faure <faure@kde.org> 0004 SPDX-FileCopyrightText: 2022 Harald Sitter <sitter@kde.org> 0005 0006 SPDX-License-Identifier: LGPL-2.0-or-later 0007 */ 0008 0009 #include <jobuidelegatefactory.h> 0010 0011 using namespace KIO; 0012 0013 JobUiDelegateFactory::JobUiDelegateFactory() 0014 : d(nullptr) 0015 { 0016 } 0017 0018 JobUiDelegateFactory::~JobUiDelegateFactory() = default; 0019 0020 static JobUiDelegateFactory *s_factory = nullptr; 0021 0022 KJobUiDelegate *KIO::createDefaultJobUiDelegate() 0023 { 0024 return s_factory ? s_factory->createDelegate() : nullptr; 0025 } 0026 0027 KJobUiDelegate *KIO::createDefaultJobUiDelegate(KJobUiDelegate::Flags flags, QWidget *window) 0028 { 0029 return s_factory ? s_factory->createDelegate(flags, window) : nullptr; 0030 } 0031 0032 JobUiDelegateFactory *KIO::defaultJobUiDelegateFactory() 0033 { 0034 return s_factory; 0035 } 0036 0037 void KIO::setDefaultJobUiDelegateFactory(JobUiDelegateFactory *factory) 0038 { 0039 s_factory = factory; 0040 }