]>
cloud.milkyroute.net Git - dolphin.git/blob - src/settings/applyviewpropsjob.h
2 * SPDX-FileCopyrightText: 2006 Peter Penz <peter.penz19@gmail.com>
4 * The code is based on kdelibs/kio/directorysizejob:
5 * SPDX-FileCopyrightText: 2006 David Faure <faure@kde.org>
7 * SPDX-License-Identifier: GPL-2.0-or-later
10 #ifndef APPLYVIEWPROPSJOB_H
11 #define APPLYVIEWPROPSJOB_H
14 #include <KIO/UDSEntry>
21 * @brief Applies view properties recursively to directories.
25 * KJob* job = new ApplyViewPropsJob(dir, viewProps);
26 * connect(job, SIGNAL(result(KJob*)),
27 * this, SLOT(slotResult(KJob*)));
30 * To be able to show a progress of the operation, the following steps
32 * - Use a DirectorySizeJob to count the number of directories.
33 * - Use a timer to show the current count of directories by invoking
34 * DirectorySizeJob::totalSubdirs() until the result signal is emitted.
35 * - Use the ApplyViewPropsJob.
36 * - Use a timer to show the progress by invoking ApplyViwePropsJob::progress().
37 * In combination with the total directory count it is possible to show a
40 class ApplyViewPropsJob
: public KIO::Job
46 * @param dir Directory where the view properties should be applied to
47 * (including sub directories).
48 * @param viewProps View properties for the directory \a dir including its
51 ApplyViewPropsJob(const QUrl
&dir
, const ViewProperties
&viewProps
);
52 ~ApplyViewPropsJob() override
;
56 void slotResult(KJob
*job
) override
;
57 void slotEntries(KIO::Job
*, const KIO::UDSEntryList
&);
60 ViewProperties
*m_viewProps
;
65 inline int ApplyViewPropsJob::progress() const