1/*
2 This file is part of the KDE project
3 SPDX-FileCopyrightText: 1998, 1999 Torben Weis <weis@kde.org>
4 SPDX-FileCopyrightText: 2000 Carsten Pfeiffer <pfeiffer@kde.org>
5 SPDX-FileCopyrightText: 2003-2005 David Faure <faure@kde.org>
6 SPDX-FileCopyrightText: 2001-2006 Michael Brade <brade@kde.org>
7
8 SPDX-License-Identifier: LGPL-2.0-or-later
9*/
10
11#include "kdirlister.h"
12#include <KJobUiDelegate>
13#include <KJobWidgets>
14#include <kio/listjob.h>
15
16#include <QWidget>
17
18class KDirListerPrivate
19{
20public:
21 KDirListerPrivate()
22 {
23 }
24
25 QWidget *m_window = nullptr; // Main window this lister is associated with
26};
27
28KDirLister::KDirLister(QObject *parent)
29 : KCoreDirLister(parent)
30 , d(new KDirListerPrivate)
31{
32}
33
34KDirLister::~KDirLister()
35{
36}
37
38bool KDirLister::autoErrorHandlingEnabled() const
39{
40 return KCoreDirLister::autoErrorHandlingEnabled();
41}
42
43void KDirLister::setMainWindow(QWidget *window)
44{
45 d->m_window = window;
46}
47
48QWidget *KDirLister::mainWindow()
49{
50 return d->m_window;
51}
52
53void KDirLister::jobStarted(KIO::ListJob *job)
54{
55 if (d->m_window) {
56 KJobWidgets::setWindow(job, widget: d->m_window);
57 }
58}
59
60#include "moc_kdirlister.cpp"
61

source code of kio/src/widgets/kdirlister.cpp