]>
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
20 * @brief Applies view properties recursively to directories.
24 * KJob* job = new ApplyViewPropsJob(dir, viewProps);
25 * connect(job, SIGNAL(result(KJob*)),
26 * this, SLOT(slotResult(KJob*)));
29 * To be able to show a progress of the operation, the following steps
31 * - Use a DirectorySizeJob to count the number of directories.
32 * - Use a timer to show the current count of directories by invoking
33 * DirectorySizeJob::totalSubdirs() until the result signal is emitted.
34 * - Use the ApplyViewPropsJob.
35 * - Use a timer to show the progress by invoking ApplyViwePropsJob::progress().
36 * In combination with the total directory count it is possible to show a
39 class ApplyViewPropsJob
: public KIO::Job
45 * @param dir Directory where the view properties should be applied to
46 * (including sub directories).
47 * @param viewProps View properties for the directory \a dir including its
50 ApplyViewPropsJob(const QUrl
& dir
, const ViewProperties
& viewProps
);
51 ~ApplyViewPropsJob() override
;
55 void slotResult(KJob
* job
) override
;
56 void slotEntries(KIO::Job
*, const KIO::UDSEntryList
&);
59 ViewProperties
* m_viewProps
;
64 inline int ApplyViewPropsJob::progress() const