KIO

jobuidelegatefactory.cpp
1 /*
2  This file is part of the KDE libraries
3  SPDX-FileCopyrightText: 2013 David Faure <[email protected]>
4  SPDX-FileCopyrightText: 2022 Harald Sitter <[email protected]>
5 
6  SPDX-License-Identifier: LGPL-2.0-or-later
7 */
8 
9 #include <jobuidelegatefactory.h>
10 
11 using namespace KIO;
12 
14  : d(nullptr)
15 {
16 }
17 
19 
20 static JobUiDelegateFactory *s_factory = nullptr;
21 static JobUiDelegateFactoryV2 *s_factoryV2 = nullptr;
22 
24 {
25  return s_factory ? s_factory->createDelegate() : nullptr;
26 }
27 
29 {
30  return s_factoryV2 ? s_factoryV2->createDelegate(flags, window) : nullptr;
31 }
32 
33 #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 98)
35 {
36  return s_factory;
37 }
38 #endif
39 
40 JobUiDelegateFactoryV2 *KIO::defaultJobUiDelegateFactoryV2()
41 {
42  return s_factoryV2;
43 }
44 
45 #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 98)
47 {
48  s_factory = factory;
49 }
50 #endif
51 
52 void KIO::setDefaultJobUiDelegateFactoryV2(JobUiDelegateFactoryV2 *factory)
53 {
54  s_factoryV2 = factory;
55  s_factory = factory;
56 }
KIOCORE_EXPORT JobUiDelegateFactory * defaultJobUiDelegateFactory()
Returns the default job UI delegate factory to be used by all KIO jobs (in which HideProgressInfo is ...
KIOCORE_EXPORT JobUiDelegateFactoryV2 * defaultJobUiDelegateFactoryV2()
Returns the default job UI delegate factory to be used by all KIO jobs (in which HideProgressInfo is ...
KIOCORE_EXPORT void setDefaultJobUiDelegateFactoryV2(JobUiDelegateFactoryV2 *factory)
Internal.
virtual ~JobUiDelegateFactory()
Destructor.
KIOCORE_EXPORT KJobUiDelegate * createDefaultJobUiDelegate()
Convenience method: use default factory, if there's one, to create a delegate and return it.
A namespace for KIO globals.
KIOCORE_EXPORT void setDefaultJobUiDelegateFactory(JobUiDelegateFactory *factory)
Internal.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Dec 5 2023 03:55:24 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.